Hi,
I want to customize the HTML editor in Cockpit to leave only the Bold and Italic options.
I saw in the documentation that this was possible.
{
"iframe" : false,
"mode" : "split",
"markdown" : false,
"enablescripts" : false,
"height" : 500,
"maxsplitsize" : 1000,
"codemirror" : { /* codemirror settings */ },
"toolbar" : [ "bold", "italic", "strike", "link", "image", "blockquote", "listUl", "listOl" ],
"lblPreview" : "Preview",
"lblCodeview" : "HTML",
"lblMarkedview" : "Markdown"
}
To test it, I decided to remove the Bold button (see toolbar key). It works.
{
"iframe" : false,
"mode" : "split",
"markdown" : false,
"enablescripts" : false,
"height" : 500,
"maxsplitsize" : 1000,
"codemirror" : { /* codemirror settings */ },
"toolbar" : [ "italic", "strike", "link", "image", "blockquote", "listUl", "listOl" ],
"lblPreview" : "Preview",
"lblCodeview" : "HTML",
"lblMarkedview" : "Markdown"
}
Then I tested leaving only Bold and Italic (see toolbar key)… but it doesn’t work. All the buttons remain displayed.
{
"iframe" : false,
"mode" : "split",
"markdown" : false,
"enablescripts" : false,
"height" : 500,
"maxsplitsize" : 1000,
"codemirror" : { /* codemirror settings */ },
"toolbar" : [ "bold", "italic" ],
"lblPreview" : "Preview",
"lblCodeview" : "HTML",
"lblMarkedview" : "Markdown"
}
I tested again by deleting only the ListUl and ListOl (see toolbar key)… but again it doesn’t work. All the buttons remain displayed.
{
"iframe" : false,
"mode" : "split",
"markdown" : false,
"enablescripts" : false,
"height" : 500,
"maxsplitsize" : 1000,
"codemirror" : { /* codemirror settings */ },
"toolbar" : [ "bold", "italic", "strike", "link", "image", "blockquote" ],
"lblPreview" : "Preview",
"lblCodeview" : "HTML",
"lblMarkedview" : "Markdown"
}
I don’t understand where the problem comes from. I know that it is possible to hide the buttons by injecting CSS into Cockpit… but if it is possible to do otherwise, I think it would be better.
Do you have an idea ?
Thanks.