Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7415629
ve.ce.MWMagicLinkNode.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
ve.ce.MWMagicLinkNode.js
View Options
/*!
* VisualEditor ContentEditable MWMagicLinkNode class.
*
* @copyright See AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
/**
* ContentEditable MediaWiki magic link node.
*
* @class
* @extends ve.ce.LeafNode
* @mixes ve.ce.FocusableNode
* @constructor
* @param {ve.dm.MWMagicLinkNode} model Model to observe
* @param {Object} [config] Configuration options
*/
ve
.
ce
.
MWMagicLinkNode
=
function
VeCeMWMagicLinkNode
()
{
// Parent constructor
ve
.
ce
.
MWMagicLinkNode
.
super
.
apply
(
this
,
arguments
);
// Mixin constructors
ve
.
ce
.
FocusableNode
.
call
(
this
);
// DOM changes
this
.
$element
.
addClass
(
've-ce-mwMagicLinkNode'
);
// Add link
this
.
$link
=
$
(
'<a>'
).
appendTo
(
this
.
$element
);
// Events
this
.
model
.
connect
(
this
,
{
update
:
'onUpdate'
}
);
// Initialization
this
.
onUpdate
();
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ce
.
MWMagicLinkNode
,
ve
.
ce
.
LeafNode
);
OO
.
mixinClass
(
ve
.
ce
.
MWMagicLinkNode
,
ve
.
ce
.
FocusableNode
);
/* Static Properties */
ve
.
ce
.
MWMagicLinkNode
.
static
.
name
=
'link/mwMagic'
;
ve
.
ce
.
MWMagicLinkNode
.
static
.
tagName
=
'span'
;
ve
.
ce
.
MWMagicLinkNode
.
static
.
primaryCommandName
=
'link'
;
/* Static Methods */
/**
* @inheritdoc
*/
ve
.
ce
.
MWMagicLinkNode
.
static
.
getDescription
=
function
(
model
)
{
return
model
.
getAttribute
(
'content'
);
};
/* Methods */
/**
* Handle model update events.
*/
ve
.
ce
.
MWMagicLinkNode
.
prototype
.
onUpdate
=
function
()
{
this
.
$link
.
attr
(
'rel'
,
this
.
model
.
getRel
()
)
.
text
(
this
.
model
.
getAttribute
(
'content'
)
);
// T322704
ve
.
setAttributeSafe
(
this
.
$link
[
0
],
'href'
,
this
.
model
.
getHref
(),
'#'
);
};
/* Registration */
ve
.
ce
.
nodeFactory
.
register
(
ve
.
ce
.
MWMagicLinkNode
);
File Metadata
Details
Attached
Mime Type
text/x-asm
Expires
Sun, Nov 22, 02:17 (1 d, 11 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
43/96/f4bf180dc3e455e1709ef343d356
Default Alt Text
ve.ce.MWMagicLinkNode.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment