Hilfe:JavaScript: Unterschied zwischen den Versionen

Aus Stupidedia, der sinnfreien Enzyklopädie!
Wechseln zu: Navigation, Suche
(Beispiel eines vector.js für "Einsteiger")
K (Beispiel eines vector.js für "Einsteiger")
Zeile 49: Zeile 49:
 
Die "Namen" der einzelnen Elemente auf einer Seite findest du entweder im Quelltext, mit einem DOM-Inspektor, oder (wenn du bei keinem von beiden weißt, worum es sich handelt): auf einer Liste, die hier in naher Zukunft zu finden sein wird.
 
Die "Namen" der einzelnen Elemente auf einer Seite findest du entweder im Quelltext, mit einem DOM-Inspektor, oder (wenn du bei keinem von beiden weißt, worum es sich handelt): auf einer Liste, die hier in naher Zukunft zu finden sein wird.
  
== Beispiel eines vector.js für "Einsteiger" ==
+
== Beispiel einer vector.js für "Einsteiger" ==
  
 
<syntaxhighlight lang="javascript">
 
<syntaxhighlight lang="javascript">
Zeile 122: Zeile 122:
  
 
function Conflict() {
 
function Conflict() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{Conflict}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Conflict}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Conflict|Es gibt einen Konflikt]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Conflict|Es gibt einen Konflikt]]";
 
}
 
}
  
 
function InterneLinks() {
 
function InterneLinks() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{IL}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{IL}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:IL|Interne Links hinzufügen/korrigieren!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:IL|Interne Links hinzufügen/korrigieren!]]";
 
}
 
}
  
 
function KK() {
 
function KK() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{KK}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{KK}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:KK|Kategorien hinzufügen/korrigieren!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:KK|Kategorien hinzufügen/korrigieren!]]";
 
}
 
}
  
 
function Rechtschreibung() {
 
function Rechtschreibung() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{R}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{R}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:R|Rechtschreibung inakzeptabel!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:R|Rechtschreibung inakzeptabel!]]";
 
}
 
}
  
 
function Format() {
 
function Format() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{F}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{F}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:F|Formatieren, Übersichtlichkeit herstellen!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:F|Formatieren, Übersichtlichkeit herstellen!]]";
 
}
 
}
  
 
function Form() {
 
function Form() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{Form}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Form}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Form|Formulierung ändern, enzyklopisch!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Form|Formulierung ändern, enzyklopisch!]]";
 
}
 
}
Zeile 162: Zeile 162:
 
     Erweiterung = '';
 
     Erweiterung = '';
 
   }
 
   }
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = '{{Stub|{{Subst:Datum}}|' + Erweiterung + '}}\n' + Inhalt;
+
   document.getElementById("wpTextbox1").value = '{{Stub|{{Subst:Datum}}|' + Erweiterung + '}}\n' + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Stub|Stub]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Stub|Stub]]";
 
   }
 
   }
Zeile 169: Zeile 169:
  
 
function QO() {
 
function QO() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{QO|{{Subst:Datum}}}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{QO|{{Subst:Datum}}}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:QO|Qualitätsoffensive!!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:QO|Qualitätsoffensive!!]]";
 
}
 
}
  
 
function Message() {
 
function Message() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
 
   var Nachricht = prompt("Text der Nachricht?", "Hier Nachricht schreiben");
 
   var Nachricht = prompt("Text der Nachricht?", "Hier Nachricht schreiben");
   document.editform.wpTextbox1.value = "{{M|" + wgUserName + "|" + Nachricht + "}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{M|" + wgUserName + "|" + Nachricht + "}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "Message";
 
   document.editform.wpSummary.value = "Message";
 
}
 
}
Zeile 183: Zeile 183:
 
