|
|
(17 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();
| |
β |
| |
β | // Feedback namespace, user related additions
| |
β | if ( ( wgNamespaceNumber == 202 || wgNamespaceNumber == 203 ) )
| |
β | {
| |
β | var regExp = /^Feedback(?:_talk)?:User\/([^\/]+)(\/.*?)?$/;
| |
β | if ( ( obj = document.getElementById( 'catlinks' ) ) && obj.innerHTML.match( 'Category:Staff feedback pages' ) )
| |
β | regExp = /^Feedback_talk:([^\/]+)(\/.*?)?$/;
| |
β |
| |
β | if ( ( match = wgPageName.match( regExp ) ) && ( obj = document.getElementById( 'p-tb' ) ) && ( obj = obj.getElementsByTagName( 'ul' )[0] ) )
| |
β | {
| |
β | match[1] = encodeURIComponent( match[1] );
| |
β | obj.innerHTML = obj.innerHTML.replace( /^([\s\S]*?<li id="t-recentchangeslinked".*?\/li>)([\s\S]+)$/i, '$1<li id="t-contributions"><a title="View the list of contributions of this user" href="/wiki/Special:Contributions/' + match[1] + '">User contributions</a></li>\n<li id="t-log"><a href="/index.php?title=Special:Log&user=' + match[1] + '">Logs</a></li>\n<li id="t-emailuser"><a title="Send an e-mail to this user" href="/wiki/Special:EmailUser/' + match[1] + '">E-mail this user</a></li>\n$2' );
| |
β | }
| |
β | delete obj, regExp, match;
| |
β | }
| |
β |
| |
β | // 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>*/
| |