From 455c8cdee6fb0300fcb40456f45703f601ab6082 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 9 Jan 2015 09:05:50 +0800 Subject: [PATCH] MDL-47166 atto_indent: Swap Outdent and Indent --- .../moodle-atto_indent-button-debug.js | 14 +++++++------- .../moodle-atto_indent-button-min.js | 2 +- .../moodle-atto_indent-button.js | 14 +++++++------- .../plugins/indent/yui/src/button/js/button.js | 14 +++++++------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-debug.js b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-debug.js index 8526fe71779..dee99ad72a9 100644 --- a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-debug.js +++ b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-debug.js @@ -36,19 +36,19 @@ YUI.add('moodle-atto_indent-button', function (Y, NAME) { Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { - this.addButton({ - icon: 'e/increase_indent', - title: 'indent', - buttonName: 'indent', - callback: this.indent - }); - this.addButton({ icon: 'e/decrease_indent', title: 'outdent', buttonName: 'outdent', callback: this.outdent }); + + this.addButton({ + icon: 'e/increase_indent', + title: 'indent', + buttonName: 'indent', + callback: this.indent + }); }, /** diff --git a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-min.js b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-min.js index 340a6df4da7..1ac739b9655 100644 --- a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-min.js +++ b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_indent-button",function(e,t){e.namespace("M.atto_indent").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/increase_indent",title:"indent",buttonName:"indent",callback:this.indent}),this.addButton({icon:"e/decrease_indent",title:"outdent",buttonName:"outdent",callback:this.outdent})},indent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();this.editor.all(".rangySelectionBoundary").setStyle("display",null),t.addClass("pre-existing"),document.execCommand("indent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},outdent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();t.addClass("pre-existing"),this.replaceEditorIndents(this.editor),rangy.restoreSelection(e),e=rangy.saveSelection(),document.execCommand("outdent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},replaceBlockquote:function(t){t.all("blockquote").setAttribute("data-iterate",!0);var n=t.one("blockquote"),r=e.one("body.dir-ltr")?"marginLeft":"marginRight";while(n){n.removeAttribute("data-iterate");if(n.hasClass("pre-existing"))n.removeClass("pre-existing");else{var i=e.Node.create("
").setAttrs(n.getAttrs()).setStyle(r,"30px").addClass("editor-indent"),s=n.getDOMNode().childNodes,o;o=s[0];while(typeof o!="undefined")i.append(o),o=s[0];n.replace(i)}n=t.one("blockquote[data-iterate]")}},replaceEditorIndents:function(t){var n=t.one(".editor-indent");while(n){var r=e.Node.create("
").setAttrs(n.getAttrs()).removeClass("editor-indent"),i=n.getDOMNode().childNodes,s;s=i[0];while(typeof s!="undefined")r.append(s),s=i[0];n.replace(r),n=t.one(".editor-indent")}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); +YUI.add("moodle-atto_indent-button",function(e,t){e.namespace("M.atto_indent").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/decrease_indent",title:"outdent",buttonName:"outdent",callback:this.outdent}),this.addButton({icon:"e/increase_indent",title:"indent",buttonName:"indent",callback:this.indent})},indent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();this.editor.all(".rangySelectionBoundary").setStyle("display",null),t.addClass("pre-existing"),document.execCommand("indent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},outdent:function(){var e=rangy.saveSelection(),t=this.editor.all("blockquote"),n=t.size();t.addClass("pre-existing"),this.replaceEditorIndents(this.editor),rangy.restoreSelection(e),e=rangy.saveSelection(),document.execCommand("outdent",!1,null),t=this.editor.all("blockquote"),t.size()!==n?(this.replaceBlockquote(this.editor),rangy.restoreSelection(e)):t.size()>0&&t.removeClass("pre-existing"),rangy.removeMarkers(e),this.markUpdated()},replaceBlockquote:function(t){t.all("blockquote").setAttribute("data-iterate",!0);var n=t.one("blockquote"),r=e.one("body.dir-ltr")?"marginLeft":"marginRight";while(n){n.removeAttribute("data-iterate");if(n.hasClass("pre-existing"))n.removeClass("pre-existing");else{var i=e.Node.create("
").setAttrs(n.getAttrs()).setStyle(r,"30px").addClass("editor-indent"),s=n.getDOMNode().childNodes,o;o=s[0];while(typeof o!="undefined")i.append(o),o=s[0];n.replace(i)}n=t.one("blockquote[data-iterate]")}},replaceEditorIndents:function(t){var n=t.one(".editor-indent");while(n){var r=e.Node.create("
").setAttrs(n.getAttrs()).removeClass("editor-indent"),i=n.getDOMNode().childNodes,s;s=i[0];while(typeof s!="undefined")r.append(s),s=i[0];n.replace(r),n=t.one(".editor-indent")}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); diff --git a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button.js b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button.js index 8526fe71779..dee99ad72a9 100644 --- a/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button.js +++ b/lib/editor/atto/plugins/indent/yui/build/moodle-atto_indent-button/moodle-atto_indent-button.js @@ -36,19 +36,19 @@ YUI.add('moodle-atto_indent-button', function (Y, NAME) { Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { - this.addButton({ - icon: 'e/increase_indent', - title: 'indent', - buttonName: 'indent', - callback: this.indent - }); - this.addButton({ icon: 'e/decrease_indent', title: 'outdent', buttonName: 'outdent', callback: this.outdent }); + + this.addButton({ + icon: 'e/increase_indent', + title: 'indent', + buttonName: 'indent', + callback: this.indent + }); }, /** diff --git a/lib/editor/atto/plugins/indent/yui/src/button/js/button.js b/lib/editor/atto/plugins/indent/yui/src/button/js/button.js index cba02ace184..fefc615f73d 100644 --- a/lib/editor/atto/plugins/indent/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/indent/yui/src/button/js/button.js @@ -34,19 +34,19 @@ Y.namespace('M.atto_indent').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { - this.addButton({ - icon: 'e/increase_indent', - title: 'indent', - buttonName: 'indent', - callback: this.indent - }); - this.addButton({ icon: 'e/decrease_indent', title: 'outdent', buttonName: 'outdent', callback: this.outdent }); + + this.addButton({ + icon: 'e/increase_indent', + title: 'indent', + buttonName: 'indent', + callback: this.indent + }); }, /**