MDL-46531 editor_atto: fontcolor -> backcolor
This commit is contained in:
+1
-1
@@ -102,7 +102,7 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
|
||||
}
|
||||
|
||||
this.editor.all('.' + classname).each(function (node) {
|
||||
node.setAttribute('class', 'fontcolor ' + backColorClass);
|
||||
node.setAttribute('class', 'backcolor ' + backColorClass);
|
||||
}, this);
|
||||
|
||||
host.setSelection(originalSelection);
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
YUI.add("moodle-atto_backcolor-button",function(e,t){var n=[{name:"white"},{name:"red"},{name:"yellow"},{name:"green"},{name:"blue"},{name:"black"}];e.namespace("M.atto_backcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div class="'+e.name+'"></div>',callbackArgs:e.className||e.name})}),this.addToolbarMenu({icon:"e/text_highlight",overlayWidth:"4",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(t,n){var r=this.get("host"),i=r.PLACEHOLDER_CLASS,s=r.getSelection(),o=rangy.createCssClassApplier(i,{normalize:!0});o.applyToSelection();if(!e.one("."+i)){var u=s[0],a=u.createContextualFragment('<span class="'+i+'"> </span>'),f=rangy.createRange(),l;u.insertNode(a.lastChild),u.collapse(),f.selectNodeContents(e.one("."+i).getDOMNode()),l=rangy.getSelection(),l.setSingleRange(f),s=l.getAllRanges()}this.editor.all("."+i).each(function(e){e.setAttribute("class","fontcolor "+n)},this),r.setSelection(s),this.markUpdated()}})},"@VERSION@");
|
||||
YUI.add("moodle-atto_backcolor-button",function(e,t){var n=[{name:"white"},{name:"red"},{name:"yellow"},{name:"green"},{name:"blue"},{name:"black"}];e.namespace("M.atto_backcolor").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=[];e.Array.each(n,function(e){t.push({text:'<div class="'+e.name+'"></div>',callbackArgs:e.className||e.name})}),this.addToolbarMenu({icon:"e/text_highlight",overlayWidth:"4",globalItemConfig:{callback:this._changeStyle},items:t})},_changeStyle:function(t,n){var r=this.get("host"),i=r.PLACEHOLDER_CLASS,s=r.getSelection(),o=rangy.createCssClassApplier(i,{normalize:!0});o.applyToSelection();if(!e.one("."+i)){var u=s[0],a=u.createContextualFragment('<span class="'+i+'"> </span>'),f=rangy.createRange(),l;u.insertNode(a.lastChild),u.collapse(),f.selectNodeContents(e.one("."+i).getDOMNode()),l=rangy.getSelection(),l.setSingleRange(f),s=l.getAllRanges()}this.editor.all("."+i).each(function(e){e.setAttribute("class","backcolor "+n)},this),r.setSelection(s),this.markUpdated()}})},"@VERSION@");
|
||||
|
||||
+1
-1
@@ -102,7 +102,7 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
|
||||
}
|
||||
|
||||
this.editor.all('.' + classname).each(function (node) {
|
||||
node.setAttribute('class', 'fontcolor ' + backColorClass);
|
||||
node.setAttribute('class', 'backcolor ' + backColorClass);
|
||||
}, this);
|
||||
|
||||
host.setSelection(originalSelection);
|
||||
|
||||
@@ -100,7 +100,7 @@ Y.namespace('M.atto_backcolor').Button = Y.Base.create('button', Y.M.editor_atto
|
||||
}
|
||||
|
||||
this.editor.all('.' + classname).each(function (node) {
|
||||
node.setAttribute('class', 'fontcolor ' + backColorClass);
|
||||
node.setAttribute('class', 'backcolor ' + backColorClass);
|
||||
}, this);
|
||||
|
||||
host.setSelection(originalSelection);
|
||||
|
||||
Reference in New Issue
Block a user