diff --git a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-debug.js b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-debug.js index ba14c132c16..21c5cdabfa0 100644 --- a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-debug.js +++ b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-debug.js @@ -65,7 +65,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito */ _toggleRTL: function(e, direction) { var host = this.get('host'), - sourceSelection = rangy.saveSelection(), + sourceSelection = window.rangy.saveSelection(), selection = host.getSelection(), newDirection = { rtl: 'ltr', @@ -84,7 +84,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito } // Change selection from the containing paragraph to the original one. - rangy.restoreSelection(sourceSelection); + window.rangy.restoreSelection(sourceSelection); // Mark the text as having been updated. this.markUpdated(); } diff --git a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js index 51d0be479a8..21c50882b70 100644 --- a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js +++ b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_rtl-button",function(e,t){e.namespace("M.atto_rtl").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;e="ltr",this.addButton({icon:"e/left_to_right",title:e,buttonName:e,callback:this._toggleRTL,callbackArgs:e}),e="rtl",this.addButton({icon:"e/right_to_left",title:e,buttonName:e,callback:this._toggleRTL,callbackArgs:e})},_toggleRTL:function(e,t){var n=this.get("host"),r=rangy.saveSelection(),i=n.getSelection(),s={rtl:"ltr",ltr:"rtl"};if(i){var o=n.formatSelectionBlock(),u=o.getDOMNode(),a=u.getAttribute("dir");a===t?u.setAttribute("dir",s[t]):u.setAttribute("dir",t),rangy.restoreSelection(r),this.markUpdated()}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); +YUI.add("moodle-atto_rtl-button",function(e,t){e.namespace("M.atto_rtl").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var e;e="ltr",this.addButton({icon:"e/left_to_right",title:e,buttonName:e,callback:this._toggleRTL,callbackArgs:e}),e="rtl",this.addButton({icon:"e/right_to_left",title:e,buttonName:e,callback:this._toggleRTL,callbackArgs:e})},_toggleRTL:function(e,t){var n=this.get("host"),r=window.rangy.saveSelection(),i=n.getSelection(),s={rtl:"ltr",ltr:"rtl"};if(i){var o=n.formatSelectionBlock(),u=o.getDOMNode(),a=u.getAttribute("dir");a===t?u.setAttribute("dir",s[t]):u.setAttribute("dir",t),window.rangy.restoreSelection(r),this.markUpdated()}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); diff --git a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button.js b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button.js index ba14c132c16..21c5cdabfa0 100644 --- a/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button.js +++ b/lib/editor/atto/plugins/rtl/yui/build/moodle-atto_rtl-button/moodle-atto_rtl-button.js @@ -65,7 +65,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito */ _toggleRTL: function(e, direction) { var host = this.get('host'), - sourceSelection = rangy.saveSelection(), + sourceSelection = window.rangy.saveSelection(), selection = host.getSelection(), newDirection = { rtl: 'ltr', @@ -84,7 +84,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito } // Change selection from the containing paragraph to the original one. - rangy.restoreSelection(sourceSelection); + window.rangy.restoreSelection(sourceSelection); // Mark the text as having been updated. this.markUpdated(); } diff --git a/lib/editor/atto/plugins/rtl/yui/src/button/js/button.js b/lib/editor/atto/plugins/rtl/yui/src/button/js/button.js index 2fb15438e66..88bf7c0bcbe 100644 --- a/lib/editor/atto/plugins/rtl/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/rtl/yui/src/button/js/button.js @@ -63,7 +63,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito */ _toggleRTL: function(e, direction) { var host = this.get('host'), - sourceSelection = rangy.saveSelection(), + sourceSelection = window.rangy.saveSelection(), selection = host.getSelection(), newDirection = { rtl: 'ltr', @@ -82,7 +82,7 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito } // Change selection from the containing paragraph to the original one. - rangy.restoreSelection(sourceSelection); + window.rangy.restoreSelection(sourceSelection); // Mark the text as having been updated. this.markUpdated(); }