Merge branch 'MDL-51719-master' of git://github.com/danpoltawski/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2015-12-22 13:07:01 +01:00
commit c38bdd62c7
4 changed files with 13 additions and 7 deletions

View File

@ -43,7 +43,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=ltr]'
});
direction = 'rtl';
@ -52,7 +53,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=rtl]'
});
},

View File

@ -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=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"]});
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,tags:"[dir=ltr]"}),e="rtl",this.addButton({icon:"e/right_to_left",title:e,buttonName:e,callback:this._toggleRTL,callbackArgs:e,tags:"[dir=rtl]"})},_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"]});

View File

@ -43,7 +43,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=ltr]'
});
direction = 'rtl';
@ -52,7 +53,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=rtl]'
});
},

View File

@ -41,7 +41,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=ltr]'
});
direction = 'rtl';
@ -50,7 +51,8 @@ Y.namespace('M.atto_rtl').Button = Y.Base.create('button', Y.M.editor_atto.Edito
title: direction,
buttonName: direction,
callback: this._toggleRTL,
callbackArgs: direction
callbackArgs: direction,
tags: '[dir=rtl]'
});
},