summaryrefslogtreecommitdiff
path: root/skins/common/mwsuggest.js
diff options
context:
space:
mode:
Diffstat (limited to 'skins/common/mwsuggest.js')
-rw-r--r--skins/common/mwsuggest.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js
index 6dbce050..dac59546 100644
--- a/skins/common/mwsuggest.js
+++ b/skins/common/mwsuggest.js
@@ -30,8 +30,8 @@ window.os_mouse_moved = false;
// delay between keypress and suggestion (in ms)
window.os_search_timeout = 250;
// these pairs of inputs/forms will be autoloaded at startup
-window.os_autoload_inputs = new Array('searchInput', 'searchInput2', 'powerSearchText', 'searchText');
-window.os_autoload_forms = new Array('searchform', 'searchform2', 'powersearch', 'search' );
+window.os_autoload_inputs = ['searchInput', 'searchInput2', 'powerSearchText', 'searchText'];
+window.os_autoload_forms = ['searchform', 'searchform2', 'powersearch', 'search'];
// if we stopped the service
window.os_is_stopped = false;
// max lines to show in suggest table
@@ -423,7 +423,7 @@ window.os_setupDatalist = function( r, results ) {
}
s.setAttribute( 'list', r.container );
- r.results = new Array();
+ r.results = [];
r.resultCount = results.length;
r.visible = true;
for ( i = 0; i < results.length; i++ ) {
@@ -436,7 +436,7 @@ window.os_setupDatalist = function( r, results ) {
};
/** Fetch namespaces from checkboxes or hidden fields in the search form,
- if none defined use wgSearchNamespaces global */
+ if none defined use wgSearchNamespaces */
window.os_getNamespaces = function( r ) {
var namespaces = '';
var elements = document.forms[r.searchform].elements;
@@ -455,7 +455,7 @@ window.os_getNamespaces = function( r ) {
}
}
if( namespaces == '' ) {
- namespaces = wgSearchNamespaces.join('|');
+ namespaces = mw.config.get( 'wgSearchNamespaces' ).join('|');
}
return namespaces;
};
@@ -478,7 +478,7 @@ window.os_delayedFetch = function() {
var query = os_timer.query;
os_timer = null;
var path = mw.config.get( 'wgMWSuggestTemplate' ).replace( "{namespaces}", os_getNamespaces( r ) )
- .replace( "{dbname}", wgDBname )
+ .replace( "{dbname}", mw.config.get( 'wgDBname' ) )
.replace( "{searchTerms}", os_encodeQuery( query ) );
// try to get from cache, if not fetch using ajax
@@ -643,7 +643,7 @@ window.os_createResultTable = function( r, results ) {
var c = document.getElementById( r.container );
var width = c.offsetWidth - os_operaWidthFix( c.offsetWidth );
var html = '<table class="os-suggest-results" id="' + r.resultTable + '" style="width: ' + width + 'px;">';
- r.results = new Array();
+ r.results = [];
r.resultCount = results.length;
for( i = 0; i < results.length; i++ ) {
var title = os_decodeValue( results[i] );