1

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);
        }

1 Answers1

0

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;
}
luongit
  • 117
  • 2
  • 13