First some experiences:
The document
describes how to put an additional button to editor tool bar.
It is not so complex, but there some pitfalls:
edit the object “CKEditor.ConfigClass” in CKEditor.Config
where the used commandId key must be found in the two css-declarations
of the XWiki.StyleSheetExtension object like
a.cke_button.cke_button__xwiki-macro-html-dirty
> span.cke_button_icon.cke_button__xwiki-macro-html-dirty_icon {
... }
a.cke_button.cke_button__xwiki-macro-html-dirty
> span.cke_button_icon.cke_button__xwiki-macro-html-dirty_icon {
You need lower cases!
There are some doubled underline characters!
Don’t forget to activate the parameter Load JavasScript Skin Extension in the Object.
The CKEditor uses the font-family: ‘Glyphicons Halflings’.
To keep the editor’s design consistent, one should continue to use this font
A little help - the following code generates some tables of available characters:
(% style="font-family:'Glyphicons Halflings';font-size:250%" %)
(((
{{groovy}}
hex=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"]
outerhex=["20","21","22","23","24","25","26","27","2a","29","2a","2b",
"e0","e1","e2"] // private use of unicode
R="{{html}}"
outerhex.each{ t ->
R+="<table class='table-bordered' style='width:auto'><tr><td style='text-align:right;background-color:grey'>x=</td>"
hex.each{k-> R+="<td style='background-color:lightgray;text-align:center'><b >"+k+"</td>"}
R+="</tr>"
hex.each{i ->
R+="<tr><td style='background-color:lightgray'><b>"+t+i+"x</b></td>"
hex.each{ j-> R+= "<td style='text-align:center'>&#x"+t+i+j+";</td>"
}
R+="</tr>\n"
}
R += "</table><br/>"
}
R + "{{/html}}"
{{/groovy}}
)))
Back to the question:
The new button will open a modal window to modify the macro parameter.
But how to define a button that will execute the macro with the given defined parameter at once?
The standard “table of content” does.
Thanks for help
Norbert