diff --git a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-debug.js b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-debug.js index 2c864522711..3af90d3a415 100644 --- a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-debug.js +++ b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-debug.js @@ -37,7 +37,8 @@ var PLUGINNAME = 'atto_collapse', ATTRSHOWGROUPS = 'showgroups', COLLAPSE = 'collapse', COLLAPSED = 'collapsed', - GROUPS = '.atto_group'; + GROUPS = '.atto_group', + ROWS = '.atto_toolbar_row'; Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { @@ -62,11 +63,23 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. // Perform a toggle after all plugins have been loaded for the first time. this.get('host').on('pluginsloaded', function(e, button) { - this._setVisibility(button); + // Add 2 rows in the toolbar. + var toolbarRows = [ + Y.Node.create('
'), + Y.Node.create(''), + ]; + this.toolbar.appendChild(toolbarRows[0]).insert(toolbarRows[1], 'after'); - // Set the toolbar to break after the initial those displayed by default. - var firstGroup = this.toolbar.all(GROUPS).item(this.get(ATTRSHOWGROUPS)); - firstGroup.insert('', 'before'); + // Split toolbar buttons between the 2 rows created above. + var buttonGroups = this.toolbar.all(GROUPS); + buttonGroups.slice(0, this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[0].appendChild(buttonGroup); + }); + buttonGroups.slice(this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[1].appendChild(buttonGroup); + }); + + this._setVisibility(button); }, this, button); }, @@ -101,15 +114,15 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. * @private */ _setVisibility: function(button, visibility) { - var groups = this.toolbar.all(GROUPS).slice(this.get(ATTRSHOWGROUPS)); + var secondaryRow = this.toolbar.all(ROWS).item(1); if (visibility) { button.set('title', M.util.get_string('showfewer', PLUGINNAME)); - groups.show(); + secondaryRow.show(); button.setData(COLLAPSED, false); } else { button.set('title', M.util.get_string('showmore', PLUGINNAME)); - groups.hide(); + secondaryRow.hide(); button.setData(COLLAPSED, true); } diff --git a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js index bf69dae776b..d6b85b48d0f 100644 --- a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js +++ b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button-min.js @@ -1 +1 @@ -YUI.add("moodle-atto_collapse-button",function(s,t){var o="atto_collapse",e="showgroups",l="collapse",a="collapsed",n=".atto_group";s.namespace("M.atto_collapse").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{initializer:function(){var t,i=s.Object.size(this.get("host").get("plugins"));i<=1+parseInt(this.get(e),10)||this.toolbar.all(n).size()>this.get(e)||(t=this.addButton({icon:"icon",iconComponent:o,callback:this._toggle}),this.get("host").on("pluginsloaded",function(t,i){this._setVisibility(i),this.toolbar.all(n).item(this.get(e)).insert('',"before")},this,t))},_toggle:function(t){t.preventDefault();var i=this.buttons[l];i.getData(a)?(this.highlightButtons(l),this._setVisibility(i,!0)):(this.unHighlightButtons(l),this._setVisibility(i)),this.buttons[this.name].focus()},_setVisibility:function(t,i){var s=this.toolbar.all(n).slice(this.get(e));i?(t.set("title",M.util.get_string("showfewer",o)),s.show(),t.setData(a,!1)):(t.set("title",M.util.get_string("showmore",o)),s.hide(),t.setData(a,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file +YUI.add("moodle-atto_collapse-button",function(s,t){var e="atto_collapse",a="showgroups",o="collapse",l="collapsed",n=".atto_group";s.namespace("M.atto_collapse").Button=s.Base.create("button",s.M.editor_atto.EditorPlugin,[],{initializer:function(){var t,i=s.Object.size(this.get("host").get("plugins"));i<=1+parseInt(this.get(a),10)||this.toolbar.all(n).size()>this.get(a)||(t=this.addButton({icon:"icon",iconComponent:e,callback:this._toggle}),this.get("host").on("pluginsloaded",function(t,i){var o,e=[s.Node.create(''),s.Node.create('')];this.toolbar.appendChild(e[0]).insert(e[1],"after"),(o=this.toolbar.all(n)).slice(0,this.get(a)).each(function(t){e[0].appendChild(t)}),o.slice(this.get(a)).each(function(t){e[1].appendChild(t)}),this._setVisibility(i)},this,t))},_toggle:function(t){t.preventDefault();var i=this.buttons[o];i.getData(l)?(this.highlightButtons(o),this._setVisibility(i,!0)):(this.unHighlightButtons(o),this._setVisibility(i)),this.buttons[this.name].focus()},_setVisibility:function(t,i){var o=this.toolbar.all(".atto_toolbar_row").item(1);i?(t.set("title",M.util.get_string("showfewer",e)),o.show(),t.setData(l,!1)):(t.set("title",M.util.get_string("showmore",e)),o.hide(),t.setData(l,!0))}},{ATTRS:{showgroups:{value:3}}})},"@VERSION@",{requires:["moodle-editor_atto-plugin"]}); \ No newline at end of file diff --git a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button.js b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button.js index d4c0e9f4191..3c9fd95f0d2 100644 --- a/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button.js +++ b/lib/editor/atto/plugins/collapse/yui/build/moodle-atto_collapse-button/moodle-atto_collapse-button.js @@ -37,7 +37,8 @@ var PLUGINNAME = 'atto_collapse', ATTRSHOWGROUPS = 'showgroups', COLLAPSE = 'collapse', COLLAPSED = 'collapsed', - GROUPS = '.atto_group'; + GROUPS = '.atto_group', + ROWS = '.atto_toolbar_row'; Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { @@ -58,11 +59,23 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. // Perform a toggle after all plugins have been loaded for the first time. this.get('host').on('pluginsloaded', function(e, button) { - this._setVisibility(button); + // Add 2 rows in the toolbar. + var toolbarRows = [ + Y.Node.create(''), + Y.Node.create(''), + ]; + this.toolbar.appendChild(toolbarRows[0]).insert(toolbarRows[1], 'after'); - // Set the toolbar to break after the initial those displayed by default. - var firstGroup = this.toolbar.all(GROUPS).item(this.get(ATTRSHOWGROUPS)); - firstGroup.insert('', 'before'); + // Split toolbar buttons between the 2 rows created above. + var buttonGroups = this.toolbar.all(GROUPS); + buttonGroups.slice(0, this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[0].appendChild(buttonGroup); + }); + buttonGroups.slice(this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[1].appendChild(buttonGroup); + }); + + this._setVisibility(button); }, this, button); }, @@ -97,15 +110,15 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. * @private */ _setVisibility: function(button, visibility) { - var groups = this.toolbar.all(GROUPS).slice(this.get(ATTRSHOWGROUPS)); + var secondaryRow = this.toolbar.all(ROWS).item(1); if (visibility) { button.set('title', M.util.get_string('showfewer', PLUGINNAME)); - groups.show(); + secondaryRow.show(); button.setData(COLLAPSED, false); } else { button.set('title', M.util.get_string('showmore', PLUGINNAME)); - groups.hide(); + secondaryRow.hide(); button.setData(COLLAPSED, true); } diff --git a/lib/editor/atto/plugins/collapse/yui/src/button/js/button.js b/lib/editor/atto/plugins/collapse/yui/src/button/js/button.js index 462654ae811..564bbb89590 100644 --- a/lib/editor/atto/plugins/collapse/yui/src/button/js/button.js +++ b/lib/editor/atto/plugins/collapse/yui/src/button/js/button.js @@ -35,7 +35,8 @@ var PLUGINNAME = 'atto_collapse', ATTRSHOWGROUPS = 'showgroups', COLLAPSE = 'collapse', COLLAPSED = 'collapsed', - GROUPS = '.atto_group'; + GROUPS = '.atto_group', + ROWS = '.atto_toolbar_row'; Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto.EditorPlugin, [], { initializer: function() { @@ -60,11 +61,23 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. // Perform a toggle after all plugins have been loaded for the first time. this.get('host').on('pluginsloaded', function(e, button) { - this._setVisibility(button); + // Add 2 rows in the toolbar. + var toolbarRows = [ + Y.Node.create(''), + Y.Node.create(''), + ]; + this.toolbar.appendChild(toolbarRows[0]).insert(toolbarRows[1], 'after'); - // Set the toolbar to break after the initial those displayed by default. - var firstGroup = this.toolbar.all(GROUPS).item(this.get(ATTRSHOWGROUPS)); - firstGroup.insert('', 'before'); + // Split toolbar buttons between the 2 rows created above. + var buttonGroups = this.toolbar.all(GROUPS); + buttonGroups.slice(0, this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[0].appendChild(buttonGroup); + }); + buttonGroups.slice(this.get(ATTRSHOWGROUPS)).each(function(buttonGroup) { + toolbarRows[1].appendChild(buttonGroup); + }); + + this._setVisibility(button); }, this, button); }, @@ -99,15 +112,15 @@ Y.namespace('M.atto_collapse').Button = Y.Base.create('button', Y.M.editor_atto. * @private */ _setVisibility: function(button, visibility) { - var groups = this.toolbar.all(GROUPS).slice(this.get(ATTRSHOWGROUPS)); + var secondaryRow = this.toolbar.all(ROWS).item(1); if (visibility) { button.set('title', M.util.get_string('showfewer', PLUGINNAME)); - groups.show(); + secondaryRow.show(); button.setData(COLLAPSED, false); } else { button.set('title', M.util.get_string('showmore', PLUGINNAME)); - groups.hide(); + secondaryRow.hide(); button.setData(COLLAPSED, true); } diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js index a854730b4cc..e57624b3412 100644 --- a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js +++ b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-debug.js @@ -2310,7 +2310,6 @@ EditorToolbarNav.prototype = { */ _findFirstFocusable: function(buttons, startAt, direction) { var checkCount = 0, - group, candidate, button, index; @@ -2340,12 +2339,8 @@ EditorToolbarNav.prototype = { // Loop while: // * we haven't checked every button; // * the button is hidden or disabled; - // * the group is hidden. - if (candidate.hasAttribute('hidden') || candidate.hasAttribute('disabled')) { - continue; - } - group = candidate.ancestor('.atto_group'); - if (group.hasAttribute('hidden')) { + // * the button is inside a hidden wrapper element. + if (candidate.hasAttribute('hidden') || candidate.hasAttribute('disabled') || candidate.ancestor('[hidden]')) { continue; } diff --git a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js index b41a5581e61..d9909ddb72f 100644 --- a/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js +++ b/lib/editor/atto/yui/build/moodle-editor_atto-editor/moodle-editor_atto-editor-min.js @@ -1,5 +1,5 @@ YUI.add("moodle-editor_atto-editor",function(u,t){var o,r,n,l,s,a={CONTENT:"editor_atto_content",CONTENTWRAPPER:"editor_atto_content_wrap",TOOLBAR:"editor_atto_toolbar",WRAPPER:"editor_atto",HIGHLIGHT:"highlight"},c=window.rangy;function e(){e.superclass.constructor.apply(this,arguments)}function i(){}function h(){}function d(){}function g(){g.superclass.constructor.apply(this,arguments),this._submitEvents={},this._queue=[],this._throttle=null}function p(){}function f(){}function m(){}function v(){}function b(){}function _(){}function y(){}function S(){}u.extend(e,u.Base,{BLOCK_TAGS:["address","article","aside","audio","blockquote","canvas","dd","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","noscript","ol","output","p","pre","section","table","tfoot","ul","video"],PLACEHOLDER_CLASS:"atto-tmp-class",ALL_NODES_SELECTOR:"[style],font[face]",FONT_FAMILY:"fontFamily",_wrapper:null,editor:null,textarea:null,textareaLabel:null,plugins:null,coreDirection:null,_eventHandles:null,initializer:function(){var t,e,i,n;this.textarea=u.one(document.getElementById(this.get("elementid"))),this.textarea&&(e=this.textarea.getAttribute("class"),this._eventHandles=[],i=u.Node.create('","
','
','
","
','
','