mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34: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
47 lines
1.2 KiB
JavaScript
47 lines
1.2 KiB
JavaScript
/*!
|
|
* VisualEditor UserInterface MWReferenceResultWidget class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Creates an ve.ui.MWReferenceResultWidget object.
|
|
*
|
|
* @class
|
|
* @extends ve.ui.OptionWidget
|
|
*
|
|
* @constructor
|
|
* @param {Mixed} data Item data
|
|
* @param {Object} [config] Config options
|
|
* @cfg {boolean} [divider] Section divider item, not highlightable or selectable
|
|
*/
|
|
ve.ui.MWReferenceResultWidget = function VeUiMWReferenceResultWidget( data, config ) {
|
|
// Configuration intialization
|
|
config = config || {};
|
|
|
|
// Parent constructor
|
|
ve.ui.OptionWidget.call( this, data, config );
|
|
|
|
// Properties
|
|
this.$shield = this.$$( '<div>' );
|
|
|
|
// Initialization
|
|
this.$shield.addClass( 've-ui-mwReferenceResultWidget-shield' );
|
|
this.$
|
|
.addClass( 've-ui-mwReferenceResultWidget' )
|
|
.append( this.$shield );
|
|
if ( config.divider ) {
|
|
this.$.addClass( 've-ui-mwReferenceResultWidget-divider' );
|
|
this.setDisabled( true );
|
|
}
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.ui.MWReferenceResultWidget, ve.ui.OptionWidget );
|
|
|
|
/* Static Properties */
|
|
|
|
ve.ui.MWReferenceResultWidget.static.highlightable = false;
|