相关的fck代码如下:function StartEditor()
{
// Remove the onload listener.
FCK.ToolbarSet.OnLoad = null ; FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ; FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ; // Start the editor.
FCK.StartEditor() ;
}function WaitForActive( editorInstance, newStatus )
{
if ( newStatus == FCK_STATUS_ACTIVE )
{
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ; // Call the special "FCKeditor_OnComplete" function that should be present in
// the HTML page where the editor is located.
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
window.parent.FCKeditor_OnComplete( FCK ) ;
}
}// Gecko browsers doens't calculate well that IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko )
{
function Window_OnResize()
{
var oCell = document.getElementById( 'xEditingArea' ) ;
var eInnerElement ;
if ( eInnerElement == oCell.firstChild )
{
if ( eInnerElement != undefined) {
eInnerElement.style.height = 0 ;
eInnerElement.style.height = oCell.scrollHeight - 2 ;
}
}
}
window.onresize = Window_OnResize ;
}
/////////////////////////////////////////////////////////////////
function getstr(str)
{
stag=str.lastIndexOf('/');
etag=str.lastIndexOf('.');
rstr=str.substring(stag+1,etag);
return rstr
} function imgUrl(url,isThumb)
{
if (isThumb.toString() != "" && isThumb.toString() == "true") {
var iurl = getstr(url);
url = url.replace(iurl, iurl +"_S");
}
parent.SetUrl(url);
}var sourceMode = 0;function ExecuteCommand(commandName)
{
// Get the editor instance that we want to interact with.
//var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
// Execute the command.
FCK.Commands.GetCommand(commandName).Execute() ; if(sourceMode == 0){
document.getElementById('Source').className = "TB_Button_On";
sourceMode = 1;
}else{
document.getElementById('Source').className = "TB_ToolbarSet";
sourceMode = 0;
}
}
function SourceOut(source)
{
if(sourceMode == 0){
source.className='TB_ToolbarSet';
}else{
source.className='TB_Button_On';
}
}function SourceOver(source)
{
source.className='TB_Button_On_Over';
}
// 改变编辑区高度
function sizeChange(size){
for (var i=0; i<parent.frames.length; i++){
if (parent.frames[i].document==self.document){
var obj=parent.frames[i].frameElement;
var height = parseInt(obj.offsetHeight);
if (height+size>=100){
obj.height=height+size;
}
break;
}
}
}
</script>
{
// Remove the onload listener.
FCK.ToolbarSet.OnLoad = null ; FCKeditorAPI._FunctionQueue.Remove( LoadToolbar ) ; FCK.Events.AttachEvent( 'OnStatusChange', WaitForActive ) ; // Start the editor.
FCK.StartEditor() ;
}function WaitForActive( editorInstance, newStatus )
{
if ( newStatus == FCK_STATUS_ACTIVE )
{
if ( FCKBrowserInfo.IsGecko )
FCKTools.RunFunction( window.onresize ) ; FCK.SetStatus( FCK_STATUS_COMPLETE ) ; // Call the special "FCKeditor_OnComplete" function that should be present in
// the HTML page where the editor is located.
if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
window.parent.FCKeditor_OnComplete( FCK ) ;
}
}// Gecko browsers doens't calculate well that IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko )
{
function Window_OnResize()
{
var oCell = document.getElementById( 'xEditingArea' ) ;
var eInnerElement ;
if ( eInnerElement == oCell.firstChild )
{
if ( eInnerElement != undefined) {
eInnerElement.style.height = 0 ;
eInnerElement.style.height = oCell.scrollHeight - 2 ;
}
}
}
window.onresize = Window_OnResize ;
}
/////////////////////////////////////////////////////////////////
function getstr(str)
{
stag=str.lastIndexOf('/');
etag=str.lastIndexOf('.');
rstr=str.substring(stag+1,etag);
return rstr
} function imgUrl(url,isThumb)
{
if (isThumb.toString() != "" && isThumb.toString() == "true") {
var iurl = getstr(url);
url = url.replace(iurl, iurl +"_S");
}
parent.SetUrl(url);
}var sourceMode = 0;function ExecuteCommand(commandName)
{
// Get the editor instance that we want to interact with.
//var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
// Execute the command.
FCK.Commands.GetCommand(commandName).Execute() ; if(sourceMode == 0){
document.getElementById('Source').className = "TB_Button_On";
sourceMode = 1;
}else{
document.getElementById('Source').className = "TB_ToolbarSet";
sourceMode = 0;
}
}
function SourceOut(source)
{
if(sourceMode == 0){
source.className='TB_ToolbarSet';
}else{
source.className='TB_Button_On';
}
}function SourceOver(source)
{
source.className='TB_Button_On_Over';
}
// 改变编辑区高度
function sizeChange(size){
for (var i=0; i<parent.frames.length; i++){
if (parent.frames[i].document==self.document){
var obj=parent.frames[i].frameElement;
var height = parseInt(obj.offsetHeight);
if (height+size>=100){
obj.height=height+size;
}
break;
}
}
}
</script>
oEditor.EditorDocument.body.innerText="你要复制的内容"