mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
d6067d5718
New changes: 776e801 Delimit text nodes in debug observations 72643bc Remove debug bar hiding now it is handled by the surface cf1e167 [BREAKING CHANGE] Multiple surface support and demo Local changes: Account for detachable toolbars in core being setup in a different order. Change-Id: I29156948711d55ba5f6dd4f6c35ca0e4cca32373
23 lines
735 B
JavaScript
23 lines
735 B
JavaScript
/*!
|
|
* VisualEditor MediaWiki test utilities.
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
ve.test.utils.createSurfaceFromDocument = function ( doc ) {
|
|
// Prevent the target from setting up the surface immediately
|
|
ve.init.platform.initialized = $.Deferred();
|
|
// HACK: MW targets are async and heavy, use an SA target but
|
|
// override the global registration
|
|
var target = new ve.init.sa.Target( $( '#qunit-fixture' ) ),
|
|
mwTarget = new ve.init.mw.Target( $( '<div>' ).appendTo( $( '#qunit-fixture' ) ) );
|
|
|
|
target.addSurface( doc );
|
|
|
|
ve.init.platform.initialized.resolve();
|
|
mwTarget = null;
|
|
target.addSurface( doc );
|
|
return target.surface;
|
|
};
|