VOOZH about

URL: https://meta.wikimedia.org/w/index.php?diff=11633255

⇱ User:Quentinv57/global.js: Difference between revisions - Meta-Wiki


Jump to content
From Meta, a Wikimedia project coordination wiki
Content deleted Content added
m -
updated scripts
Line 6: Line 6:
// Functions
// Functions
function userIsInGroup (group) {
function userIsInGroup (group) {
//are they in a given local group?
//are they in a given local group?
if (wgUserGroups) {
if (wgUserGroups) {
if (!group || group.length == 0) group = '*';
if (!group || group.length == 0) group = '*';
if (wgUserGroups.join (' ').indexOf (group) != -1){
if (wgUserGroups.join (' ').indexOf (group) != -1){
return true;
return true;
}
}
else{
else{
return false;
return false;
}
}
Line 20: Line 20:


function importAnyScript(lang,family,script) {
function importAnyScript(lang,family,script) {
importScriptURI('//' + encodeURIComponent(lang) + '.' + encodeURIComponent(family) + '.org/w/index.php?title=' + encodeURIComponent(script) + '&action=raw&ctype=text/javascript');
//use importScriptURI with the full-qualified source, else importScript(); runs in the context of the remote wiki, finding nothing.
importScriptURI('http://'
+ encodeURIComponent(lang) + '.'
+ encodeURIComponent(family) + '.org/w/index.php?title='
+ encodeURIComponent(script) + '&action=raw&ctype=text/javascript');
}
}


Line 45: Line 41:


// Scripts by Pathoschild
// Scripts by Pathoschild
/**
importAnyScript('meta','wikimedia','User:Pathoschild/Scripts/Force ltr.js');
* Forces left-to-right layout and editing on RTL wikis.
importAnyScript('meta','wikimedia','User:Pathoschild/Scripts/Ajax_sysop.js');
* @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
* @update-token [[File:pathoschild/forceltr.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js');

/**
* Ajax sysop
* @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
* @update-token [[File:pathoschild/ajaxsysop.js]]
*/
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');


// Scripts by Erwin
// Scripts by Erwin
Line 65: Line 72:


/*
/*
if (userIsInGroup('oversight') && location.href.match(/&action=delete/))
if (userIsInGroup('oversight') && location.href.match(/&action=delete/))
document.getElementById(''). = ;
{
document.getElementById(''). = ;
document.getElementById(''). = ;
document.getElementById('wpDeleteReasonList').innerHTML = '<option value="other">Other reason</option><optgroup label="Libellous informations"><option value="remove libellous information">remove libellous information</option><optgroup label="Private data"><option value="remove non-public identifying or personal informations">remove non-public identifying or personal informations</option><option value="remove personal informations">remove personal informations</option>';
document.getElementById(''). = ;
document.getElementById('wpDeleteReasonList').innerHTML = '<option value="other">Other reason</option><optgroup label="Libellous informations"><option value="remove libellous information">remove libellous information</option><optgroup label="Private data"><option value="remove non-public identifying or personal informations">remove non-public identifying or personal informations</option><option value="remove personal informations">remove personal informations</option>';
}
}
*/
*/

Revision as of 03:54, 20 March 2015

/* Global JavaScript
 Functions userIsInGroup() and userIsInGlobalGroup() and importAnyScript() by Mike.lifeguard
 Function IsGlobalSysopWiki() by me (feel free to copy or modify)
*/
// Functions
functionuserIsInGroup(group){
//are they in a given local group?
if(wgUserGroups){
if(!group||group.length==0)group='*';
if(wgUserGroups.join(' ').indexOf(group)!=-1){
returntrue;
}
else{
returnfalse;
}
}
returnfalse;
}
functionimportAnyScript(lang,family,script){
importScriptURI('//'+encodeURIComponent(lang)+'.'+encodeURIComponent(family)+'.org/w/index.php?title='+encodeURIComponent(script)+'&action=raw&ctype=text/javascript');
}
/************************************
 Importing scripts
************************************/
// Scripts by Mike.lifeguard
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/modRollback.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/regexliFilter.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/rangeContribs.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/autoDelete.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/blockOptions.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/enhancedUndelete.js');
importAnyScript('meta','wikimedia','User:Mike.lifeguard/massBlock.js');
// Scripts by Pathoschild
/**
 * Forces left-to-right layout and editing on RTL wikis.
 * @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
 * @update-token [[File:pathoschild/forceltr.js]]
 */
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js');
/**
 * Ajax sysop
 * @see https://github.com/Pathoschild/Wikimedia-contrib#user-scripts
 * @update-token [[File:pathoschild/ajaxsysop.js]]
 */
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');
// Scripts by Erwin
importAnyScript('meta','wikimedia','User:Erwin/xwikirollback.js');
importAnyScript('meta','wikimedia','User:Erwin/stewardlinks.js');
// Scripts by MarcoAurelio
importAnyScript('meta','wikimedia','User:MarcoAurelio/xwikiblock.js');
importAnyScript('meta','wikimedia','User:MarcoAurelio/bpi.js');
// Scripts by Hoo man
importAnyScript('meta','wikimedia','User:Hoo_man/tagger.js');
importAnyScript('meta','wikimedia','User:Hoo_man/active_sysops.js');
importAnyScript('meta','wikimedia','User:Hoo_man/smart_rollback.js');
// Scripts by myself
importAnyScript('meta','wikimedia','User:Quentinv57/HideButtonsFromNonGsProjects.js');
/*
if (userIsInGroup('oversight') && location.href.match(/&action=delete/)) {
	document.getElementById('wpReason').value = null;
	document.getElementById('wpSuppress').checked = true;
	document.getElementById('wpDeleteReasonList').innerHTML = '<option value="other">Other reason</option><optgroup label="Libellous informations"><option value="remove libellous information">remove libellous information</option><optgroup label="Private data"><option value="remove non-public identifying or personal informations">remove non-public identifying or personal informations</option><option value="remove personal informations">remove personal informations</option>';
}
*/