mediawiki-extensions-Cite/modules/ve-cite/ve.ui.MWCitationAction.js
Adam Wight 73c90a0e7d Clean up and fix some jsdoc annotations
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
2024-02-29 13:05:42 +01:00

56 lines
1.2 KiB
JavaScript

'use strict';
/*!
* VisualEditor UserInterface MWCitationAction class.
*
* @copyright 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
* @license MIT
*/
/**
* Citation action.
*
* Opens the {@see ve.ui.MWCitationDialog} (via it's name "cite") in VisualEditor.
*
* @constructor
* @extends ve.ui.Action
* @param {ve.ui.Surface} surface Surface to act on
*/
ve.ui.MWCitationAction = function VeUiMWCitationAction() {
// Parent constructor
ve.ui.MWCitationAction.super.apply( this, arguments );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWCitationAction, ve.ui.Action );
/* Static Properties */
ve.ui.MWCitationAction.static.name = 'mwcite';
ve.ui.MWCitationAction.static.methods = [ 'open' ];
/* Methods */
/**
* When opening a citation, send the dialog a property of the surface
* dialog name.
*
* @method
* @param {Object} windowData Data to send to the dialog
* @return {boolean} Action was executed
*/
ve.ui.MWCitationAction.prototype.open = function ( windowData ) {
windowData = $.extend( {
inDialog: this.surface.getInDialog()
}, windowData );
this.surface.execute( 'window', 'open', 'cite', windowData );
return true;
};
/* Registration */
ve.ui.actionFactory.register( ve.ui.MWCitationAction );