function RedirectArticle() {
 
function RedirectArticle() {
 
   var DirectSite = prompt("Zielartikel?", "Unlustig");
 
   var DirectSite = prompt("Zielartikel?", "Unlustig");
   document.editform.wpTextbox1.value = "#Redirect [[" + DirectSite + "]]";
+
   document.getElementById("wpTextbox1").value = "#Redirect [[" + DirectSite + "]]";
 
   document.editform.wpSummary.value = "Redirect nach [[" + DirectSite + "]]";
 
   document.editform.wpSummary.value = "Redirect nach [[" + DirectSite + "]]";
 
}
 
}
  
 
function RedirectArticle2() {
 
function RedirectArticle2() {
   document.editform.wpTextbox1.value = "#Redirect [[Namensartikel]]";
+
   document.getElementById("wpTextbox1").value = "#Redirect [[Namensartikel]]";
 
   document.editform.wpSummary.value = "Redirect nach [[Namensartikel]]";
 
   document.editform.wpSummary.value = "Redirect nach [[Namensartikel]]";
 
}
 
}
  
 
function CorrectArticle() {
 
function CorrectArticle() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
 
   var iLink = prompt("Interne Links überprüfen?", "Einfügen, da keine vorhanden");
 
   var iLink = prompt("Interne Links überprüfen?", "Einfügen, da keine vorhanden");
 
   var Category = prompt("Kategorisieren?", "Ja");
 
   var Category = prompt("Kategorisieren?", "Ja");
Zeile 200: Zeile 200:
 
   var Pictures = prompt("Bilder überprüfen?", "Nein");
 
   var Pictures = prompt("Bilder überprüfen?", "Nein");
 
   var Comment = prompt("Commentar:","Jetzt im Sonderangebot: [[Spam]]");
 
   var Comment = prompt("Commentar:","Jetzt im Sonderangebot: [[Spam]]");
   document.editform.wpTextbox1.value = "{{V|" + iLink + "|" + Category + "|" + Syntax + "|" + Format + "|" + Pictures + "|" + Comment + "|{{Subst:Datum}}}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{V|" + iLink + "|" + Category + "|" + Syntax + "|" + Format + "|" + Pictures + "|" + Comment + "|{{Subst:Datum}}}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "Verbesserungsprogramm";
 
   document.editform.wpSummary.value = "Verbesserungsprogramm";
 
}
 
}
  
 
function BadSig() {
 
function BadSig() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
 
   var userSig = prompt("Benutzername und Signaturpfad des Übeltäters?", "Muster/Sig");
 
   var userSig = prompt("Benutzername und Signaturpfad des Übeltäters?", "Muster/Sig");
 
   var reason = prompt("Zu hoch, zu breit, zu blöd?", "breit");
 
   var reason = prompt("Zu hoch, zu breit, zu blöd?", "breit");
   document.editform.wpTextbox1.value = "{{BadSig|" + userSig + "|" + reason + "|" + wgUserName + "}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{BadSig|" + userSig + "|" + reason + "|" + wgUserName + "}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "Signatur bemängelt!";
 
   document.editform.wpSummary.value = "Signatur bemängelt!";
 
}
 
}
  
 
function Double() {
 
function Double() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
 
   var pageone = prompt("Erster Artikel?", "");
 
   var pageone = prompt("Erster Artikel?", "");
 
   var pagetwo = prompt("Zweiter Artikel?", "");
 
   var pagetwo = prompt("Zweiter Artikel?", "");
   document.editform.wpTextbox1.value = "{{Überschneidung|" + pageone + "|" + pagetwo + "}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Überschneidung|" + pageone + "|" + pagetwo + "}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Überschneidung|Überschneidung]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Überschneidung|Überschneidung]]";
 
}
 
}
Zeile 223: Zeile 223:
 
   var Article = prompt('Gemeinter Artikel');
 
   var Article = prompt('Gemeinter Artikel');
 
   if (Article != ''){
 
   if (Article != ''){
     Inhalt = document.editform.wpTextbox1.value;
+
     Inhalt = document.getElementById("wpTextbox1").value;
     document.editform.wpTextbox1.value = '{{Vorschau|' + Article + '}}\n' + Inhalt;
+
     document.getElementById("wpTextbox1").value = '{{Vorschau|' + Article + '}}\n' + Inhalt;
 
     document.editform.wpSummary.value = "[[Vorlage:Vorschau|Erst gucken, dann speichern!]]";
 
     document.editform.wpSummary.value = "[[Vorlage:Vorschau|Erst gucken, dann speichern!]]";
 
   }
 
   }
