mirror of
https://github.com/moodle/moodle.git
synced 2025-05-10 10:17:17 +02:00
Merge branch 'MDL-60574_master' of https://github.com/t-schroeder/moodle
This commit is contained in:
commit
acf199345a
lib/editor/atto/plugins/undo/yui
build/moodle-atto_undo-button
src/button/js
6
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-debug.js
vendored
6
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-debug.js
vendored
@ -257,6 +257,12 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
*/
|
||||
_redoHandler: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Don't do anything if redo stack is empty.
|
||||
if (this._redoStack.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var html = this._getHTML(),
|
||||
redo = this._getRedo();
|
||||
|
||||
|
2
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js
vendored
2
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button-min.js
vendored
@ -1 +1 @@
|
||||
YUI.add("moodle-atto_undo-button",function(t,e){t.namespace("M.atto_undo").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this._undoStack=[],this._redoStack=[],this.addButton({title:"undo",icon:"e/undo",callback:this._undoHandler,buttonName:"undo",keys:90}),this.addButton({title:"redo",icon:"e/redo",callback:this._redoHandler,buttonName:"redo",keys:89}),this.get("host").on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.get("host").on("atto:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates()},_addToRedo:function(t){this._redoStack.push(t)},_addToUndo:function(t,e){for(void 0===e&&(e=!1),this._undoStack[this._undoStack.length-1]!==t&&(this._undoStack.push(t),e&&(this._redoStack=[]));this._undoStack.length>this._maxUndos;)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(t){if(1===this._undoStack.length)return this._undoStack[0];var e=this._undoStack.pop();return e===t&&(e=this._undoStack.pop()),0===this._undoStack.length&&this._addToUndo(e),e},_restoreValue:function(t){this.editor.setHTML(t),this._addToUndo(t)},_updateButtonsStates:function(){1<this._undoStack.length?this.enableButtons("undo"):this.disableButtons("undo"),0<this._redoStack.length?this.enableButtons("redo"):this.disableButtons("redo")},_undoHandler:function(t){t.preventDefault();var e=this._getHTML(),o=this._getUndo(e);e!==o&&(this._restoreValue(o),this._addToRedo(e)),this._updateButtonsStates()},_redoHandler:function(t){t.preventDefault();var e=this._getHTML(),o=this._getRedo();e!==o&&this._restoreValue(o),this._updateButtonsStates()},_changeListener:function(t){t.event&&-1!==t.event.type.indexOf("key")&&39!==t.event.keyCode&&37!==t.event.keyCode&&40!==t.event.keyCode&&38!==t.event.keyCode||(this._addToUndo(this._getHTML(),!0),this._updateButtonsStates())}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
YUI.add("moodle-atto_undo-button",function(t,e){t.namespace("M.atto_undo").Button=t.Base.create("button",t.M.editor_atto.EditorPlugin,[],{_maxUndos:40,_undoStack:null,_redoStack:null,initializer:function(){this._undoStack=[],this._redoStack=[],this.addButton({title:"undo",icon:"e/undo",callback:this._undoHandler,buttonName:"undo",keys:90}),this.addButton({title:"redo",icon:"e/redo",callback:this._redoHandler,buttonName:"redo",keys:89}),this.get("host").on("pluginsloaded",function(){this._addToUndo(this._getHTML()),this.get("host").on("atto:selectionchanged",this._changeListener,this)},this),this._updateButtonsStates()},_addToRedo:function(t){this._redoStack.push(t)},_addToUndo:function(t,e){for(void 0===e&&(e=!1),this._undoStack[this._undoStack.length-1]!==t&&(this._undoStack.push(t),e&&(this._redoStack=[]));this._undoStack.length>this._maxUndos;)this._undoStack.shift()},_getHTML:function(){return this.get("host").getCleanHTML()},_getRedo:function(){return this._redoStack.pop()},_getUndo:function(t){if(1===this._undoStack.length)return this._undoStack[0];var e=this._undoStack.pop();return e===t&&(e=this._undoStack.pop()),0===this._undoStack.length&&this._addToUndo(e),e},_restoreValue:function(t){this.editor.setHTML(t),this._addToUndo(t)},_updateButtonsStates:function(){1<this._undoStack.length?this.enableButtons("undo"):this.disableButtons("undo"),0<this._redoStack.length?this.enableButtons("redo"):this.disableButtons("redo")},_undoHandler:function(t){t.preventDefault();var e=this._getHTML(),o=this._getUndo(e);e!==o&&(this._restoreValue(o),this._addToRedo(e)),this._updateButtonsStates()},_redoHandler:function(t){if(t.preventDefault(),0!==this._redoStack.length){var e=this._getHTML(),o=this._getRedo();e!==o&&this._restoreValue(o),this._updateButtonsStates()}},_changeListener:function(t){t.event&&-1!==t.event.type.indexOf("key")&&39!==t.event.keyCode&&37!==t.event.keyCode&&40!==t.event.keyCode&&38!==t.event.keyCode||(this._addToUndo(this._getHTML(),!0),this._updateButtonsStates())}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
6
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button.js
vendored
6
lib/editor/atto/plugins/undo/yui/build/moodle-atto_undo-button/moodle-atto_undo-button.js
vendored
@ -257,6 +257,12 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
*/
|
||||
_redoHandler: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Don't do anything if redo stack is empty.
|
||||
if (this._redoStack.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var html = this._getHTML(),
|
||||
redo = this._getRedo();
|
||||
|
||||
|
@ -255,6 +255,12 @@ Y.namespace('M.atto_undo').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
*/
|
||||
_redoHandler: function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Don't do anything if redo stack is empty.
|
||||
if (this._redoStack.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var html = this._getHTML(),
|
||||
redo = this._getRedo();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user