User:Sherurcij/monobook.js

// /* Preload Template:Header2 when adding a new text */ function preloadHeaderTemplate {   var wpTextbox1 = document.getElementById("wpTextbox1") if (wpTextbox1.value == "") {       //fill in header template var isSubpage = wgTitle.indexOf("/") != -1 var subpageDepth = 0 var subpageTitle var subpageTitleRegExp var rawBasePageRequest //title var wpTextbox1value = "\n\n" } }

/* Preload Template:Textinfo when starting a discussion page */ function preloadTextinfoTemplate {   var wpTextbox1 = document.getElementById("wpTextbox1") if (wpTextbox1.value == "") {       wpTextbox1.value = "\n" } }

/* Preload Template:Author when starting an author page */ function preloadAuthorTemplate {   var wpTextbox1 = document.getElementById("wpTextbox1") if (wpTextbox1.value == "") {       wpTextbox1.value = "\n\n==Works==\n\n" } }

if (wgAction == "edit") {   switch (wgNamespaceNumber) {       case 0: //main addOnloadHook(preloadHeaderTemplate) break case 1: //Talk addOnloadHook(preloadTextinfoTemplate) break case 102: //Author addOnloadHook(preloadAuthorTemplate) } } //