mediawiki-extensions-Visual.../modules/ve/ui/tools/buttons/ve.ui.MWTemplateButtonTool.js
Trevor Parscal 231a50f2b6 Implement ve.ui.MWTemplateDialog
Objective:

* Add button to launch template dialog
* Add template dialog

Changes;

*.php
* Add messages and links to files

ve.ce.Node.css
* Make inline templates display as inline-block to contain their
  contents (allowing shields to work properly)

ve.ui.MWTemplateDialog.js
* New empty dialog for templates

ve.ui.MWTemplateButtonTool.js
* New template button, appears in context and launches dialog

Change-Id: I9174ed7c9012522246a6defc859276bf36763f5b
2013-05-15 19:36:18 +00:00

39 lines
1,003 B
JavaScript

/*!
* VisualEditor UserInterface MWTemplateButtonTool class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Template button tool.
*
* @class
* @extends ve.ui.DialogButtonTool
* @constructor
* @param {ve.ui.Toolbar} toolbar
* @param {Object} [config] Config options
*/
ve.ui.MWTemplateButtonTool = function VeUiMwTemplateButtonTool( toolbar, config ) {
// Parent constructor
ve.ui.DialogButtonTool.call( this, toolbar, config );
};
/* Inheritance */
ve.inheritClass( ve.ui.MWTemplateButtonTool, ve.ui.DialogButtonTool );
/* Static Properties */
ve.ui.MWTemplateButtonTool.static.name = 'mwTemplate';
ve.ui.MWTemplateButtonTool.static.icon = 'template';
ve.ui.MWTemplateButtonTool.static.titleMessage = 'visualeditor-dialogbutton-template-tooltip';
ve.ui.MWTemplateButtonTool.static.dialog = 'mwTemplate';
/* Registration */
ve.ui.toolFactory.register( 'mwTemplate', ve.ui.MWTemplateButtonTool );