mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-27 16:30:12 +00:00
73c90a0e7d
Some of the annotations were used in a way that confused jsdoc. This cleans up redundant annotations and uses more canonical tags. These changes cause all classes to now appear in the generated pages. Includes linking to external docs. Bug: T358641 Change-Id: Iaee1dadcc19a70c27839d0d27dfa6a07a70fb46b
52 lines
1.2 KiB
JavaScript
52 lines
1.2 KiB
JavaScript
'use strict';
|
|
|
|
/*!
|
|
* VisualEditor UserInterface MediaWiki UseExistingReferenceCommand class.
|
|
*
|
|
* @copyright 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
|
|
* @license MIT
|
|
*/
|
|
|
|
/**
|
|
* Use existing reference command.
|
|
*
|
|
* @constructor
|
|
* @extends ve.ui.Command
|
|
*/
|
|
ve.ui.MWUseExistingReferenceCommand = function VeUiMWUseExistingReferenceCommand() {
|
|
// Parent constructor
|
|
ve.ui.MWUseExistingReferenceCommand.super.call(
|
|
this, 'reference/existing', 'window', 'open',
|
|
{ args: [ 'reference', { useExisting: true } ], supportedSelections: [ 'linear' ] }
|
|
);
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
OO.inheritClass( ve.ui.MWUseExistingReferenceCommand, ve.ui.Command );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* @override
|
|
*/
|
|
ve.ui.MWUseExistingReferenceCommand.prototype.isExecutable = function ( fragment ) {
|
|
if ( !ve.ui.MWUseExistingReferenceCommand.super.prototype
|
|
.isExecutable.apply( this, arguments )
|
|
) {
|
|
return false;
|
|
}
|
|
|
|
const groups = fragment.getDocument().getInternalList().getNodeGroups();
|
|
for ( const groupName in groups ) {
|
|
if ( groupName.indexOf( 'mwReference/' ) === 0 && groups[ groupName ].indexOrder.length ) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|
|
/* Registration */
|
|
|
|
ve.ui.commandRegistry.register( new ve.ui.MWUseExistingReferenceCommand() );
|