Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7396219
ve.ce.SectionNode.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.ce.SectionNode.js
View Options
/*!
* VisualEditor ContentEditable SectionNode class.
*
* @copyright See AUTHORS.txt
*/
/**
* ContentEditable section node.
*
* @class
* @extends ve.ce.BranchNode
* @mixes ve.ce.ActiveNode
* @constructor
* @param {ve.dm.SectionNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve
.
ce
.
SectionNode
=
function
VeCeSectionNode
()
{
// Parent constructor
ve
.
ce
.
SectionNode
.
super
.
apply
(
this
,
arguments
);
// Events
this
.
model
.
connect
(
this
,
{
update
:
'onUpdate'
}
);
// Mixin constructors
ve
.
ce
.
ActiveNode
.
call
(
this
);
// DOM changes
this
.
$element
.
addClass
(
've-ce-sectionNode'
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ce
.
SectionNode
,
ve
.
ce
.
BranchNode
);
OO
.
mixinClass
(
ve
.
ce
.
SectionNode
,
ve
.
ce
.
ActiveNode
);
/* Static Properties */
ve
.
ce
.
SectionNode
.
static
.
name
=
'section'
;
/* Methods */
/**
* Get the HTML tag name.
*
* Tag name is selected based on the model's style attribute.
*
* @return {string} HTML tag name
*/
ve
.
ce
.
SectionNode
.
prototype
.
getTagName
=
function
()
{
const
style
=
this
.
model
.
getAttribute
(
'style'
);
if
(
this
.
model
.
constructor
.
static
.
matchTagNames
.
indexOf
(
style
)
===
-
1
)
{
throw
new
Error
(
'Invalid style'
);
}
return
style
;
};
/**
* Handle model update events.
*
* If the style changed since last update the DOM wrapper will be replaced with an appropriate one.
*/
ve
.
ce
.
SectionNode
.
prototype
.
onUpdate
=
function
()
{
this
.
updateTagName
();
};
/* Registration */
ve
.
ce
.
nodeFactory
.
register
(
ve
.
ce
.
SectionNode
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 14:04 (1 d, 3 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
3b/b8/8c96ec9c220338d4047e6fb15031
Default Alt Text
ve.ce.SectionNode.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment