i need some help to change FCK plugins for use in CKeditor.
i don't know how to use those function in CKeditor.
i don't know how to use those function in CKeditor.
function FormatText() { var oEditor = FCKeditorAPI.GetInstance(FCK.Name) ; if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG ) { var temps = new Array(); var sec = oEditor.EditorDocument.selection.createRange(); var tmpText = sec.text; var isPart = tmpText != null && tmpText.trim().length > 0; isPart = false; if (!isPart) { var imgs = oEditor.EditorDocument.images; if (imgs != null && imgs.length > 0) { for (j = 0; j < imgs.length; j++) { var t = document.createElement("IMG"); t.alt = imgs[j].alt; t.src = imgs[j].src; t.width = imgs[j].width; t.height = imgs[j].height; t.align = imgs[j].align; temps[temps.length] = t; } var formatImgCount = 0; for (j = 0; j < imgs.length;) { imgs[j].outerHTML = "#FormatImgID_" + formatImgCount + "#"; formatImgCount++; } } var html = processFormatText(oEditor.EditorDocument.body.innerText); if (temps != null && temps.length > 0) { for (j = 0; j < temps.length; j++) { var imghtml = "<img src=\"" + temps[j].src + "\" alt=\"" + temps[j].alt + "\" width=\"" + temps[j].width + "\" height=\"" + temps[j].height + "\" align=\"" + temps[j].align + "\">"; html = html.replace("#FormatImgID_" + j + "#", imghtml); } } oEditor.SetHTML(html); } else { var html = processFormatText(tmpText); sec.pasteHTML(html); } } else alert( 'wrong mode!' ) ; }