mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-05 22:22:54 +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
41 lines
1.1 KiB
JavaScript
41 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWReferenceEditButtonTool class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Reference edit button tool.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.DialogButtonTool
|
|
* @constructor
|
|
* @param {ve.ui.Toolbar} toolbar
|
|
* @param {Object} [config] Config options
|
|
*/
|
|
ve.ui.MWReferenceEditButtonTool = function VeUiMwReferenceEditButtonTool( toolbar, config ) {
|
|
// Parent constructor
|
|
ve.ui.DialogButtonTool.call( this, toolbar, config );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.MWReferenceEditButtonTool, ve.ui.DialogButtonTool );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ui.MWReferenceEditButtonTool.static.name = 'mwReferenceEdit';
|
|
|
|
ve.ui.MWReferenceEditButtonTool.static.icon = 'reference';
|
|
|
|
ve.ui.MWReferenceEditButtonTool.static.titleMessage = 'visualeditor-dialogbutton-reference-tooltip';
|
|
|
|
ve.ui.MWReferenceEditButtonTool.static.dialog = 'mwReferenceEdit';
|
|
|
|
ve.ui.MWReferenceEditButtonTool.static.modelClasses = [ ve.dm.MWReferenceNode ];
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.toolFactory.register( 'mwReferenceEdit', ve.ui.MWReferenceEditButtonTool );
|