mediawiki-extensions-Visual.../modules/ve-mw/ui/tools/ve.ui.MWTransclusionDialogTool.js
James D. Forrester 31bafa183d Update VE core submodule to master (a942301)
New changes:
2cc219a Update OOjs UI to v0.1.0-pre (571f26d0ab)
3543cb7 Protect against offset=-1 in insertContent()
7a3d456 [BREAKING CHANGE] Move selection restrictions from tools to commands
3d847bb Disable desktop context on table selections
41282dd Missed function rename from RangeFix change
dd6c8b8 Support toDomElements returning an empty array
9be6464 Placholder -> placeholder
9bdd0a8 Restore basic styling to toolbar in core target (only)

Local changes:
Move selection restrictions from tools to commands

Change-Id: I88f3d04946bd1d03ed001d747475a8b495a0f64c
2014-11-04 14:11:04 -08:00

70 lines
1.7 KiB
JavaScript

/*!
* VisualEditor MediaWiki UserInterface transclusion tool classes.
*
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* MediaWiki UserInterface transclusion tool.
*
* @class
* @extends ve.ui.DialogTool
* @constructor
* @param {OO.ui.ToolGroup} toolGroup
* @param {Object} [config] Configuration options
*/
ve.ui.MWTransclusionDialogTool = function VeUiMWTransclusionDialogTool( toolGroup, config ) {
ve.ui.DialogTool.call( this, toolGroup, config );
};
/* Inheritance */
OO.inheritClass( ve.ui.MWTransclusionDialogTool, ve.ui.DialogTool );
/* Static Properties */
ve.ui.MWTransclusionDialogTool.static.name = 'transclusion';
ve.ui.MWTransclusionDialogTool.static.group = 'object';
ve.ui.MWTransclusionDialogTool.static.icon = 'template';
ve.ui.MWTransclusionDialogTool.static.title =
OO.ui.deferMsg( 'visualeditor-dialogbutton-template-tooltip' );
ve.ui.MWTransclusionDialogTool.static.modelClasses = [ ve.dm.MWTransclusionNode ];
ve.ui.MWTransclusionDialogTool.static.commandName = 'transclusion';
/**
* Only display tool for single-template transclusions of these templates.
*
* @property {string|string[]|null}
* @static
* @inheritable
*/
ve.ui.MWTransclusionDialogTool.static.template = null;
/* Methods */
/**
* @inheritdoc
*/
ve.ui.MWTransclusionDialogTool.static.isCompatibleWith = function ( model ) {
var compatible;
// Parent method
compatible = ve.ui.DialogTool.static.isCompatibleWith.call( this, model );
if ( compatible && this.template ) {
return model.isSingleTemplate( this.template );
}
return compatible;
};
/* Registration */
ve.ui.toolFactory.register( ve.ui.MWTransclusionDialogTool );