|
24 | 24 | },
|
25 | 25 | state: CKEDITOR.TRISTATE_DISABLED,
|
26 | 26 | canUndo: false
|
27 |
| - }); |
| 27 | + } ); |
28 | 28 |
|
29 | 29 | var redoCommand = editor.addCommand( 'redo', {
|
30 | 30 | exec: function() {
|
|
35 | 35 | },
|
36 | 36 | state: CKEDITOR.TRISTATE_DISABLED,
|
37 | 37 | canUndo: false
|
38 |
| - }); |
| 38 | + } ); |
39 | 39 |
|
40 | 40 | editor.setKeystroke( [
|
41 | 41 | [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
|
|
61 | 61 | // Save snapshots before doing custom changes.
|
62 | 62 | editor.on( 'saveSnapshot', function( evt ) {
|
63 | 63 | undoManager.save( evt.data && evt.data.contentOnly );
|
64 |
| - }); |
| 64 | + } ); |
65 | 65 |
|
66 | 66 | // Registering keydown on every document recreation.(#3844)
|
67 | 67 | editor.on( 'contentDom', function() {
|
68 | 68 | editor.editable().on( 'keydown', function( event ) {
|
69 | 69 | var keystroke = event.data.getKey();
|
70 | 70 |
|
71 |
| - if ( keystroke == 8 /*Backspace*/ || keystroke == 46 /*Delete*/ ) { |
| 71 | + if ( keystroke == 8 /*Backspace*/ || keystroke == 46 /*Delete*/ ) |
72 | 72 | undoManager.type( keystroke, 0 );
|
73 |
| - } |
74 |
| - }); |
| 73 | + } ); |
75 | 74 |
|
76 | 75 | editor.editable().on( 'keypress', function( event ) {
|
77 | 76 | undoManager.type( event.data.getKey(), 1 );
|
78 |
| - }); |
79 |
| - }); |
| 77 | + } ); |
| 78 | + } ); |
80 | 79 |
|
81 | 80 | // Always save an undo snapshot - the previous mode might have
|
82 | 81 | // changed editor contents.
|
83 | 82 | editor.on( 'beforeModeUnload', function() {
|
84 | 83 | editor.mode == 'wysiwyg' && undoManager.save( true );
|
85 |
| - }); |
| 84 | + } ); |
86 | 85 |
|
87 | 86 | function toggleUndoManager() {
|
88 | 87 | undoManager.enabled = editor.readOnly ? false : editor.mode == 'wysiwyg';
|
|
100 | 99 | label: editor.lang.undo.undo,
|
101 | 100 | command: 'undo',
|
102 | 101 | toolbar: 'undo,10'
|
103 |
| - }); |
| 102 | + } ); |
104 | 103 |
|
105 | 104 | editor.ui.addButton( 'Redo', {
|
106 | 105 | label: editor.lang.undo.redo,
|
107 | 106 | command: 'redo',
|
108 | 107 | toolbar: 'undo,20'
|
109 |
| - }); |
| 108 | + } ); |
110 | 109 | }
|
111 | 110 |
|
112 | 111 | /**
|
|
140 | 139 | editor.on( 'updateSnapshot', function() {
|
141 | 140 | if ( undoManager.currentImage )
|
142 | 141 | undoManager.update();
|
143 |
| - }); |
| 142 | + } ); |
144 | 143 |
|
145 | 144 | /**
|
146 | 145 | * Lock manager to prevent any save/update operations.
|
|
170 | 169 | */
|
171 | 170 | editor.on( 'unlockSnapshot', undoManager.unlock, undoManager );
|
172 | 171 | }
|
173 |
| - }); |
| 172 | + } ); |
174 | 173 |
|
175 | 174 | CKEDITOR.plugins.undo = {};
|
176 | 175 |
|
|
0 commit comments