简体   繁体   中英

How To Integrate CKFinder To TinyMCE4?

Sorry for my bad english. I tried to explain the problems I encountered. I'm using asp.net MVC5. I want to integrate the ckfinder to tinymce4. This code works, but only successful in one area. How can I integrate all areas.

 tinymce.init({ ... file_browser_callback: function() { var finder = new CKFinder(); finder.selectActionFunction = SetFileField; finder.popup();} ... }); function SetFileField(fileUrl) { jQuery('#mceu_47-inp').val(fileUrl); } 

You can try use code bellow

tinymce.init({
     selector: 'textarea#desc',
     toolbar_items_size: 'small',
     menubar: false,
     plugins: [],
    toolbar1: "",
    image_advtab: true,
    menubar: false,
    toolbar_items_size: 'small',
    relative_urls: false,
    remove_script_host : false,
    file_browser_callback: openKCFinder,
    file_browser_callback_types: 'file image media'

});

function openKCFinder(field_name, url, type, win) {
    tinyMCE.activeEditor.windowManager.open({
        file: '/kcfinder/ckfinder.html',//path to your ckfinder
        title: 'KCFinder',
        width: 700,
        height: 500,
        resizable: "yes",
        inline: true,
        close_previous: "no",
        popup_css: false
    }, {
        window: win,
        input: field_name
    });
    return false;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM