User:DDOstream/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

/* RC long dates */ $( 'div.mw-changeslist h4' ).each( function( n, h4date ) { var arrDaysOfWeek = [ 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday' ];  var strDate = h4date.innerText;  h4date.innerText = arrDaysOfWeek[ ( new Date( strDate ) ).getDay ] + ', ' + strDate; } );

/* De-orpahaning script */ importScript( 'User:Technical_13/SandBox/DeOrphaner.js' );//User:Technical_13/SandBox/DeOrphaner.js

/* NOW LIVE */ importScript( 'User:DDOstream/LiveStream.js' );//User:DDOstream/LiveStream.js

// importScript( 'MediaWiki:Gadget-delete.js' );//MediaWiki:Gadget-delete.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 + '   '  );

/* fixes for T:Unique enchantment changes */ // $( document ).ready( function { var pageid = mw.config.get( 'wgArticleId' );  var editSummary = 'Modifications for changes in  T:Unique enchantment';  var pageContent = '';  mw.util.addPortletLink( 'p-tb-list', '#',   'Fix Enchantments', 'ca-fix-ue', 'Update for modifications to T:Unique enchantment', null, null ); $( '#ca-fix-ue' ).click( function ( e ) { e.preventDefault; new mw.Api.get( {     action: 'query',      prop: 'revisions|info',      rvprop: 'content',      pageids: pageid,      indexpageids: 1    } ).done( function ( pageResponse ) {      pageContent = pageResponse.query.pages[ pageid ].revisions[ 0 ][ '*' ];      pageContent = pageContent        .replace( /[\s\r\n]*?\{\{Unique[ _]enchantment/gi, '{{Unique enchantment' )        .replace( /[\s\r\n]*?\| *?name *?= *?/g,   '\n  | name   = ' )        .replace( /[\s\r\n]*?\| *?effect *?= *?/g, '\n  | effect = ' )        .replace( /[\s\r\n]*?\| *?found *?= *?/g,  '\n  | found  = ' )        .replace( /[\s\r\n]*?\| *?note *?= *?/g,   '\n  | note   = ' )        .replace( /\[http:\/\/forums\.ddo\.com\/showthread\.php\?t=([\d]*)(.*?)\]/, '{{Forums|$1}}' )        .replace( /={1} */g,                                   '\= ' )        .replace( /[\s\r\n]*?\}\}\{\{/g,                  '\n}}\n', nextTemplateStart + 2 ); founds++; } else { if ( founds > 1 ) { alert( '\t\t|found=\t\t\n\nOkay, I won\'t remove any more "found" line(s)' ); } else { alert( '\t\t|found=\t\t\n\nOkay, I won\'t remove any "found" line(s)' ); }         break; }     }      new mw.Api.postWithToken( 'edit', {        action: 'edit',        pageid: pageid,        text: pageContent,        summary: editSummary      } ).done( function ( tagged ) {         if ( tagged.edit.result === 'Success' ) {          alert( 'Page was updated!' );          location.href = location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'diff=last';       } else {          alert( 'Page was NOT updated!' );        }      } ); // console.log( pageContent ); } ); } ); } ); //