Index: wikibits.js =================================================================== --- wikibits.js (revision 40285) +++ wikibits.js (working copy) @@ -1,19 +1,16 @@ // MediaWiki JavaScript support functions var clientPC = navigator.userAgent.toLowerCase(); // Get client info -var is_gecko = /gecko/.test( clientPC ) && - !/khtml|spoofer|netscape\/7\.0/.test(clientPC); +var is_gecko = /gecko/.test(clientPC) && !/khtml|spoofer|netscape\/7\.0/.test(clientPC); var webkit_match = clientPC.match(/applewebkit\/(\d+)/); if (webkit_match) { - var is_safari = clientPC.indexOf('applewebkit') != -1 && - clientPC.indexOf('spoofer') == -1; + var is_safari = clientPC.indexOf('applewebkit') != -1 && clientPC.indexOf('spoofer') == -1; var is_safari_win = is_safari && clientPC.indexOf('windows') != -1; var webkit_version = parseInt(webkit_match[1]); } -var is_khtml = navigator.vendor == 'KDE' || - ( document.childNodes && !document.all && !navigator.taintEnabled ); +var is_khtml = navigator.vendor == 'KDE' || (document.childNodes && !document.all && !navigator.taintEnabled); // For accesskeys; note that FF3+ is included here! -var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC ); +var is_ff2 = /firefox\/[2-9]|minefield\/3/.test(clientPC); // These aren't used here, but some custom scripts rely on them var is_ff2_win = is_ff2 && clientPC.indexOf('windows') != -1; var is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') != -1; @@ -21,7 +18,7 @@ var is_opera = true; var is_opera_preseven = window.opera && !document.childNodes; var is_opera_seven = window.opera && document.childNodes; - var is_opera_95 = /opera\/(9.[5-9]|[1-9][0-9])/.test( clientPC ); + var is_opera_95 = /opera\/(9.[5-9]|[1-9][0-9])/.test(clientPC); } // Global external objects used by this script. @@ -30,46 +27,42 @@ // add any onload functions in this hook (please don't hard-code any events in the xhtml source) var doneOnloadHook; -if (!window.onloadFuncts) { +if (!window.onloadFuncts) var onloadFuncts = []; -} function addOnloadHook(hookFunct) { // Allows add-on scripts to add onload functions - if(!doneOnloadHook) { + if(!doneOnloadHook) onloadFuncts[onloadFuncts.length] = hookFunct; - } else { + else hookFunct(); // bug in MSIE script loading - } } function hookEvent(hookName, hookFunct) { - if (window.addEventListener) { + if (window.addEventListener) window.addEventListener(hookName, hookFunct, false); - } else if (window.attachEvent) { + else if (window.attachEvent) window.attachEvent("on" + hookName, hookFunct); - } } function importScript(page) { - return importScriptURI(wgScript + '?action=raw&ctype=text/javascript&title=' + encodeURIComponent(page.replace(/ /g,'_'))); + return importScriptURI(wgScript + '?action=raw&ctype=text/javascript&title=' + encodeURIComponent(page.replace(/ /g, '_'))); } var loadedScripts = {}; // included-scripts tracker function importScriptURI(url) { - if (loadedScripts[url]) { + if (loadedScripts[url]) return null; - } loadedScripts[url] = true; var s = document.createElement('script'); - s.setAttribute('src',url); - s.setAttribute('type','text/javascript'); + s.setAttribute('src', url); + s.setAttribute('type', 'text/javascript'); document.getElementsByTagName('head')[0].appendChild(s); return s; } function importStylesheet(page) { - return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_'))); + return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g, '_'))); } function importStylesheetURI(url) { @@ -88,20 +81,18 @@ // special stylesheet links if (typeof stylepath != 'undefined' && typeof skin != 'undefined') { - if (is_opera_preseven) { - importStylesheetURI(stylepath+'/'+skin+'/Opera6Fixes.css'); - } else if (is_opera_seven && !is_opera_95) { - importStylesheetURI(stylepath+'/'+skin+'/Opera7Fixes.css'); - } else if (is_khtml) { - importStylesheetURI(stylepath+'/'+skin+'/KHTMLFixes.css'); - } + if (is_opera_preseven) + importStylesheetURI(stylepath + '/' + skin + '/Opera6Fixes.css'); + else if (is_opera_seven && !is_opera_95) + importStylesheetURI(stylepath + '/' + skin + '/Opera7Fixes.css'); + else if (is_khtml) + importStylesheetURI(stylepath + '/' + skin + '/KHTMLFixes.css'); } if (wgBreakFrames) { // Un-trap us from framesets - if (window.top != window) { + if (window.top != window) window.top.location = window.location; - } } // for enhanced RecentChanges @@ -125,9 +116,8 @@ // Uses DOM calls to avoid document.write + XHTML issues var linkHolder = document.getElementById('toctitle'); - if (!linkHolder) { + if (!linkHolder) return; - } var outerSpan = document.createElement('span'); outerSpan.className = 'toctoggle'; @@ -146,19 +136,17 @@ linkHolder.appendChild(outerSpan); var cookiePos = document.cookie.indexOf("hidetoc="); - if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1) { + if (cookiePos > -1 && document.cookie.charAt(cookiePos + 8) == 1) toggleToc(); - } } } function changeText(el, newText) { // Safari work around - if (el.innerText) { + if (el.innerText) el.innerText = newText; - } else if (el.firstChild && el.firstChild.nodeValue) { + else if (el.firstChild && el.firstChild.nodeValue) el.firstChild.nodeValue = newText; - } } function toggleToc() { @@ -180,22 +168,22 @@ var mwCustomEditButtons = []; // eg to add in MediaWiki:Common.js function escapeQuotes(text) { - var re = new RegExp("'","g"); - text = text.replace(re,"\\'"); - re = new RegExp("\\n","g"); - text = text.replace(re,"\\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) { - 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,">"); + 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; } @@ -204,17 +192,15 @@ * Set the accesskey prefix based on browser detection. */ var tooltipAccessKeyPrefix = 'alt-'; -if (is_opera) { +if (is_opera) tooltipAccessKeyPrefix = 'shift-esc-'; -} else if (!is_safari_win && is_safari && webkit_version > 526) { +else if (!is_safari_win && is_safari && webkit_version > 526) tooltipAccessKeyPrefix = 'ctrl-alt-'; -} else if (!is_safari_win && (is_safari - || clientPC.indexOf('mac') != -1 - || clientPC.indexOf('konqueror') != -1 )) { +else if (!is_safari_win && (is_safari || clientPC.indexOf('mac') != -1 || clientPC.indexOf('konqueror') != -1)) tooltipAccessKeyPrefix = 'ctrl-'; -} else if (is_ff2) { +else if (is_ff2) tooltipAccessKeyPrefix = 'alt-shift-'; -} + var tooltipAccessKeyRegexp = /\[(ctrl-)?(alt-)?(shift-)?(esc-)?(.)\]$/; /** @@ -225,25 +211,24 @@ * * @param Array nodeList -- list of elements to update */ -function updateTooltipAccessKeys( nodeList ) { - if ( !nodeList ) { +function updateTooltipAccessKeys(nodeList) { + if (!nodeList) { // skins without a "column-one" element don't seem to have links with accesskeys either var columnOne = document.getElementById("column-one"); - if ( columnOne ) - updateTooltipAccessKeys( columnOne.getElementsByTagName("a") ); + if (columnOne) + updateTooltipAccessKeys(columnOne.getElementsByTagName("a")); // these are rare enough that no such optimization is needed - updateTooltipAccessKeys( document.getElementsByTagName("input") ); - updateTooltipAccessKeys( document.getElementsByTagName("label") ); + updateTooltipAccessKeys(document.getElementsByTagName("input")); + updateTooltipAccessKeys(document.getElementsByTagName("label")); return; } - for ( var i = 0; i < nodeList.length; i++ ) { + for (var i = 0; i < nodeList.length; i++) { var element = nodeList[i]; var tip = element.getAttribute("title"); - if ( tip && tooltipAccessKeyRegexp.exec(tip) ) { - tip = tip.replace(tooltipAccessKeyRegexp, - "["+tooltipAccessKeyPrefix+"$5]"); - element.setAttribute("title", tip ); + if (tip && tooltipAccessKeyRegexp.exec(tip)) { + tip = tip.replace(tooltipAccessKeyRegexp, "[" + tooltipAccessKeyPrefix + "$5]"); + element.setAttribute("title", tip); } } } @@ -278,33 +263,31 @@ */ function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) { var node = document.getElementById(portlet); - if ( !node ) return null; - node = node.getElementsByTagName( "ul" )[0]; - if ( !node ) return null; + if (!node) return null; + node = node.getElementsByTagName("ul")[0]; + if (!node) return null; - var link = document.createElement( "a" ); - link.appendChild( document.createTextNode( text ) ); + var link = document.createElement("a"); + link.appendChild(document.createTextNode(text)); link.href = href; - var item = document.createElement( "li" ); - item.appendChild( link ); - if ( id ) item.id = id; + var item = document.createElement("li"); + item.appendChild(link); + if (id) item.id = id; - if ( accesskey ) { - link.setAttribute( "accesskey", accesskey ); - tooltip += " ["+accesskey+"]"; + if (accesskey) { + link.setAttribute("accesskey", accesskey); + tooltip += " [" + accesskey + "]"; } - if ( tooltip ) { - link.setAttribute( "title", tooltip ); - } - if ( accesskey && tooltip ) { - updateTooltipAccessKeys( new Array( link ) ); - } + if (tooltip) + link.setAttribute("title", tooltip); + if (accesskey && tooltip) + updateTooltipAccessKeys(new Array(link)); - if ( nextnode && nextnode.parentNode == node ) - node.insertBefore( item, nextnode ); + if (nextnode && nextnode.parentNode == node) + node.insertBefore(item, nextnode); else - node.appendChild( item ); // IE compatibility (?) + node.appendChild(item); // IE compatibility (?) return item; } @@ -318,23 +301,18 @@ * * @param mixed doId string or null */ -function akeytt( doId ) { +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 = new Array; + if (!window.ta) window.ta = []; // Make a local, possibly restricted, copy to avoid clobbering // the original. - var ta; - if ( doId ) { - ta = [doId]; - } else { - ta = window.ta; - } + var ta = doid ? [doId] : window.ta; // Now deal with evil deprecated ta - var watchCheckboxExists = document.getElementById( 'wpWatchthis' ) ? true : false; + var watchCheckboxExists = document.getElementById('wpWatchthis') ? true : false; for (var id in ta) { var n = document.getElementById(id); if (n) { @@ -343,17 +321,12 @@ // Are we putting accesskey in it if (ta[id][0].length > 0) { // Is this object a object? If not assume it's the next child. - - if (n.nodeName.toLowerCase() == "a") { - a = n; - } else { - a = n.childNodes[0]; - } + a = n.nodeName.toLowerCase() == "a" ? n : n.childNodes[0]; // Don't add an accesskey for the watch tab if the watch // checkbox is also available. if (a && ((id != 'ca-watch' && id != 'ca-unwatch') || !watchCheckboxExists)) { a.accessKey = ta[id][0]; - ak = ' ['+tooltipAccessKeyPrefix+ta[id][0]+']'; + ak = ' [' + tooltipAccessKeyPrefix+ta[id][0] + ']'; } } else { // We don't care what type the object is when assigning tooltip @@ -361,9 +334,8 @@ ak = ''; } - if (a) { - a.title = ta[id][1]+ak; - } + if (a) + a.title = ta[id][1] + ak; } } } @@ -379,15 +351,15 @@ } function addCheckboxClickHandlers(inputs, start) { - if ( !start) start = 0; + if (!start) start = 0; var finish = start + 250; - if ( finish > inputs.length ) + if (finish > inputs.length) finish = inputs.length; - for ( var i = start; i < finish; i++ ) { + for (var i = start; i < finish; i++) { var cb = inputs[i]; - if ( !cb.type || cb.type.toLowerCase() != 'checkbox' ) + if (!cb.type || cb.type.toLowerCase() != 'checkbox') continue; var end = checkboxes.length; checkboxes[end] = cb; @@ -395,49 +367,42 @@ cb.onclick = checkboxClickHandler; } - if ( finish < inputs.length ) { - setTimeout( function () { - addCheckboxClickHandlers(inputs, finish); - }, 200 ); - } + if (finish < inputs.length) + setTimeout(function () {addCheckboxClickHandlers(inputs, finish);}, 200); } function checkboxClickHandler(e) { - if (typeof e == 'undefined') { + if (typeof e == 'undefined') e = window.event; - } - if ( !e.shiftKey || lastCheckbox === null ) { + if (!e.shiftKey || lastCheckbox === null) { lastCheckbox = this.index; return true; } var endState = this.checked; var start, finish; - if ( this.index < lastCheckbox ) { + if (this.index < lastCheckbox) { start = this.index + 1; finish = lastCheckbox; } else { start = lastCheckbox; finish = this.index - 1; } - for (var i = start; i <= finish; ++i ) { + for (var i = start; i <= finish; ++i) checkboxes[i].checked = endState; - } lastCheckbox = this.index; return true; } -function toggle_element_activation(ida,idb) { - if (!document.getElementById) { +function toggle_element_activation(ida, idb) { + if (!document.getElementById) return; - } document.getElementById(ida).disabled=true; document.getElementById(idb).disabled=false; } -function toggle_element_check(ida,idb) { - if (!document.getElementById) { +function toggle_element_check(ida, idb) { + if (!document.getElementById) return; - } document.getElementById(ida).checked=true; document.getElementById(idb).checked=false; } @@ -448,34 +413,28 @@ Author says "The credit comment is all it takes, no license. Go crazy with it!:-)" From http://www.robertnyman.com/2005/11/07/the-ultimate-getelementsbyclassname/ */ -function getElementsByClassName(oElm, strTagName, oClassNames){ - var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName); - var arrReturnElements = new Array(); - var arrRegExpClassNames = new Array(); - if(typeof oClassNames == "object"){ - for(var i=0; i 0) { - if (table.tHead && table.tHead.rows.length > 0) { + if (table.tHead && table.tHead.rows.length > 0) firstRow = table.tHead.rows[table.tHead.rows.length-1]; - } else { + else firstRow = table.rows[0]; - } } if (!firstRow) return; // We have a first row: assume it's the header, and make its contents clickable links for (var i = 0; i < firstRow.cells.length; i++) { var cell = firstRow.cells[i]; - if ((" "+cell.className+" ").indexOf(" unsortable ") == -1) { - cell.innerHTML += '  ↓'; - } + if ((" " + cell.className + " ").indexOf(" unsortable ") == -1) + cell.innerHTML += '  ↓'; } - if (ts_alternate_row_colors) { + if (ts_alternate_row_colors) ts_alternate(table); - } } function ts_getInnerText(el) { @@ -621,43 +572,43 @@ var reverse = (span.getAttribute("sortdir") == 'down'); - var newRows = new Array(); + var newRows = []; for (var j = rowStart; j < table.rows.length; j++) { var row = table.rows[j]; var keyText = ts_getInnerText(row.cells[column]); var oldIndex = (reverse ? -j : j); - newRows[newRows.length] = new Array(row, keyText, oldIndex); + newRows[newRows.length] = [row, keyText, oldIndex]; } newRows.sort(sortfn); var arrowHTML; if (reverse) { - arrowHTML = '↓'; + arrowHTML = '↓'; newRows.reverse(); - span.setAttribute('sortdir','up'); + span.setAttribute('sortdir', 'up'); } else { - arrowHTML = '↑'; - span.setAttribute('sortdir','down'); + arrowHTML = '↑'; + span.setAttribute('sortdir', 'down'); } // We appendChild rows that already exist to the tbody, so it moves them rather than creating new ones // don't do sortbottom rows for (var i = 0; i < newRows.length; i++) { - if ((" "+newRows[i][0].className+" ").indexOf(" sortbottom ") == -1) + if ((" " + newRows[i][0].className + " ").indexOf(" sortbottom ") == -1) table.tBodies[0].appendChild(newRows[i][0]); } // do sortbottom rows only for (var i = 0; i < newRows.length; i++) { - if ((" "+newRows[i][0].className+" ").indexOf(" sortbottom ") != -1) + if ((" " + newRows[i][0].className + " ").indexOf(" sortbottom ") != -1) table.tBodies[0].appendChild(newRows[i][0]); } // Delete any other arrows there may be showing var spans = getElementsByClassName(tr, "span", "sortarrow"); for (var i = 0; i < spans.length; i++) { - spans[i].innerHTML = '↓'; + spans[i].innerHTML = '↓'; } span.innerHTML = arrowHTML; @@ -667,7 +618,7 @@ function ts_dateToSortKey(date) { // y2k notes: two digit years less than 50 are treated as 20XX, greater than 50 are treated as 19XX if (date.length == 11) { - switch (date.substr(3,3).toLowerCase()) { + switch (date.substr(3, 3).toLowerCase()) { case "jan": var month = "01"; break; case "feb": var month = "02"; break; case "mar": var month = "03"; break; @@ -682,25 +633,19 @@ case "dec": var month = "12"; break; // default: var month = "00"; } - return date.substr(7,4)+month+date.substr(0,2); + return date.substr(7, 4) + month + date.substr(0, 2); } else if (date.length == 10) { - if (ts_europeandate == false) { - return date.substr(6,4)+date.substr(0,2)+date.substr(3,2); - } else { - return date.substr(6,4)+date.substr(3,2)+date.substr(0,2); - } + if (ts_europeandate == false) + return date.substr(6, 4) + date.substr(0, 2) + date.substr(3, 2); + else + return date.substr(6, 4) + date.substr(3, 2) + date.substr(0, 2); } else if (date.length == 8) { - yr = date.substr(6,2); - if (parseInt(yr) < 50) { - yr = '20'+yr; - } else { - yr = '19'+yr; - } - if (ts_europeandate == true) { - return yr+date.substr(3,2)+date.substr(0,2); - } else { - return yr+date.substr(0,2)+date.substr(3,2); - } + yr = date.substr(6, 2); + yr = parseInt(yr) < 50 ? '20' + yr : '19' + yr; + if (ts_europeandate == true) + return yr + date.substr(3, 2) + date.substr(0, 2); + else + return yr + date.substr(0, 2) + date.substr(3, 2); } return "00000000"; } @@ -711,31 +656,31 @@ return (isNaN(num) ? 0 : num); } -function ts_sort_date(a,b) { +function ts_sort_date(a, b) { var aa = ts_dateToSortKey(a[1]); var bb = ts_dateToSortKey(b[1]); return (aa < bb ? -1 : aa > bb ? 1 : a[2] - b[2]); } -function ts_sort_currency(a,b) { - var aa = ts_parseFloat(a[1].replace(/[^0-9.]/g,'')); - var bb = ts_parseFloat(b[1].replace(/[^0-9.]/g,'')); +function ts_sort_currency(a, b) { + var aa = ts_parseFloat(a[1].replace(/[^0-9.]/g, '')); + var bb = ts_parseFloat(b[1].replace(/[^0-9.]/g, '')); return (aa != bb ? aa - bb : a[2] - b[2]); } -function ts_sort_numeric(a,b) { +function ts_sort_numeric(a, b) { var aa = ts_parseFloat(a[1]); var bb = ts_parseFloat(b[1]); return (aa != bb ? aa - bb : a[2] - b[2]); } -function ts_sort_caseinsensitive(a,b) { +function ts_sort_caseinsensitive(a, b) { var aa = a[1].toLowerCase(); var bb = b[1].toLowerCase(); return (aa < bb ? -1 : aa > bb ? 1 : a[2] - b[2]); } -function ts_sort_default(a,b) { +function ts_sort_default(a, b) { return (a[1] < b[1] ? -1 : a[1] > b[1] ? 1 : a[2] - b[2]); } @@ -775,48 +720,35 @@ * call to allow CSS/JS to hide different boxes. null = no class used. * @return Boolean True on success, false on failure */ -function jsMsg( message, className ) { - if ( !document.getElementById ) { +function jsMsg(message, className) { + if (!document.getElementById) return false; - } // We special-case skin structures provided by the software. Skins that // choose to abandon or significantly modify our formatting can just define // an mw-js-message div to start with. - var messageDiv = document.getElementById( 'mw-js-message' ); - if ( !messageDiv ) { - messageDiv = document.createElement( 'div' ); - if ( document.getElementById( 'column-content' ) - && document.getElementById( 'content' ) ) { - // MonoBook, presumably - document.getElementById( 'content' ).insertBefore( - messageDiv, - document.getElementById( 'content' ).firstChild - ); - } else if ( document.getElementById('content') - && document.getElementById( 'article' ) ) { - // Non-Monobook but still recognizable (old-style) - document.getElementById( 'article').insertBefore( - messageDiv, - document.getElementById( 'article' ).firstChild - ); - } else { + var messageDiv = document.getElementById('mw-js-message'); + if (!messageDiv) { + messageDiv = document.createElement('div'); + // MonoBook, presumably + if (document.getElementById('column-content') && document.getElementById('content')) + document.getElementById('content').insertBefore(messageDiv, document.getElementById('content').firstChild); + // Non-Monobook but still recognizable (old-style) + else if (document.getElementById('content') && document.getElementById('article')) + document.getElementById('article').insertBefore(messageDiv, document.getElementById('article').firstChild); + else return false; - } } - messageDiv.setAttribute( 'id', 'mw-js-message' ); - if( className ) { - messageDiv.setAttribute( 'class', 'mw-js-message-'+className ); - } - + messageDiv.setAttribute('id', 'mw-js-message'); + if (className) + messageDiv.setAttribute('class', 'mw-js-message-' + className); if (typeof message === 'object') { while (messageDiv.hasChildNodes()) // Remove old content messageDiv.removeChild(messageDiv.firstChild); messageDiv.appendChild (message); // Append new content } - else { + else messageDiv.innerHTML = message; - } return true; } @@ -826,16 +758,15 @@ * @param element Element to inject after * @param id Identifier string (for use with removeSpinner(), below) */ -function injectSpinner( element, id ) { - var spinner = document.createElement( "img" ); +function injectSpinner(element, id) { + var spinner = document.createElement("img"); spinner.id = "mw-spinner-" + id; spinner.src = stylepath + "/common/images/spinner.gif"; spinner.alt = spinner.title = "..."; - if( element.nextSibling ) { - element.parentNode.insertBefore( spinner, element.nextSibling ); - } else { - element.parentNode.appendChild( spinner ); - } + if (element.nextSibling) + element.parentNode.insertBefore(spinner, element.nextSibling); + else + element.parentNode.appendChild(spinner); } /** @@ -843,32 +774,29 @@ * * @param id Identifier string */ -function removeSpinner( id ) { - var spinner = document.getElementById( "mw-spinner-" + id ); - if( spinner ) { - spinner.parentNode.removeChild( spinner ); - } +function removeSpinner(id) { + var spinner = document.getElementById("mw-spinner-" + id); + if (spinner) + spinner.parentNode.removeChild(spinner); } function runOnloadHook() { // don't run anything below this for non-dom browsers - if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) { + if (doneOnloadHook || !(document.getElementById && document.getElementsByTagName)) return; - } // set this before running any hooks, since any errors below // might cause the function to terminate prematurely doneOnloadHook = true; - updateTooltipAccessKeys( null ); - akeytt( null ); + updateTooltipAccessKeys(null); + akeytt(null); setupCheckboxShiftClick(); sortables_init(); // Run any added-on functions - for (var i = 0; i < onloadFuncts.length; i++) { + for (var i = 0; i < onloadFuncts.length; i++) onloadFuncts[i](); - } } /** @@ -878,12 +806,11 @@ * @param String attach Event to attach to * @param callable handler Event handler callback */ -function addHandler( element, attach, handler ) { - if( window.addEventListener ) { - element.addEventListener( attach, handler, false ); - } else if( window.attachEvent ) { - element.attachEvent( 'on' + attach, handler ); - } +function addHandler(element, attach, handler) { + if (window.addEventListener) + element.addEventListener(attach, handler, false); + else if (window.attachEvent) + element.attachEvent('on' + attach, handler); } /** @@ -892,8 +819,8 @@ * @param Element element Element to add handler to * @param callable handler Event handler callback */ -function addClickHandler( element, handler ) { - addHandler( element, 'click', handler ); +function addClickHandler(element, handler) { + addHandler(element, 'click', handler); } //note: all skins should call runOnloadHook() at the end of html output, // so the below should be redundant. It's there just in case.