mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
Merge branch 'MDL-45447-master' of git://github.com/FMCorz/moodle
This commit is contained in:
commit
e1a83b8327
@ -81,8 +81,10 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.
|
||||
var button = this.buttons[COLLAPSE];
|
||||
|
||||
if (button.getData(COLLAPSED)) {
|
||||
this.highlightButtons(COLLAPSE);
|
||||
this._setVisibility(button, true);
|
||||
} else {
|
||||
this.unHighlightButtons(COLLAPSE);
|
||||
this._setVisibility(button);
|
||||
}
|
||||
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-atto_collapse-button",function(e,t){var n="atto_collapse",r="showgroups",i="collapse",s="collapsed",o=".atto_group";e.namespace("M.atto_collapse").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=e.Object.size(this.get("host").get("plugins"));if(t<=1+parseInt(this.get(r),10))return;if(this.toolbar.all(o).size()>this.get(r))return;var i=this.addButton({icon:M.util.image_url("icon",n),callback:this._toggle});this.get("host").on("pluginsloaded",function(e,t){this._setVisibility(t);var n=this.toolbar.all(o).item(this.get(r));n.insert('<div class="toolbarbreak"></div>',"before")},this,i)},_toggle:function(e){e.preventDefault();var t=this.buttons[i];t.getData(s)?this._setVisibility(t,!0):this._setVisibility(t),this.buttons[this.name].focus()},_setVisibility:function(e,t){var i=this.toolbar.all(o).slice(this.get(r));t?(e.set("title",M.util.get_string("showfewer",n)),i.show(),e.setData(s,!1)):(e.set("title",M.util.get_string("showmore",n)),i.hide(),e.setData(s,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
YUI.add("moodle-atto_collapse-button",function(e,t){var n="atto_collapse",r="showgroups",i="collapse",s="collapsed",o=".atto_group";e.namespace("M.atto_collapse").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){var t=e.Object.size(this.get("host").get("plugins"));if(t<=1+parseInt(this.get(r),10))return;if(this.toolbar.all(o).size()>this.get(r))return;var i=this.addButton({icon:M.util.image_url("icon",n),callback:this._toggle});this.get("host").on("pluginsloaded",function(e,t){this._setVisibility(t);var n=this.toolbar.all(o).item(this.get(r));n.insert('<div class="toolbarbreak"></div>',"before")},this,i)},_toggle:function(e){e.preventDefault();var t=this.buttons[i];t.getData(s)?(this.highlightButtons(i),this._setVisibility(t,!0)):(this.unHighlightButtons(i),this._setVisibility(t)),this.buttons[this.name].focus()},_setVisibility:function(e,t){var i=this.toolbar.all(o).slice(this.get(r));t?(e.set("title",M.util.get_string("showfewer",n)),i.show(),e.setData(s,!1)):(e.set("title",M.util.get_string("showmore",n)),i.hide(),e.setData(s,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]});
|
||||
|
@ -77,8 +77,10 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.
|
||||
var button = this.buttons[COLLAPSE];
|
||||
|
||||
if (button.getData(COLLAPSED)) {
|
||||
this.highlightButtons(COLLAPSE);
|
||||
this._setVisibility(button, true);
|
||||
} else {
|
||||
this.unHighlightButtons(COLLAPSE);
|
||||
this._setVisibility(button);
|
||||
}
|
||||
|
||||
|
@ -79,8 +79,10 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.
|
||||
var button = this.buttons[COLLAPSE];
|
||||
|
||||
if (button.getData(COLLAPSED)) {
|
||||
this.highlightButtons(COLLAPSE);
|
||||
this._setVisibility(button, true);
|
||||
} else {
|
||||
this.unHighlightButtons(COLLAPSE);
|
||||
this._setVisibility(button);
|
||||
}
|
||||
|
||||
|
@ -66,6 +66,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
_showHTML: function() {
|
||||
var host = this.get('host');
|
||||
if (!this.get('isHTML')) {
|
||||
// Unhighlight icon.
|
||||
this.unHighlightButtons('html');
|
||||
|
||||
// Enable all plugins.
|
||||
host.enablePlugins();
|
||||
|
||||
@ -82,6 +85,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
// And re-mark everything as updated.
|
||||
this.markUpdated();
|
||||
} else {
|
||||
// Highlight icon.
|
||||
this.highlightButtons('html');
|
||||
|
||||
// Disable all plugins.
|
||||
host.disablePlugins();
|
||||
|
||||
|
@ -1 +1 @@
|
||||
YUI.add("moodle-atto_html-button",function(e,t){e.namespace("M.atto_html").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/source_code",callback:this._toggleHTML})},_toggleHTML:function(){this.set("isHTML",!this.get("isHTML")),this._showHTML()},_showHTML:function(){var e=this.get("host");this.get("isHTML")?(e.disablePlugins(),e.enablePlugins(this.name),e.updateOriginal(),this.editor.hide(),e.textarea.show(),e.textarea.focus()):(e.enablePlugins(),e.updateFromTextArea(),e.textarea.hide(),this.editor.show(),e.focus(),this.markUpdated())}},{ATTRS:{isHTML:{value:!1}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","event-valuechange"]});
|
||||
YUI.add("moodle-atto_html-button",function(e,t){e.namespace("M.atto_html").Button=e.Base.create("button",e.M.editor_atto.EditorPlugin,[],{initializer:function(){this.addButton({icon:"e/source_code",callback:this._toggleHTML})},_toggleHTML:function(){this.set("isHTML",!this.get("isHTML")),this._showHTML()},_showHTML:function(){var e=this.get("host");this.get("isHTML")?(this.highlightButtons("html"),e.disablePlugins(),e.enablePlugins(this.name),e.updateOriginal(),this.editor.hide(),e.textarea.show(),e.textarea.focus()):(this.unHighlightButtons("html"),e.enablePlugins(),e.updateFromTextArea(),e.textarea.hide(),this.editor.show(),e.focus(),this.markUpdated())}},{ATTRS:{isHTML:{value:!1}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin","event-valuechange"]});
|
||||
|
@ -66,6 +66,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
_showHTML: function() {
|
||||
var host = this.get('host');
|
||||
if (!this.get('isHTML')) {
|
||||
// Unhighlight icon.
|
||||
this.unHighlightButtons('html');
|
||||
|
||||
// Enable all plugins.
|
||||
host.enablePlugins();
|
||||
|
||||
@ -82,6 +85,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
// And re-mark everything as updated.
|
||||
this.markUpdated();
|
||||
} else {
|
||||
// Highlight icon.
|
||||
this.highlightButtons('html');
|
||||
|
||||
// Disable all plugins.
|
||||
host.disablePlugins();
|
||||
|
||||
|
@ -64,6 +64,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
_showHTML: function() {
|
||||
var host = this.get('host');
|
||||
if (!this.get('isHTML')) {
|
||||
// Unhighlight icon.
|
||||
this.unHighlightButtons('html');
|
||||
|
||||
// Enable all plugins.
|
||||
host.enablePlugins();
|
||||
|
||||
@ -80,6 +83,9 @@ Y.namespace('M.atto_html').Button = Y.Base.create('button', Y.M.editor_atto.Edit
|
||||
// And re-mark everything as updated.
|
||||
this.markUpdated();
|
||||
} else {
|
||||
// Highlight icon.
|
||||
this.highlightButtons('html');
|
||||
|
||||
// Disable all plugins.
|
||||
host.disablePlugins();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user