{"version":3,"sources":["oojs-ui-toolbars.js"],"names":["OO","ui","Toolbar","toolFactory","toolGroupFactory","config","isPlainObject","undefined","parent","call","this","EventEmitter","mixin","GroupElement","groups","tools","position","$bar","$","$actions","initialized","narrowThreshold","onWindowResizeHandler","onWindowResize","bind","$element","add","$group","on","onPointerDown","addClass","actions","append","inheritClass","Element","mixinClass","prototype","getToolFactory","getToolGroupFactory","e","$closestWidgetToEvent","target","closest","$closestWidgetToToolbar","length","toggleClass","width","getNarrowThreshold","initialize","getElementWindow","setup","i","len","type","group","items","reset","include","label","msg","lookup","push","create","addItems","destroy","clearItems","off","remove","isToolAvailable","name","reserveTool","tool","getName","releaseTool","getToolAccelerator","Tool","toolGroup","toolbar","getToolbar","active","$title","$accel","$link","title","IconElement","FlaggedElement","TabIndexedElement","extend","$tabIndexed","connect","updateState","prop","dir","lang","$icon","attr","data","constructor","static","replace","displayBothIconAndLabel","setTitle","Widget","tagName","autoAddToCatchall","autoAddToGroup","isCompatibleWith","onUpdateState","onSelect","isActive","setActive","state","setFlags","progressive","removeClass","resolveMsg","updateTitle","getTitle","titleTooltips","accelTooltips","accel","tooltipParts","text","join","removeAttr","disconnect","ToolGroup","pressed","autoDisabled","exclude","promote","demote","onCapturedMouseKeyUpHandler","onCapturedMouseKeyUp","mousedown","onMouseKeyDown","mouseup","onMouseKeyUp","keydown","keyup","focus","onMouseOverFocus","blur","onMouseOutBlur","mouseover","mouseout","register","aggregate","disable","itemDisable","populate","autoDisable","isDisabled","apply","arguments","updateDisabled","item","allDisabled","which","MouseButtons","LEFT","Keys","SPACE","ENTER","getTargetTool","getElementDocument","addEventListener","removeEventListener","preventDefault","stopPropagation","$item","onToolFactoryRegister","names","list","getTools","removeItems","ToolFactory","Factory","included","promoted","demoted","auto","used","simpleArrayDifference","extract","concat","collection","Array","isArray","registry","ToolGroupFactory","l","defaultClasses","getDefaultClasses","BarToolGroup","ListToolGroup","MenuToolGroup","PopupTool","PopupElement","popup","setPosition","toggle","ToolGroupTool","innerToolGroup","createGroup","groupConfig","onToolGroupDisable","disabled","setDisabled","PopupToolGroup","indicator","dragging","onBlurHandler","onBlur","$handle","IndicatorElement","LabelElement","TitledElement","ClippableElement","$clippable","onHandleMouseKeyDown","onHandleMouseKeyUp","$label","$indicator","header","prepend","isElementAttached","value","containerWidth","containerLeft","css","toggleClipping","isClippedHorizontally","$clippableScrollableContainer","offset","left","allowCollapse","forceExpand","expanded","collapsibleTools","Object","keys","getExpandCollapseTool","updateCollapsibleState","ExpandCollapseTool","expandCollapseTool","setIcon","clip","labelTexts","setLabel"],"mappings":";CAUE,SAAWA,GAEb,YA4RAA,GAAGC,GAAGC,QAAU,SAAsBC,EAAaC,EAAkBC,GAE/DL,EAAGM,cAAeH,IAA4BI,SAAXF,IACvCA,EAASF,EACTA,EAAcE,EAAOF,YACrBC,EAAmBC,EAAOD,kBAI3BC,EAASA,MAGTL,EAAGC,GAAGC,QAAQM,OAAOC,KAAMC,KAAML,GAGjCL,EAAGW,aAAaF,KAAMC,MACtBV,EAAGC,GAAGW,MAAMC,aAAaJ,KAAMC,KAAML,GAGrCK,KAAKP,YAAcA,EACnBO,KAAKN,iBAAmBA,EACxBM,KAAKI,UACLJ,KAAKK,SACLL,KAAKM,SAAWX,EAAOW,UAAY,MACnCN,KAAKO,KAAOC,EAAG,SACfR,KAAKS,SAAWD,EAAG,SACnBR,KAAKU,aAAc,EACnBV,KAAKW,gBAAkB,KACvBX,KAAKY,sBAAwBZ,KAAKa,eAAeC,KAAMd,MAGvDA,KAAKe,SACHC,IAAKhB,KAAKO,MAAOS,IAAKhB,KAAKiB,QAASD,IAAKhB,KAAKS,UAC9CS,GAAI,oBAAqBlB,KAAKmB,cAAcL,KAAMd,OAGpDA,KAAKiB,OAAOG,SAAU,uBACjBzB,EAAO0B,SACXrB,KAAKO,KAAKe,OAAQtB,KAAKS,SAASW,SAAU,0BAE3CpB,KAAKO,KACHa,SAAU,qBACVE,OAAQtB,KAAKiB,OAAQ,kCACvBjB,KA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,GAGhDK,KAAKmE,QAAQY,QAAS/E,MAAQgF,YAAa,kBAG3ChF,KAAKe,SAASK,SAAU,wBAKzB9B,EAAGiC,aAAcjC,EAAGC,GAAGmM,cAAepM,EAAGC,GAAGgN,gBAQ5CjN,EAAGC,GAAGmM,cAAclG,OAAO7B,KAAO,OAYlCrE,EAAGC,GAAGmM,cAAchK,UAAUuE,cAAgB,WAC7C,GAAItC,GACHmL,IAED,KAAMnL,IAAQ3D,MAAKK,MACbL,KAAKK,MAAOsD,GAAOwC,YACvB2I,EAAW3L,KAAMnD,KAAKK,MAAOsD,GAAOgD,WAItC3G,MAAK+O,SAAUD,EAAW7H,KAAM,OAAU,OAGxC3H","file":"oojs-ui-toolbars.min.js","sourcesContent":["/*!\n * OOjs UI v0.22.1\n * https://www.mediawiki.org/wiki/OOjs_UI\n *\n * Copyright 2011–2017 OOjs UI Team and other contributors.\n * Released under the MIT license\n * http://oojs.mit-license.org\n *\n * Date: 2017-05-31T19:07:36Z\n */\n( function ( OO ) {\n\n'use strict';\n\n/**\n * Toolbars are complex interface components that permit users to easily access a variety\n * of {@link OO.ui.Tool tools} (e.g., formatting commands) and actions, which are additional commands that are\n * part of the toolbar, but not configured as tools.\n *\n * Individual tools are customized and then registered with a {@link OO.ui.ToolFactory tool factory}, which creates\n * the tools on demand. Each tool has a symbolic name (used when registering the tool), a title (e.g., ‘Insert\n * image’), and an icon.\n *\n * Individual tools are organized in {@link OO.ui.ToolGroup toolgroups}, which can be {@link OO.ui.MenuToolGroup menus}\n * of tools, {@link OO.ui.ListToolGroup lists} of tools, or a single {@link OO.ui.BarToolGroup bar} of tools.\n * The arrangement and order of the toolgroups is customized when the toolbar is set up. Tools can be presented in\n * any order, but each can only appear once in the toolbar.\n *\n * The toolbar can be synchronized with the state of the external \"application\", like a text\n * editor's editing area, marking tools as active/inactive (e.g. a 'bold' tool would be shown as\n * active when the text cursor was inside bolded text) or enabled/disabled (e.g. a table caption\n * tool would be disabled while the user is not editing a table). A state change is signalled by\n * emitting the {@link #event-updateState 'updateState' event}, which calls Tools'\n * {@link OO.ui.Tool#onUpdateState onUpdateState method}.\n *\n * The following is an example of a basic toolbar.\n *\n * @example\n * // Example of a toolbar\n * // Create the toolbar\n * var toolFactory = new OO.ui.ToolFactory();\n * var toolGroupFactory = new OO.ui.ToolGroupFactory();\n * var toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );\n *\n * // We will be placing status text in this element when tools are used\n * var $area = $( '
' ).text( 'Toolbar example' );\n *\n * // Define the tools that we're going to place in our toolbar\n *\n * // Create a class inheriting from OO.ui.Tool\n * function SearchTool() {\n * SearchTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( SearchTool, OO.ui.Tool );\n * // Each tool must have a 'name' (used as an internal identifier, see later) and at least one\n * // of 'icon' and 'title' (displayed icon and text).\n * SearchTool.static.name = 'search';\n * SearchTool.static.icon = 'search';\n * SearchTool.static.title = 'Search...';\n * // Defines the action that will happen when this tool is selected (clicked).\n * SearchTool.prototype.onSelect = function () {\n * $area.text( 'Search tool clicked!' );\n * // Never display this tool as \"active\" (selected).\n * this.setActive( false );\n * };\n * SearchTool.prototype.onUpdateState = function () {};\n * // Make this tool available in our toolFactory and thus our toolbar\n * toolFactory.register( SearchTool );\n *\n * // Register two more tools, nothing interesting here\n * function SettingsTool() {\n * SettingsTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( SettingsTool, OO.ui.Tool );\n * SettingsTool.static.name = 'settings';\n * SettingsTool.static.icon = 'settings';\n * SettingsTool.static.title = 'Change settings';\n * SettingsTool.prototype.onSelect = function () {\n * $area.text( 'Settings tool clicked!' );\n * this.setActive( false );\n * };\n * SettingsTool.prototype.onUpdateState = function () {};\n * toolFactory.register( SettingsTool );\n *\n * // Register two more tools, nothing interesting here\n * function StuffTool() {\n * StuffTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( StuffTool, OO.ui.Tool );\n * StuffTool.static.name = 'stuff';\n * StuffTool.static.icon = 'ellipsis';\n * StuffTool.static.title = 'More stuff';\n * StuffTool.prototype.onSelect = function () {\n * $area.text( 'More stuff tool clicked!' );\n * this.setActive( false );\n * };\n * StuffTool.prototype.onUpdateState = function () {};\n * toolFactory.register( StuffTool );\n *\n * // This is a PopupTool. Rather than having a custom 'onSelect' action, it will display a\n * // little popup window (a PopupWidget).\n * function HelpTool( toolGroup, config ) {\n * OO.ui.PopupTool.call( this, toolGroup, $.extend( { popup: {\n * padded: true,\n * label: 'Help',\n * head: true\n * } }, config ) );\n * this.popup.$body.append( '
I am helpful!
' );\n * }\n * OO.inheritClass( HelpTool, OO.ui.PopupTool );\n * HelpTool.static.name = 'help';\n * HelpTool.static.icon = 'help';\n * HelpTool.static.title = 'Help';\n * toolFactory.register( HelpTool );\n *\n * // Finally define which tools and in what order appear in the toolbar. Each tool may only be\n * // used once (but not all defined tools must be used).\n * toolbar.setup( [\n * {\n * // 'bar' tool groups display tools' icons only, side-by-side.\n * type: 'bar',\n * include: [ 'search', 'help' ]\n * },\n * {\n * // 'list' tool groups display both the titles and icons, in a dropdown list.\n * type: 'list',\n * indicator: 'down',\n * label: 'More',\n * include: [ 'settings', 'stuff' ]\n * }\n * // Note how the tools themselves are toolgroup-agnostic - the same tool can be displayed\n * // either in a 'list' or a 'bar'. There is a 'menu' tool group too, not showcased here,\n * // since it's more complicated to use. (See the next example snippet on this page.)\n * ] );\n *\n * // Create some UI around the toolbar and place it in the document\n * var frame = new OO.ui.PanelLayout( {\n * expanded: false,\n * framed: true\n * } );\n * var contentFrame = new OO.ui.PanelLayout( {\n * expanded: false,\n * padded: true\n * } );\n * frame.$element.append(\n * toolbar.$element,\n * contentFrame.$element.append( $area )\n * );\n * $( 'body' ).append( frame.$element );\n *\n * // Here is where the toolbar is actually built. This must be done after inserting it into the\n * // document.\n * toolbar.initialize();\n * toolbar.emit( 'updateState' );\n *\n * The following example extends the previous one to illustrate 'menu' toolgroups and the usage of\n * {@link #event-updateState 'updateState' event}.\n *\n * @example\n * // Create the toolbar\n * var toolFactory = new OO.ui.ToolFactory();\n * var toolGroupFactory = new OO.ui.ToolGroupFactory();\n * var toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );\n *\n * // We will be placing status text in this element when tools are used\n * var $area = $( '' ).text( 'Toolbar example' );\n *\n * // Define the tools that we're going to place in our toolbar\n *\n * // Create a class inheriting from OO.ui.Tool\n * function SearchTool() {\n * SearchTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( SearchTool, OO.ui.Tool );\n * // Each tool must have a 'name' (used as an internal identifier, see later) and at least one\n * // of 'icon' and 'title' (displayed icon and text).\n * SearchTool.static.name = 'search';\n * SearchTool.static.icon = 'search';\n * SearchTool.static.title = 'Search...';\n * // Defines the action that will happen when this tool is selected (clicked).\n * SearchTool.prototype.onSelect = function () {\n * $area.text( 'Search tool clicked!' );\n * // Never display this tool as \"active\" (selected).\n * this.setActive( false );\n * };\n * SearchTool.prototype.onUpdateState = function () {};\n * // Make this tool available in our toolFactory and thus our toolbar\n * toolFactory.register( SearchTool );\n *\n * // Register two more tools, nothing interesting here\n * function SettingsTool() {\n * SettingsTool.parent.apply( this, arguments );\n * this.reallyActive = false;\n * }\n * OO.inheritClass( SettingsTool, OO.ui.Tool );\n * SettingsTool.static.name = 'settings';\n * SettingsTool.static.icon = 'settings';\n * SettingsTool.static.title = 'Change settings';\n * SettingsTool.prototype.onSelect = function () {\n * $area.text( 'Settings tool clicked!' );\n * // Toggle the active state on each click\n * this.reallyActive = !this.reallyActive;\n * this.setActive( this.reallyActive );\n * // To update the menu label\n * this.toolbar.emit( 'updateState' );\n * };\n * SettingsTool.prototype.onUpdateState = function () {};\n * toolFactory.register( SettingsTool );\n *\n * // Register two more tools, nothing interesting here\n * function StuffTool() {\n * StuffTool.parent.apply( this, arguments );\n * this.reallyActive = false;\n * }\n * OO.inheritClass( StuffTool, OO.ui.Tool );\n * StuffTool.static.name = 'stuff';\n * StuffTool.static.icon = 'ellipsis';\n * StuffTool.static.title = 'More stuff';\n * StuffTool.prototype.onSelect = function () {\n * $area.text( 'More stuff tool clicked!' );\n * // Toggle the active state on each click\n * this.reallyActive = !this.reallyActive;\n * this.setActive( this.reallyActive );\n * // To update the menu label\n * this.toolbar.emit( 'updateState' );\n * };\n * StuffTool.prototype.onUpdateState = function () {};\n * toolFactory.register( StuffTool );\n *\n * // This is a PopupTool. Rather than having a custom 'onSelect' action, it will display a\n * // little popup window (a PopupWidget). 'onUpdateState' is also already implemented.\n * function HelpTool( toolGroup, config ) {\n * OO.ui.PopupTool.call( this, toolGroup, $.extend( { popup: {\n * padded: true,\n * label: 'Help',\n * head: true\n * } }, config ) );\n * this.popup.$body.append( '
I am helpful!
' );\n * }\n * OO.inheritClass( HelpTool, OO.ui.PopupTool );\n * HelpTool.static.name = 'help';\n * HelpTool.static.icon = 'help';\n * HelpTool.static.title = 'Help';\n * toolFactory.register( HelpTool );\n *\n * // Finally define which tools and in what order appear in the toolbar. Each tool may only be\n * // used once (but not all defined tools must be used).\n * toolbar.setup( [\n * {\n * // 'bar' tool groups display tools' icons only, side-by-side.\n * type: 'bar',\n * include: [ 'search', 'help' ]\n * },\n * {\n * // 'menu' tool groups display both the titles and icons, in a dropdown menu.\n * // Menu label indicates which items are selected.\n * type: 'menu',\n * indicator: 'down',\n * include: [ 'settings', 'stuff' ]\n * }\n * ] );\n *\n * // Create some UI around the toolbar and place it in the document\n * var frame = new OO.ui.PanelLayout( {\n * expanded: false,\n * framed: true\n * } );\n * var contentFrame = new OO.ui.PanelLayout( {\n * expanded: false,\n * padded: true\n * } );\n * frame.$element.append(\n * toolbar.$element,\n * contentFrame.$element.append( $area )\n * );\n * $( 'body' ).append( frame.$element );\n *\n * // Here is where the toolbar is actually built. This must be done after inserting it into the\n * // document.\n * toolbar.initialize();\n * toolbar.emit( 'updateState' );\n *\n * @class\n * @extends OO.ui.Element\n * @mixins OO.EventEmitter\n * @mixins OO.ui.mixin.GroupElement\n *\n * @constructor\n * @param {OO.ui.ToolFactory} toolFactory Factory for creating tools\n * @param {OO.ui.ToolGroupFactory} toolGroupFactory Factory for creating toolgroups\n * @param {Object} [config] Configuration options\n * @cfg {boolean} [actions] Add an actions section to the toolbar. Actions are commands that are included\n * in the toolbar, but are not configured as tools. By default, actions are displayed on the right side of\n * the toolbar.\n * @cfg {string} [position='top'] Whether the toolbar is positioned above ('top') or below ('bottom') content.\n */\nOO.ui.Toolbar = function OoUiToolbar( toolFactory, toolGroupFactory, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolFactory ) && config === undefined ) {\n\t\tconfig = toolFactory;\n\t\ttoolFactory = config.toolFactory;\n\t\ttoolGroupFactory = config.toolGroupFactory;\n\t}\n\n\t// Configuration initialization\n\tconfig = config || {};\n\n\t// Parent constructor\n\tOO.ui.Toolbar.parent.call( this, config );\n\n\t// Mixin constructors\n\tOO.EventEmitter.call( this );\n\tOO.ui.mixin.GroupElement.call( this, config );\n\n\t// Properties\n\tthis.toolFactory = toolFactory;\n\tthis.toolGroupFactory = toolGroupFactory;\n\tthis.groups = [];\n\tthis.tools = {};\n\tthis.position = config.position || 'top';\n\tthis.$bar = $( 'I am helpful!
' );\n * };\n * OO.inheritClass( HelpTool, OO.ui.PopupTool );\n * HelpTool.static.name = 'help';\n * HelpTool.static.icon = 'help';\n * HelpTool.static.title = 'Help';\n * toolFactory.register( HelpTool );\n *\n * For an example of a toolbar that contains a popup tool, see {@link OO.ui.Toolbar toolbars}. For more information about\n * toolbars in genreral, please see the [OOjs UI documentation on MediaWiki][1].\n *\n * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Toolbars\n *\n * @abstract\n * @class\n * @extends OO.ui.Tool\n * @mixins OO.ui.mixin.PopupElement\n *\n * @constructor\n * @param {OO.ui.ToolGroup} toolGroup\n * @param {Object} [config] Configuration options\n */\nOO.ui.PopupTool = function OoUiPopupTool( toolGroup, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolGroup ) && config === undefined ) {\n\t\tconfig = toolGroup;\n\t\ttoolGroup = config.toolGroup;\n\t}\n\n\t// Parent constructor\n\tOO.ui.PopupTool.parent.call( this, toolGroup, config );\n\n\t// Mixin constructors\n\tOO.ui.mixin.PopupElement.call( this, config );\n\n\t// Initialization\n\tthis.popup.setPosition( toolGroup.getToolbar().position === 'bottom' ? 'above' : 'below' );\n\tthis.$element\n\t\t.addClass( 'oo-ui-popupTool' )\n\t\t.append( this.popup.$element );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.PopupTool, OO.ui.Tool );\nOO.mixinClass( OO.ui.PopupTool, OO.ui.mixin.PopupElement );\n\n/* Methods */\n\n/**\n * Handle the tool being selected.\n *\n * @inheritdoc\n */\nOO.ui.PopupTool.prototype.onSelect = function () {\n\tif ( !this.isDisabled() ) {\n\t\tthis.popup.toggle();\n\t}\n\tthis.setActive( false );\n\treturn false;\n};\n\n/**\n * Handle the toolbar state being updated.\n *\n * @inheritdoc\n */\nOO.ui.PopupTool.prototype.onUpdateState = function () {\n\tthis.setActive( false );\n};\n\n/**\n * A ToolGroupTool is a special sort of tool that can contain other {@link OO.ui.Tool tools}\n * and {@link OO.ui.ToolGroup toolgroups}. The ToolGroupTool was specifically designed to be used\n * inside a {@link OO.ui.BarToolGroup bar} toolgroup to provide access to additional tools from\n * the bar item. Included tools will be displayed in a dropdown {@link OO.ui.ListToolGroup list}\n * when the ToolGroupTool is selected.\n *\n * // Example: ToolGroupTool with two nested tools, 'setting1' and 'setting2', defined elsewhere.\n *\n * function SettingsTool() {\n * SettingsTool.parent.apply( this, arguments );\n * };\n * OO.inheritClass( SettingsTool, OO.ui.ToolGroupTool );\n * SettingsTool.static.name = 'settings';\n * SettingsTool.static.title = 'Change settings';\n * SettingsTool.static.groupConfig = {\n * icon: 'settings',\n * label: 'ToolGroupTool',\n * include: [ 'setting1', 'setting2' ]\n * };\n * toolFactory.register( SettingsTool );\n *\n * For more information, please see the [OOjs UI documentation on MediaWiki][1].\n *\n * Please note that this implementation is subject to change per [T74159] [2].\n *\n * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Toolbars#ToolGroupTool\n * [2]: https://phabricator.wikimedia.org/T74159\n *\n * @abstract\n * @class\n * @extends OO.ui.Tool\n *\n * @constructor\n * @param {OO.ui.ToolGroup} toolGroup\n * @param {Object} [config] Configuration options\n */\nOO.ui.ToolGroupTool = function OoUiToolGroupTool( toolGroup, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolGroup ) && config === undefined ) {\n\t\tconfig = toolGroup;\n\t\ttoolGroup = config.toolGroup;\n\t}\n\n\t// Parent constructor\n\tOO.ui.ToolGroupTool.parent.call( this, toolGroup, config );\n\n\t// Properties\n\tthis.innerToolGroup = this.createGroup( this.constructor.static.groupConfig );\n\n\t// Events\n\tthis.innerToolGroup.connect( this, { disable: 'onToolGroupDisable' } );\n\n\t// Initialization\n\tthis.$link.remove();\n\tthis.$element\n\t\t.addClass( 'oo-ui-toolGroupTool' )\n\t\t.append( this.innerToolGroup.$element );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.ToolGroupTool, OO.ui.Tool );\n\n/* Static Properties */\n\n/**\n * Toolgroup configuration.\n *\n * The toolgroup configuration consists of the tools to include, as well as an icon and label\n * to use for the bar item. Tools can be included by symbolic name, group, or with the\n * wildcard selector. Please see {@link OO.ui.ToolGroup toolgroup} for more information.\n *\n * @property {Object.' ).text( 'Example of a BarToolGroup with two tools.' );\n *\n * // Define the tools that we're going to place in our toolbar\n *\n * // Create a class inheriting from OO.ui.Tool\n * function SearchTool() {\n * SearchTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( SearchTool, OO.ui.Tool );\n * // Each tool must have a 'name' (used as an internal identifier, see later) and at least one\n * // of 'icon' and 'title' (displayed icon and text).\n * SearchTool.static.name = 'search';\n * SearchTool.static.icon = 'search';\n * SearchTool.static.title = 'Search...';\n * // Defines the action that will happen when this tool is selected (clicked).\n * SearchTool.prototype.onSelect = function () {\n * $area.text( 'Search tool clicked!' );\n * // Never display this tool as \"active\" (selected).\n * this.setActive( false );\n * };\n * SearchTool.prototype.onUpdateState = function () {};\n * // Make this tool available in our toolFactory and thus our toolbar\n * toolFactory.register( SearchTool );\n *\n * // This is a PopupTool. Rather than having a custom 'onSelect' action, it will display a\n * // little popup window (a PopupWidget).\n * function HelpTool( toolGroup, config ) {\n * OO.ui.PopupTool.call( this, toolGroup, $.extend( { popup: {\n * padded: true,\n * label: 'Help',\n * head: true\n * } }, config ) );\n * this.popup.$body.append( '
I am helpful!
' );\n * }\n * OO.inheritClass( HelpTool, OO.ui.PopupTool );\n * HelpTool.static.name = 'help';\n * HelpTool.static.icon = 'help';\n * HelpTool.static.title = 'Help';\n * toolFactory.register( HelpTool );\n *\n * // Finally define which tools and in what order appear in the toolbar. Each tool may only be\n * // used once (but not all defined tools must be used).\n * toolbar.setup( [\n * {\n * // 'bar' tool groups display tools by icon only\n * type: 'bar',\n * include: [ 'search', 'help' ]\n * }\n * ] );\n *\n * // Create some UI around the toolbar and place it in the document\n * var frame = new OO.ui.PanelLayout( {\n * expanded: false,\n * framed: true\n * } );\n * var contentFrame = new OO.ui.PanelLayout( {\n * expanded: false,\n * padded: true\n * } );\n * frame.$element.append(\n * toolbar.$element,\n * contentFrame.$element.append( $area )\n * );\n * $( 'body' ).append( frame.$element );\n *\n * // Here is where the toolbar is actually built. This must be done after inserting it into the\n * // document.\n * toolbar.initialize();\n *\n * For more information about how to add tools to a bar tool group, please see {@link OO.ui.ToolGroup toolgroup}.\n * For more information about toolbars in general, please see the [OOjs UI documentation on MediaWiki][1].\n *\n * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Toolbars\n *\n * @class\n * @extends OO.ui.ToolGroup\n *\n * @constructor\n * @param {OO.ui.Toolbar} toolbar\n * @param {Object} [config] Configuration options\n */\nOO.ui.BarToolGroup = function OoUiBarToolGroup( toolbar, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolbar ) && config === undefined ) {\n\t\tconfig = toolbar;\n\t\ttoolbar = config.toolbar;\n\t}\n\n\t// Parent constructor\n\tOO.ui.BarToolGroup.parent.call( this, toolbar, config );\n\n\t// Initialization\n\tthis.$element.addClass( 'oo-ui-barToolGroup' );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.BarToolGroup, OO.ui.ToolGroup );\n\n/* Static Properties */\n\n/**\n * @static\n * @inheritdoc\n */\nOO.ui.BarToolGroup.static.titleTooltips = true;\n\n/**\n * @static\n * @inheritdoc\n */\nOO.ui.BarToolGroup.static.accelTooltips = true;\n\n/**\n * @static\n * @inheritdoc\n */\nOO.ui.BarToolGroup.static.name = 'bar';\n\n/**\n * PopupToolGroup is an abstract base class used by both {@link OO.ui.MenuToolGroup MenuToolGroup}\n * and {@link OO.ui.ListToolGroup ListToolGroup} to provide a popup--an overlaid menu or list of tools with an\n * optional icon and label. This class can be used for other base classes that also use this functionality.\n *\n * @abstract\n * @class\n * @extends OO.ui.ToolGroup\n * @mixins OO.ui.mixin.IconElement\n * @mixins OO.ui.mixin.IndicatorElement\n * @mixins OO.ui.mixin.LabelElement\n * @mixins OO.ui.mixin.TitledElement\n * @mixins OO.ui.mixin.FlaggedElement\n * @mixins OO.ui.mixin.ClippableElement\n * @mixins OO.ui.mixin.TabIndexedElement\n *\n * @constructor\n * @param {OO.ui.Toolbar} toolbar\n * @param {Object} [config] Configuration options\n * @cfg {string} [header] Text to display at the top of the popup\n */\nOO.ui.PopupToolGroup = function OoUiPopupToolGroup( toolbar, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolbar ) && config === undefined ) {\n\t\tconfig = toolbar;\n\t\ttoolbar = config.toolbar;\n\t}\n\n\t// Configuration initialization\n\tconfig = $.extend( {\n\t\tindicator: config.indicator === undefined ? ( toolbar.position === 'bottom' ? 'up' : 'down' ) : config.indicator\n\t}, config );\n\n\t// Parent constructor\n\tOO.ui.PopupToolGroup.parent.call( this, toolbar, config );\n\n\t// Properties\n\tthis.active = false;\n\tthis.dragging = false;\n\tthis.onBlurHandler = this.onBlur.bind( this );\n\tthis.$handle = $( '' );\n\n\t// Mixin constructors\n\tOO.ui.mixin.IconElement.call( this, config );\n\tOO.ui.mixin.IndicatorElement.call( this, config );\n\tOO.ui.mixin.LabelElement.call( this, config );\n\tOO.ui.mixin.TitledElement.call( this, config );\n\tOO.ui.mixin.FlaggedElement.call( this, config );\n\tOO.ui.mixin.ClippableElement.call( this, $.extend( {}, config, { $clippable: this.$group } ) );\n\tOO.ui.mixin.TabIndexedElement.call( this, $.extend( {}, config, { $tabIndexed: this.$handle } ) );\n\n\t// Events\n\tthis.$handle.on( {\n\t\tkeydown: this.onHandleMouseKeyDown.bind( this ),\n\t\tkeyup: this.onHandleMouseKeyUp.bind( this ),\n\t\tmousedown: this.onHandleMouseKeyDown.bind( this ),\n\t\tmouseup: this.onHandleMouseKeyUp.bind( this )\n\t} );\n\n\t// Initialization\n\tthis.$handle\n\t\t.addClass( 'oo-ui-popupToolGroup-handle' )\n\t\t.attr( 'role', 'button' )\n\t\t.append( this.$icon, this.$label, this.$indicator );\n\t// If the pop-up should have a header, add it to the top of the toolGroup.\n\t// Note: If this feature is useful for other widgets, we could abstract it into an\n\t// OO.ui.HeaderedElement mixin constructor.\n\tif ( config.header !== undefined ) {\n\t\tthis.$group\n\t\t\t.prepend( $( '' )\n\t\t\t\t.addClass( 'oo-ui-popupToolGroup-header' )\n\t\t\t\t.text( config.header )\n\t\t\t);\n\t}\n\tthis.$element\n\t\t.addClass( 'oo-ui-popupToolGroup' )\n\t\t.prepend( this.$handle );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.PopupToolGroup, OO.ui.ToolGroup );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.IconElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.IndicatorElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.LabelElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.TitledElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.FlaggedElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.ClippableElement );\nOO.mixinClass( OO.ui.PopupToolGroup, OO.ui.mixin.TabIndexedElement );\n\n/* Methods */\n\n/**\n * @inheritdoc\n */\nOO.ui.PopupToolGroup.prototype.setDisabled = function () {\n\t// Parent method\n\tOO.ui.PopupToolGroup.parent.prototype.setDisabled.apply( this, arguments );\n\n\tif ( this.isDisabled() && this.isElementAttached() ) {\n\t\tthis.setActive( false );\n\t}\n};\n\n/**\n * Handle focus being lost.\n *\n * The event is actually generated from a mouseup/keyup, so it is not a normal blur event object.\n *\n * @protected\n * @param {MouseEvent|KeyboardEvent} e Mouse up or key up event\n */\nOO.ui.PopupToolGroup.prototype.onBlur = function ( e ) {\n\t// Only deactivate when clicking outside the dropdown element\n\tif ( $( e.target ).closest( '.oo-ui-popupToolGroup' )[ 0 ] !== this.$element[ 0 ] ) {\n\t\tthis.setActive( false );\n\t}\n};\n\n/**\n * @inheritdoc\n */\nOO.ui.PopupToolGroup.prototype.onMouseKeyUp = function ( e ) {\n\t// Only close toolgroup when a tool was actually selected\n\tif (\n\t\t!this.isDisabled() && this.pressed && this.pressed === this.getTargetTool( e ) &&\n\t\t( e.which === OO.ui.MouseButtons.LEFT || e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.ENTER )\n\t) {\n\t\tthis.setActive( false );\n\t}\n\treturn OO.ui.PopupToolGroup.parent.prototype.onMouseKeyUp.call( this, e );\n};\n\n/**\n * Handle mouse up and key up events.\n *\n * @protected\n * @param {jQuery.Event} e Mouse up or key up event\n */\nOO.ui.PopupToolGroup.prototype.onHandleMouseKeyUp = function ( e ) {\n\tif (\n\t\t!this.isDisabled() &&\n\t\t( e.which === OO.ui.MouseButtons.LEFT || e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.ENTER )\n\t) {\n\t\treturn false;\n\t}\n};\n\n/**\n * Handle mouse down and key down events.\n *\n * @protected\n * @param {jQuery.Event} e Mouse down or key down event\n */\nOO.ui.PopupToolGroup.prototype.onHandleMouseKeyDown = function ( e ) {\n\tif (\n\t\t!this.isDisabled() &&\n\t\t( e.which === OO.ui.MouseButtons.LEFT || e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.ENTER )\n\t) {\n\t\tthis.setActive( !this.active );\n\t\treturn false;\n\t}\n};\n\n/**\n * Switch into 'active' mode.\n *\n * When active, the popup is visible. A mouseup event anywhere in the document will trigger\n * deactivation.\n *\n * @param {boolean} value The active state to set\n */\nOO.ui.PopupToolGroup.prototype.setActive = function ( value ) {\n\tvar containerWidth, containerLeft;\n\tvalue = !!value;\n\tif ( this.active !== value ) {\n\t\tthis.active = value;\n\t\tif ( value ) {\n\t\t\tthis.getElementDocument().addEventListener( 'mouseup', this.onBlurHandler, true );\n\t\t\tthis.getElementDocument().addEventListener( 'keyup', this.onBlurHandler, true );\n\n\t\t\tthis.$clippable.css( 'left', '' );\n\t\t\t// Try anchoring the popup to the left first\n\t\t\tthis.$element.addClass( 'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left' );\n\t\t\tthis.toggleClipping( true );\n\t\t\tif ( this.isClippedHorizontally() ) {\n\t\t\t\t// Anchoring to the left caused the popup to clip, so anchor it to the right instead\n\t\t\t\tthis.toggleClipping( false );\n\t\t\t\tthis.$element\n\t\t\t\t\t.removeClass( 'oo-ui-popupToolGroup-left' )\n\t\t\t\t\t.addClass( 'oo-ui-popupToolGroup-right' );\n\t\t\t\tthis.toggleClipping( true );\n\t\t\t}\n\t\t\tif ( this.isClippedHorizontally() ) {\n\t\t\t\t// Anchoring to the right also caused the popup to clip, so just make it fill the container\n\t\t\t\tcontainerWidth = this.$clippableScrollableContainer.width();\n\t\t\t\tcontainerLeft = this.$clippableScrollableContainer.offset().left;\n\n\t\t\t\tthis.toggleClipping( false );\n\t\t\t\tthis.$element.removeClass( 'oo-ui-popupToolGroup-right' );\n\n\t\t\t\tthis.$clippable.css( {\n\t\t\t\t\tleft: -( this.$element.offset().left - containerLeft ),\n\t\t\t\t\twidth: containerWidth\n\t\t\t\t} );\n\t\t\t}\n\t\t} else {\n\t\t\tthis.getElementDocument().removeEventListener( 'mouseup', this.onBlurHandler, true );\n\t\t\tthis.getElementDocument().removeEventListener( 'keyup', this.onBlurHandler, true );\n\t\t\tthis.$element.removeClass(\n\t\t\t\t'oo-ui-popupToolGroup-active oo-ui-popupToolGroup-left oo-ui-popupToolGroup-right'\n\t\t\t);\n\t\t\tthis.toggleClipping( false );\n\t\t}\n\t}\n};\n\n/**\n * ListToolGroups are one of three types of {@link OO.ui.ToolGroup toolgroups} that are used to\n * create {@link OO.ui.Toolbar toolbars} (the other types of groups are {@link OO.ui.MenuToolGroup MenuToolGroup}\n * and {@link OO.ui.BarToolGroup BarToolGroup}). The {@link OO.ui.Tool tools} in a ListToolGroup are displayed\n * by label in a dropdown menu. The title of the tool is used as the label text. The menu itself can be configured\n * with a label, icon, indicator, header, and title.\n *\n * ListToolGroups can be configured to be expanded and collapsed. Collapsed lists will have a ‘More’ option that\n * users can select to see the full list of tools. If a collapsed toolgroup is expanded, a ‘Fewer’ option permits\n * users to collapse the list again.\n *\n * ListToolGroups are created by a {@link OO.ui.ToolGroupFactory toolgroup factory} when the toolbar is set up. The factory\n * requires the ListToolGroup's symbolic name, 'list', which is specified along with the other configurations. For more\n * information about how to add tools to a ListToolGroup, please see {@link OO.ui.ToolGroup toolgroup}.\n *\n * @example\n * // Example of a ListToolGroup\n * var toolFactory = new OO.ui.ToolFactory();\n * var toolGroupFactory = new OO.ui.ToolGroupFactory();\n * var toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );\n *\n * // Configure and register two tools\n * function SettingsTool() {\n * SettingsTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( SettingsTool, OO.ui.Tool );\n * SettingsTool.static.name = 'settings';\n * SettingsTool.static.icon = 'settings';\n * SettingsTool.static.title = 'Change settings';\n * SettingsTool.prototype.onSelect = function () {\n * this.setActive( false );\n * };\n * SettingsTool.prototype.onUpdateState = function () {};\n * toolFactory.register( SettingsTool );\n * // Register two more tools, nothing interesting here\n * function StuffTool() {\n * StuffTool.parent.apply( this, arguments );\n * }\n * OO.inheritClass( StuffTool, OO.ui.Tool );\n * StuffTool.static.name = 'stuff';\n * StuffTool.static.icon = 'search';\n * StuffTool.static.title = 'Change the world';\n * StuffTool.prototype.onSelect = function () {\n * this.setActive( false );\n * };\n * StuffTool.prototype.onUpdateState = function () {};\n * toolFactory.register( StuffTool );\n * toolbar.setup( [\n * {\n * // Configurations for list toolgroup.\n * type: 'list',\n * label: 'ListToolGroup',\n * icon: 'ellipsis',\n * title: 'This is the title, displayed when user moves the mouse over the list toolgroup',\n * header: 'This is the header',\n * include: [ 'settings', 'stuff' ],\n * allowCollapse: ['stuff']\n * }\n * ] );\n *\n * // Create some UI around the toolbar and place it in the document\n * var frame = new OO.ui.PanelLayout( {\n * expanded: false,\n * framed: true\n * } );\n * frame.$element.append(\n * toolbar.$element\n * );\n * $( 'body' ).append( frame.$element );\n * // Build the toolbar. This must be done after the toolbar has been appended to the document.\n * toolbar.initialize();\n *\n * For more information about toolbars in general, please see the [OOjs UI documentation on MediaWiki][1].\n *\n * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Toolbars\n *\n * @class\n * @extends OO.ui.PopupToolGroup\n *\n * @constructor\n * @param {OO.ui.Toolbar} toolbar\n * @param {Object} [config] Configuration options\n * @cfg {Array} [allowCollapse] Allow the specified tools to be collapsed. By default, collapsible tools\n * will only be displayed if users click the ‘More’ option displayed at the bottom of the list. If\n * the list is expanded, a ‘Fewer’ option permits users to collapse the list again. Any tools that\n * are included in the toolgroup, but are not designated as collapsible, will always be displayed.\n * To open a collapsible list in its expanded state, set #expanded to 'true'.\n * @cfg {Array} [forceExpand] Expand the specified tools. All other tools will be designated as collapsible.\n * Unless #expanded is set to true, the collapsible tools will be collapsed when the list is first opened.\n * @cfg {boolean} [expanded=false] Expand collapsible tools. This config is only relevant if tools have\n * been designated as collapsible. When expanded is set to true, all tools in the group will be displayed\n * when the list is first opened. Users can collapse the list with a ‘Fewer’ option at the bottom.\n */\nOO.ui.ListToolGroup = function OoUiListToolGroup( toolbar, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolbar ) && config === undefined ) {\n\t\tconfig = toolbar;\n\t\ttoolbar = config.toolbar;\n\t}\n\n\t// Configuration initialization\n\tconfig = config || {};\n\n\t// Properties (must be set before parent constructor, which calls #populate)\n\tthis.allowCollapse = config.allowCollapse;\n\tthis.forceExpand = config.forceExpand;\n\tthis.expanded = config.expanded !== undefined ? config.expanded : false;\n\tthis.collapsibleTools = [];\n\n\t// Parent constructor\n\tOO.ui.ListToolGroup.parent.call( this, toolbar, config );\n\n\t// Initialization\n\tthis.$element.addClass( 'oo-ui-listToolGroup' );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.ListToolGroup, OO.ui.PopupToolGroup );\n\n/* Static Properties */\n\n/**\n * @static\n * @inheritdoc\n */\nOO.ui.ListToolGroup.static.name = 'list';\n\n/* Methods */\n\n/**\n * @inheritdoc\n */\nOO.ui.ListToolGroup.prototype.populate = function () {\n\tvar i, len, allowCollapse = [];\n\n\tOO.ui.ListToolGroup.parent.prototype.populate.call( this );\n\n\t// Update the list of collapsible tools\n\tif ( this.allowCollapse !== undefined ) {\n\t\tallowCollapse = this.allowCollapse;\n\t} else if ( this.forceExpand !== undefined ) {\n\t\tallowCollapse = OO.simpleArrayDifference( Object.keys( this.tools ), this.forceExpand );\n\t}\n\n\tthis.collapsibleTools = [];\n\tfor ( i = 0, len = allowCollapse.length; i < len; i++ ) {\n\t\tif ( this.tools[ allowCollapse[ i ] ] !== undefined ) {\n\t\t\tthis.collapsibleTools.push( this.tools[ allowCollapse[ i ] ] );\n\t\t}\n\t}\n\n\t// Keep at the end, even when tools are added\n\tthis.$group.append( this.getExpandCollapseTool().$element );\n\n\tthis.getExpandCollapseTool().toggle( this.collapsibleTools.length !== 0 );\n\tthis.updateCollapsibleState();\n};\n\n/**\n * Get the expand/collapse tool for this group\n *\n * @return {OO.ui.Tool} Expand collapse tool\n */\nOO.ui.ListToolGroup.prototype.getExpandCollapseTool = function () {\n\tvar ExpandCollapseTool;\n\tif ( this.expandCollapseTool === undefined ) {\n\t\tExpandCollapseTool = function () {\n\t\t\tExpandCollapseTool.parent.apply( this, arguments );\n\t\t};\n\n\t\tOO.inheritClass( ExpandCollapseTool, OO.ui.Tool );\n\n\t\tExpandCollapseTool.prototype.onSelect = function () {\n\t\t\tthis.toolGroup.expanded = !this.toolGroup.expanded;\n\t\t\tthis.toolGroup.updateCollapsibleState();\n\t\t\tthis.setActive( false );\n\t\t};\n\t\tExpandCollapseTool.prototype.onUpdateState = function () {\n\t\t\t// Do nothing. Tool interface requires an implementation of this function.\n\t\t};\n\n\t\tExpandCollapseTool.static.name = 'more-fewer';\n\n\t\tthis.expandCollapseTool = new ExpandCollapseTool( this );\n\t}\n\treturn this.expandCollapseTool;\n};\n\n/**\n * @inheritdoc\n */\nOO.ui.ListToolGroup.prototype.onMouseKeyUp = function ( e ) {\n\t// Do not close the popup when the user wants to show more/fewer tools\n\tif (\n\t\t$( e.target ).closest( '.oo-ui-tool-name-more-fewer' ).length &&\n\t\t( e.which === OO.ui.MouseButtons.LEFT || e.which === OO.ui.Keys.SPACE || e.which === OO.ui.Keys.ENTER )\n\t) {\n\t\t// HACK: Prevent the popup list from being hidden. Skip the PopupToolGroup implementation (which\n\t\t// hides the popup list when a tool is selected) and call ToolGroup's implementation directly.\n\t\treturn OO.ui.ListToolGroup.parent.parent.prototype.onMouseKeyUp.call( this, e );\n\t} else {\n\t\treturn OO.ui.ListToolGroup.parent.prototype.onMouseKeyUp.call( this, e );\n\t}\n};\n\nOO.ui.ListToolGroup.prototype.updateCollapsibleState = function () {\n\tvar i, len;\n\n\tthis.getExpandCollapseTool()\n\t\t.setIcon( this.expanded ? 'collapse' : 'expand' )\n\t\t.setTitle( OO.ui.msg( this.expanded ? 'ooui-toolgroup-collapse' : 'ooui-toolgroup-expand' ) );\n\n\tfor ( i = 0, len = this.collapsibleTools.length; i < len; i++ ) {\n\t\tthis.collapsibleTools[ i ].toggle( this.expanded );\n\t}\n\n\t// Re-evaluate clipping, because our height has changed\n\tthis.clip();\n};\n\n/**\n * MenuToolGroups are one of three types of {@link OO.ui.ToolGroup toolgroups} that are used to\n * create {@link OO.ui.Toolbar toolbars} (the other types of groups are {@link OO.ui.BarToolGroup BarToolGroup}\n * and {@link OO.ui.ListToolGroup ListToolGroup}). MenuToolGroups contain selectable {@link OO.ui.Tool tools},\n * which are displayed by label in a dropdown menu. The tool's title is used as the label text, and the\n * menu label is updated to reflect which tool or tools are currently selected. If no tools are selected,\n * the menu label is empty. The menu can be configured with an indicator, icon, title, and/or header.\n *\n * MenuToolGroups are created by a {@link OO.ui.ToolGroupFactory tool group factory} when the toolbar\n * is set up.\n *\n * @example\n * // Example of a MenuToolGroup\n * var toolFactory = new OO.ui.ToolFactory();\n * var toolGroupFactory = new OO.ui.ToolGroupFactory();\n * var toolbar = new OO.ui.Toolbar( toolFactory, toolGroupFactory );\n *\n * // We will be placing status text in this element when tools are used\n * var $area = $( '' ).text( 'An example of a MenuToolGroup. Select a tool from the dropdown menu.' );\n *\n * // Define the tools that we're going to place in our toolbar\n *\n * function SettingsTool() {\n * SettingsTool.parent.apply( this, arguments );\n * this.reallyActive = false;\n * }\n * OO.inheritClass( SettingsTool, OO.ui.Tool );\n * SettingsTool.static.name = 'settings';\n * SettingsTool.static.icon = 'settings';\n * SettingsTool.static.title = 'Change settings';\n * SettingsTool.prototype.onSelect = function () {\n * $area.text( 'Settings tool clicked!' );\n * // Toggle the active state on each click\n * this.reallyActive = !this.reallyActive;\n * this.setActive( this.reallyActive );\n * // To update the menu label\n * this.toolbar.emit( 'updateState' );\n * };\n * SettingsTool.prototype.onUpdateState = function () {};\n * toolFactory.register( SettingsTool );\n *\n * function StuffTool() {\n * StuffTool.parent.apply( this, arguments );\n * this.reallyActive = false;\n * }\n * OO.inheritClass( StuffTool, OO.ui.Tool );\n * StuffTool.static.name = 'stuff';\n * StuffTool.static.icon = 'ellipsis';\n * StuffTool.static.title = 'More stuff';\n * StuffTool.prototype.onSelect = function () {\n * $area.text( 'More stuff tool clicked!' );\n * // Toggle the active state on each click\n * this.reallyActive = !this.reallyActive;\n * this.setActive( this.reallyActive );\n * // To update the menu label\n * this.toolbar.emit( 'updateState' );\n * };\n * StuffTool.prototype.onUpdateState = function () {};\n * toolFactory.register( StuffTool );\n *\n * // Finally define which tools and in what order appear in the toolbar. Each tool may only be\n * // used once (but not all defined tools must be used).\n * toolbar.setup( [\n * {\n * type: 'menu',\n * header: 'This is the (optional) header',\n * title: 'This is the (optional) title',\n * include: [ 'settings', 'stuff' ]\n * }\n * ] );\n *\n * // Create some UI around the toolbar and place it in the document\n * var frame = new OO.ui.PanelLayout( {\n * expanded: false,\n * framed: true\n * } );\n * var contentFrame = new OO.ui.PanelLayout( {\n * expanded: false,\n * padded: true\n * } );\n * frame.$element.append(\n * toolbar.$element,\n * contentFrame.$element.append( $area )\n * );\n * $( 'body' ).append( frame.$element );\n *\n * // Here is where the toolbar is actually built. This must be done after inserting it into the\n * // document.\n * toolbar.initialize();\n * toolbar.emit( 'updateState' );\n *\n * For more information about how to add tools to a MenuToolGroup, please see {@link OO.ui.ToolGroup toolgroup}.\n * For more information about toolbars in general, please see the [OOjs UI documentation on MediaWiki] [1].\n *\n * [1]: https://www.mediawiki.org/wiki/OOjs_UI/Toolbars\n *\n * @class\n * @extends OO.ui.PopupToolGroup\n *\n * @constructor\n * @param {OO.ui.Toolbar} toolbar\n * @param {Object} [config] Configuration options\n */\nOO.ui.MenuToolGroup = function OoUiMenuToolGroup( toolbar, config ) {\n\t// Allow passing positional parameters inside the config object\n\tif ( OO.isPlainObject( toolbar ) && config === undefined ) {\n\t\tconfig = toolbar;\n\t\ttoolbar = config.toolbar;\n\t}\n\n\t// Configuration initialization\n\tconfig = config || {};\n\n\t// Parent constructor\n\tOO.ui.MenuToolGroup.parent.call( this, toolbar, config );\n\n\t// Events\n\tthis.toolbar.connect( this, { updateState: 'onUpdateState' } );\n\n\t// Initialization\n\tthis.$element.addClass( 'oo-ui-menuToolGroup' );\n};\n\n/* Setup */\n\nOO.inheritClass( OO.ui.MenuToolGroup, OO.ui.PopupToolGroup );\n\n/* Static Properties */\n\n/**\n * @static\n * @inheritdoc\n */\nOO.ui.MenuToolGroup.static.name = 'menu';\n\n/* Methods */\n\n/**\n * Handle the toolbar state being updated.\n *\n * When the state changes, the title of each active item in the menu will be joined together and\n * used as a label for the group. The label will be empty if none of the items are active.\n *\n * @private\n */\nOO.ui.MenuToolGroup.prototype.onUpdateState = function () {\n\tvar name,\n\t\tlabelTexts = [];\n\n\tfor ( name in this.tools ) {\n\t\tif ( this.tools[ name ].isActive() ) {\n\t\t\tlabelTexts.push( this.tools[ name ].getTitle() );\n\t\t}\n\t}\n\n\tthis.setLabel( labelTexts.join( ', ' ) || ' ' );\n};\n\n}( OO ) );\n\n//# sourceMappingURL=oojs-ui-toolbars.js.map"]}