/*
* fckeditor - the text editor for internet - http://www.fckeditor.net
* copyright (c) 2003-2009 frederico caldeira knabben
*
* == begin license ==
*
* licensed under the terms of any of the following licenses at your
* choice:
*
* - gnu general public license version 2 or later (the "gpl")
* http://www.gnu.org/licenses/gpl.html
*
* - gnu lesser general public license version 2.1 or later (the "lgpl")
* http://www.gnu.org/licenses/lgpl.html
*
* - mozilla public license version 1.1 or later (the "mpl")
* http://www.mozilla.org/mpl/mpl-1.1.html
*
* == end license ==
*
* this is the integration file for javascript.
*
* it defines the fckeditor class that can be used to create editor
* instances in a html page in the client side. for server side
* operations, use the specific integration system.
*/
// fckeditor class
var fckeditor = function( instancename, width, height, toolbarset, value )
{
// properties
this.instancename = instancename ;
this.width = width || '100%' ;
this.height = height || '200' ;
this.toolbarset = toolbarset || 'default' ;
this.value = value || '' ;
this.basepath = fckeditor.basepath ;
this.checkbrowser = true ;
this.displayerrors = true ;
this.config = new object() ;
// events
this.onerror = null ; // function( source, errornumber, errordescription )
}
/**
* this is the default basepath used by all editor instances.
*/
fckeditor.basepath = '/fckeditor/' ;
/**
* the minimum height used when replacing textareas.
*/
fckeditor.minheight = 200 ;
/**
* the minimum width used when replacing textareas.
*/
fckeditor.minwidth = 750 ;
fckeditor.prototype.version = '2.6.4.1' ;
fckeditor.prototype.versionbuild = '23187' ;
fckeditor.prototype.create = function()
{
document.write( this.createhtml() ) ;
}
fckeditor.prototype.createhtml = function()
{
// check for errors
if ( !this.instancename || this.instancename.length == 0 )
{
this._throwerror( 701, 'you must specify an instance name.' ) ;
return '' ;
}
var shtml = '' ;
if ( !this.checkbrowser || this._iscompatiblebrowser() )
{
shtml += '' ;
shtml += this._getconfightml() ;
shtml += this._getiframehtml() ;
}
else
{
var swidth = this.width.tostring().indexof('%') > 0 ? this.width : this.width + 'px' ;
var sheight = this.height.tostring().indexof('%') > 0 ? this.height : this.height + 'px' ;
shtml += '