2017-02-17 147 views
0

我想上傳圖片,給它一個類,並將其放置在編輯器中。這是我完整的tinymce代碼。TinyMCE - 如何上傳圖片

tinymce.init({ 
    selector: "#editor", 
    file_browser_callback_types: 'file image media', 
    menubar: false, 
    resize: false, 
    statusbar: false, 
    plugins: ["code autoresize autolink table image media"], 
    toolbar1: "undo redo bold italic alignleft aligncenter alignright alignjustify fontsizeselect bullist numlist outdent indent backcolor image media", 
    file_browser_callback: function(field_name, url, type, win) { 
      if(type=='image') $('#my_form input').click(); 
     }, 

    image_caption: true, 
    image_description: false, 
    image_dimensions: false, 
    image_advtab: true, 
    image_class_list: [ 
    {title: 'None', value: ''}, 
    {title: 'Dog', value: 'dog'}, 
    {title: 'Cat', value: 'cat'} 
    ], 
    style_formats: [ 
    {title: 'Image Left', selector: 'img', styles: { 
    'float' : 'left', 
    'margin': '0 10px 0 10px' 
    }}, 
    {title: 'Image Right', selector: 'img', styles: { 
    'float' : 'right', 
    'margin': '0 10px 0 10px' 
    }} 
    ], 
}); 

點擊img圖標給我下面的彈出窗口。

enter image description here

但照片上點擊圖標裏面彈出死了。

任何幫助?

回答