mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Followup 7994eae8c2
: fix MWLinkInspector breakage
getAnnotationFromText was renamed to getAnnotationFromFragment, update MWLinkInspector for this. Bug: 60374 Bug: 60378 Change-Id: I202a2777f0202dcf42c5968daf8bdf5583b0a11b
This commit is contained in:
parent
0e7d5eb397
commit
3acd206a6a
|
@ -41,16 +41,17 @@ ve.ui.MWLinkInspector.static.linkTargetInputWidget = ve.ui.MWLinkTargetInputWidg
|
|||
/* Methods */
|
||||
|
||||
/**
|
||||
* Gets an annotation object from a target.
|
||||
* Gets an annotation object from a fragment.
|
||||
*
|
||||
* The type of link is automatically detected based on some crude heuristics.
|
||||
*
|
||||
* @method
|
||||
* @param {string} target Link target
|
||||
* @param {ve.dm.SurfaceFragment} fragment Current selection
|
||||
* @returns {ve.dm.MWInternalLinkAnnotation|ve.dm.MWExternalLinkAnnotation|null}
|
||||
*/
|
||||
ve.ui.MWLinkInspector.prototype.getAnnotationFromText = function ( target ) {
|
||||
var title = mw.Title.newFromText( target );
|
||||
ve.ui.MWLinkInspector.prototype.getAnnotationFromFragment = function ( fragment ) {
|
||||
var target = fragment.getText(),
|
||||
title = mw.Title.newFromText( target );
|
||||
|
||||
// Figure out if this is an internal or external link
|
||||
if ( ve.init.platform.getExternalLinkUrlProtocolsRegExp().test( target ) ) {
|
||||
|
|
Loading…
Reference in a new issue