2013-08-19 178 views

回答

3

你可以做到这一点通过CSS

ul.wysihtml5-toolbar li a[title="Insert image"] { display: none; } 
ul.wysihtml5-toolbar li.dropdown { display: none; } 
12

可以使用启动参数禁用工具栏选项:

$('#[YOUR INPUT ID]').wysihtml5({ 
    "font-styles": false, //Font styling, e.g. h1, h2, etc. 
    "emphasis": true, //Italics, bold, etc. 
    "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. 
    "html": true, //Button which allows you to edit the generated HTML. 
    "link": true, //Button to insert a link. 
    "image": false, //Button to insert an image. 
    "color": true //Button to change color of font 
}); 

此信息应在标签粘贴:

<head> 
    <script> HERE </scrip> 
</head> 
13

如果您碰巧使用bootstrap-wysiwyg/bootstrap3-wysiwyg(例如,由宝石bootstrap-wysihtml5-rails使用),s因斯3.0版本,则需要其嵌套工具栏里面:

$('#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 
    } 
}); 
+0

这就是答案.......非常感谢 – GhostRider

+0

这对我来说工作..谢谢 –