ᱵᱮᱵᱷᱟᱨᱤᱭᱟᱹ:Sadhuguru/nightpedia.js
ᱧᱮᱛᱮᱞ: ᱨᱩᱠᱷᱤᱭᱟᱹ ᱦᱩᱭ ᱠᱟᱛᱮ, ᱟᱢᱟᱜ ᱵᱨᱟᱣᱡᱚᱨ ᱠᱮᱪ ᱵᱟᱭᱯᱟᱥ ᱦᱩᱭᱩᱜ ᱛᱟᱢᱟ ᱚᱫᱚᱞ ᱠᱚ ᱧᱮᱞ ᱞᱟᱹᱜᱤᱫ ᱾
- ᱯᱷᱟᱭᱟᱨᱯᱷᱚᱠᱥ / ᱥᱟᱯᱷᱟᱨᱤ: 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: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
//<nowiki>
$(function() {
var nighttime = 'on' === mw.storage.get('nightpedia'),
cssLoaded = nighttime ? lightsOff() : false;
mw.util.addPortletLink('p-personal', '#', nighttime ? 'Daypedia' : 'Nightpedia', 'pt-nightpedia', '', 'np', '#pt-watchlist');
$('#pt-nightpedia').on('click', function(e) {
e.preventDefault();
nighttime = !nighttime;
if (nighttime) {
lightsOff();
} else {
lightsOn();
}
});
function lightsOn() {
$('html').removeClass('nighttime');
$('#pt-nightpedia a').text('Nightpedia');
mw.storage.set('nightpedia', 'off');
}
function lightsOff() {
if(!cssLoaded) {
$('head').append(mw.loader.load('https://en.wikipedia.org/w/index.php?title=User:MusikAnimal/nightpedia.css&action=raw&ctype=text/css', 'text/css'));
}
$('html').addClass('nighttime');
$('#pt-nightpedia a').text('Daypedia');
mw.storage.set('nightpedia', 'on');
return true;
}
});
//</nowiki>