User:Labgo/shellhelper.js

// addOnloadHook( function { alert("OK"); if(getElementById('toolbar')) {       var di = document.getElementById('toolbar');        var newselect = document.createElement("select");        newselect.setAttribute('name', "Shells");        newselect.setAttribute('onchange', "AddShell");

var newoption = document.createElement("option"); newoption.setAttribute('value', "Empty"); newoption.innerText="==Select a shell to insert==";

var newoption1 = document.createElement("option"); newoption1.setAttribute('value', "Character"); newoption1.innerText="Character shell";

var newoption2= document.createElement("option"); newoption2.setAttribute('value', "Cast"); newoption2.innerText="Cast shell";

var newoption3 = document.createElement("option"); newoption3.setAttribute('value', "Transcript"); newoption3.innerText="Transcript shell";

var newoption4 = document.createElement("option"); newoption4.setAttribute('value', "Episode"); newoption4.innerText="Episode shell";

var newoption5 = document.createElement("option"); newoption5.setAttribute('value', "Talk"); newoption5.innerText="Talk page";

var newoption6 = document.createElement("option"); newoption6.setAttribute('value', "Theory"); newoption6.innerText="Theory page";

newselect.appendChild(newoption); newselect.appendChild(newoption1); newselect.appendChild(newoption2); newselect.appendChild(newoption3); newselect.appendChild(newoption4); newselect.appendChild(newoption5); newselect.appendChild(newoption6); di.appendChild(newselect); } } );

function AddShell {   if (document.getElementById("wpTextbox1").innerText == "") { switch (Shells.value) { case "Character": document.getElementById("wpTextbox1").innerText = "\n\ \n\

About
\n\ \n\

Appearances
\n\ \n\

Trivia
\n\ \n\

Quotes
\n\ \n\ \n\ \n\

Unanswered Questions
";               break;            case "Cast":                document.getElementById("wpTextbox1").innerText = "\n";                break;            case "Transcript":                document.getElementById("wpTextbox1").innerText = "\n\ Please see guidelines for transcripts\n\

\n\

PROLOGUE
\n\ \n\

ACT I
\n\ \n\

ACT II
\n\ \n\

ACT III
\n\ \n\

ACT IV
\n\ \n\

ACT V
\n\ \n\ \n";               break;            case "Episode":                document.getElementById("wpTextbox1").innerText = "\n\ \n\

Introduction
\n\ \n\ \n\ \n\ \n\ \n\ \n\

Synopsis
\n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\ \n\

Unanswered Questions
\n\ \n\ \n\ \n";

break; case "Talk": document.getElementById("wpTextbox1").innerText = ""; break; case "Theory": document.getElementById("wpTextbox1").innerText = ""; break; }   } } //