Merge branch 'MDL-47166-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2015-01-20 16:14:26 +01:00
commit 782ea98c59
4 changed files with 22 additions and 22 deletions

View file

@ -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
});
},
/**

View file

@ -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("<div></div>").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("<blockquote></blockquote>").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("<div></div>").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("<blockquote></blockquote>").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"]});

View file

@ -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
});
},
/**

View file

@ -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
});
},
/**