2010-09-20 76 views
1

裏面當你插入Flash對象到CKEDITOR編輯器窗口中會顯示這個符號:CKEDITOR - 自定義標籤和符號editorwindow

alt text

我想知道。是否有可能當用戶插入此標記到編輯器做同樣的事情(使用正則表達式{formbuilder =(\ d +)} /):

{formbuilder = 2}

如果是這樣,可能有人請解釋如何至? :)

UPDATE:

我一直在尋找的分頁符插件,試圖瞭解這到底是怎麼回事。這個插件和我的最大區別在於HTML插入到編輯器中的方式。

CKEDITOR.plugins.add('formbuilder', 
{ 
    init: function(editor) 
    { 
     var pluginName = 'formbuilder'; 
     var windowObjectReference = null; 

     editor.ui.addButton('Formbuilder', 
      { 

       label : editor.lang.common.form, 
       command: pluginName, 
       icon: 'http://' + top.location.host + '/publish/ckeditor/images/formbuilder.png', 
       click: function (editor) 
        {  
         if (windowObjectReference == null || windowObjectReference.closed){ 
          var siteid = $('#siteid').val(); 

          windowObjectReference = window.open('/publish/formbuilder/index.php?siteid='+siteid,'Formbuilder','scrollbars=0,width=974,height=650'); 
         } else { 
          windowObjectReference.focus(); 
         } 
        } 
      }); 
    } 
}); 

正如你看到的,我的插件打開一個新的窗口和標籤插入:

function InsertForm(form_id) 
     { 
      // Get the editor instance that we want to interact with. 
      var oEditor = CKEDITOR.instances.page_content; 

      // Check the active editing mode. 
      if (oEditor.mode == 'wysiwyg') 
      { 
       // Insert the desired HTML. 
       oEditor.insertHtml('{formbuilder='+form_id+'}'); 
      } 
      else 
       alert('You must be on WYSIWYG mode!'); 
     } 

的分頁符插件做的一切,當你點擊工具欄上的圖標。這使得可以在插件文件中創建fakeImage。另一方面,對於我來說,我不明白這是如何實現的:\

回答

0

我正在尋找解決類似的問題,除了我的東西看起來像XML。如此,<cms:include page="whatever" />。在你的情況下,你將能夠複製佔位符插件並改變佔位符正則表達式來匹配你的標籤。就我而言,看起來我會修改iframe插件或其他東西,並希望弄清楚如何將每個標籤添加爲自閉合...