Zeile 230: Zeile 230:
  
 
function WelcomeUser(){
 
function WelcomeUser(){
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{W|" + wgUserName + "}}" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{W|" + wgUserName + "}}" + Inhalt;
 
   document.editform.wpSummary.value = "Welcome";
 
   document.editform.wpSummary.value = "Welcome";
 
   if (confirm("Kommentar hinzufügen?"))
 
   if (confirm("Kommentar hinzufügen?"))
 
   {
 
   {
 
     var Comment = prompt("Kommentar:", "");
 
     var Comment = prompt("Kommentar:", "");
     document.editform.wpTextbox1.value += "<p>P.P.S: " + Comment + " - Gruß, ~~~~";
+
     document.getElementById("wpTextbox1").value += "<p>P.P.S: " + Comment + " - Gruß, ~~~~";
 
   }
 
   }
 
}
 
}
 
function WIP(){
 
function WIP(){
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{WIP|" + wgUserName + "}}" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{WIP|" + wgUserName + "}}" + Inhalt;
 
   document.editform.wpSummary.value = "Lust anzumelden?";
 
   document.editform.wpSummary.value = "Lust anzumelden?";
 
   if (confirm("Kommentar hinzufügen?"))
 
   if (confirm("Kommentar hinzufügen?"))
 
   {
 
   {
 
     var Comment = prompt("Kommentar:", "");
 
     var Comment = prompt("Kommentar:", "");
     document.editform.wpTextbox1.value += "<p>P.P.S:" + Comment + " - Gruß, ~~~~";
+
     document.getElementById("wpTextbox1").value += "<p>P.P.S:" + Comment + " - Gruß, ~~~~";
 
   }
 
   }
 
}
 
}
  
 
function SLA() {
 
function SLA() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{SLA|" + wgUserName + "}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{SLA|" + wgUserName + "}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "Hinweis für SL-Autor";
 
   document.editform.wpSummary.value = "Hinweis für SL-Autor";
 
}
 
}
  
 
function SL() {
 
function SL() {
   Inhalt = document.editform.wpTextbox1.value;  
+
   Inhalt = document.getElementById("wpTextbox1").value;  
   document.editform.wpTextbox1.value = "{{SL|" + wgUserName + "}}\n" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{SL|" + wgUserName + "}}\n" + Inhalt;
 
   document.editform.wpSummary.value = "Sofort Löschen!!";
 
   document.editform.wpSummary.value = "Sofort Löschen!!";
 
}
 
}
Zeile 269: Zeile 269:
 
       var bla = 0;
 
       var bla = 0;
 
       var blubb = 0;
 
       var blubb = 0;
       for ( var i = 0; document.editform.wpTextbox1.value.length; i++ ) {
+
       for ( var i = 0; document.getElementById("wpTextbox1").value.length; i++ ) {
         bla = document.editform.wpTextbox1.value.indexOf(s, bla) + 1; // Die Position des gefundenen Strings wird um 1 erhöht, damit nicht noch einmal an derselben Stelle gesucht wird.
+
         bla = document.getElementById("wpTextbox1").value.indexOf(s, bla) + 1; // Die Position des gefundenen Strings wird um 1 erhöht, damit nicht noch einmal an derselben Stelle gesucht wird.
 
         if ( bla == 0 ) { // Wenn nix mehr gefunden wird (-1 + 1), wird die Schleife beendet.
 
         if ( bla == 0 ) { // Wenn nix mehr gefunden wird (-1 + 1), wird die Schleife beendet.
 
           break;
 
           break;
Zeile 277: Zeile 277:
 
       }
 
       }
 
       for ( var i = 0; i <= blubb; i++ ) {
 
       for ( var i = 0; i <= blubb; i++ ) {
         document.editform.wpTextbox1.value = document.editform.wpTextbox1.value.replace(s, r);
+
         document.getElementById("wpTextbox1").value = document.getElementById("wpTextbox1").value.replace(s, r);
 
       }
 
       }
 
     }
 
     }
