2013-02-20 19:44:44 +00:00
|
|
|
/*!
|
|
|
|
* 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
|
2013-05-01 22:21:32 +00:00
|
|
|
* @mixins ve.EventEmitter
|
2013-02-20 19:44:44 +00:00
|
|
|
*
|
|
|
|
* @constructor
|
|
|
|
* @param {jQuery} $container Conainter to render target into
|
|
|
|
*/
|
|
|
|
ve.init.Target = function VeInitTarget( $container ) {
|
2013-05-01 22:21:32 +00:00
|
|
|
// Mixin constructors
|
2013-02-20 19:44:44 +00:00
|
|
|
ve.EventEmitter.call( this );
|
|
|
|
|
|
|
|
// Properties
|
|
|
|
this.$ = $container;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Inheritance */
|
|
|
|
|
2013-05-01 22:21:32 +00:00
|
|
|
ve.mixinClass( ve.init.Target, ve.EventEmitter );
|
2013-05-10 00:17:51 +00:00
|
|
|
|
2013-05-14 23:45:42 +00:00
|
|
|
/* Static Properties */
|
2013-05-10 00:17:51 +00:00
|
|
|
|
2013-08-09 18:29:09 +00:00
|
|
|
ve.init.Target.static.toolbarGroups = [
|
|
|
|
{
|
|
|
|
'include': [ 'history' ],
|
|
|
|
'promote': [
|
|
|
|
'history/undo',
|
|
|
|
'history/redo'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'include': [ 'format' ],
|
|
|
|
'promote': [ 'format/convert' ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'include': [ 'textStyle', 'meta', 'utility/clear' ],
|
|
|
|
'promote': [
|
|
|
|
'textStyle/bold',
|
|
|
|
'textStyle/italic',
|
|
|
|
'meta/link'
|
|
|
|
],
|
|
|
|
'demote': [ 'utility/clear' ]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'include': [ 'structure' ],
|
|
|
|
'promote': [
|
|
|
|
'structure/number',
|
|
|
|
'structure/bullet',
|
|
|
|
'structure/outdent',
|
|
|
|
'structure/indent'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{ 'include': [ 'object' ] }
|
2013-05-14 23:45:42 +00:00
|
|
|
];
|
2013-05-10 00:17:51 +00:00
|
|
|
|
2013-05-14 23:45:42 +00:00
|
|
|
ve.init.Target.static.surfaceCommands = [
|
2013-08-09 18:29:09 +00:00
|
|
|
'history/undo',
|
|
|
|
'history/redo',
|
|
|
|
'textStyle/bold',
|
|
|
|
'textStyle/italic',
|
|
|
|
'meta/link',
|
|
|
|
'utility/clear',
|
|
|
|
'structure/indent',
|
|
|
|
'structure/outdent'
|
2013-05-14 23:45:42 +00:00
|
|
|
];
|