User:Technical 13/vector.js

/* RC long dates */ if( mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Recentchanges' ){ var arrDaysOfWeek = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ]; $( 'div.mw-changeslist h4' ).each( function( n, h4date ) {   var strDate = h4date.innerText;    var thisDay = ( new Date( strDate ) ).getDay;    if ( n === 0 ) {      h4date.id = "today";    } else {      h4date.id = arrDaysOfWeek[ thisDay ] + ( Math.floor( n / 7 ) + 1 );    }    h4date.innerText = arrDaysOfWeek[ thisDay ] + ', ' + strDate;  } ); $( 'fieldset.rcoptions' ).html(   $( 'fieldset.rcoptions' ).html      .replace( ' minor edits | ', ' minor | ' )      .replace( ' anonymous users | ', ' IPs | ' )      .replace( ' registered users | ', ' users | ' )      .replace( ' patrolled edits | ', ' patrolled | ' )      .replace( ' my edits', ' mine' )  ); $( 'body' ).append( '&uArr;  &uArr;   Today   &uArr;   &uArr;  ' ); }

/* UserCSSJS */// To make it easy to navigate to your own custom CSS and JS pages // Special:MyPage/common.css Special:MyPage/common.js // Special:MyPage/vector.css Special:MyPage/vector.js

mw.loader.load( '/index.php?title=MediaWiki:Gadget-DeOrphaner.js&action=raw&ctype=text/javascript' );// Gadget-DeOrphaner.js

//mw.loader.load( '/index.php?title=MediaWiki:Gadget-spamBlock.js/sandbox.js&action=raw&ctype=text/javascript' );// Gadget-spamBlock.js/sandbox.js

mw.loader.load( '/index.php?title=MediaWiki:Gadget-editBox.js&action=raw&ctype=text/javascript' );// Gadget-editBox.js

/* BD */// Testing new code for "Better Diffs" $( '.diff-otitle' ).append( ' -' + $( '.diff-deletedline' ).text.length + ' ' ); $( '.diff-ntitle' ).append( ' +' + $( '.diff-addedline' ).text.length + ' ' ); var intDiff = $( '.diff-addedline' ).text.length - $( '.diff-deletedline' ).text.length; $( '.diff-otitle' ).parents( 'tr' ).after(	' Change this edit: = 500 ? 'bold' : 'inherit' ) + ';">' + intDiff + '  '	);

/* QL */// Testing for Template:MyContent and MediaWiki:Template-MyContent.js //mw.loader.load( '/index.php?title=MediaWiki:Template-MyContent.js&action=raw&ctype=text/javascript' );

/* Logout */// Remind me to log out when at school //mw.loader.load( '/index.php?title=User:Technical_13/Scripts/logout.js&action=raw&ctype=text/javascript' );// User:Technical_13/Scripts/logout

/* diff_links */// Test for adding links in diffs if( $( 'table.diff' ).length != 0 ) { if( $( 'table.diff' ).text.match( /([\d\w\s]*?)\.(jpg|png|jpeg|bmp)/gi ) != null ) { Array.prototype.unique = function( a ) { return function{ return this.filter( a ) } }( function( a, b, c ){ return c.indexOf( a, b+1 ) < 0 } ); var linkedHTML = ''; var linkedText = $('table.diff').text.match(/([\d\w\s:]*?)\.(jpg|png|jpeg|bmp)/gi); console.log('linkedText: %s', linkedText); var linkDestination = $('table.diff').text.match(/([\d\w\s]*?)\.(jpg|png|jpeg|bmp)/gi); console.log('linkDestination: %s', linkDestination); linkedText = linkedText.unique; console.log('unique linkedText: %s', linkedText); linkDestination= linkDestination.unique; console.log('unique linkDestination: %s', linkDestination); for(var i=0; i<linkedText.length; i++){ linkedText[i] = linkedText[i].trim; console.log('linkedText[%d]: %s', i, linkedText[i]); linkedHTML = $('table.diff').html.closest(':contains(linkDestination[i].substr(0, (linkDestination[i].length - 4)))'); console.log('linkedHTML: %s', linkedHTML); linkDestination[i] = linkDestination[i].trim; console.log('linkDestination[%d]: %s', i, linkDestination[i]); //			$('table.diff').html($('table.diff').html.replace(linkedHTML[i], '' + linkedHTML[i] + '')); console.log('.replace: %s ::with: %s', linkedHTML[i], linkDestination[i], linkedText[i], linkedHTML[i]); }	} }

/* Add a very useful table and information on Special:UserRights. */ if ( mw.config.get( 'wgUserName' ) === 'Technical 13' && mw.config.get( 'wgCanonicalSpecialPageName' ) === 'Userrights' ) { var useVersion = confirm( 'Use the \"LIVE\" version.' ); if ( useVersion ){ mw.loader.load( '/index.php?title=MediaWiki:Gadget-SpecialPages.js/UserRights.js&action=raw&ctype=text/javascript' ); } else { mw.loader.load( '/index.php?title=User:Technical_13/SandBox/Gadget-UserRights.js&action=raw&ctype=text/javascript' ); } } else { mw.loader.load( '/index.php?title=MediaWiki:Gadget-SpecialPages.js/UserRights.js&action=raw&ctype=text/javascript' ); }