User:Internoob/colour.js

/* This will import a stylesheet for only the main namespace and Appendices of terms. */

var baseOfPage = wgPageName.indexOf("/"); // what position (in numbers) is the / in the pagename

if (baseOfPage == -1) { //if there's no / in the page name baseOfPage = wgPageName.length; }

var nameOfPage = wgPageName.slice(0, baseOfPage); //the page name up to and not including the /

// make a list of appendices where the stylesheet is to be included var listOfAppendices = [ "Appendix:A_Programming_Language", "Appendix:Hyper_Text_Markup_Language", "Appendix:Brave_New_World", "Appendix:DC_Comics", "Appendix:Harry_Potter", "Appendix:Marvel_Comics", "Appendix:Pokémon", "Appendix:Star_Trek", "Appendix:Star_Wars", "Appendix:Tolkien's_legendarium", "Appendix:Unsupported_titles" ]

for (a in listOfAppendices) { if (wgNamespaceNumber == 0 || listOfAppendices[a] == nameOfPage ) { //main namespace or one of the list importStylesheet("User:Internoob/colour.css"); break; } }

importStylesheet("User:Internoob/colour1.css"); //this stuff goes on all pages