Zeile 301: Zeile 301:
  
 
function NolicenseUser() {
 
function NolicenseUser() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{Vorlage:Nolicenseuser|" + wgUserName + "}}" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Vorlage:Nolicenseuser|" + wgUserName + "}}" + Inhalt;
 
   document.editform.wpSummary.value = "Bilder-Rechte sind nicht geklärt. Es droht die Löschung!";
 
   document.editform.wpSummary.value = "Bilder-Rechte sind nicht geklärt. Es droht die Löschung!";
 
}
 
}
  
 
function Baustelle() {
 
function Baustelle() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{Baustelle}}" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Baustelle}}" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Baustelle|Frisch ans Werk, Geselle!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Baustelle|Frisch ans Werk, Geselle!]]";
 
}
 
}
  
 
function Lizenz() {
 
function Lizenz() {
   Inhalt = document.editform.wpTextbox1.value;
+
   Inhalt = document.getElementById("wpTextbox1").value;
   document.editform.wpTextbox1.value = "{{Lizenz!}}" + Inhalt;
+
   document.getElementById("wpTextbox1").value = "{{Lizenz!}}" + Inhalt;
 
   document.editform.wpSummary.value = "[[Vorlage:Lizenz!|Lizenzangaben! Sofort!]]";
 
   document.editform.wpSummary.value = "[[Vorlage:Lizenz!|Lizenzangaben! Sofort!]]";
 
}
 
}

Version vom 13. November 2011, 01:39 Uhr

Das neue Projekt zum einfachen
Einbinden von JavaScripts: Rein Damit

Hier wird die Welt der JavaScripts erläutert. Oder jedenfalls die paar Gegenden dieser Welt, die für die Stupidedia interessant sind.

externe Infoseite für Spezialanwendungen

Was ist das?

JavaScript ist eine Programmiersprache, die im Internet verwendet werden kann. Sie dient dazu, Aufgaben auszuführen, die mit bloßem HTML nicht möglich sind. Ein Beispiel ist das Einfügen von zusätzlichen Inhalten in eine Seite.

Auf der Stupidedia gibt es (wie in jedem anderen Wiki) die Möglichkeit, eigene JavaScripts einzubinden. Diese werden dann bei jedem Seitenaufruf mitgeladen.

Was muss ich tun?

Wir haben gerade gelernt, dass JavaScript eine Programmiersprache ist - das heißt, dass man sie lernen muss. Für weniger erfahrene Benutzer ist das nicht zu empfehlen, weil zu Beginn die Erfolge eher enttäuschend sein werden.
Für diese Benutzer bietet es sich an, bestehende JavaScripts zu benutzen. Eine Technik, mit der man eine Menge sehr einfach einbinden kann, findet sich unter Hilfe:Javascripts/Rein Damit.

Doch bevor du die Javascript-Funktionen von Vector richtig nutzen kannst, musst du noch etwas in deinen Einstellungen verändern. Unter dem Reiter Aussehen sind mehrere Auswahlmöglichkeiten für Skins zu finden. Ausgewählt sein muss der Punkt Vector.

Zur Technik

Wenn du ein JavaScript benutzen willst, musst du zuerst deine „vector.js“ anlegen.
Dazu folgst du einfach diesem Link (Benutzer:XYZ/vector.js).
Auf dieser Seite fügst du folgendes ein:

//<nowiki>

//</nowiki>

Zwischen diesen beiden Zeilen kannst du nun reines JavaScript benutzen. Detaillierte Infos über die in der Stupidedia häufig genutzten Erweiterungen findest du unter der Hilfe:Editierwerkzeug-Leiste!

Programmierung

Jetzt kommen wir zum Programmieren an sich. Als Beispiel geben wir dem Knopf "Bearbeiten" einen neuen Namen:

document.getElementById('ca-edit').getElementsByTagName('a')[0].firstChild.data = 'Edit';

//<nowiki>
var knopf = document.getElementById('ca-edit');    // "ca-edit" ist der Name des Knopfes

