From 3acd206a6a6a3926017c113fe6145ced72448c4b Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Mon, 27 Jan 2014 13:11:06 -0800 Subject: [PATCH] Followup 7994eae8c2: fix MWLinkInspector breakage getAnnotationFromText was renamed to getAnnotationFromFragment, update MWLinkInspector for this. Bug: 60374 Bug: 60378 Change-Id: I202a2777f0202dcf42c5968daf8bdf5583b0a11b --- modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js index 8adc45b076..525ddd44c5 100644 --- a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js +++ b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkInspector.js @@ -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 ) ) {