From 55f78fcbf624dfd56de1a8edade8c4df7e9318b2 Mon Sep 17 00:00:00 2001 From: "James D. Forrester" Date: Wed, 19 Aug 2015 15:58:10 -0700 Subject: [PATCH] MWLinkNodeInspector: Remove 'Open' button You can now do this from the context menu. No need to have extra buttons, and this makes it consistent with the MWInternal/MWExternal link inspector. Bug: T109646 Change-Id: Ifd4b3645c66ba2f32ccee7e2848967cf5e7ec82e --- .../inspectors/ve.ui.MWLinkNodeInspector.js | 29 ------------------- 1 file changed, 29 deletions(-) diff --git a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js index 6dc2cb91e8..9ab8ffb063 100644 --- a/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js +++ b/modules/ve-mw/ui/inspectors/ve.ui.MWLinkNodeInspector.js @@ -34,11 +34,6 @@ ve.ui.MWLinkNodeInspector.static.title = OO.ui.deferMsg( 'visualeditor-linknodei ve.ui.MWLinkNodeInspector.static.modelClasses = [ ve.dm.MWNumberedExternalLinkNode ]; ve.ui.MWLinkNodeInspector.static.actions = ve.ui.MWLinkNodeInspector.super.static.actions.concat( [ - { - action: 'open', - label: OO.ui.deferMsg( 'visualeditor-linkinspector-open' ), - modes: [ 'edit', 'insert' ] - }, { action: 'convert', label: OO.ui.deferMsg( 'visualeditor-linknodeinspector-add-label' ), @@ -60,34 +55,10 @@ ve.ui.MWLinkNodeInspector.prototype.initialize = function () { validate: ve.init.platform.getExternalLinkUrlProtocolsRegExp() } ); - // Events - this.targetInput.connect( this, { change: 'onTargetInputChange' } ); - // Initialization this.form.$element.append( this.targetInput.$element ); }; -/** - * Handle target input change events. - * - * Updates the open button's hyperlink location. - * - * @param {string} value New target input value - */ -ve.ui.MWLinkNodeInspector.prototype.onTargetInputChange = function () { - var href = this.targetInput.getValue(), - inspector = this; - this.targetInput.isValid().done( function ( valid ) { - inspector.actions.forEach( { actions: 'open' }, function ( action ) { - action.setHref( href ).setTarget( '_blank' ).setDisabled( !valid ); - // HACK: Chrome renders a dark outline around the action when it's a link, but causing it to - // re-render makes it magically go away; this is incredibly evil and needs further - // investigation - action.$element.hide().fadeIn( 0 ); - } ); - } ); -}; - /** * @inheritdoc */