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: format - If there is a selection this wraps it with the open and close strings, else it inserts the title.
insert - Simple string insertion. insert.
picker - Displays the picker with mutiple insertion selections. Populated by array or assosiative array(iconified) list and optional icobase.
mediapopup - opens the media manager. Probably not useful for you
signature - inserts the signature. Probably not useful for you
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'), }; }