Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7417720
ve.init.sa.Target.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.init.sa.Target.js
View Options
/*!
* VisualEditor Standalone Initialization Target class.
*
* @copyright See AUTHORS.txt
*/
/**
* Initialization Standalone target.
*
* A platform must be constructed first. See ve.init.sa.Platform for an example.
*
* @example
* ve.init.platform.initialize().done( () => {
* var target = new ve.init.sa.DesktopTarget();
* target.addSurface(
* ve.dm.converter.getModelFromDom(
* ve.createDocumentFromHtml( '<p>Hello, World!</p>' )
* )
* );
* $( document.body ).append( target.$element );
* } );
*
* @abstract
* @class
* @extends ve.init.Target
*
* @constructor
* @param {Object} [config] Configuration options
* @param {Object} [config.toolbarConfig] Configuration options for the toolbar
*/
ve
.
init
.
sa
.
Target
=
function
VeInitSaTarget
(
config
)
{
config
=
config
||
{};
config
.
toolbarConfig
=
ve
.
extendObject
(
{
shadow
:
true
,
floatable
:
true
},
config
.
toolbarConfig
);
// Parent constructor
ve
.
init
.
sa
.
Target
.
super
.
call
(
this
,
config
);
this
.
$element
.
addClass
(
've-init-sa-target'
)
.
attr
(
'lang'
,
ve
.
init
.
platform
.
getUserLanguages
()[
0
]
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
init
.
sa
.
Target
,
ve
.
init
.
Target
);
/* Methods */
/**
* @inheritdoc
* @fires ve.init.Target#surfaceReady
*/
ve
.
init
.
sa
.
Target
.
prototype
.
addSurface
=
function
()
{
// Parent method
const
surface
=
ve
.
init
.
sa
.
Target
.
super
.
prototype
.
addSurface
.
apply
(
this
,
arguments
);
this
.
$element
.
append
(
$
(
'<div>'
).
addClass
(
've-init-sa-target-surfaceWrapper'
).
append
(
surface
.
$element
)
);
if
(
!
this
.
getSurface
()
)
{
this
.
setSurface
(
surface
);
}
surface
.
initialize
();
this
.
emit
(
'surfaceReady'
);
return
surface
;
};
/**
* @inheritdoc
*/
ve
.
init
.
sa
.
Target
.
prototype
.
setupToolbar
=
function
(
surface
)
{
// Parent method
ve
.
init
.
sa
.
Target
.
super
.
prototype
.
setupToolbar
.
call
(
this
,
surface
);
this
.
getToolbar
().
$element
.
addClass
(
've-init-sa-target-toolbar'
);
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 03:29 (1 d, 9 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
41/b2/85b5a3e6fda2f8fae3f37223a4c5
Default Alt Text
ve.init.sa.Target.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment