mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 08:34:54 +00:00
81c9b72db5
Major changes: demos/ve/index.php * Renamed ve-demo-content to ve-demo-editor ve.init.mw.ViewPageTarget, ve.init.sa.Target * Added handlers for dialog events ve.ui.*Dialog.js * Added skeleton classes for dialogs ve.init.Target.js * Create abstract class methods for Target. ve.init.sa.Target.js * Create Standalone target view methods. ve.init.mw.Target.js * Added MW specific target view methods. * Integration action buttons are now added to the edit view in the toolbar. ve.Surface.js * Simplified constructor, now requiring a target which contains the container * Other changes include some documentation and code cleanup. Bug: 39597 Change-Id: Iff39266bdd3052f34bda254ca407030dbbc81f26
43 lines
913 B
JavaScript
43 lines
913 B
JavaScript
/*!
|
|
* VisualEditor Standalone Initialization Target class.
|
|
*
|
|
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
/**
|
|
* Initialization Standalone target.
|
|
*
|
|
* @class
|
|
* @extends ve.init.Target
|
|
*
|
|
* @constructor
|
|
* @param {jQuery} $container Container to render target into
|
|
*/
|
|
ve.init.sa.Target = function VeInitSaTarget( $container ) {
|
|
// Parent constructor
|
|
ve.init.Target.call( this, $container );
|
|
|
|
// Events
|
|
this.addListenerMethods( this, { 'addDialog': 'onAddDialog' } );
|
|
};
|
|
|
|
/* Inheritance */
|
|
|
|
ve.inheritClass( ve.init.sa.Target, ve.init.Target );
|
|
|
|
/* Methods */
|
|
|
|
/**
|
|
* Handle add dialog events.
|
|
*
|
|
* @method
|
|
* @param {string} name Name of added dialog
|
|
*/
|
|
ve.init.sa.Target.prototype.onAddDialog = function ( name ) {
|
|
var dialog = this.dialogs[name];
|
|
|
|
// Append dialog to target container
|
|
this.$.append( dialog.$ );
|
|
};
|