1
里面当你插入Flash对象到CKEDITOR编辑器窗口中会显示这个符号:CKEDITOR - 自定义标签和符号editorwindow
我想知道。是否有可能当用户插入此标记到编辑器做同样的事情(使用正则表达式{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。另一方面,对于我来说,我不明白这是如何实现的:\