jenkins-bot has submitted this change and it was merged.

Change subject: Create ref list insertion tool
......................................................................


Create ref list insertion tool

Fixes (follows-up I1b48ef5240, I6daff5c596):
* Invalid html passed to jQuery constructor.
* Use prop() instead of attr() for boolean values.
* Use append() instead of html() when appending nodes instead
  of parsing html.
* Rename shadowed variable name clash 'mw' to 'mwData'.
* Fix odd construction where we parse '{}' to create an empty
  object.
* Have ve.ce.MWReferenceListNode#update perform changes off-document
  in a detached tree.
* Fix deep property access that can fail. mwData is set to
  either JSON parse of data-mw attr or empty object.
  Accessing mwData.attrs.group needs to be guarded by whether
  mw.attrs is indeed set.
* Have `mw` and `about` attribtue in references list roundtrip
  (especially mw which can data we aren't editing/re-creating).
* Add missing 'refGroup' property to MWReferenceListNode's
  data element (similar to what MWReferenceNode already has).

Change-Id: I67e4f378ccd04e97361d8e58ae57db5353075756
---
M VisualEditor.i18n.php
M VisualEditor.php
M modules/ve/ce/nodes/ve.ce.MWReferenceListNode.js
M modules/ve/ce/styles/ve.ce.Node.css
M modules/ve/dm/nodes/ve.dm.MWReferenceListNode.js
M modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
M modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
M modules/ve/test/dm/ve.dm.example.js
A modules/ve/ui/dialogs/ve.ui.MWReferenceListDialog.js
M modules/ve/ui/styles/ve.ui.Dialog.css
A modules/ve/ui/tools/buttons/ve.ui.MWReferenceListButtonTool.js
11 files changed, 288 insertions(+), 27 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/VisualEditor.i18n.php b/VisualEditor.i18n.php
index 752ce37..1e0c503 100644
--- a/VisualEditor.i18n.php
+++ b/VisualEditor.i18n.php
@@ -55,6 +55,7 @@
        'visualeditor-dialog-reference-options-name-label' => 'Re-use by this 
name',
        'visualeditor-dialog-reference-options-group-label' => 'Use this group',
        'visualeditor-dialog-reference-title' => 'Reference',
+       'visualeditor-dialog-referencelist-title' => 'References list',
        'visualeditor-dialog-media-title' => 'Media settings',
        'visualeditor-dialog-transclusion-add-param' => 'Add parameter',
        'visualeditor-dialog-transclusion-add-template' => 'Add template',
@@ -70,6 +71,7 @@
        'visualeditor-dialogbutton-media-tooltip' => 'Media',
        'visualeditor-dialogbutton-meta-tooltip' => 'Page settings',
        'visualeditor-dialogbutton-reference-tooltip' => 'Reference',
+       'visualeditor-dialogbutton-referencelist-tooltip' => 'References list',
        'visualeditor-dialogbutton-transclusion-tooltip' => 'Transclusion',
        'visualeditor-diff-nochanges' => 'Could not start the review because 
your revision matches the latest version of this page.',
        'visualeditor-differror' => 'Error loading data from server: $1.',
@@ -111,6 +113,7 @@
        'visualeditor-outline-control-move-down' => 'Move item down',
        'visualeditor-preference-enable' => 'Enable VisualEditor (only in the 
[[{{MediaWiki:Visualeditor-mainnamespacepagelink}}|main]] and 
[[{{MediaWiki:Visualeditor-usernamespacepagelink}}|user]] namespaces)',
        'visualeditor-preference-nosectionedit' => 'Use the wikitext editor for 
editing sections while VisualEditor is in beta',
+       'visualeditor-referencelist-isempty' => 'There are no references with 
the group "$1" on this page.',
        'visualeditor-savedialog-label-create' => 'Create page',
        'visualeditor-savedialog-label-report' => 'Report problem',
        'visualeditor-savedialog-label-resolve-conflict' => 'Resolve conflict',
@@ -251,6 +254,7 @@
        'visualeditor-dialogbutton-media-tooltip' => '{{Identical|Media}}',
        'visualeditor-dialogbutton-meta-tooltip' => '{{Identical|Page 
Settings}}',
        'visualeditor-dialogbutton-reference-tooltip' => 
