mediawiki-extensions-Visual.../modules/ve/init/ve.init.Target.js

64 lines
1.2 KiB
JavaScript
Raw Normal View History

/*!
* 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.$element = $container;
};
/* Inheritance */
OO.mixinClass( ve.init.Target, OO.EventEmitter );
Floating toolbar cleanup Objective: Move toolbar floating functionality to ve.init and clean it up As a bonus: demo.css * Fix CSS path to set width of inputs properly Changes: demos/ve/index.php * Allow ve.init.sa.Target to construct it's own surface object ve.ce.Surface.js * Move object resizing and table editing disabling commands from ve.Surface * Add method for getting the currently focused node ve.init.mw.ViewPageTarget.js * Remove initializing surface property (now done in parent class) * Normalize all uses of "setup" to "setUp" * Replace uses of getDocumentModel with getModel().getDocument() * Add calls to set up and tear down for toolbar floating ve.init.mw.Target.js * Replace uses of getDocumentModel with getModel().getDocument() ve.init.sa.Target.js * Move example from ve.Surface * Change constructor to accept document model * Create ve.Surface object in constructor * Add set up for toolbar floating ve.ui.init.Target.js * Initialize surface property * Move and cleanup toolbar floating functionality from ve.Surface ve.ui.Surface.js * Remove example now that init.sa creates it's own surface (moved) * Document options * Simplify toolbar options and remove the concept of multiple toolbars * No longer cache the options object * Move toolbar initialization to constructor * Change setupCommands to addCommands, making it useful after construction * Inline selection initialization * Move and cleanup toolbar floating functionality to ve.ce.Surface * Reorganize a few methods * Move toolbar floating to ve.init.Target.js Change-Id: I393a426e35567d57c048122bf64a83c1ef45e6e8
2013-05-10 00:17:51 +00:00
/* Static Properties */
Floating toolbar cleanup Objective: Move toolbar floating functionality to ve.init and clean it up As a bonus: demo.css * Fix CSS path to set width of inputs properly Changes: demos/ve/index.php * Allow ve.init.sa.Target to construct it's own surface object ve.ce.Surface.js * Move object resizing and table editing disabling commands from ve.Surface * Add method for getting the currently focused node ve.init.mw.ViewPageTarget.js * Remove initializing surface property (now done in parent class) * Normalize all uses of "setup" to "setUp" * Replace uses of getDocumentModel with getModel().getDocument() * Add calls to set up and tear down for toolbar floating ve.init.mw.Target.js * Replace uses of getDocumentModel with getModel().getDocument() ve.init.sa.Target.js * Move example from ve.Surface * Change constructor to accept document model * Create ve.Surface object in constructor * Add set up for toolbar floating ve.ui.init.Target.js * Initialize surface property * Move and cleanup toolbar floating functionality from ve.Surface ve.ui.Surface.js * Remove example now that init.sa creates it's own surface (moved) * Document options * Simplify toolbar options and remove the concept of multiple toolbars * No longer cache the options object * Move toolbar initialization to constructor * Change setupCommands to addCommands, making it useful after construction * Inline selection initialization * Move and cleanup toolbar floating functionality to ve.ce.Surface * Reorganize a few methods * Move toolbar floating to ve.init.Target.js Change-Id: I393a426e35567d57c048122bf64a83c1ef45e6e8
2013-05-10 00:17:51 +00:00
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': '*' }
];
Floating toolbar cleanup Objective: Move toolbar floating functionality to ve.init and clean it up As a bonus: demo.css * Fix CSS path to set width of inputs properly Changes: demos/ve/index.php * Allow ve.init.sa.Target to construct it's own surface object ve.ce.Surface.js * Move object resizing and table editing disabling commands from ve.Surface * Add method for getting the currently focused node ve.init.mw.ViewPageTarget.js * Remove initializing surface property (now done in parent class) * Normalize all uses of "setup" to "setUp" * Replace uses of getDocumentModel with getModel().getDocument() * Add calls to set up and tear down for toolbar floating ve.init.mw.Target.js * Replace uses of getDocumentModel with getModel().getDocument() ve.init.sa.Target.js * Move example from ve.Surface * Change constructor to accept document model * Create ve.Surface object in constructor * Add set up for toolbar floating ve.ui.init.Target.js * Initialize surface property * Move and cleanup toolbar floating functionality from ve.Surface ve.ui.Surface.js * Remove example now that init.sa creates it's own surface (moved) * Document options * Simplify toolbar options and remove the concept of multiple toolbars * No longer cache the options object * Move toolbar initialization to constructor * Change setupCommands to addCommands, making it useful after construction * Inline selection initialization * Move and cleanup toolbar floating functionality to ve.ce.Surface * Reorganize a few methods * Move toolbar floating to ve.init.Target.js Change-Id: I393a426e35567d57c048122bf64a83c1ef45e6e8
2013-05-10 00:17:51 +00:00
ve.init.Target.static.surfaceCommands = [
'undo',
'redo',
'bold',
'italic',
'link',
'clear',
'indent',
'outdent',
'paragraph',
'heading1',
'heading2',
'heading3',
'heading4',
'heading5',
'heading6',
'preformatted'
];