User:ToolWiki23/vector.js: Difference between revisions

Content deleted Content added
Created page with '//<nowiki> (function() { var nighttime, cssLoaded; mw.loader.using('jquery.jStorage', function() { mw.util.addPortletLink("p-personal", "#", "Nightpedia",...'
 
Blanked the page
Line 1:
//<nowiki>
(function() {
var nighttime, cssLoaded;
mw.loader.using('jquery.jStorage', function() {
mw.util.addPortletLink("p-personal", "#", "Nightpedia", "pt-nightpedia", "", "np", "#pt-watchlist");
var nighttime = $.jStorage.get("nightpediaTime") === "nighttime",
cssLoaded = nighttime ? lightsOff() : false;
});
 
$("#pt-nightpedia").on("click", function(e) {
e.preventDefault();
nighttime = !nighttime;
if(nighttime) {
lightsOff();
} else {
lightsOn();
}
});
 
function lightsOn() {
$("body").removeClass("nighttime");
$("#pt-nightpedia a").text("Nightpedia");
$.jStorage.set("nightpediaTime", "daytime");
}
function lightsOff() {
if(!cssLoaded) importStylesheet("User:MusikAnimal/nightpedia.css");
$("body").addClass("nighttime");
$("#pt-nightpedia a").text("Daypedia");
$.jStorage.set("nightpediaTime", "nighttime");
return true;
}
}());
//</nowiki>