'{{Identical|Reference}}',
+       'visualeditor-dialogbutton-referencelist-tooltip' => 'Tooltip for 
button for dialog that inserts the references list object 
(<code><nowik>Reference list</nowiki></code>)',
        'visualeditor-dialogbutton-transclusion-tooltip' => 
'{{Identical|Transclusion}}',
        'visualeditor-diff-nochanges' => 'Message displayed in the diff view 
when no changes were detected',
        'visualeditor-differror' => 'Text shown when the editor fails to load 
the diff.
diff --git a/VisualEditor.php b/VisualEditor.php
index 8124bd7..96c87bb 100644
--- a/VisualEditor.php
+++ b/VisualEditor.php
@@ -604,12 +604,12 @@
                'scripts' => array(
                        've/dm/nodes/ve.dm.MWReferenceListNode.js',
                        've/dm/nodes/ve.dm.MWReferenceNode.js',
-
                        've/ce/nodes/ve.ce.MWReferenceListNode.js',
                        've/ce/nodes/ve.ce.MWReferenceNode.js',
-
+                       
've/ui/tools/buttons/ve.ui.MWReferenceListButtonTool.js',
                        've/ui/tools/buttons/ve.ui.MWReferenceButtonTool.js',
                        've/ui/dialogs/ve.ui.MWReferenceDialog.js',
+                       've/ui/dialogs/ve.ui.MWReferenceListDialog.js',
                ),
                'dependencies' => array(
                        'ext.visualEditor.core',
@@ -621,7 +621,10 @@
                        'visualeditor-dialog-reference-options-name-label',
                        'visualeditor-dialog-reference-options-section',
                        'visualeditor-dialog-reference-title',
+                       'visualeditor-dialog-referencelist-title',
                        'visualeditor-dialogbutton-reference-tooltip',
+                       'visualeditor-dialogbutton-referencelist-tooltip',
+                       'visualeditor-referencelist-isempty',
                ),
        ),
        'ext.visualEditor.icons-raster' => $wgVisualEditorResourceTemplate + 
array(
diff --git a/modules/ve/ce/nodes/ve.ce.MWReferenceListNode.js 
b/modules/ve/ce/nodes/ve.ce.MWReferenceListNode.js
index 4ff16b5..a5a1684 100644
--- a/modules/ve/ce/nodes/ve.ce.MWReferenceListNode.js
+++ b/modules/ve/ce/nodes/ve.ce.MWReferenceListNode.js
@@ -25,10 +25,12 @@
        ve.ce.FocusableNode.call( this );
 
        // DOM Changes
-       this.$.addClass( 've-ce-mwReferenceListNode', 'reference' )
-               .attr( 'contenteditable', false );
-       this.$reflist = $( '<ol class="references">' );
-       this.$.append( this.$reflist );
+       this.$
+               .addClass( 've-ce-mwReferenceListNode', 'reference' )
+               .prop( 'contenteditable', false );
+       this.$reflist = $( '<ol class="references"></ol>' );
+       this.$refmsg = $( '<p>' )
+               .addClass( 've-ce-mwReferenceListNode-muted' );
 
        // Events
        this.model.getDocument().internalList.connect( this, { 'update': 
'onInternalListUpdate' } );
@@ -70,6 +72,19 @@
 };
 
 /**
+ * Handle attribute change events.
+ *
+ * @param {string} key Attribute key
+ * @param {string} from Old value
+ * @param {string} to New value
+ */
+ve.ce.MWReferenceListNode.prototype.onAttributeChange = function ( key ) {
+       if ( key === 'listGroup' ) {
+               this.update();
+       }
+};
+
+/**
  * Handle the updating of the InternalListNode.
  *
  * This will occur after changes to any InternalItemNode.
@@ -89,6 +104,7 @@
 ve.ce.MWReferenceListNode.prototype.update = function () {
        var i, j, iLen, jLen, index, firstNode, key, keyedNodes, $li, itemNode,
                internalList = this.model.getDocument().internalList,
+               refGroup = this.model.getAttribute( 'refGroup' ),
                listGroup = this.model.getAttribute( 'listGroup' ),
                nodes = internalList.getNodeGroup( listGroup );
 
@@ -100,8 +116,13 @@
        }
        this.attachedItems = this.attachedItems || [];
 
-       this.$reflist.empty();
-       if ( nodes && nodes.indexOrder.length ) {
+       this.$reflist.detach().empty();
+       this.$refmsg.detach();
+
+       if ( !nodes || !nodes.indexOrder.length ) {
+               this.$refmsg.text( ve.msg( 
'visualeditor-referencelist-isempty', refGroup ) );
+               this.$.append( this.$refmsg );
+       } else {
                for ( i = 0, iLen = nodes.indexOrder.length; i < iLen; i++ ) {
                        index = nodes.indexOrder[i];
                        firstNode = nodes.firstNodes[index];
@@ -132,10 +153,11 @@
                        // HACK: ProtectedNode crashes when dealing with an 
unattached node
                        this.attachedItems.push( itemNode );
                        itemNode.attach( this );
-                       $li.append( $( '<span class="reference-text">' ).html( 
itemNode.$.clone().show() ) );
+                       $li.append( $( '<span class="reference-text"></span>' 
).append( itemNode.$.clone().show() ) );
                        this.$reflist.append( $li );
                }
-       } // TODO: Show a placeholder for an empty reference list in the 'else' 
section
+               this.$.append( this.$reflist );
+       }
 };
 
 /* Registration */
