Please note: Due to constant attempts by spambots to gain access to SpongePedia, account creation is currently disabled. We apologize for any inconvenience.
You are not logged in. Please log in to get the full benefit of SpongePedia.
For further questions go to SpongePedia:Contents !
MediaWiki:Extra-Editbuttons.js
From SpongePedia, the First SpongeBob Wiki.
Note: After saving, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Konqueror: Click Reload or press F5
- Opera: Clear the cache in Tools → Preferences
var XEBOrder=[]; var attributes = ["imageFile","speedTip","tagOpen","tagClose","sampleText"]; var usersignature = '--\~\~\~\~'; var Isrc='http://de.spongepedia.org/skins/common/images/buttons/'; var BDict={ //'ID':['Bild','Tooltip','Vor Text','Nach Text','Beispiel'], 'A2':['headline2.png','First Heading','\n=== ',' ===','First Heading'], 'A3':['headline3.png','Minor Heading','\n==== ',' ====','Minor Heading'], //Textformatierung 'U':['underline.png','Underlined Text','<u>','<\/u>','Underlined Text'], 'S':['strike.png','Striked Text','<s>','<\/s>','Striked Text'], 'SML':['small.png','Small Text','<small>','<\/small>','Small Text'], 'BIG':['big.png','Big Text','<big>','<\/big>','Big Text'], 'C':['center.png','Centered Text','<div style="text-align: center;">\n','\n<\/div>','Centered Text'], 'F':['color.png','Farbiger Text','<span style="color: Farbe">','<\/span>','Farbiger Text'], 'SUP':['sup.png','Hochgestellter Text','<sup>','<\/sup>','Hochgestellter Text'], 'SUB':['sub.png','Tiefgestellter Text','<sub>','<\/sub>','Tiefgestellter Text'], 'PRE':['pre.png','Vorformatierter Text','<pre>','<\/pre>','Vorformatierter Text'], 'COD':['code.png','Code einfügen','<code>','<\/code>','Code'], 'TT':['tt.png','Schreibmaschinenstil','<tt>','<\/tt>','Teletyper Text'], // 'G':['gallery.png','Bildergalerie','\n<gallery>\nDatei:55a SpongeBob.jpg|[[SpongeBob Schwammkopf]]\nDatei:PatrickStar.jpg|[[Patrick Star]]\nDatei:56b Thaddäus.jpg|[[Thaddäus Tentakel]]\n<\/gallery>','',''], 'T':['table.png','Tabelle','\n{| class="wikitable" border="1" \n|- \n| 1 || 2\n|- \n| 3 || 4','\n|}\n',''], // 'K':['category.png','Kategorie','[[Kategorie:',']]','Name der Kategorie'], 'V':['template.png','Vorlage','{{','}}','Vorlagenname'], 'EP':['episode.png','Episode','[[',' (Episode)|]]','Episodentitel'], //Liste 'L1':['list.png','Liste','\n* Element A\n* Element B\n* Element C','',''], 'L2':['numlist.png','Nummerierte Liste','\n# Element 1\n# Element 2\n# Element 3','',''], // 'BR':['br.png','Zeilenumbruch','<br>','',''], 'BR2':['br2.png','Zeilenumbruch','<br />','',''], 'KO':['comment.png','Versteckter Kommentar','<!--','-->','Kommentar'], 'ST':['span.png','span-Tag mit CSS-Angabe','<span style="">','<\/span>','Markierter Inhalt'], 'NBS':['nbsp.png','Geschütztes Leerzeichen (nonbreaking space)',' ','',''], // 'L':['shift.png','Setze Tab(s)',':','',':'], 'M':['blockquote.png','Markiert ein Zitat mit Absatz','<blockquote style="border: 1px solid blue; padding: 2em;">\n','\n<\/blockquote>','Text'], // 'W':['redirect.png','Weiterleitung (Redirect)','#WEITERLEITUNG [[',']]','Ziel einfügen'], 'P':['sublink.png','Link zu einem Seiten-Abschnitt','[[Seite#',']]','Abschnitt'], //Zeichen 'CR':['copyright.png','Copyright','©','',''], 'AZ':['quotes.png','Anführungszeichen','„','“','Text'], 'AP':['apostrophe.png','Apostroph','’','',''], 'GS':['dash.png','Gedankenstrich','–','',''], //Vorlagen 'BK':['disambig.png','Begriffsklärungseite','{{Begriffsklärung}}','',''], 'ZI':['cite.png','Zitat','{{Zitat|','}}','Text|Autor|Quelle'], 'FS':['signature.png','Fehlende Signatur','\{\{Unsigniert|','}}','Benutzername|Zeitpunkt|' + usersignature,], 'Y1':['noinclude.png','No Include','<noinclude>','<\/noinclude>','Text'], 'Y2':['includeonly.png','Include only','<includeonly>','<\/includeonly>','Text'], //Abstimmungen 'VP':['pro.png','Pro','#{{pro}} ' + usersignature,'',''], 'VC':['contra.png','Kontra','#{{contra}} ' + usersignature,'',''], // 'X0':['bg.png','','','',''], 'X1':['bg.png','','','',''], 'X2':['bg.png','','','',''], 'X3':['bg.png','','','',''], 'X4':['bg.png','','','',''], 'X5':['bg.png','','','',''], 'X6':['bg.png','','','',''], 'X7':['bg.png','','','',''], }; function addCustomButton(){ var a = {}; for (d in attributes) a[attributes[d]] = arguments[d]; mwCustomEditButtons.push(a); }; function initButtons(){ var bc,d; if (typeof customEditButtons!='string') // can be modified XEBOrder="X0,A2,A3,U,S,SML,BIG,C,F,SUP,SUB,PRE,COD,TT,X1,G,T,X2,K,V,EP,L1,L2,X3,BR,BR2,KO,ST,NBS,X4,L,M,X5,W,P,X6,CR,AZ,AP,GS,X7,BK,ZI,FS,Y1,Y2,VP,VC".split(","); else if (customEditButtons.toLowerCase()=='all') for (b in BDict) XEBOrder.push(b); else XEBOrder=customEditButtons.split(","); for (b in BDict) BDict[b][0] = Isrc+BDict[b][0]; // // Add the start of the URL (Isrc) to the XEB buttons // If the user has defined any buttons then add them into the available button lists if (typeof myButtons=='object') for (b in myButtons) BDict[b] = myButtons[b]; // custom user buttons // Add the media wiki standard buttons into the available buttons for (b in mwEditButtons) { // add standard buttons for full XEB order changing BDict[b]=[]; // for (d in mwEditButtons[b]) for (d in attributes) BDict[b].push(mwEditButtons[b][attributes[d]]); } // Build the new buttons for (i=0;i<XEBOrder.length;i++) { bc = BDict[XEBOrder[i]]; //try { // catch not existing button names addCustomButton(bc[0],bc[1],bc[2],bc[3],bc[4]); //} // catch(e) {continue} } // Remove the default buttons (if requested by the user) eraseButtons(); }; // Table generator /** @author: originally from fr:user:dake * @version: 0.2 */ function generateTable(caption, exhead, nbCol, nbRow, exfield, align){ var code = "\n"; code += '{| class="wikitable" ' + align + '\n'; if (exfield) code += '!\n'; for (i=1;i<nbCol+1;i++) code += '! FELD ' + i + '\n'; var items = 0; for (var j=0;j<nbRow;j++){ if (exfield) { items++; code += '|-\n! style="background: #FFDDDD;"|ITEM ' + items + '\n'; } else code += '|-\n'; for (i=0;i<nbCol;i++) code += '| Element\n'; } code += '|}\n'; insertTags('','', code); editform.elements['wpSummary'].value+=' table+'; return false }; function popupTable(){ var popup = window.open('about:blank','WPtable','height=200,width=300,scrollbars=yes'); var javaCode = '<script type="text\/javascript">function insertCode(){' +'var caption = (document.paramForm.inputCaption.checked)?"\|\+ TABLE CAPTION \\n":""; ' +'var exhead = (document.paramForm.inputHead.checked)?\'\|\- style=\"background: #DDFFDD;\"\\n\':""; ' +'var row = parseInt(document.paramForm.inputRow.value); ' +'var col = parseInt(document.paramForm.inputCol.value); ' +'var exfield = document.paramForm.inputItems.checked; ' +'var align = (document.paramForm.inputAlign.checked)?\'align="center"\':""; ' +'window.opener.generateTable(caption,exhead,col,row,exfield,align); ' +'window.close()}<\/script>'; popup.document.write('<html><head><title>Tabelle erstellen<\/title>' + javaCode +'<\/head><body>' +'<form name="paramForm">' +'Anzahl der Reihen: <input type="text" name="inputRow" value="3" size="2" \/><p\/>' +'Anzahl der Spalten: <input type="text" name="inputCol" value="3" size="2" \/><p\/>' +'Tabelle zentrieren <input type="checkbox" name="inputAlign" \/><p\/>' +'<\/form">' +'<p><a href="javascript:insertCode()">Tabelle einfügen<\/a> |' +' <a href="javascript:self.close()">Schließen<\/a><\/p>' +'<\/body><\/html>'); popup.document.close(); return false }; function extendButtons(){ if(!(allEditButtons = document.getElementById('toolbar'))) return false; if(typeof editform == 'undefined') if(!(window.editform = document.editform)) return false; XEBOrder.getIndex = function (item){ if(is_gecko) return this.indexOf(item); else //is IE (Opera < 9) for (var i=0;i < this.length;i++) if (this[i]==item) return Number(i); return -1 } var searchbox = allEditButtons.getElementsByTagName('span')[0]; if (searchbox) allEditButtons.appendChild(searchbox) // pay Zocky/Search Box allEditButtons = allEditButtons.getElementsByTagName('img'); var bu_len = mwEditButtons.length; var c=0; if(!allEditButtons.length) return false; // Tabelle if((c=XEBOrder.getIndex('T')) != -1) allEditButtons[bu_len+c].onclick=popupTable; // Weiterleitung c=XEBOrder.getIndex('W'); if(c != -1) allEditButtons[bu_len+c].onclick=function(){ if (a = window.prompt("Ziel der Weiterleitung", "")) { a = '\#WEITERLEITUNG \[\[' + a + '\]\]'; } }; if((c = XEBOrder.getIndex('X0')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X1')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X2')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X3')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X4')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X5')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X6')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X7')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X8')) != -1) allEditButtons[bu_len+c].width = 3; if((c = XEBOrder.getIndex('X9')) != -1) allEditButtons[bu_len+c].width = 3; }; if ((wgAction=="edit") || (wgAction=="submit")) addOnloadHook(initButtons); if(!wgIsArticle) // only if edit hookEvent("load", extendButtons);