Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F4058151
ExternalLinksEditCheck.js
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
ExternalLinksEditCheck.js
View Options
mw
.
editcheck
.
ExternalLinksEditCheck
=
function
MWExternalLinksEditCheck
(
/* config */
)
{
// Parent constructor
mw
.
editcheck
.
ExternalLinksEditCheck
.
super
.
apply
(
this
,
arguments
);
};
OO
.
inheritClass
(
mw
.
editcheck
.
ExternalLinksEditCheck
,
mw
.
editcheck
.
BaseEditCheck
);
mw
.
editcheck
.
ExternalLinksEditCheck
.
static
.
title
=
'External link'
;
mw
.
editcheck
.
ExternalLinksEditCheck
.
static
.
name
=
'externalLink'
;
mw
.
editcheck
.
ExternalLinksEditCheck
.
static
.
description
=
'Generally, external links should not appear in the body of the article. Please refer to WP:ELNO. Edit this link?'
;
mw
.
editcheck
.
ExternalLinksEditCheck
.
static
.
defaultConfig
=
ve
.
extendObject
(
{},
mw
.
editcheck
.
BaseEditCheck
.
static
.
defaultConfig
,
{
ignoreSections
:
[
'External links'
]
}
);
mw
.
editcheck
.
ExternalLinksEditCheck
.
static
.
choices
=
[
{
action
:
'edit'
,
label
:
'Edit link'
,
icon
:
'edit'
},
{
action
:
'dismiss'
,
label
:
ve
.
msg
(
'editcheck-dialog-action-no'
),
icon
:
'check'
}
];
mw
.
editcheck
.
ExternalLinksEditCheck
.
prototype
.
onDocumentChange
=
function
(
surfaceModel
)
{
const
modified
=
this
.
getModifiedContentRanges
(
surfaceModel
.
getDocument
()
);
return
surfaceModel
.
documentModel
.
documentNode
.
getAnnotationRanges
()
.
filter
(
(
annRange
)
=>
annRange
.
annotation
instanceof
ve
.
dm
.
MWExternalLinkAnnotation
&&
!
this
.
isDismissedRange
(
annRange
.
range
)
&&
this
.
isRangeInValidSection
(
annRange
.
range
,
surfaceModel
.
documentModel
)
&&
modified
.
some
(
(
modifiedRange
)
=>
modifiedRange
.
containsRange
(
annRange
.
range
)
)
).
map
(
(
annRange
)
=>
new
mw
.
editcheck
.
EditCheckAction
(
{
fragments
:
[
surfaceModel
.
getLinearFragment
(
annRange
.
range
)
],
check
:
this
}
)
);
};
mw
.
editcheck
.
ExternalLinksEditCheck
.
prototype
.
act
=
function
(
choice
,
action
,
surface
)
{
switch
(
choice
)
{
case
'dismiss'
:
this
.
dismiss
(
action
);
break
;
case
'edit'
:
setTimeout
(
()
=>
{
action
.
fragments
[
0
].
select
();
surface
.
execute
(
'window'
,
'open'
,
'link'
);
}
);
break
;
}
};
mw
.
editcheck
.
editCheckFactory
.
register
(
mw
.
editcheck
.
ExternalLinksEditCheck
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Aug 16 2026, 04:33 (12 w, 1 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
53/83/52b3e7b5a737090d8ecf48f88d80
Default Alt Text
ExternalLinksEditCheck.js (2 KB)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment