Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F7410875
ve.ui.MWLinkCommand.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.ui.MWLinkCommand.js
View Options
/*!
* @copyright See AUTHORS.txt
*/
/**
* Command to open the link inspector, unless the currently selected link's target is uneditable.
*
* @class
* @extends ve.ui.Command
*
* @constructor
*/
ve
.
ui
.
MWLinkCommand
=
function
VeUiMwLinkCommand
()
{
// Parent constructor
ve
.
ui
.
MWLinkCommand
.
super
.
apply
(
this
,
arguments
);
};
/* Inheritance */
OO
.
inheritClass
(
ve
.
ui
.
MWLinkCommand
,
ve
.
ui
.
Command
);
/* Methods */
/**
* @inheritdoc
*/
ve
.
ui
.
MWLinkCommand
.
prototype
.
isExecutable
=
function
(
fragment
)
{
if
(
!
ve
.
ui
.
MWLinkCommand
.
super
.
prototype
.
isExecutable
.
apply
(
this
,
arguments
)
)
{
return
false
;
}
const
anns
=
fragment
.
getAnnotations
(
true
);
for
(
const
ann
of
anns
.
getAnnotationsByName
(
'link/mwInternal'
).
get
()
)
{
if
(
ann
.
getAttribute
(
'hasGeneratedHref'
)
)
{
return
false
;
}
}
return
true
;
};
/* Registration */
// Override VE core link commands
ve
.
ui
.
commandRegistry
.
register
(
new
ve
.
ui
.
MWLinkCommand
(
'link'
,
'window'
,
'open'
,
{
args
:
[
'link'
],
supportedSelections
:
[
'linear'
]
}
)
);
ve
.
ui
.
commandRegistry
.
register
(
new
ve
.
ui
.
MWLinkCommand
(
'linkNoExpand'
,
'window'
,
'open'
,
{
args
:
[
'link'
,
{
noExpand
:
true
}
],
supportedSelections
:
[
'linear'
]
}
)
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 21, 23:15 (1 d, 20 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
84/aa/396b6f46cb5614c8662680e27264
Default Alt Text
ve.ui.MWLinkCommand.js (1 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment