// delay between keypress and suggestion (in ms)
var os_search_timeout = 250;
// these pairs of inputs/forms will be autoloaded at startup
-var os_autoload_inputs = ['searchInput', 'searchInput2', 'powerSearchText', 'searchText'];
-var os_autoload_forms = ['searchform', 'searchform2', 'powersearch', 'search'];
+var os_autoload_inputs = new Array('searchInput', 'searchInput2', 'powerSearchText', 'searchText');
+var os_autoload_forms = new Array('searchform', 'searchform2', 'powersearch', 'search' );
// if we stopped the service
var os_is_stopped = false;
// max lines to show in suggest table
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 = [];
+ r.results = new Array();
r.resultCount = results.length;
for(i=0;i<results.length;i++){
var title = os_decodeValue(results[i]);
*/
'getLevelSelectors': function() {
var all = document.getElementsByTagName("select");
- var ours = [];
+ var ours = new Array();
for (var i = 0; i < all.length; i++) {
var element = all[i];
if (element.id.match(/^mwProtect-level-/)) {
*/
'getExpiryInputs': function() {
var all = document.getElementsByTagName("input");
- var ours = [];
+ var ours = new Array();
for (var i = 0; i < all.length; i++) {
var element = all[i];
if (element.name.match(/^mwProtect-expiry-/)) {
*/
'getExpirySelectors': function() {
var all = document.getElementsByTagName("select");
- var ours = [];
+ var ours = new Array();
for (var i = 0; i < all.length; i++) {
var element = all[i];
if (element.id.match(/^mwProtectExpirySelection-/)) {
var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js
function escapeQuotes(text) {
- return escapeQuotesHTML(text.replace(/'/g,"\\'").replace(/\n/g,"\\n"));
+ var re = new RegExp("'","g");
+ text = text.replace(re,"\\'");
+ re = new RegExp("\\n","g");
+ text = text.replace(re,"\\n");
+ return escapeQuotesHTML(text);
}
function escapeQuotesHTML(text) {
- return text.replace(/&/g,"&")
- .replace(/"/g,""")
- .replace(/</gre,"<")
- .replace(/>/g,">");
+ var re = new RegExp('&',"g");
+ text = text.replace(re,"&");
+ re = new RegExp('"',"g");
+ text = text.replace(re,""");
+ re = new RegExp('<',"g");
+ text = text.replace(re,"<");
+ re = new RegExp('>',"g");
+ text = text.replace(re,">");
+ return text;
}
link.setAttribute( "title", tooltip );
}
if ( accesskey && tooltip ) {
- updateTooltipAccessKeys( [link] );
+ updateTooltipAccessKeys( new Array( link ) );
}
if ( nextnode && nextnode.parentNode == node )
// A lot of user scripts (and some of the code below) break if
// ta isn't defined, so we make sure it is. Explictly using
// window.ta avoids a "ta is not defined" error.
- if (!window.ta) window.ta = [];
+ if (!window.ta) window.ta = new Array;
// Make a local, possibly restricted, copy to avoid clobbering
// the original.
// Now deal with evil deprecated ta
var watchCheckboxExists = document.getElementById( 'wpWatchthis' ) ? true : false;
- for (var id = 0; id < ta.length; id++) {
+ for (var id in ta) {
var n = document.getElementById(id);
if (n) {
var a = null;
From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/
*/
function getElementsByClassName(oElm, strTagName, oClassNames){
- var arrReturnElements = [];
+ var arrReturnElements = new Array();
if ( typeof( oElm.getElementsByClassName ) == "function" ) {
/* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
return arrReturnElements;
}
var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
- var arrRegExpClassNames = [];
+ var arrRegExpClassNames = new Array();
if(typeof oClassNames == "object"){
for(var i=0; i<oClassNames.length; i++){
arrRegExpClassNames[arrRegExpClassNames.length] =
var reverse = (span.getAttribute("sortdir") == 'down');
- var newRows = [];
- var staticRows = [];
+ var newRows = new Array();
+ var staticRows = new Array();
for (var j = rowStart; j < table.rows.length; j++) {
var row = table.rows[j];
if((" "+row.className+" ").indexOf(" unsortable ") < 0) {
var oldIndex = (reverse ? -j : j);
var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, "") );
- newRows[newRows.length] = [row, preprocessed, oldIndex];
- } else staticRows[staticRows.length] = [row, false, j-rowStart];
+ newRows[newRows.length] = new Array(row, preprocessed, oldIndex);
+ } else staticRows[staticRows.length] = new Array(row, false, j-rowStart);
}
newRows.sort(sortfn);