From: Niklas Laxström Date: Tue, 25 Aug 2009 13:56:42 +0000 (+0000) Subject: * Revert r55555-55557 for now, breaks tabs in special preferences, don't know why X-Git-Tag: 1.31.0-rc.0~40069 X-Git-Url: http://git.cyclocoop.org//%27%40script%40/%27?a=commitdiff_plain;h=26d55f5e34962db9cc10085af1277256f8479ce8;p=lhc%2Fweb%2Fwiklou.git * Revert r55555-55557 for now, breaks tabs in special preferences, don't know why Also, the following looks wrong: - for (var id = 0; id < ta.length; id++) { + for (var id in ta) { var n = document.getElementById(id); --- diff --git a/skins/common/mwsuggest.js b/skins/common/mwsuggest.js index 8e37a4859e..77792b0616 100644 --- a/skins/common/mwsuggest.js +++ b/skins/common/mwsuggest.js @@ -24,8 +24,8 @@ var os_mouse_moved = false; // 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 @@ -364,7 +364,7 @@ function os_createResultTable(r, results){ var c = document.getElementById(r.container); var width = c.offsetWidth - os_operaWidthFix(c.offsetWidth); var html = ""; - r.results = []; + r.results = new Array(); r.resultCount = results.length; for(i=0;i/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; } @@ -299,7 +308,7 @@ function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) { link.setAttribute( "title", tooltip ); } if ( accesskey && tooltip ) { - updateTooltipAccessKeys( [link] ); + updateTooltipAccessKeys( new Array( link ) ); } if ( nextnode && nextnode.parentNode == node ) @@ -345,7 +354,7 @@ function akeytt( doId ) { // 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. @@ -358,7 +367,7 @@ function akeytt( doId ) { // 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; @@ -489,7 +498,7 @@ function toggle_element_check(ida,idb) { 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 ); @@ -502,7 +511,7 @@ function getElementsByClassName(oElm, strTagName, 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