r82025 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82024‎ | r82025 | r82026 >
Date:20:08, 12 February 2011
Author:krinkle
Status:ok
Tags:
Comment:
Since mwsuggest.js is no longer used in core, wgMWSuggestTemplate is not defined either.
This variable was previously defined by default.

Gadgets using this broke with 1.17 since they assumed wgMWSuggestTemplate was defined just like mwsuggest.js did.
I've added the definition for it inside the file itself.
Modified paths:
  • /trunk/phase3/skins/common/mwsuggest.js (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/common/mwsuggest.js
@@ -7,6 +7,12 @@
88 * by Robert Stojnic (April 2008)
99 */
1010
 11+// Make sure wgMWSuggestTemplate is defined
 12+if ( !mw.config.exists( 'wgMWSuggestTemplate' ) ) {
 13+ mw.config.set( 'wgMWSuggestTemplate', mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' )
 14+ + "/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest" );
 15+}
 16+
1117 // search_box_id -> Results object
1218 window.os_map = {};
1319 // cached data, url -> json_text
@@ -416,7 +422,7 @@
417423 var r = os_timer.r;
418424 var query = os_timer.query;
419425 os_timer = null;
420 - var path = wgMWSuggestTemplate.replace( "{namespaces}", os_getNamespaces( r ) )
 426+ var path = mw.config.get( 'wgMWSuggestTemplate' ).replace( "{namespaces}", os_getNamespaces( r ) )
421427 .replace( "{dbname}", wgDBname )
422428 .replace( "{searchTerms}", os_encodeQuery( query ) );
423429

Follow-up revisions

RevisionCommit summaryAuthorDate
r821511.17wmf1: MFT r78964, r79086, r79087, r79091, r82004, r82025, r82048, r82070,...catrope22:55, 14 February 2011
r85151MFT: r82000, r82004, r82020, r82025, r82038, r82039, r82048, r82070, r82081, ...demon20:39, 1 April 2011

Status & tagging log