mediawiki-extensions-Visual.../modules/ve/init/ve.init.Target.js
Trevor Parscal 6018e77d70 Use OO.EventEmitter instead of ve.EventEmitter
Change-Id: Ie35e5f51a8d3c0d7f4fa46230b7b37112df610b9
2013-10-22 16:57:33 +00:00

64 lines
1.2 KiB
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 OO.EventEmitter
*
* @constructor
* @param {jQuery} $container Conainter to render target into
*/
ve.init.Target = function VeInitTarget( $container ) {
// Mixin constructors
OO.EventEmitter.call( this );
// Properties
this.$ = $container;
};
/* Inheritance */
OO.mixinClass( ve.init.Target, OO.EventEmitter );
/* Static Properties */
ve.init.Target.static.toolbarGroups = [
{ 'include': [ 'undo', 'redo' ] },
{
'type': 'menu',
'include': [ { 'group': 'format' } ],
'promote': [ 'paragraph' ],
'demote': [ 'preformatted', 'heading1' ]
},
{ 'include': [ 'bold', 'italic', 'link', 'clear' ] },
{ 'include': [ 'number', 'bullet', 'outdent', 'indent' ] },
{ 'include': '*' }
];
ve.init.Target.static.surfaceCommands = [
'undo',
'redo',
'bold',
'italic',
'link',
'clear',
'indent',
'outdent',
'paragraph',
'heading1',
'heading2',
'heading3',
'heading4',
'heading5',
'heading6',
'preformatted'
];