mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 10:59:56 +00:00
0aac4c7e60
Objectives: * Split reference dialog (at least for now) an edit and an insert dialog * Add reference search widget for selecting an existing source, or choosing to add a new one * Abstract reference names, don't allow editing them and generate them when needed * When editing groups, move the internal item and update all references to it * Resolve name conflicts when moving a reference to a new group by generating a new list key Bonus: * Add getNodeGroups method to internal list * Add getUniqueListKey method to internal list * Add destroy functionality to ce.node to release events and references Bug: 49733 Change-Id: Ib244ff6ad9b4cee1decfd9b9e1d3d4e9cdcfb78c
42 lines
1.2 KiB
JavaScript
42 lines
1.2 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWReferenceButtonTool class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* ReferenceWiki media insert button tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.DialogButtonTool
|
|
*
|
|
* @constructor
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ui.MWReferenceInsertButtonTool = function VeUiMWReferenceButtonTool( toolbar, config ) {
|
|
// Parent constructor
|
|
ve.ui.DialogButtonTool.call( this, toolbar, config );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.MWReferenceInsertButtonTool, ve.ui.DialogButtonTool );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ui.MWReferenceInsertButtonTool.static.name = 'mwReferenceInsert';
|
|
|
|
ve.ui.MWReferenceInsertButtonTool.static.icon = 'reference';
|
|
|
|
ve.ui.MWReferenceInsertButtonTool.static.titleMessage = 'visualeditor-dialogbutton-reference-insert-tooltip';
|
|
|
|
ve.ui.MWReferenceInsertButtonTool.static.dialog = 'mwReferenceInsert';
|
|
|
|
ve.ui.MWReferenceInsertButtonTool.static.modelClasses = [ ve.dm.MWReferenceNode ];
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.toolFactory.register( 'mwReferenceInsert', ve.ui.MWReferenceInsertButtonTool );
|