FCKeditorAPI中文用例说明
function abc()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
alert(checkContent.GetXHTML());//获取当前内容
var newelement = document.createElement("a");
newelement.href="#";
newelement.innerHTML="df";
checkContent.InsertElement(newelement);//前部添加元素(无返回值)
var a=checkContent.InsertElementAndGetIt(newelement);//前部添加元素(返回元素)
checkContent.InsertHtml("<input tyep='text'>")//添加html
checkContent.SetHTML("<input tyep='text'>",true);//设置内容,后为bool,是否所见即所得
}
function aaa()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//获取实例
checkContent.SwitchEditMode();//转变编辑模式
checkContent.UpdateLinkedField();//更新关联文件
}
function FCKeditor_OnComplete( checkContent )//当加载完
{
alert( checkContent.Name ) ;
}
如何插入插件
在plugins里新建个文件夹.如newthing
里面有newthing.js newthing.html newthing.gif
newthing
/*
FCKCommands.RegisterCommand(commandName, command)
commandName - Command name, referenced by the Toolbar, etc...
command - Command object (must provide an Execute() function).
*/
// Register the related commands.
FCKCommands.RegisterCommand(
'newthing',
new FCKDialogCommand(
'新建的按纽',
'新建的按纽页面',
FCKConfig.PluginsPath + 'newthing/newthing.html', 340, 170));
// Create the "newthing" toolbar button.
var oFindItem = new FCKToolbarButton('newthing', FCKLang['DlgMyFindTitle']);
oFindItem.IconPath = FCKConfig.PluginsPath + 'newthing/newthing.gif' ;
// 'newthing' is the name used in the Toolbar config.
FCKToolbarItems.RegisterItem( 'newthing', oFindItem ) ;
;
newthing.html 上面的
myconfig
加上FCKConfig.Plugins.Add( 'newthing', '' ) ;