if(knopf){                                         // WENN es diesen Knopf gibt (und die Seite
                                                   // nicht gesperrt ist)...

 var link = knopf.getElementsByTagName('a')[0];    // ...DANN suchen wir uns den ersten
                                                   // (bzw. einzigen) Link in diesem Knopf.

 link.firstChild.data = 'Edit';                    // Hier wird der Text angesprochen, der zu
                                                   // dem Link gehört und auf "Edit" gesetzt.

}                                                  // Hier noch das Ende der if-Bedingung
//</nowiki>

Die "Namen" der einzelnen Elemente auf einer Seite findest du entweder im Quelltext, mit einem DOM-Inspektor, oder (wenn du bei keinem von beiden weißt, worum es sich handelt): auf einer Liste, die hier in naher Zukunft zu finden sein wird.

Beispiel einer vector.js für "Einsteiger"

//<pre><nowiki>

/*
  StupidScript   v1.1,08-15 STABILE VERSION
*/

rein_damit('add2toolbar');
rein_damit('addlilink');
rein_damit('indexlink');
rein_damit('rv2version');
rein_damit('loeschvorlage_einfügen');
rein_damit('Sterne');
rein_damit('linkchecker');

var Inhalt;
  
function init() {
  add2toolbar('javascript:insertTags("[[Wikipedia:de:","]]","Wikipedialink einfügen")','http://www.stupidedia.org/images/1/12/Wikipedia.png','Interwikilink setzen');
  add2toolbar('javascript:RedirectArticle()', 'http://www.stupidedia.org/images/9/91/Redirect.png', 'Weiterleitung erstellen');
  add2toolbar('javascript:RedirectArticle2()', 'http://www.stupidedia.org/images/a/a2/Namensartikel.png', 'Redirect Namensartikel');
  add2toolbar('javascript:SL()', 'http://www.stupidedia.org/images/d/d8/Sofort_Loeschen_neu.png', 'Sofort-Löschen');
  add2toolbar('javascript:Conflict()', 'http://www.stupidedia.org/images/4/4e/Conflict.png', 'Conflict');
  add2toolbar('javascript:CorrectArticle()', 'http://www.stupidedia.org/images/2/24/Verbesserung.png', 'Verbesserungsvorlage erstellen');
  add2toolbar('javascript:WelcomeUser()', 'http://www.stupidedia.org/images/4/42/Welcome.png', 'Benutzer Willkommenheissen');
  add2toolbar('javascript:WIP()', 'http://www.stupidedia.org/images/9/93/Welcome_IP.png', 'IP Einladen');
  add2toolbar('javascript:insertTags("{{","}}","Gewünschte Vorlage hier einfügen")','http://www.stupidedia.org/images/4/48/Vorlage.png', 'Vorlage einfügen');
  add2toolbar('javascript:insertTags("=== "," ===","Ebene 3 Überschrift")','http://www.stupidedia.org/images/e/e7/Ebene_3.png', 'Ebene 3 Überschrift');
  add2toolbar('javascript:FindReplace()', 'http://www.stupidedia.org/images/b/b6/Ersetzen.png', 'Text ersetzen');
  add2toolbar('javascript:ColorOn()', 'http://www.stupidedia.org/images/7/77/Schriftfarbe.png', 'Text einfärben');
  add2toolbar('javascript:ColorBackground()', 'http://www.stupidedia.org/images/d/de/Hintergrundfarbe.png', 'Texthintergrund einfärben');
  add2toolbar('javascript:insertTags("<span style=text-decoration:blink;>","</span>","Blinkschrift hier einfügen")','http://www.stupidedia.org/images/8/8c/Blink.PNG','Blinkschrift');
  add2toolbar('javascript:insertTags("<s>","</s>","Durchgestrichenen Text hier einfügen")','http://www.stupidedia.org/images/7/73/Durchstreichen.png','Durchgestrichenen Text einfügen');
  add2toolbar('javascript:insertTags("<u>","</u>","Unterstrichenen Text hier einfügen")','http://www.stupidedia.org/images/8/82/Unterstreichen.png','Unterstrichenen Text einfügen');
  add2toolbar('javascript:insertTags("<big>","</big>","Großen Text einfügen")','http://www.stupidedia.org/images/c/cc/Big.png','Großen Text einfügen');
  add2toolbar('javascript:insertTags("<small>","</small>","Kleinen Text einfügen")','http://www.stupidedia.org/images/b/b6/Small.png','Kleinen Text einfügen');
  add2toolbar('javascript:insertTags("<sub>","</sub>","Tiefgestellten Text einfügen")','http://www.stupidedia.org/images/6/67/Sub.png','Tiefgestellten Text einfügen');
  add2toolbar('javascript:insertTags("<sup>","</sup>","Hochgestellten Text einfügen")','http://www.stupidedia.org/images/f/f3/Sup.png','Hochgestellten Text einfügen');
  add2toolbar('javascript:insertTags("<center>","</center>","Zentrieren")','http://www.stupidedia.org/images/5/56/Center.png','Zentrieren');
  add2toolbar('javascript:insertTags("<div align=right>","</div>","Rechts ausgerichteten Text einfügen")','http://www.stupidedia.org/images/0/02/Right.PNG','Text nach Rechts ausrichten');
  add2toolbar('javascript:insertTags("<br>","","")','http://www.stupidedia.org/images/4/44/Zeilenumbruch.png','Zeilenumbruch');
  add2toolbar('javascript:insertTags("<br style=clear:both />","","")','http://www.stupidedia.org/images/e/e8/Absatz.png','Großabsatz setzen');
  add2toolbar('javascript:QO()','http://www.stupidedia.org/images/5/54/Qualit%C3%A4tsoffensive.png','QO');
  add2toolbar('javascript:Baustelle()', 'http://www.stupidedia.org/images/e/e0/Baustelle.gif', 'Baustelle');
  add2toolbar('javascript:Double()', 'http://www.stupidedia.org/images/0/02/Doppelt.png', 'Überschneidung');
  add2toolbar('javascript:Stub()', 'http://www.stupidedia.org/images/f/fe/Stub.png', 'Stub');
  add2toolbar('javascript:InterneLinks()','http://www.stupidedia.org/images/0/0d/Interne_Links.png','Vorlage:Interne Links setzen');
  add2toolbar('javascript:KK()','http://www.stupidedia.org/images/3/34/Keine_Kategorie.png','Vorlage:KK setzen');
  add2toolbar('javascript:Rechtschreibung()','http://www.stupidedia.org/images/a/ab/Rechtschreibung.png','Vorlage:Rechtschreibung setzen');
  add2toolbar('javascript:Format()','http://www.stupidedia.org/images/6/6c/Format.png','Vorlage:Format setzen');
  add2toolbar('javascript:Form()','http://www.stupidedia.org/images/d/d0/Form.png','Vorlage:Form setzen');
  add2toolbar('javascript:Message()', 'http://www.stupidedia.org/images/a/a5/Message.png', 'Mitteilung schreiben');
  add2toolbar('javascript:UsePreview();','http://www.stupidedia.org/images/7/75/Preview.png','Vorschau-Button benutzen');  
  add2toolbar('javascript:insertTags(" http://www.stupidedia.org/images/6/63/Laugth.gif ","","")','http://www.stupidedia.org/images/8/80/Smiley.png','Smiley setzen');
  add2toolbar('javascript:insertTags("[[Benutzer:","|]]","Benutzername hier einfügen")','http://www.stupidedia.org/images/5/5b/Benutzer.png','Userlink setzen');
  add2toolbar('javascript:insertTags("[[Kategorie:","]]","Kategorie hier einfügen")','http://www.stupidedia.org/images/3/3c/Kategorie.png','Kategorie setzen');
  add2toolbar('javascript:insertTags("„<i>","</i>“","Zitat hier einfügen")','http://www.stupidedia.org/images/9/97/Zitat.png','Zitat setzen');
  add2toolbar('javascript:BadSig()','http://www.stupidedia.org/images/0/06/BadSig.png','Benutzer wegen Signatur anmeckern');
  add2toolbar('javascript:NolicenseUser()','http://www.stupidedia.org/images/4/4c/Nolicenseusernb3.png', 'Nolicense-User-Diskussionsvorlage');
  add2toolbar('javascript:Lizenz()', 'http://stupidedia.org/images/d/d3/Editleistenknopf_lizenz.png', 'Lizenz! Sofort!');
}

