User:Alien333/common.js

/* global $, mw */ "use strict"; importScript("User:Alien333/poemise.js"); importScript("User:Alien333/nobr.js"); importScript("User:Alien333/clean.js"); importScript("User:Alien333/dab.js"); importScript("User:Alien333/cuts.js"); mw.loader.load('//en.wikisource.org/w/index.php?title=User:Inductiveload/popups reloaded.js&action=raw&ctype=text/javascript'); // these look cool mw.loader.load("//en.wikisource.org/w/index.php?title=User:Inductiveload/popups_reloaded.css&action=raw&ctype=text/css", 'text/css'); mw.loader.using(['mediawiki.util'], => {

$( => {    if ($.inArray(mw.config.get('wgAction'), ['edit', 'submit']) < 0) { // if not editing        return;    }    if (mw.config.get('wgCanonicalNamespace') == '' && mw.config.get("wgPageName").search("/") != -1 && mw.config.get("wgUserName") == "Alien333" && $("#firstHeading")[0].innerHTML.search("Creating") != -1) { // too specific stuff    	mainspacetricks;    }  }); });

var transclude = "include= "; // type of transclusion function mainspacetricks { var l = $('#wpTextbox1').val; var name = mw.config.get("wgPageName").split("/")[0].replaceAll("(", "").replaceAll(")", "").replaceAll("_", " "); // again, my own naming conventions for indexes if (name.slice(0,6) == "Poems ") { l = l.replace("../", "Poems");// I usually do works titled Poems (author name), this keeps me from having to add |Poems for every single subpage [[../	}	l = l.replace("| previous  = \n", "| previous   = [[../\n");	l = l.replace("| next       = \n", "| next       = [[../\n");	if (l.search("';	}	$("#wpTextbox1").val(l); }