From b365425f767bd202863a60f7ce65854295809bda Mon Sep 17 00:00:00 2001 From: Fomafix Date: Fri, 26 Jun 2015 08:59:53 +0000 Subject: [PATCH] Replace deprecated 'jquery.mwExtension' by 'mediawiki.RegExp' Replace $.escapeRE from 'jquery.mwExtension' by mw.RegExp.escape from 'mediawiki.RegExp'. This change requires MediaWiki 1.26+ Bug: T103993 Change-Id: I5fc19e1313fc6a06726981e0365cea6d00abb5f3 --- extension.json | 2 +- modules/jquery.wikiEditor.dialogs.config.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extension.json b/extension.json index 6f6a2da4..0d0ccfe0 100644 --- a/extension.json +++ b/extension.json @@ -80,12 +80,12 @@ "scripts": "jquery.wikiEditor.dialogs.config.js", "styles": "jquery.wikiEditor.dialogs.config.less", "dependencies": [ - "jquery.mwExtension", "jquery.wikiEditor", "jquery.wikiEditor.dialogs", "jquery.wikiEditor.toolbar.i18n", "jquery.suggestions", "mediawiki.api", + "mediawiki.RegExp", "mediawiki.Title", "mediawiki.jqueryMsg" ], diff --git a/modules/jquery.wikiEditor.dialogs.config.js b/modules/jquery.wikiEditor.dialogs.config.js index 31b54805..3c806375 100644 --- a/modules/jquery.wikiEditor.dialogs.config.js +++ b/modules/jquery.wikiEditor.dialogs.config.js @@ -536,7 +536,7 @@ $.wikiEditor.modules.dialogs.config = { var serverName = mw.config.get( 'wgServer' ).replace( /^(https?:)?\/\//, '' ); // Cache the articlepath regex $( this ).data( 'articlePathRegex', new RegExp( - '^https?://' + $.escapeRE( serverName + mw.config.get( 'wgArticlePath' ) ) + '^https?://' + mw.RegExp.escape( serverName + mw.config.get( 'wgArticlePath' ) ) .replace( /\\\$1/g, '(.*)' ) + '$' ) ); // Pre-fill the text fields based on the current selection @@ -1168,7 +1168,7 @@ $.wikiEditor.modules.dialogs.config = { } var isRegex = $( '#wikieditor-toolbar-replace-regex' ).is( ':checked' ); if ( !isRegex ) { - searchStr = $.escapeRE( searchStr ); + searchStr = mw.RegExp.escape( searchStr ); } if ( mode === 'replaceAll' ) { flags += 'g';