Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F6079651
ve.dm.MWAnnotationNode.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.dm.MWAnnotationNode.js
View Options
/*!
* VisualEditor DataModel MWAnnotationNode class.
*
* @copyright See AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* DataModel MW node for mw:Annotation tags.
*
* @class
* @extends ve.dm.AlienInlineNode
* @constructor
* @param {Object} element Reference to element in linear model
*/
ve
.
dm
.
MWAnnotationNode
=
function
VeDmMWAnnotationNode
()
{
// Parent constructor
ve
.
dm
.
MWAnnotationNode
.
super
.
apply
(
this
,
arguments
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
dm
.
MWAnnotationNode
,
ve
.
dm
.
AlienInlineNode
);
/* Static Properties */
ve
.
dm
.
MWAnnotationNode
.
static
.
name
=
'mwAnnotation'
;
ve
.
dm
.
MWAnnotationNode
.
static
.
preserveHtmlAttributes
=
true
;
/* Static Methods */
/**
* @inheritdoc
*/
ve
.
dm
.
MWAnnotationNode
.
static
.
toDataElement
=
function
(
domElements
)
{
const
mwDataJSON
=
domElements
[
0
].
getAttribute
(
'data-mw'
),
type
=
domElements
[
0
].
getAttribute
(
'typeof'
);
const
dataElement
=
{
type
:
'mwAnnotation'
,
attributes
:
{
type
:
type
}
};
if
(
mwDataJSON
!==
null
)
{
dataElement
.
attributes
.
mw
=
JSON
.
parse
(
mwDataJSON
);
}
return
dataElement
;
};
ve
.
dm
.
MWAnnotationNode
.
static
.
toDomElements
=
function
(
dataElement
,
doc
)
{
const
el
=
doc
.
createElement
(
'meta'
);
el
.
setAttribute
(
'typeof'
,
dataElement
.
attributes
.
type
);
if
(
dataElement
.
attributes
.
mw
)
{
el
.
setAttribute
(
'data-mw'
,
JSON
.
stringify
(
dataElement
.
attributes
.
mw
)
);
}
return
[
el
];
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 5 2026, 10:40 (6 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
85/c4/652ebbff6bfdf24efdb621f6ce02
Default Alt Text
ve.dm.MWAnnotationNode.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment