User:Kanonkas/common.js
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: 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 / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
function userIsInGroup (group) {
return $.inArray(group, mw.config.get('wgUserGroups')) != -1;
}
function userIsInGlobalGroup (group) {
return $.inArray('*', mw.config.get('wgGlobalGroups')) != -1
}
function importAnyScript(lang,family,script) {
mw.loader.load('//' + encodeURIComponent(lang) + '.' + encodeURIComponent(family) + '.org/w/index.php?title=' + encodeURIComponent(script) + '&action=raw&ctype=text/javascript');
}
importAnyScript('meta','wikimedia','User:Mike.lifeguard/sixTabs.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/addTools.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/removeSpam.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/regexliFilter.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/rangeContribs.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/fixCompare.js');
/**
* Ajax sysop
* @see https://meta.wikimedia.org/wiki/Ajax_sysop
* @update-token [[File:pathoschild/ajaxsysop.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Kanonkas/amelvand.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Kanonkas/rollback.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Kanonkas/revert.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Lupin/popups.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Splarka/ajaxmassrollback.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org//index.php?title=User:Splarka/quicktag.js&action=raw&ctype=text/javascript');
/**
* TemplateScript adds configurable templates and scripts to the sidebar, and adds an example regex editor.
* @see https://meta.wikimedia.org/wiki/TemplateScript
* @update-token [[File:pathoschild/templatescript.js]]
*/
// <nowiki>
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
pathoschild.TemplateScript.add([
{ name:'welcome', template:'{{subst:sb}}\nThanks, --~~~~', editSummary:'Please use the sandbox' },
{ name:'Test 1', template:'{{subst:test1}}\n--~~~~', editSummary:'Your recent test edit(s)' },
{ name:'Test 2', template:'{{subst:test2}}\n--~~~~', editSummary:'Please stop' },
{ name:'Test 3', template:'{{subst:test3}}\n--~~~~', editSummary:'Warning' },
{ name:'Test 4', template:'{{subst:test4}}\n--~~~~', editSummary:'Final warning' },
{ name:'Vandal', template:'{{subst:bw}}\n--~~~~', editSummary:'Only warning' },
{ name:'Scope', template:'{{subst:scope}}\n--~~~~', editSummary:'Notice regarding our project scope' },
{ name:'Not wikipedia', template:'{{subst:welcome}}\n\n{{subst:not an encyclopedia}}\n--~~~~', editSummary:'welcome, +note' },
{ name:'File warning', template:'{{subst:welcome}}\n--~~~~\n==images==\n{{subst:upload warning}}\n--~~~~', editSummary:'welcome, +images' },
{ name:'Spam', template:'{{subst:spam|1=}}\n--~~~~', editSummary:'no advertising please' },
{ name:'Personal attack', template:'{{subst:attack|1=}}\n--~~~~', editSummary:'personal attacks are not accepted' }
]);
});
// </nowiki>
importScript('User:Kanonkas/SBHandler.js');
SBHandlerAddComment = ':{{Added}} ~~'+'~~';
SBHandlerRemComment = ':{{Removed}} ~~'+'~~';
SBHandlerRevComment = ':{{Reverted}} ~~'+'~~';
SBHandlerDecComment = ':{{Declined}} ~~'+'~~';
SBHandlerCloseComment = ':{{Closing}} ~~'+'~~';
importScript('User:Kanonkas/customEditButtons.js');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Splarka/ajaxmassrollback.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Kanonkas/quicktag.js&action=raw&ctype=text/javascript');