2012-05-16 54 views
0

如果有人有興趣,請靠近 c5如果我可以全部使用它,Filebrowser看起來非常酷!c5 Filemanager和TinyMCE

我已經得到了「瀏覽」按鈕出現在TimyMCE>插入/編輯圖像彈出加入爲出現在接下來的tinymce_jquery_full.cshtml文件

function myFileBrowser (field_name, url, type, win) { 

var cmsURL = "../../Filemanager/index.html" 

tinyMCE.activeEditor.windowManager.open({ 
    file : cmsURL, 
    title : 'Browser', 
    width : 800, // Your dimensions may differ - toy around with them! 
    height : 500, 
    resizable : "yes", 
    inline : "yes", // This parameter only has an effect if you use the inlinepopups plugin! 
    close_previous : "no" 
}, { 
    window : win, 
    input : field_name 
}); 
return false; 
} 

file_browser_callback : 'myFileBrowser', 

只需添加它裏面的所有主要

<script type="text/javascript"> tag 

它工作正常

使用此按鈕c5 Filebrowser打開,我可以正常玩它。

我可以告訴的是,C5 filebrowser設置了CKEditor的工作,而不是TimyMCE所以這是我無法

然後我跟着這個鏈接如下指令:

http://forum.filemanager.corefive.com/topic/how-do-i-get-a-value-back-from-the-filemanager-for-the-selected-file

它向我展示瞭如何讓'選擇'按鈕在Filemanager中顯示,以及其他一些不適合我的信息。

如果我添加的推薦碼:

var selectItem = function (data) { 
    var p = data['Path']; 
    alert(p); 
    $('#field_name', window.opener.document).val(p); 
    window.close(); 
} 

要filemanager.js,我可以得到警報(P);工作,它給了我的網址sting到我以後的圖像,但窗口不會關閉,更不用說'p'的值回發到TinyMCE彈出窗口字段。

因此,我現在有兩個JavaScript彈出窗口打開其中一個,但在Filemanager中的圖像選擇,我需要filemanger關閉和'p'的值傳回到'scr'字段的TimyMCE的「插入/編輯圖像」彈出窗體。

難以解釋!

調用所有Javascript嚮導以獲取幫助?

原始帖子下面

有誰知道如何C5文件管理器(http://forum.filemanager.corefive.com/#home)和TinyMCE的整合教程,我已經做了一些搜索但我找不到多少!我想添加一個瀏覽按鈕到TinyMCE上的插入/編輯圖像彈出窗口,然後打開文件管理器並填充圖像URL字段和圖像URL?

回答

0

完成,這一切都在這裏TinyMCE的網站:

http://www.tinymce.com/wiki.php/How-to_implement_a_custom_file_browser

我只是不看遠遠不夠下跌的一頁,我猜是因爲我感到驚訝的是TinyMCE的將給予在這麼多的幫助問題。

var selectItem = function(data){ 
    var url = relPath + data['Path']; 

    if(window.tinyMCEPopup){ 
     // use TinyMCE > 3.0 integration method 
     var win = tinyMCEPopup.getWindowArg("window"); 
     win.document.getElementById(tinyMCEPopup.getWindowArg("input")).value = url; 
     if (typeof(win.ImageDialog) != "undefined") { 
      // Update image dimensions 
      if (win.ImageDialog.getImageData) 
       win.ImageDialog.getImageData(); 

      // Preview if necessary 
      if (win.ImageDialog.showPreviewImage) 
       win.ImageDialog.showPreviewImage(url); 
     } 
     tinyMCEPopup.close(); 
     return; 
    } 
} 

的代碼已經存在於filemanager.js,你就必須刪除所有的,如果(window.opener){代碼,而這一切完美的作品!

對於c5 filemanager和TinyMCE的所有人來說,熱愛你的工作!