Registration has been disabled and the moderation extension has been turned off.
Contact an admin on Discord or EDF if you want an account. Also fuck bots.

User:Ed Lolington/vector.js

From Encyclopedia Dramatica
Jump to navigation Jump to search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Adds "Contributions" button to userpages
 * @author ED_Lolington
 */

function doWaitJQ( func ){
 
    if( window.$ ){
        func();
    } else {
        window.setTimeout( doWaitJQ( func ), 50 );
    }
    
}

doWaitJQ( function () { console.log( "Dongs" ); } );

//var userpageMatch = /https?:\/\/(?:www\.)?encyclopediadramatica.se\/(?:index.php\?title=)?User(?:_talk)?:(.+)\/?&?.+?/gi;
//userpageMatch.compile();

var groupsMatched = /https?:\/\/(?:www\.)?encyclopediadramatica.se\/(?:index.php\?title=)?User(?:_talk)?:(.+)(?:\/?&?.+?)?/gi.exec( document.location );
var userName      = groupsMatched[1];

//Debug
console.log( "User Name: " + userName );

if( userName != undefined ){

    //Add to #p-namespaces > ul
    doWaitJQ( function () {
        $( "#p-namespaces > ul" ).append( "<li id=\"ca-contribs\"><a href=\"/Special:Contributions/" + userName + "\" title=\"This user's contributions [alt+c]\" accesskey=\"c\" ><span>Contributions</span></a></li>" );
    });

}