Jump to content

User:Roland zh/common.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
if(mw.config.get('wgAction') == 'edit') {
    addOnloadHook(function minorEdit() {
       addHandler(document.getElementById('wpMinoredit'), 'change', minorEdit_change);
       if (document.cookie.indexOf("minorEdit=true")!=-1) {document.getElementById('wpMinoredit').checked = true };
    } )
}
 
function minorEdit_change() {
    var e = new Date();
    e.setTime( e.getTime() + (24*60*60*1000) ); // one day
    document.cookie = 'minorEdit='+document.getElementById('wpMinoredit').checked+';expires=' + e.toGMTString();
}
window.catALotPrefs = {editpages:  true};
mw.loader.using(['mediawiki.util'], function(){
  mw.loader.load('//commons.wikimedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-Cat-a-lot.js');
  importStylesheetURI('//commons.wikimedia.org/w/index.php?action=raw&ctype=text/css&title=MediaWiki:Gadget-Cat-a-lot.css');
});

//<nowiki>
//catALot///////////////////////////////////////
mw.loader.using(['mediawiki.util'], function(){
	mw.loader.load('//commons.wikimedia.org/w/load.php?modules=ext.gadget.Cat-a-lot');
});
////////// Cat-A-Lot user preferences //////////
window.catALotPrefs = {"watchlist":"preferences","minor":true,"editpages":true,"docleanup":false,"subcatcount":10};
////////////////////////////////////catALotEnd//
//</nowiki>