function deleteButton(Nr){
  document.getElementById('toolbar').getElementsByTagName("img")[Nr].style.display = "none";
}

if (global.bearbeitend) {
  addOnload(init);
}

function Conflict() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{Conflict}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Conflict|Es gibt einen Konflikt]]";
}

function InterneLinks() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{IL}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:IL|Interne Links hinzufügen/korrigieren!]]";
}

function KK() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{KK}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:KK|Kategorien hinzufügen/korrigieren!]]";
}

function Rechtschreibung() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{R}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:R|Rechtschreibung inakzeptabel!]]";
}

function Format() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{F}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:F|Formatieren, Übersichtlichkeit herstellen!]]";
}

function Form() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{Form}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Form|Formulierung ändern, enzyklopisch!]]";
}

function Stub() {
  var Erweiterung = prompt('Erweiterungsvorschläge?');
  if (!Erweiterung) {
    Erweiterung = '';
  }
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = '{{Stub|{{Subst:Datum}}|' + Erweiterung + '}}\n' + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Stub|Stub]]";
  }
}

function QO() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{QO|{{Subst:Datum}}}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:QO|Qualitätsoffensive!!]]";
}

function Message() {
  Inhalt = document.getElementById("wpTextbox1").value;
  var Nachricht = prompt("Text der Nachricht?", "Hier Nachricht schreiben");
  document.getElementById("wpTextbox1").value = "{{M|" + wgUserName + "|" + Nachricht + "}}\n" + Inhalt;
  document.editform.wpSummary.value = "Message";
}

