Dies ist eine alte Version des Dokuments!
Um einen Button bei der Editpage oben hinzuzufügen:
Quelle1)
zh-tw Table of Contents Adding your own button to the toolbar userscript.js examples Discussion Icons Adding your own button to the toolbar The toolbar is completely built through JavaScript. Which buttons the toolbar contains, is read from an array called toolbar which is created from the defines in the inc/toolbar.php. To add your own button, you can simply enhance the toolbar array in your conf/userscript.js file(you need to create this file). Eg. if you want a button for the subscript syntax, just place a button image into the lib/images/toolbar folder and add the following code to conf/userscript.js:
if(toolbar){ toolbar[toolbar.length] = {"type":"format", "title":"Subscripted Text", "icon":"subscript.png", "key":"", "open":"<sub>", "close":"</sub>"}; }
Button types:
if(window.toolbar!=undefined){ /* format: subscript */ toolbar[toolbar.length] = {"type":"format", "title":"Subscript Text", "icon":"text_subscript.png", "key":"", "open":"<sub>", "close":"</sub>"}; /* insert: footnote */ toolbar[toolbar.length] = {"type":"format", "title":"Footnote", "icon":"asterisk_yellow.png", "key":"", "insert":"((footnote))", /* picker: notes plugin ICONIFIED*/ var notes_arr = new Array(); /* array[key]= insertion string , value = icon filename. */ notes_arr['<note></note>\\n']='note.png'; notes_arr['<note tip></note>\\n']='tip.png'; notes_arr['<note important></note>\\n']='important.png'; notes_arr['<note warning></note>\\n']='warning.png'; toolbar[toolbar.length] = {"type":"picker", "title":"Notes", "icon":"note.png", "key":"", "list": notes_arr, "icobase":"notes"}; /* subdir of lib/images/ where images found.*/ /* picker: sample TEXT ONLY (like special chars) */ toolbar[toolbar.length] = {"type":"picker", "title":"Bunch o strings", "icon":"stuff.png", "key":"", "list": Array('A','B','C'), }; }