2013-06-20 27 views
1

我正在自己的工作CMS。本項目使用Dojo Toolkit(版本:1.9)和TinyMCE 4TinyMCE編輯器顯示在dijit.Dialogs中,它們直接在HTML代碼中創建(不是以編程方式)。 我已閱讀關於JQuery的問題,以顯示工具欄或獲取與JQuery UI對話框相關的編輯器內容。不過幸運的是,這些問題不要t occur in my project. I use the following code to initialize the TinyMCE`編輯:dijit.dialog中的TinyMCE編輯器:鏈接對話框不工作

<script type="text/javascript"> 
    // other dojo.require calls 
    dojo.require("dijit.Dialog"); 
    require(["dijit/form/Button", "dojo/ready", "dojo/json"], function(Button, ready){ 
     ready(function(){ 
      loadPageContent(); 
     }); 
     }); 
     // some JQuery initialize for another plugin not related in any way to TinyMCE (displays toast messages) 
     $(function() { 
      $("#content .grid_5, #content .grid_6").sortable({ 
       placeholder: 'ui-state-highlight', 
       forcePlaceholderSize: true, 
       connectWith: '#content .grid_6, #content .grid_5', 
       handle: 'h2', 
       revert: true 
      }); 
      $("#content .grid_5, #content .grid_6").disableSelection(); 
     }); 
     // The TinyMCE initialization: 
     tinymce.init({ 
      selector: "textarea", 
      theme: "modern", 
      entity_encoding : "raw", 
      plugins: [ 
       "advlist autolink lists link image charmap print preview hr anchor pagebreak", 
       "searchreplace wordcount visualblocks visualchars code fullscreen", 
       "insertdatetime media nonbreaking save table contextmenu directionality", 
       "emoticons template paste textcolor" 
      ], 
      toolbar1: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image", 
      toolbar2: "print preview media | forecolor backcolor emoticons", 
      image_advtab: true, 
     }); 
    </script> 

但是,如果我想添加一個鏈接,鏈接對話框不允許我插入網址和名稱。我的問題是: 可以在此TinyMCE對話框中選擇目標窗口。如果我直接在編輯器中插入URL,它將被識別爲鏈接,但在鏈接對話框中編輯也是不可能的。

dijit.DialogTinyMCE編輯器中的HTML代碼:發現

<div dojoType="dijit.Dialog" title="Inhaltselement" id="dialogContentRightElement"> 
    <div style="width: 45em;"> 
     <form id="dialogContentElement_form"> 
     <table border="0"> 
      <tr> 
       <td>Farbe/Stil/Spezialkasten:</td> 
       <td> 
        <select name="dialogContentRightElement_form_color" id="dialogContentRightElement_form_color"> 
         // some options are here 
        </select> 
       </td> 
      </tr> 
      <tr> 
       <td>Titel:</td> 
       <td><input dojoType="dijit.form.ValidationTextBox" required="true" name="dialogContentRightElement_form_title" id="dialogContentRightElement_form_title"></input></td> 
      </tr> 
      <tr> 
       <td>Inhalt:</td> 
      </tr> 
     </table> 
     <textarea style="width: 42em; height: 20em;" id="dialogContentRightElement_form_content" name="dialogContentRightElement_form_content"></textarea> 
     <button dojoType="dijit.form.Button" onClick="saveContentRightNew()">Speichern</button><button dojoType="dijit.form.Button" onClick="dijit.byId('dialogContentRightElement').hide()">Abbrechen</button> 
     </form> 
    </div> 
</div> 
+0

找到與此問題相關的錯誤報告:http://www.tinymce.com/develop/bugtracker_view.php?id=5934 – user1995621

回答

1

解決方案:使用dojox.layout.FloatingPane代替dijit.Dialog。但我不推薦使用dojox.layout.FloatingPane,我有很多問題,所以我切換回來,並等待TinyMCE更新才能解決問題。