!/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_win = is_safari && clientPC.indexOf('windows') != -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]);
}
// For accesskeys; note that FF3+ is included here!
var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
var ff2_bugs = /firefox\/2/.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;
-if (clientPC.indexOf('opera') != -1) {
+var is_ff2_win = is_ff2 && clientPC.indexOf('windows') !== -1;
+var is_ff2_x11 = is_ff2 && clientPC.indexOf('x11') !== -1;
+if (clientPC.indexOf('opera') !== -1) {
var is_opera = true;
var is_opera_preseven = window.opera && !document.childNodes;
var is_opera_seven = window.opera && document.childNodes;
// As recommended by <http://msdn.microsoft.com/en-us/library/ms537509.aspx>,
// avoiding false positives from moronic extensions that append to the IE UA
// string (bug 23171)
-var ie6_bugs = false;
-if ( /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) != null
-&& parseFloat( RegExp.$1 ) <= 6.0 ) {
- ie6_bugs = true;
-}
+var ie6_bugs = /MSIE ([0-9]{1,}[\.0-9]{0,})/.exec( clientPC ) && parseFloat( RegExp.$1 ) <= 6.0 );
// Global external objects used by this script.
/*extern ta, stylepath, skin */
var loadedScripts = {}; // included-scripts tracker
function importScriptURI( url ) {
if ( loadedScripts[url] ) {
- return null;
+ return;
}
loadedScripts[url] = true;
var s = document.createElement( 'script' );
}
// Special stylesheet links for Monobook only (see bug 14717)
-if ( typeof stylepath != 'undefined' && skin == 'monobook' ) {
+if ( typeof stylepath !== 'undefined' && skin === 'monobook' ) {
if ( opera6_bugs ) {
importStylesheetURI( stylepath + '/' + skin + '/Opera6Fixes.css' );
} else if ( opera7_bugs ) {
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 killEvt( evt ) {
evt = evt || window.event || window.Event; // W3C, IE, Netscape
- if ( typeof ( evt.preventDefault ) != 'undefined' ) {
+ if ( typeof ( evt.preventDefault ) !== 'undefined' ) {
evt.preventDefault(); // Don't follow the link
evt.stopPropagation();
} else {
var toc = document.getElementById('toc').getElementsByTagName('ul')[0];
var toggleLink = document.getElementById( 'togglelink' );
- if ( toc && toggleLink && toc.style.display == 'none' ) {
+ if ( toc && toggleLink && toc.style.display === 'none' ) {
changeText( toggleLink, tocHideText );
toc.style.display = 'block';
document.cookie = "hidetoc=0";
} 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 ) ) {
+ || clientPC.indexOf('mac') !== -1
+ || clientPC.indexOf('konqueror') !== -1 ) ) {
tooltipAccessKeyPrefix = 'ctrl-';
} else if ( is_ff2 ) {
tooltipAccessKeyPrefix = 'alt-shift-';
function addPortletLink( portlet, href, text, id, tooltip, accesskey, nextnode ) {
var root = document.getElementById( portlet );
if ( !root ) {
- return null;
+ return;
}
var node = root.getElementsByTagName( 'ul' )[0];
if ( !node ) {
- return null;
+ return;
}
// unhide portlet if it was hidden before
updateTooltipAccessKeys( new Array( link ) );
}
- if ( nextnode && nextnode.parentNode == node ) {
+ if ( nextnode && nextnode.parentNode === node ) {
node.insertBefore( item, nextnode );
} else {
node.appendChild( item ); // IE compatibility (?)
}
function getInnerText( el ) {
- if ( typeof el == 'string' ) {
+ if ( typeof el === 'string' ) {
return el;
}
- if ( typeof el == 'undefined' ) {
+ if ( typeof el === 'undefined' ) {
return el;
}
if ( el.textContent ) {
function setupCheckboxShiftClick() {
checkboxes = [];
- lastCheckbox = null;
+ lastCheckbox = undefined;
var inputs = document.getElementsByTagName( 'input' );
addCheckboxClickHandlers( inputs );
}
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;
}
function checkboxClickHandler( e ) {
- if ( typeof e == 'undefined' ) {
+ if ( typeof e === 'undefined' ) {
e = window.event;
}
- if ( !e.shiftKey || lastCheckbox === null ) {
+ if ( !e.shiftKey || lastCheckbox === undefined ) {
lastCheckbox = this.index;
return true;
}
}
for ( var i = start; i <= finish; ++i ) {
checkboxes[i].checked = endState;
- if( i > start && typeof checkboxes[i].onchange == 'function' ) {
+ if( i > start && typeof checkboxes[i].onchange === 'function' ) {
checkboxes[i].onchange(); // fire triggers
}
}
*/
function getElementsByClassName( oElm, strTagName, oClassNames ) {
var arrReturnElements = new Array();
- if ( typeof( oElm.getElementsByClassName ) == 'function' ) {
+ if ( typeof( oElm.getElementsByClassName ) === 'function' ) {
/* Use a native implementation where possible FF3, Saf3.2, Opera 9.5 */
var arrNativeReturn = oElm.getElementsByClassName( oClassNames );
- if ( strTagName == '*' ) {
+ if ( strTagName === '*' ) {
return arrNativeReturn;
}
for ( var h = 0; h < arrNativeReturn.length; h++ ) {
- if( arrNativeReturn[h].tagName.toLowerCase() == strTagName.toLowerCase() ) {
+ if( arrNativeReturn[h].tagName.toLowerCase() === strTagName.toLowerCase() ) {
arrReturnElements[arrReturnElements.length] = arrNativeReturn[h];
}
}
return arrReturnElements;
}
- var arrElements = ( strTagName == '*' && oElm.all ) ? oElm.all : oElm.getElementsByTagName( strTagName );
+ var arrElements = ( strTagName === '*' && oElm.all ) ? oElm.all : oElm.getElementsByTagName( strTagName );
var arrRegExpClassNames = new Array();
- if( typeof oClassNames == 'object' ) {
+ if( typeof oClassNames === 'object' ) {
for( var i = 0; i < oClassNames.length; i++ ) {
arrRegExpClassNames[arrRegExpClassNames.length] =
new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)");
return;
}
}
- if ( window.location.hash == '' ) {
+ if ( window.location.hash === '' ) {
window.location.hash = fragment;
// Mozilla needs to wait until after load, otherwise the window doesn't
// well.
if ( is_gecko ) {
addOnloadHook(function() {
- if ( window.location.hash == fragment ) {
+ if ( window.location.hash === fragment ) {
window.location.hash = fragment;
}
});
var ts_image_up = 'sort_up.gif';
var ts_image_down = 'sort_down.gif';
var ts_image_none = 'sort_none.gif';
-var ts_europeandate = wgContentLanguage != 'en'; // The non-American-inclined can change to "true"
+var ts_europeandate = wgContentLanguage !== 'en'; // The non-American-inclined can change to "true"
var ts_alternate_row_colors = false;
-var ts_number_transform_table = null;
-var ts_number_regex = null;
+var ts_number_transform_table;
+var ts_number_regex;
function sortables_init() {
var idnum = 0;
// 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 ) {
+ if ( (' ' + cell.className + ' ').indexOf(' unsortable ') === -1 ) {
cell.innerHTML += '<a href="#" class="sortheader" '
+ 'onclick="ts_resortTable(this);return false;">'
+ '<span class="sortarrow">'
var column = td.cellIndex;
var table = tr.parentNode;
- while ( table && !( table.tagName && table.tagName.toLowerCase() == 'table' ) ) {
+ while ( table && !( table.tagName && table.tagName.toLowerCase() === 'table' ) ) {
table = table.parentNode;
}
if ( !table ) {
}
// Generate the number transform table if it's not done already
- if ( ts_number_transform_table === null ) {
+ if ( ts_number_transform_table === undefined ) {
ts_initTransformTable();
}
// Skip the first row if that's where the headings are
var rowStart = ( table.tHead && table.tHead.rows.length > 0 ? 0 : 1 );
var bodyRows = 0;
- if (rowStart == 0 && table.tBodies) {
+ if (rowStart === 0 && table.tBodies) {
for (var i=0; i < table.tBodies.length; i++ ) {
bodyRows += table.tBodies[i].rows.length;
}
if ( table.rows[i].cells.length > column ) {
itm = ts_getInnerText(table.rows[i].cells[column]);
itm = itm.replace(/^[\s\xa0]+/, '').replace(/[\s\xa0]+$/, '');
- if ( itm != '' ) {
+ if ( itm !== '' ) {
break;
}
}
preprocessor = ts_parseFloat;
}
- var reverse = ( span.getAttribute( 'sortdir' ) == 'down' );
+ var reverse = ( span.getAttribute( 'sortdir' ) === 'down' );
var newRows = new Array();
var staticRows = new Array();
// 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] );
}
}
}
function ts_initTransformTable() {
- if ( typeof wgSeparatorTransformTable == 'undefined'
- || ( wgSeparatorTransformTable[0] == '' && wgDigitTransformTable[2] == '' ) )
+ if ( typeof wgSeparatorTransformTable === 'undefined'
+ || ( wgSeparatorTransformTable[0] === '' && wgDigitTransformTable[2] === '' ) )
{
var digitClass = "[0-9,.]";
ts_number_transform_table = false;
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 ) {
+ if ( date.length === 11 ) {
switch ( date.substr( 3, 3 ).toLowerCase() ) {
case 'jan':
var month = '01';
// default: var month = '00';
}
return date.substr( 7, 4 ) + month + date.substr( 0, 2 );
- } else if ( date.length == 10 ) {
- if ( ts_europeandate == false ) {
+ } 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 );
}
- } else if ( date.length == 8 ) {
+ } else if ( date.length === 8 ) {
var yr = date.substr( 6, 2 );
if ( parseInt( yr ) < 50 ) {
yr = '20' + yr;
} else {
yr = '19' + yr;
}
- if ( ts_europeandate == true ) {
+ 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 );
if ( !s ) {
return 0;
}
- if ( ts_number_transform_table != false ) {
+ if ( ts_number_transform_table !== false ) {
var newNum = '', c;
for ( var p = 0; p < s.length; p++ ) {
var oldClasses = tableRows[j].className.split(' ');
var newClassName = '';
for ( var k = 0; k < oldClasses.length; k++ ) {
- if ( oldClasses[k] != '' && oldClasses[k] != 'even' && oldClasses[k] != 'odd' ) {
+ if ( oldClasses[k] !== '' && oldClasses[k] !== 'even' && oldClasses[k] !== 'odd' ) {
newClassName += oldClasses[k] + ' ';
}
}
- tableRows[j].className = newClassName + ( j % 2 == 0 ? 'even' : 'odd' );
+ tableRows[j].className = newClassName + ( j % 2 === 0 ? 'even' : 'odd' );
}
}
}