diff --git a/modules/ve/ce/styles/ve.ce.Node.css 
b/modules/ve/ce/styles/ve.ce.Node.css
index 46b8d78..fb17953 100644
--- a/modules/ve/ce/styles/ve.ce.Node.css
+++ b/modules/ve/ce/styles/ve.ce.Node.css
@@ -176,6 +176,11 @@
        display: inline-block;
 }
 
+.ve-ce-mwReferenceListNode-muted {
+       font-style: italic;
+       color: #777;
+}
+
 /* ve.ce.BranchNode */
 
 .ve-ce-branchNode-blockSlug {
diff --git a/modules/ve/dm/nodes/ve.dm.MWReferenceListNode.js 
b/modules/ve/dm/nodes/ve.dm.MWReferenceListNode.js
index 8f82068..2e3a82c 100644
--- a/modules/ve/dm/nodes/ve.dm.MWReferenceListNode.js
+++ b/modules/ve/dm/nodes/ve.dm.MWReferenceListNode.js
@@ -34,23 +34,55 @@
 ve.dm.MWReferenceListNode.static.storeHtmlAttributes = false;
 
 ve.dm.MWReferenceListNode.static.toDataElement = function ( domElements ) {
-       var mw = JSON.parse( domElements[0].getAttribute( 'data-mw' ) || '{}' ),
-               refGroup = mw.attrs.group || '',
+       var mwDataJSON = domElements[0].getAttribute( 'data-mw' ),
+               mwData = mwDataJSON ? JSON.parse( mwDataJSON ) : {},
+               refGroup = mwData.attrs && mwData.attrs.group || '',
                listGroup = 'mwReference/' + refGroup;
 
        return {
                'type': this.name,
                'attributes': {
+                       'mw': mwData,
+                       'about': domElements[0].getAttribute( 'about' ),
                        'domElements': ve.copyArray( domElements ),
+                       'refGroup': refGroup,
                        'listGroup': listGroup
                }
        };
 };
 
 ve.dm.MWReferenceListNode.static.toDomElements = function ( dataElement, doc ) 
{
-       return ve.copyDomElements( dataElement.attributes.domElements, doc );
+       var el, els, mwData,
+               attribs = dataElement.attributes;
+
+       if ( attribs.domElements ) {
+               // If there's more than 1 element, preserve entire array, not 
just first element
+               els = ve.copyDomElements( attribs.domElements, doc );
+               el = els[0];
+       } else {
+               el = doc.createElement( 'div' );
+               els = [ el ];
+       }
+
+       mwData = attribs.mw ? ve.copyObject( attribs.mw ) : {};
+
+       mwData.name = 'references';
+
+       if ( attribs.refGroup ) {
+               ve.setProp( mwData, 'attrs', 'group', attribs.refGroup );
+       } else if ( mwData.attrs ) {
+               delete mwData.attrs.refGroup;
+       }
+
+       if ( attribs.about ) {
+               el.setAttribute( 'about', attribs.about );
+       }
+       el.setAttribute( 'typeof', 'mw:Extension/references' );
+       el.setAttribute( 'data-mw', JSON.stringify( mwData ) );
+
+       return els;
 };
 
 /* Registration */
 
-ve.dm.modelRegistry.register( ve.dm.MWReferenceListNode );
\ No newline at end of file
+ve.dm.modelRegistry.register( ve.dm.MWReferenceListNode );
diff --git a/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js 
b/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
index 2423a1a..36a25af 100644
--- a/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
+++ b/modules/ve/dm/nodes/ve.dm.MWReferenceNode.js
@@ -42,11 +42,12 @@
 ve.dm.MWReferenceNode.static.toDataElement = function ( domElements, converter 
) {
        var dataElement,
                about = domElements[0].getAttribute( 'about' ),
-               mw = JSON.parse( domElements[0].getAttribute( 'data-mw' ) || 
'{}' ),
-               body = mw.body ? mw.body.html : '',
-               refGroup = mw.attrs.group || '',
+               mwDataJSON = domElements[0].getAttribute( 'data-mw' ),
+               mwData = mwDataJSON ? JSON.parse( mwDataJSON ) : {},
+               body = mwData.body ? mwData.body.html : '',
+               refGroup = mwData.attrs && mwData.attrs.group || '',
                listGroup = this.name + '/' + refGroup,
-               listKey = mw.attrs && mw.attrs.name !== undefined ? 
mw.attrs.name : null,
+               listKey = mwData.attrs && mwData.attrs.name !== undefined ? 
mwData.attrs.name : null,
                queueResult = converter.internalList.queueItemHtml( listGroup, 
listKey, body ),
                listIndex = queueResult.index,
                contentsUsed = ( body !== '' && queueResult.isNew );
@@ -54,7 +55,7 @@
        dataElement = {
                'type': this.name,
                'attributes': {
-                       'mw': mw,
+                       'mw': mwData,
                        'about': about,
                        'listIndex': listIndex,
                        'listGroup': listGroup,
diff --git a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js 
b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
index 174b343..e6cf949 100644
--- a/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
+++ b/modules/ve/init/mw/targets/ve.init.mw.ViewPageTarget.js
@@ -205,7 +205,7 @@
        { 'items': [ 'mwFormat' ] },
        { 'items': [ 'bold', 'italic', 'mwLink', 'clear' ] },
        { 'items': [ 'number', 'bullet', 'outdent', 'indent' ] },
-       { 'items': [ 'mwMediaInsert', 'mwReference', 'mwTransclusion' ] }
+       { 'items': [ 'mwMediaInsert', 'mwReference', 'mwReferenceList', 
'mwTransclusion' ] }
 ];
 
 ve.init.mw.ViewPageTarget.static.surfaceCommands = [
diff --git a/modules/ve/test/dm/ve.dm.example.js 
b/modules/ve/test/dm/ve.dm.example.js
index e009e79..83278d1 100644
--- a/modules/ve/test/dm/ve.dm.example.js
+++ b/modules/ve/test/dm/ve.dm.example.js
@@ -1130,7 +1130,7 @@
                                                '<a href="#cite_note-3" 
data-parsoid="{}">[3]</a>' +
                                        '</span>' +
                                '</p>' +
-                               '<ol class="references" 
typeof="mw:Extension/references" ' +
+                               '<ol class="references" about="#mwt12" 
typeof="mw:Extension/references" ' +
                                        
'data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}" ' +
                                        'data-parsoid="{}">' +
                                        '<li id="cite_note-quux-2"><a 
href="#cite_ref-quux-2-0">u2191</a>Quux</li>' +
@@ -1278,13 +1278,19 @@
                        {
                                'type': 'mwReferenceList',
                                'attributes': {
+                                       'about': '#mwt12',
+                                       'mw': {
+                                               'name': 'references',
+                                               'attrs': {}
+                                       },
                                        'domElements': $(
-                                               '<ol class="references" 
typeof="mw:Extension/references" '+
+                                               '<ol class="references" 
about="#mwt12" typeof="mw:Extension/references" '+
                                                        
'data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}" ' +
                                                        'data-parsoid="{}">'+
                                                        '<li 
id="cite_note-quux-2"><a href="#cite_ref-quux-2-0">u2191</a>Quux</li>' +
                                                '</ol>' ).toArray(),
-                                       'listGroup': 'mwReference/'
+                                       'listGroup': 'mwReference/',
+                                       'refGroup': ''
                                }
                        },
                        { 'type': '/mwReferenceList' },
@@ -1328,7 +1334,7 @@
                                        
'data-mw="{&quot;body&quot;:{&quot;html&quot;:&quot;No 
name&quot;},&quot;attrs&quot;:{&quot;group&quot;:&quot;g1&quot;}}">' +
                                '</span>' +
                        '</p>' +
-                       '<ol class="references" 
typeof="mw:Extension/references" ' +
+                       '<ol class="references" about="#mwt12" 
typeof="mw:Extension/references" ' +
                                
'data-mw="{&quot;name&quot;:&quot;references&quot;,&quot;attrs&quot;:{}}" ' +
                                'data-parsoid="{}">' +
                                '<li id="cite_note-quux-2"><a 
href="#cite_ref-quux-2-0">u2191</a>Quux</li>' +
@@ -3597,8 +3603,14 @@
        {
                'type': 'mwReferenceList',
                'attributes': {
+                       'about': '#mwt12',
+                       'mw': {
+                               'name': 'references',
+                               'attrs': {}
+                       },
                        //'domElements': HTML,
-                       'listGroup': 'mwReference/'
+                       'listGroup': 'mwReference/',
+                       'refGroup': ''
                }
        },
        { 'type': '/mwReferenceList' },
diff --git a/modules/ve/ui/dialogs/ve.ui.MWReferenceListDialog.js 
b/modules/ve/ui/dialogs/ve.ui.MWReferenceListDialog.js
new file mode 100644
index 0000000..7c22c1e
--- /dev/null
+++ b/modules/ve/ui/dialogs/ve.ui.MWReferenceListDialog.js
@@ -0,0 +1,143 @@
+/*!
+ * VisualEditor user interface MWReferenceListDialog class.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * Dialog for a MediaWiki references list.
+ *
+ * @class
+ * @extends ve.ui.Dialog
+ *
+ * @constructor
+ * @param {ve.ui.Surface} surface
+ * @param {Object} [config] Config options
+ */
+ve.ui.MWReferenceListDialog = function VeUiMWReferenceListDialog( surface, 
config ) {
+       // Parent constructor
+       ve.ui.Dialog.call( this, surface, config );
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.MWReferenceListDialog, ve.ui.Dialog );
+
+/* Static Properties */
+
+ve.ui.MWReferenceListDialog.static.titleMessage = 
'visualeditor-dialog-referencelist-title';
+
+ve.ui.MWReferenceListDialog.static.icon = 'references';
+
+ve.ui.MWReferenceListDialog.static.modelClasses = [ ve.dm.MWReferenceListNode 
];
+
+/* Methods */
+
+ve.ui.MWReferenceListDialog.prototype.initialize = function () {
+       // Parent method
+       ve.ui.Dialog.prototype.initialize.call( this );
+
+       // Properties
+       this.optionsFieldset = new ve.ui.FieldsetLayout( {
+               '$$': this.frame.$$,
+               'label': ve.msg( 
'visualeditor-dialog-reference-options-section' ),
+               'icon': 'settings'
+       } );
+
+       this.groupInput = new ve.ui.TextInputWidget( { '$$': this.frame.$$ } );
+       this.groupLabel = new ve.ui.InputLabelWidget( {
+               '$$': this.frame.$$,
+               'input': this.groupInput,
+               'label': ve.msg( 
'visualeditor-dialog-reference-options-group-label' )
+       } );
+
+       // Initialization
+       this.optionsFieldset.$.append( this.groupLabel.$, this.groupInput.$ );
+       this.$body
+               .append( this.optionsFieldset.$ )
+               .addClass( 've-ui-mwReferenceListDialog-body' );
+};
+
+ve.ui.MWReferenceListDialog.prototype.onOpen = function () {
+       var node, refGroup;
+
+       // Parent method
+       ve.ui.Dialog.prototype.onOpen.call( this );
+
+       // Prepopulate from existing node if we're editing a node
+       // instead of inserting a new one
+       node = this.surface.getView().getFocusedNode();
+       if ( node instanceof ve.ce.MWReferenceListNode ) {
+               refGroup = node.getModel().getAttribute( 'refGroup' );
+
+       } else {
+               refGroup = '';
+       }
+
+       this.groupInput.setValue( refGroup );
+
+       /**
+        * Focused node.
+        *
+        * @private
+        * @property {ve.ce.MWReferenceListNode|undefined}
+        */
+       this.node = node;
+};
+
+/**
+ * @param {string} action Action that caused the window to be closed
+ */
+ve.ui.MWReferenceListDialog.prototype.onClose = function ( action ) {
+       var refGroup, listGroup, oldListGroup, attrChanges,
+               doc, model,
+               surfaceModel = this.surface.getModel(),
+               node = this.node;
+
+       // Save changes
+       if ( action === 'apply' ) {
+               refGroup = this.groupInput.getValue();
+               listGroup = 'mwReference/' + refGroup;
+
+               if ( node ) {
+                       // Edit existing model
+                       doc = surfaceModel.getDocument();
+                       model = node.getModel();
+                       oldListGroup = model.getAttribute( 'listGroup' );
+
+                       if ( listGroup !== oldListGroup ) {
+                               attrChanges = {
+                                       listGroup: listGroup,
+                                       refGroup: refGroup
+                               };
+                               surfaceModel.change(
+                                       
ve.dm.Transaction.newFromAttributeChanges(
+                                               doc, 
model.getOuterRange().start, attrChanges
+                                       )
+                               );
+                       }
+               } else {
+                       // Create new model
+                       
surfaceModel.getFragment().collapseRangeToEnd().insertContent( [
+                               {
+                                       'type': 'mwReferenceList',
+                                       'attributes': {
+                                               'listGroup': listGroup,
+                                               'refGroup': refGroup
+                                       }
+                               },
+                               { 'type': '/mwReferenceList' }
+                       ] );
+               }
+       }
+
+       // Parent method
+       ve.ui.Dialog.prototype.onClose.call( this );
+};
+
+/* Registration */
+
+ve.ui.dialogFactory.register( 'mwReferenceList', ve.ui.MWReferenceListDialog );
+
+ve.ui.viewRegistry.register( 'mwReferenceList', ve.ui.MWReferenceListDialog );
diff --git a/modules/ve/ui/styles/ve.ui.Dialog.css 
b/modules/ve/ui/styles/ve.ui.Dialog.css
index 61dc138..77c7302 100644
--- a/modules/ve/ui/styles/ve.ui.Dialog.css
+++ b/modules/ve/ui/styles/ve.ui.Dialog.css
@@ -145,9 +145,10 @@
        overflow: hidden;
 }
 
-/* ve.ui.MWReferenceDialog */
+/* ve.ui.MWReferenceDialog & ve.ui.MWReferenceListDialog */
 
-.ve-ui-mwReferenceDialog-body {
+.ve-ui-mwReferenceDialog-body,
+.ve-ui-mwReferenceListDialog-body {
        padding: 2em;
        overflow-y: auto;
 }
diff --git a/modules/ve/ui/tools/buttons/ve.ui.MWReferenceListButtonTool.js 
b/modules/ve/ui/tools/buttons/ve.ui.MWReferenceListButtonTool.js
new file mode 100644
index 0000000..4730104
--- /dev/null
+++ b/modules/ve/ui/tools/buttons/ve.ui.MWReferenceListButtonTool.js
@@ -0,0 +1,38 @@
+/*!
+ * VisualEditor UserInterface MWReferenceListButtonTool class.
+ *
+ * @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
+ * @license The MIT License (MIT); see LICENSE.txt
+ */
+
+/**
+ * Reference button tool.
+ *
+ * @class
+ * @extends ve.ui.DialogButtonTool
+ * @constructor
+ * @param {ve.ui.Toolbar} toolbar
+ * @param {Object} [config] Config options
+ */
+ve.ui.MWReferenceListButtonTool = function VeUiMwReferenceListButtonTool( 
toolbar, config ) {
+       // Parent constructor
+       ve.ui.DialogButtonTool.call( this, toolbar, config );
+};
+
+/* Inheritance */
+
+ve.inheritClass( ve.ui.MWReferenceListButtonTool, ve.ui.DialogButtonTool );
+
+/* Static Properties */
+
+ve.ui.MWReferenceListButtonTool.static.name = 'mwReferenceList';
+
+ve.ui.MWReferenceListButtonTool.static.icon = 'references';
+
+ve.ui.MWReferenceListButtonTool.static.titleMessage = 
'visualeditor-dialogbutton-referencelist-tooltip';
+
+ve.ui.MWReferenceListButtonTool.static.dialog = 'mwReferenceList';
+
+/* Registration */
+
+ve.ui.toolFactory.register( 'mwReferenceList', ve.ui.MWReferenceListButtonTool 
);

-- 
To view, visit https://gerrit.wikimedia.org/r/69832
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I67e4f378ccd04e97361d8e58ae57db5353075756
Gerrit-PatchSet: 18
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Catrope <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to