User:Guywan/Scripts/HistoryHighlight.js

// Category:Wikipedia scripts

//

$(function()

{

if(mw.config.get("wgCanonicalSpecialPageName") == "Contributions")

{

// Set the username in local storage.

mw.cookie.set("hh-username", mw.config.get("wgRelevantUserName"));

}

else if(mw.config.get("wgAction") == "history" && mw.cookie.get("hh-username"))

{

// Highlight edits performed by the username in storage.

var username = mw.cookie.get("hh-username");

var colour = window.hh_highlight === undefined ? "lightgreen" : window.hh_highlight;

$("#pagehistory li").each(function()

{

if(username == $(".history-user a bdi", this).html())

{

$(this).css("background-color", colour);

}

});

}

});

//