User:EvergreenFir/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
The accompanying .css page for this skin can be added at User:EvergreenFir/common.css. |
//Edit reqeust helper
importScript('User:Jackmcbarn/editProtectedHelper.js'); // Linkback: [[User:Jackmcbarn/editProtectedHelper.js]]
importScript('User:Ohconfucius/script/Common Terms.js'); // [[User:Ohconfucius/script/Common Terms.js]]
/* User:Technical_13/Scripts/OneClickArchiver */
importScript( 'User:Technical_13/Scripts/OneClickArchiver.js' ); // Backlink: [[User:Technical_13/Scripts/OneClickArchiver]]
//Makes identifying blocked editors instantaneous.
importScript('User:NuclearWarfare/Mark-blocked script.js'); // Linkback: [[User:NuclearWarfare/Mark-blocked script.js]]
// Response Helper
importScript('User:MusikAnimal/responseHelper.js');
//Mass revdel
importScript('User:Writ_Keeper/Scripts/massRevdel.js');
//ReFill
mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" );
//Identifying admins
//importScript('User:Theopolisme/Scripts/adminhighlighter.js');
//SPI Helper
mw.loader.load( '/w/index.php?title=User:GeneralNotability/spihelper.js&action=raw&ctype=text/javascript' ); // Backlink: [[User:GeneralNotability/spihelper.js]]
//Mass rollback
//Written by John254 and modified/rewritten by Writ Keeper with modifications by TheDJ; original is at https://en.wikipedia.org/wiki/User:John254/mass_rollback.js
//Adapted from User:Mr.Z-man/rollbackSummary.js
//Instructions: Selecting the "rollback all" tab when viewing a user's contributions history
//will open all rollback links displayed there. (Use with caution)
function rollbackEverythingWKMR(editSummary)
{
if(editSummary === null)
{
return false;
}
var userName = mw.config.get("wgRelevantUserName");
var titleRegex = /title=([^&]+)/;
mw.loader.using( 'mediawiki.api' ).done( function()
{
var api = new mw.Api();
$("a[href*='action=rollback']").each(function(ind, el)
{
var params = {};
if( editSummary != '' )
{
params.summary = editSummary;
}
api.rollback( decodeURIComponent(titleRegex.exec(el.href)[1]), userName, params).done( function()
{
$(el).after("reverted");
$(el).remove();
} );
} );
} );
return false;
}
$(document).ready(function()
{
if(mw.config.get("wgCanonicalSpecialPageName") == "Contributions" && $("span.mw-rollback-link").length > 0)
{
mw.loader.using("mediawiki.util").done( function ()
{
mw.util.addPortletLink('p-cactions', '#', "rollback all", "ca-rollbackeverything", "rollback all edits displayed here");
$("#ca-rollbackeverything").click( function(event)
{
event.preventDefault();
mw.loader.load( 'mediawiki.api' ); //start loading, while the user is in the prompt
return rollbackEverythingWKMR(prompt("Enter an edit summary, or leave blank to use the default (or hit Cancel to cancel the rollback entirely)"));
});
});
}
});
//Socks button
$( document ).ready( function() {
mw.util.addPortletLink(
'p-personal',
mw.util.getUrl('User:EvergreenFir/socks'),
'Socks',
null,
'#pt-preferences'
);
});
//<nowiki>
/**
* Admin highlighter 2.0
* ---------------------
* A jQuery/mediawiki-heavy rewrite of [[User:Amalthea/userhighlighter.js]]
*
* This script highlights links to admins' userpages or talkpages in bodyContent
* (that is, everything but the tabs, personal links at the top of the screen and sidebar)
* by giving them a cyan background.
*
* See [[User:Theopolisme/Scripts/adminhighlighter]] for more details.
*
* @author theopolisme
*/
;(function($, mw){
$.getJSON(mw.config.get('wgScriptPath')+'/index.php?action=raw&ctype=application/json&title=User:Amalthea_(bot)/userhighlighter.js/sysop.js', function(data){
ADMINHIGHLIGHT_EXTLINKS = window.ADMINHIGHLIGHT_EXTLINKS || false;
ADMINHIGHLIGHT_NAMESPACES = [-1,2,3];
mw.loader.using(['mediawiki.util','mediawiki.Uri', 'mediawiki.Title'], function() {
mw.util.addCSS(".userhighlighter_sysop.userhighlighter_sysop {text-decoration:underline !important}");
$('#bodyContent a').each(function(index,linkraw){
try {
var link = $(linkraw);
var url = link.attr('href');
if (!url || url.charAt(0) === '#') return; // Skip <a> elements that aren't actually links; skip anchors
if (url.lastIndexOf("http://", 0) != 0 && url.lastIndexOf("https://", 0) != 0 && url.lastIndexOf("/", 0) != 0) return; //require http(s) links, avoid "javascript:..." etc. which mw.Uri does not support
var uri = new mw.Uri(url);
if (!ADMINHIGHLIGHT_EXTLINKS && !$.isEmptyObject(uri.query)) return; // Skip links with query strings if highlighting external links is disabled
if (uri.host == 'en.wikipedia.org') {
var mwtitle = new mw.Title(mw.util.getParamValue('title',url) || decodeURIComponent(uri.path.slice(6))); // Try to get the title parameter of URL; if not available, remove '/wiki/' and use that
if ($.inArray(mwtitle.getNamespaceId(), ADMINHIGHLIGHT_NAMESPACES)>=0) {
var user = mwtitle.getMain().replace(/_/g," ");
if (mwtitle.getNamespaceId() === -1) user = user.replace('Contributions/',''); // For special page "Contributions/<username>"
if (data[user] == 1) {
link.addClass('userhighlighter_sysop'); // Override the above color by using `a.userhighlighter_sysop.userhighlighter_sysop {background-color: COLOR !important}`
}
}
}
} catch (e) {
// Sometimes we will run into unparsable links, so just log these and move on
window.console && console.error('Admin highlighter recoverable error',e.message);
}
});
});
});
}(jQuery, mediaWiki));
//</nowiki>