|
|
(16 intermediate revisions by 4 users not shown) |
Line 1: |
Line 1: |
β | /*<nowiki>*/
| + | /* nothing anymore */ |
β | /** additional scripts **/
| |
β | if ( wgIsArticle || window.location.href.indexOf( 'action=submit' ) > -1 )
| |
β | {
| |
β | addScript( 'MediaWiki:CollapsibleTables.js' );
| |
β | hookEvent( 'load', function()
| |
β | {
| |
β | new CollapsibleTables();
| |
β | diffwithFix();
| |
β |
| |
β | // Extension for the deletion drop down list
| |
β | if ( wgAction == 'delete' && ( delReasonBtn = document.getElementById( 'wpConfirmB' ) ) )
| |
β | {
| |
β | var delReasonList = document.getElementById( 'wpDeleteReasonList' );
| |
β | var delLink = document.createElement( 'a' );
| |
β | delLink.href = 'javascript:void(0);'
| |
β | delLink.title = document.getElementById( 'wpReason' ).value;
| |
β | delLink.style.fontSize = '0.9em';
| |
β | delLink.style.marginLeft = '1em';
| |
β | delLink.onclick = function()
| |
β | {
| |
β | document.getElementById( 'wpReason' ).value = this.title;
| |
β | }
| |
β | delReasonList.onchange = function ()
| |
β | {
| |
β | document.getElementById( 'wpReason' ).value = '';
| |
β | this.onchange = null;
| |
β | }
| |
β | delLink.appendChild( document.createTextNode( 'restore default reason' ) );
| |
β | delReasonBtn.parentNode.appendChild( delLink );
| |
β | delete delLink, delReasonList, delReasonBtn;
| |
β | }
| |
β | } );
| |
β | }
| |
β | 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 = '/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', '/api.php?format=xml&action=query&prop=revisions&rvprop=ids&rvlimit=1&titles=' + diffTitle, true );
| |
β | xmlHttp.send( null );
| |
β | }
| |
β | /*</nowiki>*/
| |