首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自定义WYSIHTML5工具栏

自定义WYSIHTML5工具栏
EN

Stack Overflow用户
提问于 2013-08-19 10:04:06
回答 3查看 23.6K关注 0票数 8

如何在WYSIHTML5中自定义工具栏。我想禁用字体大小和图像插入按钮,特别是在Bootstrap X-editable中使用的WYSIHTML5版本。

EN

回答 3

Stack Overflow用户

发布于 2014-12-11 00:57:34

如果您碰巧使用bootstrap-wysiwyg/bootstrap3-wysiwyg (例如,gem bootstrap-wysihtml5-rails使用它),则从3.0版开始,您将需要将其嵌套在工具栏中:

代码语言:javascript
复制
$('#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
  }
});
票数 20
EN

Stack Overflow用户

发布于 2013-09-12 03:30:35

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

代码语言:javascript
复制
$('#[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
});

此信息应粘贴到标记中:

代码语言:javascript
复制
<head>
   <script> HERE </scrip>
</head>
票数 13
EN

Stack Overflow用户

发布于 2013-08-23 00:09:26

您可以通过CSS完成此操作

代码语言:javascript
复制
ul.wysihtml5-toolbar li a[title="Insert image"] { display: none; }
ul.wysihtml5-toolbar li.dropdown { display: none; }
票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/18305497

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档