Download pool/shard009/JavaScript/0056300_UndoRedo.js from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 2.02 kB
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056300_UndoRedo.js
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/pool/shard009/JavaScript/0056300_UndoRedo.js
-
curl -L -o 0056300_UndoRedo.js https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/pool/shard009/JavaScript/0056300_UndoRedo.js
2.02 kB
| Kwf.Form.HtmlEditor.UndoRedo = Ext2.extend(Ext2.util.Observable, { | |
| init: function(cmp){ | |
| this.cmp = cmp; | |
| this.cmp.afterMethod('createToolbar', this.afterCreateToolbar, this); | |
| this.cmp.on('initialize', this.onInit, this, {delay:100, single: true}); | |
| this.cmp.afterMethod('updateToolbar', this.updateToolbar, this); | |
| }, | |
| onInit: function(){ | |
| this.cmp.tinymceEditor.on('Undo Redo AddUndo TypingUndo ClearUndos', (function() { | |
| this.updateToolbar(); | |
| }).bind(this)); | |
| }, | |
| updateToolbar: function() { | |
| this.undoAction.setDisabled(!this.cmp.tinymceEditor.undoManager.hasUndo()); | |
| this.redoAction.setDisabled(!this.cmp.tinymceEditor.undoManager.hasRedo()); | |
| }, | |
| afterCreateToolbar: function() { | |
| this.undoAction = new Ext2.Action({ | |
| handler: function() { | |
| this.cmp.tinymceEditor.undoManager.undo(); | |
| }, | |
| scope: this, | |
| disabled: true, | |
| icon: '/assets/silkicons/arrow_undo.png', | |
| tooltip: { | |
| cls: 'x2-html-editor-tip', | |
| title: trlKwf('Undo (Ctrl+Z)'), | |
| text: trlKwf('Undo the last action.') | |
| }, | |
| cls: 'x2-btn-icon', | |
| clickEvent: 'mousedown', | |
| tabIndex: -1 | |
| }); | |
| this.redoAction = new Ext2.Action({ | |
| handler: function() { | |
| this.cmp.tinymceEditor.undoManager.redo(); | |
| }, | |
| scope: this, | |
| disabled: true, | |
| icon: '/assets/silkicons/arrow_redo.png', | |
| tooltip: { | |
| cls: 'x2-html-editor-tip', | |
| title: trlKwf('Redo'), | |
| text: trlKwf('Redo the last action.') | |
| }, | |
| cls: 'x2-btn-icon', | |
| clickEvent: 'mousedown', | |
| tabIndex: -1 | |
| }); | |
| var tb = this.cmp.getToolbar(); | |
| tb.insert(0, this.undoAction); | |
| tb.insert(1, this.redoAction); | |
| tb.insert(2, '-'); | |
| } | |
| }); | |