FCKeditorAPI 매 뉴 얼 js 작업 가 져 오기 등

2803 단어 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("")// html
checkContent.SetHTML("",true);// , bool,

}
function aaa()
{
var checkContent =FCKeditorAPI.GetInstance("editor");//
checkContent.SwitchEditMode();//
checkContent.UpdateLinkedField();//
}
function FCKeditor_OnComplete( checkContent )//
{
alert( checkContent.Name ) ;
}

// fckeditor
function FCKeditor_OnComplete(editorInstance)
{
editorInstance.EditorDocument.body.disabled = true;
editorInstance.EditorWindow.parent.document.getElementById ('xExpanded').style.display = 'none';
editorInstance.EditorWindow.parent.document.getElementById('xCollapsed').style.display = 'none';
editorInstance.EditorWindow.blur();
}

//
function insertHTMLToEditor(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content");
if (oEditor.EditMode==FCK_EDITMODE_WYSIWYG){
oEditor.InsertHtml(codeStr);
}else{
return false;
}
}
//
function getLength(){
var oEditor = FCKeditorAPI.GetInstance("content");
var oDOM = oEditor.EditorDocument;
var iLength ;
if(document.all){
iLength = oDOM.body.innerText.length;
}else{
var r = oDOM.createRange();
r.selectNodeContents(oDOM.body);
iLength = r.toString().length;
}
alert(iLength);
}
//
function ExecuteCommand(commandName){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.Commands.GetCommand(commandName).Execute() ;
}
//
function SetContents(codeStr){
var oEditor = FCKeditorAPI.GetInstance("content") ;
oEditor.SetHTML(codeStr) ;
}

// FCKEditor js
function InsertHTML(e,inStr)//e:FCKEditor ID,inStr:
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
{
oEditor.InsertHtml( inStr ) ;
}
else
alert("You must be on WYSIWYG mode!" ) ;
}

function ExecuteCommand( commandName,e )
{
var oEditor = FCKeditorAPI.GetInstance(e) ;
oEditor.Commands.GetCommand(commandName ).Execute() ;
}

좋은 웹페이지 즐겨찾기