Skip to content

Commit

Permalink
Editor: Moved menubar/edit/clear_history to sidebar/history/clear.
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Feb 16, 2024
1 parent 74d7dc8 commit 8a321b5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
19 changes: 1 addition & 18 deletions editor/js/Menubar.Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,23 +47,6 @@ function MenubarEdit( editor ) {
} );
options.add( redo );

// Clear History

let option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/edit/clear_history' ) );
option.onClick( function () {

if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {

editor.history.clear();

}

} );
options.add( option );


editor.signals.historyChanged.add( function () {

const history = editor.history;
Expand Down Expand Up @@ -91,7 +74,7 @@ function MenubarEdit( editor ) {

// Center

option = new UIRow();
let option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/edit/center' ) );
option.onClick( function () {
Expand Down
21 changes: 17 additions & 4 deletions editor/js/Sidebar.Settings.History.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@

import { UIPanel, UIBreak, UIText } from './libs/ui.js';
import { UIButton, UIPanel, UIBreak, UIText } from './libs/ui.js';
import { UIBoolean, UIOutliner } from './libs/ui.three.js';

function SidebarSettingsHistory( editor ) {

const strings = editor.strings;

const signals = editor.signals;

const config = editor.config;

const history = editor.history;

const container = new UIPanel();
Expand Down Expand Up @@ -59,6 +56,22 @@ function SidebarSettingsHistory( editor ) {
} );
container.add( outliner );

container.add( new UIBreak() );

// Clear History

const option = new UIButton( strings.getKey( 'sidebar/history/clear' ) ).setTextTransform( 'uppercase' );
option.onClick( function () {

if ( confirm( 'The Undo/Redo History will be cleared. Are you sure?' ) ) {

editor.history.clear();

}

} );
container.add( option );

//

const refreshUI = function () {
Expand Down
10 changes: 5 additions & 5 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ function Strings( config ) {
'menubar/edit': 'Edit',
'menubar/edit/undo': 'Undo (Ctrl+Z)',
'menubar/edit/redo': 'Redo (Ctrl+Shift+Z)',
'menubar/edit/clear_history': 'Clear History',
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Clone',
'menubar/edit/delete': 'Delete (Del)',
Expand Down Expand Up @@ -338,7 +337,8 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': 'Focus',

'sidebar/history': 'History',
'sidebar/history/persistent': 'persistent',
'sidebar/history/clear': 'Clear',
'sidebar/history/persistent': 'Persistent',

'toolbar/translate': 'Translate',
'toolbar/rotate': 'Rotate',
Expand Down Expand Up @@ -377,7 +377,6 @@ function Strings( config ) {
'menubar/edit': 'Edition',
'menubar/edit/undo': 'Annuler (Ctrl+Z)',
'menubar/edit/redo': 'Refaire (Ctrl+Shift+Z)',
'menubar/edit/clear_history': 'Supprimer Historique',
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Cloner',
'menubar/edit/delete': 'Supprimer (Supp)',
Expand Down Expand Up @@ -687,7 +686,8 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': 'Focus',

'sidebar/history': 'Historique',
'sidebar/history/persistent': 'permanent',
'sidebar/history/clear': 'Supprimer',
'sidebar/history/persistent': 'Permanent',

'toolbar/translate': 'Position',
'toolbar/rotate': 'Rotation',
Expand Down Expand Up @@ -726,7 +726,6 @@ function Strings( config ) {
'menubar/edit': '编辑',
'menubar/edit/undo': '撤销 (Ctrl+Z)',
'menubar/edit/redo': '重做 (Ctrl+Shift+Z)',
'menubar/edit/clear_history': '清空历史记录',
'menubar/edit/center': '居中',
'menubar/edit/clone': '拷贝',
'menubar/edit/delete': '删除 (Del)',
Expand Down Expand Up @@ -1036,6 +1035,7 @@ function Strings( config ) {
'sidebar/settings/shortcuts/focus': '聚焦',

'sidebar/history': '历史记录',
'sidebar/history/clear': '清空',
'sidebar/history/persistent': '本地存储',

'toolbar/translate': '移动',
Expand Down

0 comments on commit 8a321b5

Please sign in to comment.