User:Platonides/vector.js

addPortletLink('p-personal', 'http://www.mediawiki.org/wiki/Special:Code/MediaWiki', 'Code Review', 'p-Code-Review', null, null, document.getElementById('pt-userpage') );

if ( wgPageName == "Special:Code" ) { addOnloadHook( function {  if ( document.getElementById('path') ) {     document.getElementById('path').onchange = function {        var path = document.getElementById('path').value;        var n = path.indexOf( '/' );        switch ( path.substring( 0, n ) ) {          case 'phase3':          case 'extensions':          case 'tests':            document.getElementById('path').value = "/trunk/" + path;            break;          case 'skins':          case 'maintenance':          case 'includes':            document.getElementById('path').value = "/trunk/phase3/" + path;            break;        }     }   }

function releaseFromTrunkRev(revNeedle) { var branchPoints = { /* See Branch_points */ 1284: "phase3 reorg", 2160: 1.1, 2548: 1.2, 3655: 1.3, 5374: "1.3A", 6439: 1.4, 10329: 1.5, 13500: 1.6, 15386: 1.7, 16913: 1.8, 18954: 1.9, 21728: 1.10, 25545: 1.11, 31056: 1.12, 37956: 1.13, 45489: 1.14, 48811: 1.15, 52088: "wmf-deployment 1", 56150: "wmf-deployment 2", 57447: "wmf-deployment 3", 62817: "1.16, 1.16wmf4", 77974: "1.17, 1.17wmf1", 87519: 1.18, };

revNeedle = parseInt( revNeedle, 10 ); for (rev in branchPoints ) { if (rev > revNeedle) { return branchPoints[rev]; }     }      return "trunk"; }

var wpRemoveTag = document.getElementById('wpRemoveTag'); if ( wpRemoveTag && ! document.getElementById('mw-code-batch-status') ) { var tr = document.createElement( 'tr' ); var td = document.createElement( 'td' );

td.appendChild( document.createTextNode( "Since:" ) ); tr.appendChild( td ); td = document.createElement( 'td' ); td.appendChild( document.createTextNode( releaseFromTrunkRev( $('form table tr td b')[0].firstChild.nodeValue.substring(1) ) ) ); tr.appendChild( td );

var granny = wpRemoveTag.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode; granny.parentNode.insertBefore( tr, granny.nextSibling ); } });

addOnloadHook( function {	var a = document.createElement('a');	a.href = wgArticlePath.replace( "$1", "Special:Code/MediaWiki/status/fixme?author=" + wgUserName.toLowerCase );	a.appendChild( document.createTextNode( 'my fixmes' ) );

var next = document.getElementById('contentSub').getElementsByTagName('a')[4]; next.parentNode.insertBefore(a, next); next.parentNode.insertBefore(document.getElementById('contentSub').getElementsByTagName('a')[3].nextSibling.cloneNode(false), next); }); }