2013-06-13 16 views

Trả lời

4

bạn có thể làm một cái gì đó như:

tinyMCE.init({ 
    setup: function (ed) { 
     ed.onInit.add(editor_oninit); 
    } 
... 
}); 

function editor_oninit(ed) { 
    // Add hook for onContextMenu so that Insert Image can be removed 
    ed.plugins.contextmenu.onContextMenu.add(editor_remove_image); 
} 

Và chức năng

function editor_remove_image(sender, menu) { 
    // create a new object 
    var otherItems = {}; 
    for (var itemName in menu.items) { 
     var item = menu.items[itemName]; 
     if (/^mce_/.test(itemName)) { 
      if (item.settings) { 
       if (item.settings.cmd == "mceImage" || item.settings.cmd == "mceAdvImage") { 
        // skip these items 
        continue; 
       } 
      } 
     } 
     // add all other items to this new object, so it is effectively a clone 
     // of menu.items but without the offending entries 
     otherItems[itemName] = item; 
    } 
    // replace menu.items with our new object 
    menu.items = otherItems; 
} 
0

Tôi đang sử dụng TinyMCE lần đầu tiên này và thực sự tìm kiếm một giải pháp cho cùng một vấn đề được hỏi ở đây .

Đây là Script TinyMCE của tôi:

tinymce.init({ 
    selector: "textarea#elm1", 
    images_upload_credentials: false, 
    theme: "modern", 
    branding: false, 
    <!-- elementpath: false, --> 
    menubar:false, 
    <!-- preview_styles: false, --> 

    height:300, 
     automatic_uploads: false, 
    plugins: [ 
     "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker", 
     "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", 
     "save table contextmenu directionality emoticons template paste textcolor" 
    ] 

}); 

Bây giờ, Làm thế nào để Hủy bỏ Right Click ảnh Url Lựa chọn?

Chỉ Tháo ảnh Từ plugins

plugins: [ 
     "advlist autolink link lists charmap print preview hr anchor pagebreak spellchecker", 
     "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking", 
     "save table contextmenu directionality emoticons template paste textcolor" 
    ] 
+0

là quá trình tương tự để loại bỏ bảng? –

Các vấn đề liên quan