图像插件微小的mce编辑器

时间:2017-03-17 10:25:27

标签: image tinymce

我试图将图像插件添加到微小的mce编辑器中。将代码片段添加到我的html.erb文件中,无法获得编辑器上的功能。为什么会发生这种情况。这是我写的代码

<html> 
<head>   
<script src="//cloud.tinymce.com/stable/tinymce.min.js"></script>
<script>tinymce.init({ selector:'textarea' });</script>
<script>tinymce.init({   selector: "textarea",  // change this value according to your HTML   plugins: "image",   menubar: "insert",   toolbar: "image",   image_list: [     {title: 'My image 1', value: 'http://www.tinymce.com/my1.gif'},     {title: 'My image 2', value: 'http://www.moxiecode.com/my2.gif'}   ] });  </script>
</script> </head> <body>   <textarea>Easy! You should check out MoxieManager!</textarea> </body>
</html>

1 个答案:

答案 0 :(得分:1)

来自TinyMCE DOCS的全功能示例。你需要plugins参数。

tinymce.init({
selector: 'textarea',
  height: 1000,
  menubar: true,
  plugins: [
    'advlist autolink lists link image charmap print preview anchor textcolor',
    'searchreplace visualblocks code fullscreen',
    'insertdatetime media table contextmenu paste code help wordcount'
  ],
  toolbar: 'insert | undo redo |  formatselect | bold italic backcolor  | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help',
  content_css: [
    '../../css/style.css']
});