admin管理员组文章数量:1323715
Is there a way in TinyMCE to disable the "edit html" button? I'm overwhelmed by the config options and can't seem to find it. I noticed users can use that to place javascript in their field which I do not want. By the way I am using this gem -
Is there a way in TinyMCE to disable the "edit html" button? I'm overwhelmed by the config options and can't seem to find it. I noticed users can use that to place javascript in their field which I do not want. By the way I am using this gem - https://github./spohlenz/tinymce-rails
Share Improve this question asked Oct 10, 2012 at 16:21 HelloWorldHelloWorld 4,3498 gold badges38 silver badges60 bronze badges3 Answers
Reset to default 4Use theme_advanced_disable: "code"
when you initialise the tinymce object.
EDIT - didn't see you were using the rails version, sorry. This will remove the button in plain javascript.
You might try:
HtmlEditorConfig::get('cms')->removeButtons('advcode');
or
theme_advanced_disable: "code"
I've made a fiddle here: http://fiddle.tinymce./cmcaab
If you're trying to have it set by the gem rather than just writing the javascript, you just need to edit the config/tinymce.yml
file. So the yml
file should have a line that says
theme_advanced_disable: code
OR (from README on that gem)
Custom options can be passed to tinymce to override the global options specified in config/tinymce.yml:
So I think you can just add a :theme_advanced_disable => ["code"]
when calling the timeMCE (though I'm not 100% sure that's the correct syntax):
<%= tinymce :theme => "simple", :theme_advanced_disable => ["code"], :plugins => ["inlinepopups", "paste"] %>
You can read more about this here:
Do you mean the "edit html source" button? You could just not put it in the toolbar, under the theme_advanced_buttons
options all you have to do is omit it.
The button is called code
本文标签: javascriptTinyMCE disable html edit buttonStack Overflow
版权声明:本文标题:javascript - TinyMCE: disable html edit button - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742125360a2421913.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论