19,678
edits
(removing line that only causes an error) |
(removing calls to mw.util that we can't handle) |
||
| Line 1: | Line 1: | ||
/** extract a URL parameter from the current URL ********** | /** extract a URL parameter from the current URL ********** | ||
* From [[en:User:Lupin/autoedit.js]] | |||
* | * | ||
* | * paramName : the name of the parameter to extract | ||
*/ | */ | ||
function getURLParamValue(paramName, url){ | function getURLParamValue( paramName, url) | ||
{ | |||
if (typeof (url) == 'undefined' || url === null) url = document.location.href; | |||
var cmdRe=RegExp( '[&?]' + paramName + '=([^&#]*)' ); // Stop at hash | |||
var m=cmdRe.exec(url); | |||
if (m && m.length > 1) return decodeURIComponent(m[1]); | |||
return null; | |||
} | } | ||
/** | /** &withJS= URL parameter ******* | ||
* Allow to try custom scripts from MediaWiki space | * Allow to try custom scripts from MediaWiki space | ||
* without editing | * without editing [[Special:Mypage/monobook.js]] | ||
*/ | */ | ||
var extraJS = getURLParamValue("withJS"); | |||
var extraJS = | |||
if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) { | if ( extraJS && extraJS.match("^MediaWiki:[^&<>=%]*\.js$") ) { | ||
importScript(extraJS); | importScript(extraJS); | ||
| Line 26: | Line 28: | ||
/* Import more specific scripts if necessary */ | /* Import more specific scripts if necessary */ | ||
if (wgAction == | if (wgAction == "edit" || wgAction == "submit" || wgPageName == "Special:Upload") //scripts specific to editing pages | ||
importScript( | { | ||
importScript("MediaWiki:Common.js/edit.js") | |||
} | } | ||
else if ( | else if (wgPageName == "Special:Watchlist") //watchlist scripts | ||
{ | |||
importScript("MediaWiki:Common.js/watchlist.js") | |||
} | } | ||
| Line 63: | Line 67: | ||
// In print IE (7?) does not like line-height | // In print IE (7?) does not like line-height | ||
appendCSS( '@media print { sup, sub, p, .documentDescription { line-height: normal; }}'); | |||
// IE overflow bug | // IE overflow bug | ||
appendCSS('div.overflowbugx { overflow-x: scroll !important; overflow-y: hidden !important; } div.overflowbugy { overflow-y: scroll !important; overflow-x: hidden !important; }'); | |||
// IE zoomfix | // IE zoomfix | ||
// Use to fix right floating div/table inside tables | // Use to fix right floating div/table inside tables | ||
appendCSS('.iezoomfix div, .iezoomfix table { zoom: 1;}'); | |||
// Import scripts specific to Internet Explorer 6 | // Import scripts specific to Internet Explorer 6 | ||