upload image from local into tinyMCE

后端 未结 8 811
小鲜肉
小鲜肉 2021-02-04 02:33

tinyMCE has an insert image button, but how to handle its functionality pls give some code

8条回答
  •  北恋
    北恋 (楼主)
    2021-02-04 03:15

    Din't try iManager but found tinyFCK good and easy to configure which gives CKEditor's filemanager integrated with TinyMCE

    1.Download TinyFCK

    2.replace filemanger folder in tinyFCK with filemanager folder of ur CKEditor

    3.code :

    -

    tinyMCE.init({
         theme : "advanced",
         file_browser_callback : "fileBrowserCallBack",
    });
    function fileBrowserCallBack(field_name, url, type, win) {
         var connector = "../../filemanager/browser.html?Connector=connectors/php/connector.php";
         var enableAutoTypeSelection = true;
         var cType;
         tinyfck_field = field_name;
         tinyfck = win;
         switch (type) {
             case "image":
                 cType = "Image";
             break;
             case "flash":
                 cType = "Flash";
             break;
             case "file":
                 cType = "File";
             break;
         }
         if (enableAutoTypeSelection && cType) {
             connector += "?Type=" + cType;
         }
         window.open(connector, "tinyfck", "modal,width=600,height=400");
      }
    

提交回复
热议问题