fckeditor 常用函數(shù)
更新時間:2009年06月19日 23:09:22 作者:
對于操作 fckeditor的朋友,有所幫助。其實我們用插件的方法制作也是不錯的。功能可以更強。
插入:
oEditor.FCKSelection.GetSelectedElement();
oEditor.FCK.InsertHtml("<br />");
FCKCommands.RegisterCommand('htmlcode',new FCKDialogCommand( 'htmlcode', FCKLang.htmlcodeBtn, FCKPlugins.Items['htmlcode'].Path + 'fck_htmlcode.html', 500, 420 ) ) ;
var ohtmlcode=new FCKToolbarButton('htmlcode',FCKLang.htmlcodeBtn);
ohtmlcode.IconPath=FCKPlugins.Items['htmlcode'].Path+'htmlcode.GIF';
FCKToolbarItems.RegisterItem('htmlcode',ohtmlcode);
//創(chuàng)建用于所htmlcode操作的對象
var FCKhtmlcode = new Object() ;
// 這個添加的方法將在彈出窗口點擊ok按鈕時被調(diào)用。
// 該方法將會接收從對話框中傳來的值。
FCKhtmlcode.Add = function(strtemp,str)
{
FCK.InsertHtml("["+str+"]<br>"+strtemp+"<br>[/"+str+"]") ;
}
復制代碼 代碼如下:
oEditor.FCKSelection.GetSelectedElement();
oEditor.FCK.InsertHtml("<br />");
復制代碼 代碼如下:
FCKCommands.RegisterCommand('htmlcode',new FCKDialogCommand( 'htmlcode', FCKLang.htmlcodeBtn, FCKPlugins.Items['htmlcode'].Path + 'fck_htmlcode.html', 500, 420 ) ) ;
var ohtmlcode=new FCKToolbarButton('htmlcode',FCKLang.htmlcodeBtn);
ohtmlcode.IconPath=FCKPlugins.Items['htmlcode'].Path+'htmlcode.GIF';
FCKToolbarItems.RegisterItem('htmlcode',ohtmlcode);
//創(chuàng)建用于所htmlcode操作的對象
var FCKhtmlcode = new Object() ;
// 這個添加的方法將在彈出窗口點擊ok按鈕時被調(diào)用。
// 該方法將會接收從對話框中傳來的值。
FCKhtmlcode.Add = function(strtemp,str)
{
FCK.InsertHtml("["+str+"]<br>"+strtemp+"<br>[/"+str+"]") ;
}
相關(guān)文章
常用的HTML富文本編譯器UEditor、CKEditor、TinyMCE、HTMLArea、eWebEditor、Ki
這篇文章主要介紹了常用的HTML富文本編譯器UEditor、CKEditor、TinyMCE、HTMLArea、eWebEditor、KindEditor簡介,需要的朋友可以參考下2017-03-03PHP中CKEditor和CKFinder配置問題小結(jié)
PHP中CKEditor和CKFinder配置問題小結(jié),使用CKEditor和CKFinder編輯器的朋友可以參考下2012-03-03Windows Live Writer 實現(xiàn)代碼高亮
有時會包含大量代碼,如果能在文章中高亮顯示代碼文章的可讀性肯定會好很多。2009-05-05