function RedirectArticle() {
  var DirectSite = prompt("Zielartikel?", "Unlustig");
  document.getElementById("wpTextbox1").value = "#Redirect [[" + DirectSite + "]]";
  document.editform.wpSummary.value = "Redirect nach [[" + DirectSite + "]]";
}

function RedirectArticle2() {
  document.getElementById("wpTextbox1").value = "#Redirect [[Namensartikel]]";
  document.editform.wpSummary.value = "Redirect nach [[Namensartikel]]";
}

function CorrectArticle() {
  Inhalt = document.getElementById("wpTextbox1").value;
  var iLink = prompt("Interne Links überprüfen?", "Einfügen, da keine vorhanden");
  var Category = prompt("Kategorisieren?", "Ja");
  var Syntax = prompt("Rechtschreibung verbessern?", "Ja, stellenweise");
  var Format = prompt("Formatieren?", "Zeilenumbrüche, Aufzählungszeichen und Überschriften setzen");
  var Pictures = prompt("Bilder überprüfen?", "Nein");
  var Comment = prompt("Commentar:","Jetzt im Sonderangebot: [[Spam]]");
  document.getElementById("wpTextbox1").value = "{{V|" + iLink + "|" + Category + "|" + Syntax + "|" + Format + "|" + Pictures + "|" + Comment + "|{{Subst:Datum}}}}\n" + Inhalt;
  document.editform.wpSummary.value = "Verbesserungsprogramm";
}

function BadSig() {
  Inhalt = document.getElementById("wpTextbox1").value;
  var userSig = prompt("Benutzername und Signaturpfad des Übeltäters?", "Muster/Sig");
  var reason = prompt("Zu hoch, zu breit, zu blöd?", "breit");
  document.getElementById("wpTextbox1").value = "{{BadSig|" + userSig + "|" + reason + "|" + wgUserName + "}}\n" + Inhalt;
  document.editform.wpSummary.value = "Signatur bemängelt!";
}

