|
|
Line 1: |
Line 1: |
β | function hs(id,mod) {
| + | /* nothing anymore */ |
β | if(document.getElementById(id).style.display == 'none') {
| |
β | document.getElementById(id).style.display=mod;
| |
β | }
| |
β | else {
| |
β | document.getElementById(id).style.display='none';
| |
β | }
| |
β | }
| |
β | | |
β | | |
β | /** Test if an element has a certain class ************************************** | |
β | *
| |
β | * Description: Uses regular expressions and caching for better performance.
| |
β | * Maintainers: [[User:Mike Dillon]], [[User:R. Koot]], [[User:SG]]
| |
β | */
| |
β |
| |
β | var hasClass = (function() {
| |
β | var reCache = {};
| |
β | return function( element, className ) {
| |
β | return (reCache[className] ? reCache[className] : (reCache[className] = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"))).test(element.className);
| |
β | };
| |
β | })();
| |
β | | |
β | | |
β | | |
β | if ( wgPageName == 'Special:Upload' && document.getElementById( 'mw-upload-form' ) !== 'undefined' )
| |
β | {
| |
β | addScript( 'MediaWiki:UploadForm.js' );
| |
β | hookEvent( 'load', function()
| |
β | {
| |
β | new UploadForm();
| |
β | } );
| |
β | }
| |
β | | |
β | /**** function addScript.js
| |
β | * by Patrick Westerhoff [poke]
| |
β | */
| |
β | function addScript ( pagename )
| |
β | {
| |
β | var script = document.createElement( 'script' );
| |
β | pagename = encodeURI( pagename.replace( ' ', '_' ) );
| |
β | script.src = '/w/index.php?title=' + pagename + '&action=raw&ctype=text/javascript';
| |
β | script.type = 'text/javascript';
| |
β |
| |
β | document.getElementsByTagName( 'head' )[0].appendChild( script );
| |
β | }
| |
β | | |
β | /**** function diffwithFix.js
| |
β | * by Patrick Westerhoff [poke]
| |
β | */
| |
β | function diffwithFix ()
| |
β | {
| |
β | var diffSpan = document.getElementById( 'diffwith' );
| |
β | if ( diffSpan == undefined )
| |
β | return;
| |
β |
| |
β | var diffLink = diffSpan.getElementsByTagName( 'a' )[0];
| |
β | var diffTitle = diffSpan.title;
| |
β | var xmlHttp;
| |
β |
| |
β | try
| |
β | {
| |
β | xmlHttp = new XMLHttpRequest();
| |
β | }
| |
β | catch ( e )
| |
β | {
| |
β | try
| |
β | {
| |
β | xmlHttp = new ActiveXObject( 'Msxml2.XMLHTTP' );
| |
β | }
| |
β | catch ( e )
| |
β | {
| |
β | try
| |
β | {
| |
β | xmlHttp = new ActiveXObject( 'Microsoft.XMLHTTP' );
| |
β | }
| |
β | catch ( e )
| |
β | {
| |
β | diffSpan.style.fontSize = '90%';
| |
β | diffSpan.innerHTML = '(Automated diff <b>not available</b>.)';
| |
β | return;
| |
β | }
| |
β | }
| |
β | }
| |
β |
| |
β | xmlHttp.onreadystatechange = function ()
| |
β | {
| |
β | if ( xmlHttp.readyState != 4 )
| |
β | return;
| |
β |
| |
β | revs = xmlHttp.responseXML.getElementsByTagName( 'rev' );
| |
β |
| |
β | if ( revs.length > 0 )
| |
β | {
| |
β | diffLink.href += '&oldid=' + revs[0].getAttribute( 'revid' );
| |
β | diffSpan.title = '';
| |
β | }
| |
β | }
| |
β | xmlHttp.open( 'GET', '/w/api.php?format=xml&action=query&prop=revisions&rvprop=ids&rvlimit=1&titles=' + diffTitle, true );
| |
β | xmlHttp.send( null );
| |
β | }
| |
β | /** </nowiki> **/
| |