Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7396297
ve.ce.CommentNode.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.CommentNode.js
View Options
/*!
* VisualEditor ContentEditable CommentNode class.
*
* @copyright See AUTHORS.txt
*/
/**
* ContentEditable comment node.
*
* @class
* @extends ve.ce.LeafNode
* @mixes ve.ce.FocusableNode
*
* @constructor
* @param {ve.dm.CommentNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve
.
ce
.
CommentNode
=
function
VeCeCommentNode
(
model
,
config
)
{
// Parent constructor
ve
.
ce
.
CommentNode
.
super
.
call
(
this
,
model
,
config
);
// Mixin constructors
ve
.
ce
.
FocusableNode
.
call
(
this
,
this
.
$element
,
config
);
// Events
this
.
model
.
connect
(
this
,
{
attributeChange
:
'onAttributeChange'
}
);
// DOM changes
this
.
$element
.
addClass
(
've-ce-commentNode'
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ce
.
CommentNode
,
ve
.
ce
.
LeafNode
);
OO
.
mixinClass
(
ve
.
ce
.
CommentNode
,
ve
.
ce
.
FocusableNode
);
/* Static Properties */
ve
.
ce
.
CommentNode
.
static
.
name
=
'comment'
;
ve
.
ce
.
CommentNode
.
static
.
primaryCommandName
=
'comment'
;
ve
.
ce
.
CommentNode
.
static
.
iconWhenInvisible
=
'speechBubbleNotice'
;
/* Static Methods */
/**
* @inheritdoc
*/
ve
.
ce
.
CommentNode
.
static
.
getDescription
=
function
(
model
)
{
return
model
.
getAttribute
(
'text'
);
};
/**
* Update the rendering of the 'text' attribute
* when it changes in the model.
*
* @param {string} key Attribute key
* @param {string} from Old value
* @param {string} to New value
*/
ve
.
ce
.
CommentNode
.
prototype
.
onAttributeChange
=
function
(
key
)
{
if
(
key
===
'text'
)
{
this
.
updateInvisibleIconLabel
();
}
};
/* Method */
// eslint-disable-next-line jsdoc/require-returns
/**
* @see ve.ce.FocusableNode
*/
ve
.
ce
.
CommentNode
.
prototype
.
hasRendering
=
function
()
{
// Comment nodes never have a rendering, don't bother with expensive DOM inspection
return
false
;
};
/* Registration */
ve
.
ce
.
nodeFactory
.
register
(
ve
.
ce
.
CommentNode
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 14:06 (1 w, 8 h ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
33/9a/e5eade477cb019414e96eaeb2e16
Default Alt Text
ve.ce.CommentNode.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment