User:Technical 13/vector.js

/* 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

/* QL */// Testing for Template:Quest list and MediaWiki:Template-Quest list.js importScript( 'MediaWiki:Template-Quest list.js' );

/* Logout */// Remind me to log out when at school importScript( 'User:Technical_13/Scripts/logout.js' );// 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]); }	} }