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: Difference between revisions

From Encyclopedia Dramatica
Jump to navigation Jump to search
imported>Ed Lolington
No edit summary
imported>Ed Lolington
No edit summary
 
(One intermediate revision by the same user not shown)
(No difference)

Latest revision as of 07:29, 7 October 2012

/* 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>" );
    });

}