}
// For accesskeys; note that FF3+ is included here!
var is_ff2 = /firefox\/[2-9]|minefield\/3/.test( clientPC );
-var is_ff2_ = /firefox\/2/.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;
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 );
+ var opera6_bugs = is_opera_preseven;
+ var opera7_bugs = is_opera_seven && !is_opera_95;
+ var opera95_bugs = /opera\/(9\.5)/.test( clientPC );
}
// Global external objects used by this script.
if (!window.onloadFuncts) {
var onloadFuncts = [];
-}
-
-function addOnloadHook(hookFunct) {
+}
+
+//should use mwAddOnloadHook once js2 is enabled
+function addOnloadHook(hookFunct) {
// Allows add-on scripts to add onload functions
if(!doneOnloadHook) {
onloadFuncts[onloadFuncts.length] = hookFunct;
'&action=raw&ctype=text/javascript';
return importScriptURI(uri);
}
-
+
var loadedScripts = {}; // included-scripts tracker
function importScriptURI(url) {
if (loadedScripts[url]) {
document.getElementsByTagName('head')[0].appendChild(s);
return s;
}
-
+
function importStylesheet(page) {
return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_')));
}
-
+
function importStylesheetURI(url,media) {
var l = document.createElement('link');
l.type = 'text/css';
document.getElementsByTagName('head')[0].appendChild(l);
return l;
}
-
+
function appendCSS(text) {
var s = document.createElement('style');
s.type = 'text/css';
// special stylesheet links
if (typeof stylepath != 'undefined' && typeof skin != 'undefined') {
- if (is_opera_preseven) {
+ // FIXME: This tries to load the stylesheets even for skins where they
+ // don't exist, i.e., everything but Monobook.
+ if (opera6_bugs) {
importStylesheetURI(stylepath+'/'+skin+'/Opera6Fixes.css');
- } else if (is_opera_seven && !is_opera_95) {
+ } else if (opera7_bugs) {
importStylesheetURI(stylepath+'/'+skin+'/Opera7Fixes.css');
- } else if (is_opera_95) {
+ } else if (opera95_bugs) {
importStylesheetURI(stylepath+'/'+skin+'/Opera9Fixes.css');
- } else if (is_ff2_) {
+ } else if (ff2_bugs) {
importStylesheetURI(stylepath+'/'+skin+'/FF2Fixes.css');
}
}
+
if (wgBreakFrames) {
// Un-trap us from framesets
if (window.top != window) {
if (!document.getElementById) {
return;
}
- document.getElementById(ida).disabled=true;
- document.getElementById(idb).disabled=false;
+ //hide and show appropriate upload sizes
+ if(idb == 'wpUploadFileURL'){
+ var e = document.getElementById('mw-upload-maxfilesize');
+ if(e) e.style.display = "none";
+
+ var e = document.getElementById('mw-upload-maxfilesize-url');
+ if(e) e.style.display = "block";
+ }
+ if(idb == 'wpUploadFile'){
+ var e = document.getElementById('mw-upload-maxfilesize-url');
+ if(e) e.style.display = "none";
+
+ var e = document.getElementById('mw-upload-maxfilesize');
+ if(e) e.style.display = "block";
+ }
+ document.getElementById(ida).disabled = true;
+ document.getElementById(idb).disabled = false;
}
function toggle_element_check(ida,idb) {
// Separators
ascii = wgSeparatorTransformTable[0].split("\t");
localised = wgSeparatorTransformTable[1].split("\t");
- for ( var i = 0; i < ascii.length; i++ ) {
+ for ( var i = 0; i < ascii.length; i++ ) {
ts_number_transform_table[localised[i]] = ascii[i];
}
// Digits
ascii = wgDigitTransformTable[0].split("\t");
localised = wgDigitTransformTable[1].split("\t");
- for ( var i = 0; i < ascii.length; i++ ) {
+ for ( var i = 0; i < ascii.length; i++ ) {
ts_number_transform_table[localised[i]] = ascii[i];
}
maxDigitLength = 1;
for ( var digit in ts_number_transform_table ) {
// Escape regex metacharacters
- digits.push(
+ digits.push(
digit.replace( /[\\\\$\*\+\?\.\(\)\|\{\}\[\]\-]/,
function( s ) { return '\\' + s; } )
);
}
} else if (date.length == 8) {
yr = date.substr(6,2);
- if (parseInt(yr) < 50) {
- yr = '20'+yr;
- } else {
- yr = '19'+yr;
+ 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);
/*
* End of table sorting code
*/
-
-
+
+
/**
* Add a cute little box at the top of the screen to inform the user of
* something, replacing any preexisting message.