From c77a9e5f0822f68d40fb10ec0f403a6748b075fa Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 27 Aug 2016 15:36:59 -0700 Subject: [PATCH] mediawiki.util: Remove deprecated tooltipAccessKeyPrefix/tooltipAccessKeyRegexp * Deprecated since MediaWiki 1.24. * No longer used anywhere in Wikimedia Git. * No longer used anywhere in MediaWiki-namespace on Wikimedia wikis. Fixes performance issue uncovered in T144070. Would otherwise have been addressed through a getter of sorts. Change-Id: Ib323b7a63c5a2e8d36c5f105d0554a7216339b07 --- RELEASE-NOTES-1.28 | 2 ++ resources/src/mediawiki/mediawiki.util.js | 26 ------------------- .../mediawiki/mediawiki.util.test.js | 14 ---------- 3 files changed, 2 insertions(+), 40 deletions(-) diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index 600ac7012f..fa7d9ca0b7 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -128,6 +128,8 @@ changes to languages because of Phabricator reports. login and visiting the login page while already logged in. * ResourceLoader::makeLoaderURL() was removed (deprecated since 1.24). * $.fn.liveAndTestAtStart was removed (deprecated since 1.24). +* mw.util.tooltipAccessKeyPrefix was removed (deprecated since 1.24). +* mw.util.tooltipAccessKeyRegexp was removed (deprecated since 1.24). * Linker::link() and Linker::linkKnown() were deprecated; please instead use MediaWiki\Linker\LinkRenderer. In addition, the LinkBegin and LinkEnd hooks were replaced by HtmlPageLinkRendererBegin and HtmlPageLinkRendererEnd diff --git a/resources/src/mediawiki/mediawiki.util.js b/resources/src/mediawiki/mediawiki.util.js index 2ce54e47ca..294b5de179 100644 --- a/resources/src/mediawiki/mediawiki.util.js +++ b/resources/src/mediawiki/mediawiki.util.js @@ -511,32 +511,6 @@ */ mw.log.deprecate( util, 'wikiGetlink', util.getUrl, 'Use mw.util.getUrl instead.' ); - /** - * Access key prefix. Might be wrong for browsers implementing the accessKeyLabel property. - * @property {string} tooltipAccessKeyPrefix - * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead. - */ - mw.log.deprecate( util, 'tooltipAccessKeyPrefix', $.fn.updateTooltipAccessKeys.getAccessKeyPrefix(), 'Use jquery.accessKeyLabel instead.' ); - - /** - * Regex to match accesskey tooltips. - * - * Should match: - * - * - "[ctrl-option-x]" - * - "[alt-shift-x]" - * - "[ctrl-alt-x]" - * - "[ctrl-x]" - * - * The accesskey is matched in group $6. - * - * Will probably not work for browsers implementing the accessKeyLabel property. - * - * @property {RegExp} tooltipAccessKeyRegexp - * @deprecated since 1.24 Use the module jquery.accessKeyLabel instead. - */ - mw.log.deprecate( util, 'tooltipAccessKeyRegexp', /\[(ctrl-)?(option-)?(alt-)?(shift-)?(esc-)?(.)\]$/, 'Use jquery.accessKeyLabel instead.' ); - /** * Add the appropriate prefix to the accesskey shown in the tooltip. * diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js index d697507af6..4eac362038 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js @@ -237,20 +237,6 @@ assert.strictEqual( mw.util.getParamValue( 'TEST', url ), 'a b+c d', 'Bug 30441: getParamValue must understand "+" encoding of space (multiple spaces)' ); } ); - QUnit.test( 'tooltipAccessKey', 4, function ( assert ) { - this.suppressWarnings(); - - assert.equal( typeof mw.util.tooltipAccessKeyPrefix, 'string', 'tooltipAccessKeyPrefix must be a string' ); - assert.equal( $.type( mw.util.tooltipAccessKeyRegexp ), 'regexp', 'tooltipAccessKeyRegexp is a regexp' ); - assert.ok( mw.util.updateTooltipAccessKeys, 'updateTooltipAccessKeys is non-empty' ); - - 'Example [a]'.replace( mw.util.tooltipAccessKeyRegexp, function ( sub, m1, m2, m3, m4, m5, m6 ) { - assert.equal( m6, 'a', 'tooltipAccessKeyRegexp finds the accesskey hint' ); - } ); - - this.restoreWarnings(); - } ); - QUnit.test( '$content', 2, function ( assert ) { assert.ok( mw.util.$content instanceof jQuery, 'mw.util.$content instance of jQuery' ); assert.strictEqual( mw.util.$content.length, 1, 'mw.util.$content must have length of 1' ); -- 2.20.1