Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7442756
ve.dm.ModelFactory.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
899 B
Referenced Files
None
Subscribers
None
ve.dm.ModelFactory.js
View Options
/*!
* VisualEditor DataModel ModelFactory class.
*
* @copyright See AUTHORS.txt
*/
/**
* DataModel meta item factory.
*
* @class
* @abstract
* @extends OO.Factory
* @constructor
*/
ve
.
dm
.
ModelFactory
=
function
VeDmModelFactory
()
{
// Parent constructor
ve
.
dm
.
ModelFactory
.
super
.
call
(
this
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
dm
.
ModelFactory
,
OO
.
Factory
);
/* Methods */
/**
* Create a new item from a model element
*
* @param {Object} element Model element
* @param {...any} [args] Arguments to pass to the constructor
* @return {ve.dm.Model} Model constructed from element
* @throws {Error} Element must have a .type property
*/
ve
.
dm
.
ModelFactory
.
prototype
.
createFromElement
=
function
(
element
,
...
args
)
{
if
(
element
&&
element
.
type
)
{
return
this
.
create
(
element
.
type
,
element
,
...
args
);
}
throw
new
Error
(
'Element must have a .type property'
);
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 22, 16:43 (1 d, 6 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
04/48/5eb9a77d5ab1563a978012be47dc
Default Alt Text
ve.dm.ModelFactory.js (899 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment