Index: trunk/phase3/skins/common/mwsuggest.js |
— | — | @@ -7,6 +7,12 @@ |
8 | 8 | * by Robert Stojnic (April 2008) |
9 | 9 | */ |
10 | 10 | |
| 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 | + |
11 | 17 | // search_box_id -> Results object |
12 | 18 | window.os_map = {}; |
13 | 19 | // cached data, url -> json_text |
— | — | @@ -416,7 +422,7 @@ |
417 | 423 | var r = os_timer.r; |
418 | 424 | var query = os_timer.query; |
419 | 425 | os_timer = null; |
420 | | - var path = wgMWSuggestTemplate.replace( "{namespaces}", os_getNamespaces( r ) ) |
| 426 | + var path = mw.config.get( 'wgMWSuggestTemplate' ).replace( "{namespaces}", os_getNamespaces( r ) ) |
421 | 427 | .replace( "{dbname}", wgDBname ) |
422 | 428 | .replace( "{searchTerms}", os_encodeQuery( query ) ); |
423 | 429 | |