mediawiki-extensions-Visual.../modules/ve/init/ve.init.Target.js
Trevor Parscal 2d044518bd References dialog cleanup
Objectives:

* Remove the whole toolbar subset thing, it's up to the creator of the
  subsurface to know what is and is now allowed, and the commands were
  still passing through unfiltered
* Correctly separate initialization from opening - fix issue where opening
  the reference dialog multiple times will keep adding more and more
  controls

Changes:

ve.init.Target.js
* Remove getToolbarSubset method

ve.ui.MWReferenceDialog.js
* Add toolbar tools and surface commands configs to reference dialog,
  including the things that are safe to use in references
* Move creation of field sets and reused controls to initialize method
  to prevent re-creation each time the dialog is opened
* Move static initialization stuff to the top near the other static stuff

Change-Id: I1c8577d17c506bac76e61b2b036655c59ef5a218
2013-06-12 11:27:49 -07:00

42 lines
916 B
JavaScript

/*!
* VisualEditor Initialization Target class.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* Generic Initialization target.
*
* @class
* @abstract
* @mixins ve.EventEmitter
*
* @constructor
* @param {jQuery} $container Conainter to render target into
*/
ve.init.Target = function VeInitTarget( $container ) {
// Mixin constructors
ve.EventEmitter.call( this );
// Properties
this.$ = $container;
};
/* Inheritance */
ve.mixinClass( ve.init.Target, ve.EventEmitter );
/* Static Properties */
ve.init.Target.static.toolbarTools = [
{ 'items': ['undo', 'redo'] },
{ 'items': ['format'] },
{ 'items': ['bold', 'italic', 'link', 'clear'] },
{ 'items': ['number', 'bullet', 'outdent', 'indent'] }
];
ve.init.Target.static.surfaceCommands = [
'bold', 'italic', 'link', 'undo', 'redo', 'indent', 'outdent'
];