Index: trunk/phase3/skins/common/protect.js |
— | — | @@ -250,7 +250,7 @@ |
251 | 251 | */ |
252 | 252 | 'getLevelSelectors': function() { |
253 | 253 | var all = document.getElementsByTagName("select"); |
254 | | - var ours = []; |
| 254 | + var ours = new Array(); |
255 | 255 | for (var i = 0; i < all.length; i++) { |
256 | 256 | var element = all[i]; |
257 | 257 | if (element.id.match(/^mwProtect-level-/)) { |
— | — | @@ -279,7 +279,7 @@ |
280 | 280 | */ |
281 | 281 | 'getExpiryInputs': function() { |
282 | 282 | var all = document.getElementsByTagName("input"); |
283 | | - var ours = []; |
| 283 | + var ours = new Array(); |
284 | 284 | for (var i = 0; i < all.length; i++) { |
285 | 285 | var element = all[i]; |
286 | 286 | if (element.name.match(/^mwProtect-expiry-/)) { |
— | — | @@ -307,7 +307,7 @@ |
308 | 308 | */ |
309 | 309 | 'getExpirySelectors': function() { |
310 | 310 | var all = document.getElementsByTagName("select"); |
311 | | - var ours = []; |
| 311 | + var ours = new Array(); |
312 | 312 | for (var i = 0; i < all.length; i++) { |
313 | 313 | var element = all[i]; |
314 | 314 | if (element.id.match(/^mwProtectExpirySelection-/)) { |
Index: trunk/phase3/skins/common/mwsuggest.js |
— | — | @@ -24,8 +24,8 @@ |
25 | 25 | // delay between keypress and suggestion (in ms) |
26 | 26 | var os_search_timeout = 250; |
27 | 27 | // these pairs of inputs/forms will be autoloaded at startup |
28 | | -var os_autoload_inputs = ['searchInput', 'searchInput2', 'powerSearchText', 'searchText']; |
29 | | -var os_autoload_forms = ['searchform', 'searchform2', 'powersearch', 'search']; |
| 28 | +var os_autoload_inputs = new Array('searchInput', 'searchInput2', 'powerSearchText', 'searchText'); |
| 29 | +var os_autoload_forms = new Array('searchform', 'searchform2', 'powersearch', 'search' ); |
30 | 30 | // if we stopped the service |
31 | 31 | var os_is_stopped = false; |
32 | 32 | // max lines to show in suggest table |
— | — | @@ -364,7 +364,7 @@ |
365 | 365 | var c = document.getElementById(r.container); |
366 | 366 | var width = c.offsetWidth - os_operaWidthFix(c.offsetWidth); |
367 | 367 | var html = "<table class=\"os-suggest-results\" id=\""+r.resultTable+"\" style=\"width: "+width+"px;\">"; |
368 | | - r.results = []; |
| 368 | + r.results = new Array(); |
369 | 369 | r.resultCount = results.length; |
370 | 370 | for(i=0;i<results.length;i++){ |
371 | 371 | var title = os_decodeValue(results[i]); |
Index: trunk/phase3/skins/common/wikibits.js |
— | — | @@ -181,14 +181,23 @@ |
182 | 182 | var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js |
183 | 183 | |
184 | 184 | function escapeQuotes(text) { |
185 | | - return escapeQuotesHTML(text.replace(/'/g,"\\'").replace(/\n/g,"\\n")); |
| 185 | + var re = new RegExp("'","g"); |
| 186 | + text = text.replace(re,"\\'"); |
| 187 | + re = new RegExp("\\n","g"); |
| 188 | + text = text.replace(re,"\\n"); |
| 189 | + return escapeQuotesHTML(text); |
186 | 190 | } |
187 | 191 | |
188 | 192 | function escapeQuotesHTML(text) { |
189 | | - return text.replace(/&/g,"&") |
190 | | - .replace(/"/g,""") |
191 | | - .replace(/</gre,"<") |
192 | | - .replace(/>/g,">"); |
| 193 | + var re = new RegExp('&',"g"); |
| 194 | + text = text.replace(re,"&"); |
| 195 | + re = new RegExp('"',"g"); |
| 196 | + text = text.replace(re,"""); |
| 197 | + re = new RegExp('<',"g"); |
| 198 | + text = text.replace(re,"<"); |
| 199 | + re = new RegExp('>',"g"); |
| 200 | + text = text.replace(re,">"); |
| 201 | + return text; |
193 | 202 | } |
194 | 203 | |
195 | 204 | |
— | — | @@ -299,7 +308,7 @@ |
300 | 309 | link.setAttribute( "title", tooltip ); |
301 | 310 | } |
302 | 311 | if ( accesskey && tooltip ) { |
303 | | - updateTooltipAccessKeys( [link] ); |
| 312 | + updateTooltipAccessKeys( new Array( link ) ); |
304 | 313 | } |
305 | 314 | |
306 | 315 | if ( nextnode && nextnode.parentNode == node ) |
— | — | @@ -345,7 +354,7 @@ |
346 | 355 | // A lot of user scripts (and some of the code below) break if |
347 | 356 | // ta isn't defined, so we make sure it is. Explictly using |
348 | 357 | // window.ta avoids a "ta is not defined" error. |
349 | | - if (!window.ta) window.ta = []; |
| 358 | + if (!window.ta) window.ta = new Array; |
350 | 359 | |
351 | 360 | // Make a local, possibly restricted, copy to avoid clobbering |
352 | 361 | // the original. |
— | — | @@ -358,7 +367,7 @@ |
359 | 368 | |
360 | 369 | // Now deal with evil deprecated ta |
361 | 370 | var watchCheckboxExists = document.getElementById( 'wpWatchthis' ) ? true : false; |
362 | | - for (var id = 0; id < ta.length; id++) { |
| 371 | + for (var id in ta) { |
363 | 372 | var n = document.getElementById(id); |
364 | 373 | if (n) { |
365 | 374 | var a = null; |
— | — | @@ -489,7 +498,7 @@ |
490 | 499 | From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ |
491 | 500 | */ |
492 | 501 | function getElementsByClassName(oElm, strTagName, oClassNames){ |
493 | | - var arrReturnElements = []; |
| 502 | + var arrReturnElements = new Array(); |
494 | 503 | if ( typeof( oElm.getElementsByClassName ) == "function" ) { |
495 | 504 | /* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */ |
496 | 505 | var arrNativeReturn = oElm.getElementsByClassName( oClassNames ); |
— | — | @@ -502,7 +511,7 @@ |
503 | 512 | return arrReturnElements; |
504 | 513 | } |
505 | 514 | var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); |
506 | | - var arrRegExpClassNames = []; |
| 515 | + var arrRegExpClassNames = new Array(); |
507 | 516 | if(typeof oClassNames == "object"){ |
508 | 517 | for(var i=0; i<oClassNames.length; i++){ |
509 | 518 | arrRegExpClassNames[arrRegExpClassNames.length] = |
— | — | @@ -671,8 +680,8 @@ |
672 | 681 | |
673 | 682 | var reverse = (span.getAttribute("sortdir") == 'down'); |
674 | 683 | |
675 | | - var newRows = []; |
676 | | - var staticRows = []; |
| 684 | + var newRows = new Array(); |
| 685 | + var staticRows = new Array(); |
677 | 686 | for (var j = rowStart; j < table.rows.length; j++) { |
678 | 687 | var row = table.rows[j]; |
679 | 688 | if((" "+row.className+" ").indexOf(" unsortable ") < 0) { |
— | — | @@ -680,8 +689,8 @@ |
681 | 690 | var oldIndex = (reverse ? -j : j); |
682 | 691 | var preprocessed = preprocessor( keyText.replace(/^[\s\xa0]+/, "").replace(/[\s\xa0]+$/, "") ); |
683 | 692 | |
684 | | - newRows[newRows.length] = [row, preprocessed, oldIndex]; |
685 | | - } else staticRows[staticRows.length] = [row, false, j-rowStart]; |
| 693 | + newRows[newRows.length] = new Array(row, preprocessed, oldIndex); |
| 694 | + } else staticRows[staticRows.length] = new Array(row, false, j-rowStart); |
686 | 695 | } |
687 | 696 | |
688 | 697 | newRows.sort(sortfn); |