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
This is an old revision of this page, as edited by imported>Ed Lolington at 07:29, 7 October 2012. It may differ significantly from the current revision.
Jump to navigationJump 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>" );
    });

}