function Double() {
  Inhalt = document.getElementById("wpTextbox1").value;
  var pageone = prompt("Erster Artikel?", "");
  var pagetwo = prompt("Zweiter Artikel?", "");
  document.getElementById("wpTextbox1").value = "{{Überschneidung|" + pageone + "|" + pagetwo + "}}\n" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Überschneidung|Überschneidung]]";
}

function UsePreview() {
  var Article = prompt('Gemeinter Artikel');
  if (Article != ''){
    Inhalt = document.getElementById("wpTextbox1").value;
    document.getElementById("wpTextbox1").value = '{{Vorschau|' + Article + '}}\n' + Inhalt;
    document.editform.wpSummary.value = "[[Vorlage:Vorschau|Erst gucken, dann speichern!]]";
  }
}

function WelcomeUser(){
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{W|" + wgUserName + "}}" + Inhalt;
  document.editform.wpSummary.value = "Welcome";
  if (confirm("Kommentar hinzufügen?"))
  {
    var Comment = prompt("Kommentar:", "");
    document.getElementById("wpTextbox1").value += "<p>P.P.S: " + Comment + " - Gruß, ~~~~";
  }
}
function WIP(){
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{WIP|" + wgUserName + "}}" + Inhalt;
  document.editform.wpSummary.value = "Lust anzumelden?";
  if (confirm("Kommentar hinzufügen?"))
  {
    var Comment = prompt("Kommentar:", "");
    document.getElementById("wpTextbox1").value += "<p>P.P.S:" + Comment + " - Gruß, ~~~~";
  }
}

function SLA() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{SLA|" + wgUserName + "}}\n" + Inhalt;
  document.editform.wpSummary.value = "Hinweis für SL-Autor";
}

function SL() {
  Inhalt = document.getElementById("wpTextbox1").value; 
  document.getElementById("wpTextbox1").value = "{{SL|" + wgUserName + "}}\n" + Inhalt;
  document.editform.wpSummary.value = "Sofort Löschen!!";
}

function FindReplace() {
  var s = prompt("Folgendes ersetzen:");
  if ( s ) {
    var r = prompt("Ersetzen durch:");
    if ( r != undefined ) {
      var bla = 0;
      var blubb = 0;
      for ( var i = 0; document.getElementById("wpTextbox1").value.length; i++ ) {
        bla = document.getElementById("wpTextbox1").value.indexOf(s, bla) + 1; // Die Position des gefundenen Strings wird um 1 erhöht, damit nicht noch einmal an derselben Stelle gesucht wird.
        if ( bla == 0 ) { // Wenn nix mehr gefunden wird (-1 + 1), wird die Schleife beendet.
          break;
        }
        blubb++;
      }
      for ( var i = 0; i <= blubb; i++ ) {
        document.getElementById("wpTextbox1").value = document.getElementById("wpTextbox1").value.replace(s, r);
      }
    }
  }
  document.getElementById("wpMinoredit").checked = true;
}

function ColorOn() {
  var color = prompt("Farbwert eingeben:", "");
  if (color) {
    var fontCo = '<font color="' + color + '">';
    javascript:insertTags(fontCo,"</font>","Text hier einfügen")
  }
}

function ColorBackground() {
  var color = prompt("Farbwert eingeben:", "");
  if (color) {
    var fontCo = '<font style="background:' + color + '">';
    javascript:insertTags(fontCo,"</font>","Text hier einfügen")
  }
}

function NolicenseUser() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{Vorlage:Nolicenseuser|" + wgUserName + "}}" + Inhalt;
  document.editform.wpSummary.value = "Bilder-Rechte sind nicht geklärt. Es droht die Löschung!";
}

function Baustelle() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{Baustelle}}" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Baustelle|Frisch ans Werk, Geselle!]]";
}

function Lizenz() {
  Inhalt = document.getElementById("wpTextbox1").value;
  document.getElementById("wpTextbox1").value = "{{Lizenz!}}" + Inhalt;
  document.editform.wpSummary.value = "[[Vorlage:Lizenz!|Lizenzangaben! Sofort!]]";
}

//</nowiki></pre>

Linktipps: Faditiva und 3DPresso