Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize WYSIHTML5 Toolbar

How do you customize the toolbar in WYSIHTML5. I want to disable the font size and image insert buttons, particularly for the WYSIHTML5 version used in Bootstrap X-editable.

like image 541
user2694939 Avatar asked Aug 19 '13 02:08

user2694939


Video Answer


1 Answers

If you happen to use bootstrap-wysiwyg/bootstrap3-wysiwyg (which is for example used by gem bootstrap-wysihtml5-rails), since version 3.0, you will need to nest it inside toolbar :

$('#some-textarea').wysihtml5({
  toolbar: {
    "font-styles": true, // Font styling, e.g. h1, h2, etc.
    "emphasis": true, // Italics, bold, etc.
    "lists": true, // (Un)ordered lists, e.g. Bullets, Numbers.
    "html": false, // Button which allows you to edit the generated HTML.
    "link": true, // Button to insert a link.
    "image": true, // Button to insert an image.
    "color": false, // Button to change color of font
    "blockquote": true, // Blockquote
    "size": <buttonsize> // options are xs, sm, lg
  }
});
like image 130
mdemolin Avatar answered Sep 17 '22 07:09

mdemolin