User:Techie3/common.js: Difference between revisions
Appearance
Content deleted Content added
Installing User:Enterprisey/reply-link.js (script-installer) |
Installing User:Jackmcbarn/advancedtemplatesandbox.js (script-installer) |
||
Line 26: | Line 26: | ||
}); |
}); |
||
importScript('User:Enterprisey/reply-link.js'); // Backlink: [[User:Enterprisey/reply-link.js]] |
importScript('User:Enterprisey/reply-link.js'); // Backlink: [[User:Enterprisey/reply-link.js]] |
||
importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Backlink: [[User:Jackmcbarn/advancedtemplatesandbox.js]] |
Revision as of 08:54, 21 October 2020
var AutoEd_baseurl = 'http://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedia:AutoEd/';
if (location.protocol === 'https:') {
AutoEd_baseurl = 'https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=Wikipedia:AutoEd/';
}
autoEdMinor = false;
//Sets variable configuration
autoEdTag = "Adjacent Stations using [[WP:AutoEd|AutoEd]]"; //Tweaks edit summary
autoEdLinkName = "Adjacent Stations"; //Changes the link name at the top of the page
function adjacentStation(str){
test = '$1\n{{subst:'+'#invoke:Adjacent stations|convert|$2}}'
str = str.replace(/(\| *(?:services|other_services) *=)((?:\s*\{\{.+\}\})+)/,test);
return str;
}
function autoEdFunctions() { //Activates individual modules when "auto ed" tab is clicked
var $textbox = $( '#wpTextbox1' );
var txt = $textbox.textSelection('getContents');
txt = txt.replace(/\|\s*system\s*=\s*Victoria/g,"|system = Melbourne")
txt = adjacentStation(txt);
$textbox.textSelection('setContents', txt);
}
$.when( $.ready, mw.loader.using( 'jquery.textSelection' ) ).then(function() {
importScriptURI(AutoEd_baseurl + 'core.js'); //Imports the "framework" script needed to make this function
});
importScript('User:Enterprisey/reply-link.js'); // Backlink: [[User:Enterprisey/reply-link.js]]
importScript('User:Jackmcbarn/advancedtemplatesandbox.js'); // Backlink: [[User:Jackmcbarn/advancedtemplatesandbox.js]]