phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] news_admin/js/fckeditor/editor/_source/classes fckpan


From: skwashd
Subject: [Phpgroupware-cvs] news_admin/js/fckeditor/editor/_source/classes fckpanel_ie.js, 1.1 fckplugin.js, 1.1 fckspecialcombo.js, 1.1 fckstyledef.js, 1.1 fckpanel_gecko.js, 1.1 fckevents.js, 1.1 fckcontextmenugroup.js, 1.1 fckcontextmenuitem.js, 1.1 fckcontextmenuseparator.js, 1.1 fckstyledef_gecko.js, 1.1 fckstyledef_ie.js, 1.1 fcktoolbarcombo.js, 1.1 fcktoolbarfontformatcombo.js, 1.1 fcktoolbarfontscombo.js, 1.1 fcktoolbarfontsizecombo.js, 1.1 fcktoolbarbutton.js, 1.1 fcktoolbarbreak_ie.js, 1.1 fckstylesloader.js, 1.1 fcktoolbar.js, 1.1 fcktoolbarbreak_gecko.js, 1.1 fcktoolbarpanelbutton.js, 1.1 fcktoolbarspecialcombo.js, 1.1 fcktoolbarstylecombo.js, 1.1 fckxml_gecko.js, 1.1 fckxml_ie.js, 1.1
Date: Tue, 24 May 2005 16:32:00 +0200

Update of news_admin/js/fckeditor/editor/_source/classes

Added Files:
     Branch: MAIN
            fckpanel_ie.js 
            fckplugin.js 
            fckspecialcombo.js 
            fckstyledef.js 
            fckpanel_gecko.js 
            fckevents.js 
            fckcontextmenugroup.js 
            fckcontextmenuitem.js 
            fckcontextmenuseparator.js 
            fckstyledef_gecko.js 
            fckstyledef_ie.js 
            fcktoolbarcombo.js 
            fcktoolbarfontformatcombo.js 
            fcktoolbarfontscombo.js 
            fcktoolbarfontsizecombo.js 
            fcktoolbarbutton.js 
            fcktoolbarbreak_ie.js 
            fckstylesloader.js 
            fcktoolbar.js 
            fcktoolbarbreak_gecko.js 
            fcktoolbarpanelbutton.js 
            fcktoolbarspecialcombo.js 
            fcktoolbarstylecombo.js 
            fckxml_gecko.js 
            fckxml_ie.js 

Log Message:
I am working on a much better version of news_admin, this is just a taste of 
what is coming.

Adding FCKeditor, which has the following issues:
* Images and files support FCKd
* Spellcheck FCKing up

Didn't include non php code or samples other unneeded crap

====================================================
Index: fckpanel_ie.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckpanel_ie.js
 *      FCKPanel Class: Creates and manages floating panels in IE Browsers.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-10 13:20:42
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKPanel = function( parentWindow )
{
        this.Window = parentWindow ? parentWindow : window ;
}

FCKPanel.prototype.Create = function()
{
        // Create the Popup that will hold the panel.
        this._Popup = this.Window.createPopup() ;

        this.Document = this._Popup.document ;

        this.Document.oncontextmenu = function() { return false ; }

        if ( this.StyleSheet )
                FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ;

        // Create the main DIV that is used as the panel base.
        this.PanelDiv = this.Document.body.appendChild( 
this.Document.createElement('DIV') ) ;
        this.PanelDiv.className = 'FCK_Panel' ;

        this.Created = true ;
}

FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, 
autoSize )
{
        if ( ! this.Created )
                this._Create() ;

        // The offsetWidth and offsetHeight properties are not available if the
        // element is not visible. So we must "show" the popup with no size to
        // be able to use that values in the second call.
        this._Popup.show( panelX, panelY, 0, 0, relElement ) ;

        if ( width == null || ( autoSize && width > this.PanelDiv.offsetWidth ) 
)
                var iWidth = this.PanelDiv.offsetWidth ;
        else
                var iWidth = width ;

        if ( height == null || ( autoSize && height > 
this.PanelDiv.offsetHeight ) )
                var iHeight = this.PanelDiv.offsetHeight ;
        else
                var iHeight = height ;

        this.PanelDiv.style.height = iHeight ;

        // Second call: Show the Popup at the specified location.
        this._Popup.show( panelX, panelY, iWidth, iHeight, relElement ) ;
}

FCKPanel.prototype.Hide = function()
{
        if ( this._Popup )
                this._Popup.hide() ;
}

====================================================
Index: fckplugin.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckplugin.js
 *      FCKPlugin Class: Represents a single plugin.
 *
 * Version:  2.0 RC3
 * Modified: 2005-01-19 17:27:15
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

// Certifies that the "PluginsPath" configuration ends with a slash.
if ( !FCKConfig.PluginsPath.endsWith('/') )
        FCKConfig.PluginsPath += '/' ;

var FCKPlugin = function( name, availableLangs, basePath )
{
        this.Name = name ;
        this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ;
        this.Path = this.BasePath + name + '/' ;

        if ( !availableLangs || availableLangs.length == 0 )
                this.AvailableLangs = new Array() ;
        else
                this.AvailableLangs = availableLangs.split(',') ;
}

FCKPlugin.prototype.Load = function()
{
        // Load the language file, if defined.
        if ( this.AvailableLangs.length > 0 )
        {
                // Check if the plugin has the language file for the active 
language.
                if ( this.AvailableLangs.indexOf( 
FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
                        var sLang = FCKLanguageManager.ActiveLanguage.Code ;
                else
                        // Load the default language file (first one) if the 
current one is not available.
                        var sLang = this.AvailableLangs[0] ;

                // Add the main plugin script.
                FCKScriptLoader.AddScript( this.Path + 'lang/' + sLang + '.js' 
) ;
        }

        // Add the main plugin script.
        FCKScriptLoader.AddScript( this.Path + 'fckplugin.js' ) ;
}

====================================================
Index: fckspecialcombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckspecialcombo.js
 *      FCKSpecialCombo Class: represents a special combo.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-23 18:56:39
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKSpecialCombo = function( caption )
{
        // Default properties values.
        this.FieldWidth         = 80 ;
        this.PanelWidth         = 130 ;
        this.PanelMaxHeight     = 150 ;
        this.Label = ' ' ;
        this.Caption = caption ;

        this.Enabled = true ;

        this.Items = new Object() ;

        this._Panel = new FCKPanel() ;
        this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
        this._Panel.Create() ;
        this._Panel.PanelDiv.className += ' SC_Panel' ;
        this._Panel.PanelDiv.innerHTML = '<table cellpadding="0" 
cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td 
nowrap></td></tr></table>' ;

        this._ItemsHolderEl = 
this._Panel.PanelDiv.getElementsByTagName('TD')[0] ;
}

FCKSpecialCombo.prototype.AddItem = function( id, html, label )
{
        // <div class="SC_Item" onmouseover="this.className='SC_Item 
SC_ItemOver';" onmouseout="this.className='SC_Item';"><b>Bold 1</b></div>
        var oDiv = this._ItemsHolderEl.appendChild( 
this._Panel.Document.createElement( 'DIV' ) ) ;
        oDiv.className = oDiv.originalClass = 'SC_Item' ;
        oDiv.innerHTML = html ;
        oDiv.FCKItemID = id ;
        oDiv.FCKItemLabel = label ? label : id ;
        oDiv.FCKSpecialCombo = this ;
        oDiv.Selected = false ;

        oDiv.onmouseover = function()
        {
                this.className += ' SC_ItemOver' ;
        }

        oDiv.onmouseout = function()
        {
                this.className = this.originalClass ;
        }

        oDiv.onclick = function()
        {
                this.FCKSpecialCombo._Panel.Hide() ;

                this.FCKSpecialCombo.SetLabel( this.FCKItemLabel ) ;

                if ( typeof( this.FCKSpecialCombo.OnSelect ) == 'function' )
                        this.FCKSpecialCombo.OnSelect( this.FCKItemID, this ) ;
        }

        this.Items[ id.toString().toLowerCase() ] = oDiv ;

        return oDiv ;
}

FCKSpecialCombo.prototype.SelectItem = function( itemId )
{
        itemId = itemId ? itemId.toString().toLowerCase() : '' ;

        var oDiv = this.Items[ itemId ] ;
        if ( oDiv )
        {
                oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;
                oDiv.Selected = true ;
        }
}

FCKSpecialCombo.prototype.DeselectAll = function()
{
        for ( var i in this.Items )
        {
                this.Items[i].className = this.Items[i].originalClass = 
'SC_Item' ;
                this.Items[i].Selected = false ;
        }
}

FCKSpecialCombo.prototype.SetLabelById = function( id )
{
        FCKDebug.Output( this.Caption + ': ' + id, '#0000FF' ) ;

        id = id ? id.toString().toLowerCase() : '' ;

        var oDiv = this.Items[ id ] ;
        this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ;
}

FCKSpecialCombo.prototype.SetLabel = function( text )
{
        this.Label = text.length == 0 ? '&nbsp;' : text ;

        if ( this._LabelEl )
                this._LabelEl.innerHTML = this.Label ;
}

FCKSpecialCombo.prototype.SetEnabled = function( isEnabled )
{
        this.Enabled = isEnabled ;

        this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ;
}

FCKSpecialCombo.prototype.Create = function( targetElement )
{
        this._OuterTable = targetElement.appendChild( document.createElement( 
'TABLE' ) ) ;
        this._OuterTable.cellPadding = 0 ;
        this._OuterTable.cellSpacing = 0 ;

        this._OuterTable.insertRow(-1) ;

        if ( this.Caption && this.Caption.length > 0 )
        {
                var oCaptionCell = this._OuterTable.rows[0].insertCell(-1) ;
                oCaptionCell.unselectable = 'on' ;
                oCaptionCell.innerHTML = this.Caption ;
                oCaptionCell.className = 'SC_FieldCaption' ;
        }

        // Create the main DIV element.
        var oField = this._OuterTable.rows[0].insertCell(-1).appendChild( 
document.createElement( 'DIV' ) ) ;
        oField.className = 'SC_Field' ;
        oField.style.width = this.FieldWidth + 'px' ;
        oField.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" 
style="TABLE-LAYOUT: fixed;" unselectable="on"><tbody><tr><td 
class="SC_FieldLabel" unselectable="on"><label 
unselectable="on">&nbsp;</label></td><td class="SC_FieldButton" 
unselectable="on">&nbsp;</td></tr></tbody></table>' ;

        this._LabelEl = oField.getElementsByTagName('label')[0] ;
        this._LabelEl.innerHTML = this.Label ;

        /* Events Handlers */

        oField.SpecialCombo = this ;

        oField.onmouseover = function()
        {
                if ( this.SpecialCombo.Enabled )
                        this.className='SC_Field SC_FieldOver' ;
        }

        oField.onmouseout = function()
        {
                this.className='SC_Field' ;
        }

        oField.onclick = function( e )
        {
                // For Mozilla we must stop the event propagation to avoid it 
hiding
                // the panel because of a click outside of it.
                if ( e )
                {
                        e.stopPropagation() ;
                        FCKPanelEventHandlers.OnDocumentClick( e ) ;
                }

                if ( this.SpecialCombo.Enabled )
                {
                        if ( typeof( this.SpecialCombo.OnBeforeClick ) == 
'function' )
                                this.SpecialCombo.OnBeforeClick( 
this.SpecialCombo ) ;

                        if ( this.SpecialCombo._ItemsHolderEl.offsetHeight > 
this.SpecialCombo.PanelMaxHeight )
                                this.SpecialCombo._Panel.PanelDiv.style.height 
= this.SpecialCombo.PanelMaxHeight + 'px' ;
                        else
                                this.SpecialCombo._Panel.PanelDiv.style.height 
= this.SpecialCombo._ItemsHolderEl.offsetHeight + 'px' ;

                        this.SpecialCombo._Panel.PanelDiv.style.width = 
this.SpecialCombo.PanelWidth + 'px' ;

                        if ( FCKBrowserInfo.IsGecko )
                                
this.SpecialCombo._Panel.PanelDiv.style.overflow = '-moz-scrollbars-vertical' ;

                        this.SpecialCombo._Panel.Show( 0, this.offsetHeight, 
this, null, this.SpecialCombo.PanelMaxHeight, true ) ;
                }

                return false ;
        }
}

/*
Sample Combo Field HTML output:

<div class="SC_Field" style="width: 80px;">
        <table width="100%" cellpadding="0" cellspacing="0" 
style="table-layout: fixed;">
                <tbody>
                        <tr>
                                <td 
class="SC_FieldLabel"><label>&nbsp;</label></td>
                                <td class="SC_FieldButton">&nbsp;</td>
                        </tr>
                </tbody>
        </table>
</div>
*/

====================================================
Index: fckstyledef.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckstyledef.js
 *      FCKStyleDef Class: represents a single stylke definition.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-22 11:09:42
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKStyleDef = function( name, element )
{
        this.Name = name ;
        this.Element = element.toUpperCase() ;
        this.IsObjectElement = FCKRegexLib.ObjectElements.test( this.Element ) ;
        this.Attributes = new Object() ;
}

FCKStyleDef.prototype.AddAttribute = function( name, value )
{
        this.Attributes[ name ] = value ;
}

FCKStyleDef.prototype.GetOpenerTag = function()
{
        var s = '<' + this.Element ;

        for ( var a in this.Attributes )
                s += ' ' + a + '="' + this.Attributes[a] + '"' ;

        return s + '>' ;
}

FCKStyleDef.prototype.GetCloserTag = function()
{
        return '</' + this.Element + '>' ;
}


FCKStyleDef.prototype.RemoveFromSelection = function()
{
        if ( FCKSelection.GetType() == 'Control' )
                this._RemoveMe( FCKSelection.GetSelectedElement() ) ;
        else
                this._RemoveMe( FCKSelection.GetParentElement() ) ;
}

====================================================
Index: fckpanel_gecko.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckpanel_gecko.js
 *      FCKPanel Class: Creates and manages floating panels in Gecko Browsers.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-23 18:56:41
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKPanel = function( parentWindow )
{
        if ( parentWindow )
                this.Window = parentWindow ;
        else
        {
                this.Window = window ;

                while ( this.Window != window.top )
                {
                        // Try/Catch must be used to avoit an error when using 
a frameset
                        // on a different domain:
                        // "Permission denied to get property 
HTMLDocument.Body".
                        try
                        {
                                if ( this.Window.parent.document.body.tagName 
== 'FRAMESET' )
                                        break ;
                        }
                        catch (e)
                        {
                                break ;
                        }

                        this.Window = this.Window.parent ;
                }
        }
}

FCKPanel.prototype.Create = function()
{
        this._IFrame = this.Window.document.body.appendChild( 
this.Window.document.createElement('IFRAME') ) ;
        this._IFrame.src = 'about:blank' ;
    this._IFrame.frameBorder            = '0';
    this._IFrame.scrolling                      = 'no' ;
    this._IFrame.style.left                     = '0px' ;
        this._IFrame.style.top                  = '0px' ;
    this._IFrame.width                          = 10 ;
        this._IFrame.height                             = 10 ;
    this._IFrame.style.position         = 'absolute';
        this._IFrame.style.visibility   = 'hidden' ;

        this._IFrame.IsFCKPanel = true ;
        this._IFrame.Panel              = this ;

        this.Document = this._IFrame.contentWindow.document ;

        // Initialize the IFRAME document body.
        this.Document.open() ;
        this.Document.write( '<html><head></head><body><\/body><\/html>' ) ;
        this.Document.close() ;

        // Remove the default margins.
        this.Document.body.style.margin = this.Document.body.style.padding = 
'0px' ;

        // Add the defined Style Sheet to the document.
        if ( this.StyleSheet )
                FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ;


        this.OuterDiv = this.Document.body.appendChild( 
this.Document.createElement('DIV') ) ;
        this.OuterDiv.style.cssFloat = 'left' ;

        this.PanelDiv = this.OuterDiv.appendChild( 
this.Document.createElement('DIV') ) ;
        this.PanelDiv.className = 'FCK_Panel' ;

        this.Created = true ;
}

FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, 
autoSize  )
{
        if ( ! this.Created )
                this.Create() ;

        if ( width != null && autoSize && width < this.OuterDiv.offsetWidth )
                this.PanelDiv.style.width = width ;

        if ( height != null && autoSize && height < this.PanelDiv.offsetHeight )
                this.PanelDiv.style.height = height + 'px' ;

        var oPos = this.GetElementPosition( relElement ) ;

        panelX += oPos.X ;
        panelY += oPos.Y ;

        if ( panelX + this.OuterDiv.offsetWidth > this.Window.innerWidth )
        {
                // The following line aligns the panel to the other side of the 
refElement.
                // panelX = oPos.X - ( this.PanelDiv.offsetWidth - 
relElement.offsetWidth ) ;

                panelX -= panelX + this.OuterDiv.offsetWidth - 
this.Window.innerWidth ;
        }

        // Set the context menu DIV in the specified location.
        this._IFrame.style.left = panelX + 'px' ;
        this._IFrame.style.top  = panelY + 'px' ;

        // Watch the "OnClick" event for all windows to close the Context Menu.
        function SetOnClickListener( targetWindow, targetFunction )
        {
                // Try/Catch must be used to avoit an error when using a 
frameset
                // on a different domain:
                // "Permission denied to get property Window.frameElement".
                try
                {
                        if ( targetWindow == null || ( 
targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel ) )
                                return ;

                        targetWindow.document.addEventListener( 'click', 
targetFunction, false ) ;
                }
                catch (e) {}

                for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
                        SetOnClickListener( targetWindow.frames[i], 
targetFunction ) ;
        }
        SetOnClickListener( window.top, FCKPanelEventHandlers.OnDocumentClick ) 
;

        this._IFrame.width      = this.OuterDiv.offsetWidth ;
        this._IFrame.height = this.OuterDiv.offsetHeight ;

        // Show it.
        this._IFrame.style.visibility = '' ;
}

FCKPanel.prototype.GetElementPosition = function( el )
{
        // Initializes the Coordinates object that will be returned by the 
function.
        var c = { X:0, Y:0 } ;

        // Loop throw the offset chain.
        while ( el )
        {
                c.X += el.offsetLeft ;
                c.Y += el.offsetTop ;

                if ( el.offsetParent == null && el.ownerDocument.defaultView != 
this.Window )
                        el = el.ownerDocument.defaultView.frameElement ;
                else
                        el = el.offsetParent ;
        }

        // Return the Coordinates object
        return c ;
}

FCKPanel.prototype.Hide = function()
{
        // There is a bug on Firefox over Mac. It doesn't hide the Panel
        // scrollbars, so we must force it.
        this.PanelDiv.style.overflow = 'visible' ;

        this._IFrame.style.visibility = 'hidden' ;
//      this._IFrame.style.left = this._IFrame.style.top = '0px' ;
}

var FCKPanelEventHandlers = new Object() ;

FCKPanelEventHandlers.OnDocumentClick = function( e )
{
        var oWindow = e.target.ownerDocument.defaultView ;

        if ( ! oWindow.IsFCKPanel )
        {
                function RemoveOnClickListener( targetWindow )
                {
                        if ( targetWindow == null )
                                return ;

                        // Try/Catch must be used to avoit an error when using 
a frameset
                        // on a different domain:
                        // "Permission denied to get property 
Window.frameElement".
                        try
                        {
                                if ( targetWindow.frameElement && 
targetWindow.frameElement.IsFCKPanel )
                                        targetWindow.frameElement.Panel.Hide() ;
                                else
                                        
targetWindow.document.removeEventListener( 'click', 
FCKPanelEventHandlers.OnDocumentClick, false ) ;
                        }
                        catch (e) {}

                        for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
                                RemoveOnClickListener( targetWindow.frames[i] ) 
;
                }
                RemoveOnClickListener( window.top ) ;
        }
}

====================================================
Index: fckevents.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckevents.js
 *      FCKEvents Class: used to handle events is a advanced way.
 *
 * Version:  2.0 RC3
 * Modified: 2005-03-02 09:19:48
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKEvents = function( eventsOwner )
{
        this.Owner = eventsOwner ;
        this.RegisteredEvents = new Object() ;
}

FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
{
        if ( ! this.RegisteredEvents[ eventName ] ) this.RegisteredEvents[ 
eventName ] = new Array() ;

        this.RegisteredEvents[ eventName ][ this.RegisteredEvents[ eventName 
].length ] = functionPointer ;
}

FCKEvents.prototype.FireEvent = function( eventName, params )
{
        var bReturnValue = true ;

        var oCalls = this.RegisteredEvents[ eventName ] ;
        if ( oCalls )
        {
                for ( var i = 0 ; i < oCalls.length ; i++ )
                        bReturnValue = ( oCalls[ i ]( params ) && bReturnValue 
) ;
        }

        return bReturnValue ;
}

====================================================
Index: fckcontextmenugroup.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckcontextmenugroup.js
 *      FCKContextMenuGroup Class: represents a group of items in the context
 *      menu. Generaly a group of items is directly dependent of the same rules.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-09 19:35:56
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKContextMenuGroup = function( addSeparator, contextMenu, 
firstItemCommand, firstItemLabel, hasIcon )
{
        this.IsVisible = true ;

        // Array with all available context menu items of this group.
        this.Items = new Array() ;

        if ( addSeparator )
                this.Add( new FCKContextMenuSeparator() ) ;

        if ( contextMenu && firstItemCommand && firstItemLabel )
                this.Add( new FCKContextMenuItem( contextMenu, 
firstItemCommand, firstItemLabel, hasIcon ) ) ;

        // This OPTIONAL function checks if the group must be shown.
        this.ValidationFunction = null ;
}

// Adds an item to the group's items collecion.
FCKContextMenuGroup.prototype.Add = function( contextMenuItem )
{
        this.Items[ this.Items.length ] = contextMenuItem ;
}

// Creates the <TR> elements that represent the item in a table (usually the 
rendered context menu).
FCKContextMenuGroup.prototype.CreateTableRows = function( table )
{
        for ( var i = 0 ; i < this.Items.length ; i++ )
        {
                this.Items[i].CreateTableRow( table ) ;
        }
}

FCKContextMenuGroup.prototype.SetVisible = function( isVisible )
{
        for ( var i = 0 ; i < this.Items.length ; i++ )
        {
                this.Items[i].SetVisible( isVisible ) ;
        }

        this.IsVisible = isVisible ;
}

FCKContextMenuGroup.prototype.RefreshState = function()
{
        if ( ! this.IsVisible ) return ;

        for ( var i = 0 ; i < this.Items.length ; i++ )
        {
                this.Items[i].RefreshState() ;
        }
}

====================================================
Index: fckcontextmenuitem.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckcontextmenuitem.js
 *      FCKContextMenuItem Class: represents a item in the context menu.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-23 23:44:49
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKContextMenuItem = function( contextMenu, commandName, label, hasIcon )
{
        this.ContextMenu        = contextMenu ;
        this.Command            = FCKCommands.GetCommand( commandName ) ;
        this.Label                      = label ? label : commandName ;
        this.HasIcon            = hasIcon ? true : false ;
}

FCKContextMenuItem.prototype.CreateTableRow = function( targetTable )
{
        // Creates the <TR> element.
        this._Row = targetTable.insertRow(-1) ;
        this._Row.className = 'CM_Disabled' ;
        this._Row.FCKContextMenuItem = this ;

        // Sets the mouse over event.
        this._Row.onmouseover = function()
        {
                if ( this.className != 'CM_Disabled' )
                        this.className = 'CM_Over' ;
        }

        // Sets the mouse out event.
        this._Row.onmouseout = function()
        {
                if ( this.className != 'CM_Disabled' )
                        this.className = 'CM_Option' ;
        }

        this._Row.onclick = function()
        {
                if ( this.className != 'CM_Disabled' )
                {
                        this.FCKContextMenuItem.ContextMenu.Hide() ;
                        this.FCKContextMenuItem.Command.Execute() ;
                }
                return false ;
        }

        var oCell = this._Row.insertCell(-1) ;
        oCell.className = 'CM_Icon' ;

        if ( this.HasIcon ) oCell.innerHTML = '<img alt="" src="' + 
FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + '.gif" 
width="21" height="20" unselectable="on">' ;

        oCell = this._Row.insertCell(-1) ;
        oCell.className         = 'CM_Label' ;
        oCell.unselectable      = 'on' ;
        oCell.noWrap            = true ;
        oCell.innerHTML         = this.Label ;
}

FCKContextMenuItem.prototype.SetVisible = function( isVisible )
{
        this._Row.style.display = isVisible ? '' : 'none' ;
}

FCKContextMenuItem.prototype.RefreshState = function()
{
        switch ( this.Command.GetState() )
        {
                case FCK_TRISTATE_ON :
                case FCK_TRISTATE_OFF :
                        this._Row.className = 'CM_Option' ;
                        break ;
                default :
                        this._Row.className = 'CM_Disabled' ;
                        break ;
        }
}

/*
Sample output.
-----------------------------------------
<tr class="CM_Disabled">
        <td class="CM_Icon"><img alt="" src="icons/cut.gif" width="21" 
height="20" unselectable="on"></td>
        <td class="CM_Label" unselectable="on">Cut</td>
</tr>
-----------------------------------------
<tr class="CM_Option" onmouseover="OnOver(this);" onmouseout="OnOut(this);">
        <td class="CM_Icon"></td>
        <td class="CM_Label">Do Something</td>
</tr>
*/

====================================================
Index: fckcontextmenuseparator.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckcontextmenuseparator.js
 *      FCKContextMenuSeparator Class: represents a separator in the toolbar.
 *
 * Version:  2.0 RC3
 * Modified: 2004-05-31 23:07:47
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKContextMenuSeparator = function()
{
}

FCKContextMenuSeparator.prototype.CreateTableRow = function( targetTable )
{
        // Creates the <TR> element.
        this._Row = targetTable.insertRow(-1) ;
        this._Row.className = 'CM_Separator' ;

        var oCell = this._Row.insertCell(-1) ;
        oCell.className = 'CM_Icon' ;

        oCell = this._Row.insertCell(-1) ;
        oCell.className = 'CM_Label' ;
        oCell.innerHTML = '<div></div>' ;
}

FCKContextMenuSeparator.prototype.SetVisible = function( isVisible )
{
        this._Row.style.display = isVisible ? '' : 'none' ;
}

FCKContextMenuSeparator.prototype.RefreshState = function()
{
        // Do nothing... its state doesn't change.
}

/*
Sample output.
-----------------------------------------
<tr class="CM_Separator">
        <td class="CM_Icon"></td>
        <td class="CM_Label"><div></div></td>
</tr>
*/

====================================================
Index: fckstyledef_gecko.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckstyledef_gecko.js
 *      FCKStyleDef Class: represents a single stylke definition. (Gecko 
specific)
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-22 11:09:45
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

FCKStyleDef.prototype.ApplyToSelection = function()
{
        if ( FCKSelection.GetType() == 'Text' && !this.IsObjectElement )
        {
                var oSelection = FCK.EditorWindow.getSelection() ;

                // Create the main element.
                var e = FCK.EditorDocument.createElement( this.Element ) ;

                for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
                {
                        e.appendChild( 
oSelection.getRangeAt(i).extractContents() ) ;
                }

                // Set the attributes.
                this._AddAttributes( e ) ;

                // Remove the duplicated elements.
                this._RemoveDuplicates( e ) ;

                var oRange = oSelection.getRangeAt(0) ;
                oRange.insertNode( e ) ;
        }
        else
        {
                var oControl = FCKSelection.GetSelectedElement() ;
                if ( oControl.tagName == this.Element )
                        this._AddAttributes( oControl ) ;
        }
}

FCKStyleDef.prototype._AddAttributes = function( targetElement )
{
        for ( var a in this.Attributes )
                targetElement.setAttribute( a, this.Attributes[a], 0 ) ;
}

FCKStyleDef.prototype._RemoveDuplicates = function( parent )
{
        for ( var i = 0 ; i < parent.childNodes.length ; i++ )
        {
                var oChild = parent.childNodes[i] ;

                if ( oChild.nodeType != 1 )
                        continue ;

                this._RemoveDuplicates( oChild ) ;

                if ( this.IsEqual( oChild ) )
                        FCKTools.RemoveOuterTags( oChild ) ;
        }
}

FCKStyleDef.prototype.IsEqual = function( e )
{
        if ( e.tagName != this.Element )
                return false ;

        for ( var a in this.Attributes )
        {
                if ( e.getAttribute( a ) != this.Attributes[a] )
                        return false ;
        }

        return true ;
}

FCKStyleDef.prototype._RemoveMe = function( elementToCheck )
{
        if ( ! elementToCheck )
                return ;

        var oParent = elementToCheck.parentNode ;

        if ( elementToCheck.nodeType == 1 && this.IsEqual( elementToCheck ) )
        {
                if ( this.IsObjectElement )
                {
                        for ( var a in this.Attributes )
                                elementToCheck.removeAttribute( a, 0 ) ;
                        return ;
                }
                else
                        FCKTools.RemoveOuterTags( elementToCheck ) ;
        }

        this._RemoveMe( oParent ) ;
}

====================================================
Index: fckstyledef_ie.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckstyledef_ie.js
 *      FCKStyleDef Class: represents a single stylke definition. (IE specific)
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-22 11:09:44
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

FCKStyleDef.prototype.ApplyToSelection = function()
{
        var oSelection = FCK.EditorDocument.selection ;

        if ( oSelection.type == 'Text' )
        {
                var oRange = oSelection.createRange() ;

                // Create the main element.
                var e = document.createElement( this.Element ) ;
                e.innerHTML = oRange.htmlText ;

                // Set the attributes.
                this._AddAttributes( e ) ;

                // Remove the duplicated elements.
                this._RemoveDuplicates( e ) ;

                // Replace the selection with the resulting HTML.
                oRange.pasteHTML( e.outerHTML ) ;
        }
        else if ( oSelection.type == 'Control' )
        {
                var oControl = FCKSelection.GetSelectedElement() ;
                if ( oControl.tagName == this.Element )
                        this._AddAttributes( oControl ) ;
        }
}

FCKStyleDef.prototype._AddAttributes = function( targetElement )
{
        for ( var a in this.Attributes )
        {
                if ( a.toLowerCase() == 'style' )
                        targetElement.style.cssText = this.Attributes[a] ;
                else
                        targetElement.setAttribute( a, this.Attributes[a], 0 ) ;
        }
}

FCKStyleDef.prototype._RemoveDuplicates = function( parent )
{
        for ( var i = 0 ; i < parent.children.length ; i++ )
        {
                var oChild = parent.children[i] ;
                this._RemoveDuplicates( oChild ) ;

                if ( this.IsEqual( oChild ) )
                {
                        oChild.insertAdjacentHTML( 'beforeBegin', 
oChild.innerHTML ) ;
                        oChild.parentElement.removeChild( oChild ) ;
                }
        }
}

FCKStyleDef.prototype.IsEqual = function( e )
{
        if ( e.tagName != this.Element )
                return false ;

        for ( var a in this.Attributes )
        {
                switch ( a.toLowerCase() )
                {
                        case 'style' :
                                if ( e.style.cssText.toLowerCase() != 
this.Attributes[a].toLowerCase() )
                                        return false ;
                                break ;
                        case 'class' :
                                if ( e.getAttribute( 'className', 0 ) != 
this.Attributes[a] )
                                        return false ;
                                break ;
                        default :
                                if ( e.getAttribute( a, 0 ) != 
this.Attributes[a] )
                                        return false ;
                }
        }

        return true ;
}

FCKStyleDef.prototype._RemoveMe = function( elementToCheck )
{
        if ( ! elementToCheck )
                return ;

        var oParent = elementToCheck.parentElement ;

        if ( this.IsEqual( elementToCheck ) )
        {
                if ( this.IsObjectElement )
                {
                        for ( var a in this.Attributes )
                        {
                                switch ( a.toLowerCase() )
                                {
                                        case 'class' :
                                                elementToCheck.removeAttribute( 
'className', 0 ) ;
                                                break ;
                                        default :
                                                elementToCheck.removeAttribute( 
a, 0 ) ;
                                }
                        }
                        return ;
                }
                else
                        FCKTools.RemoveOuterTags( elementToCheck ) ;
        }

        this._RemoveMe( oParent ) ;
}

====================================================
Index: fcktoolbarcombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarcombo.js
 *      FCKToolbarCombo Class: represents a combo in the toolbar.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-10 17:14:48
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarCombo = function( commandName, label, itemsValues, itemsNames, 
tooltip, style, firstIsBlank, itemsSeparator, sourceView )
{
        this.Command    = FCKCommands.GetCommand( commandName ) ;

        this.Label              = label ? label : commandName ;
        this.Tooltip    = tooltip ? tooltip : ( label ? label : commandName) ;
        this.Style              = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
        this.SourceView = sourceView ? true : false ;
        this.State              = FCK_UNKNOWN ;

        this.ItemsValues        = itemsValues ;
        this.ItemsNames         = itemsNames ? itemsNames : itemsValues ;
        this.ItemsSeparator     = itemsSeparator ? itemsSeparator : ';' ;

        this.FirstIsBlank       = firstIsBlank != null ? firstIsBlank : true ;
}

FCKToolbarCombo.prototype.CreateInstance = function( parentToolbar )
{
/*
        <td class="TB_Combo_Disabled" unselectable="on">
                <table class="ButtonType_IconText" cellspacing="0" 
cellpadding="0" border="0">
                        <tr>
                                <td class="TB_Text" unselectable="on">Style</td>
                                <td><select title="Style"><option>Style 
1</option><option>Style 2</option></select></td>
                        </tr>
                </table>
        </td>
*/
        this.DOMDiv = document.createElement( 'div' ) ;
        this.DOMDiv.className           = 'TB_Combo_Off' ;

        // Gets the correct CSS class to use for the specified style (param).
        var sClass ;
        switch ( this.Style )
        {
                case FCK_TOOLBARITEM_ONLYICON :
                        sClass = 'TB_ButtonType_Icon' ;
                        break ;
                case FCK_TOOLBARITEM_ONLYTEXT :
                        sClass = 'TB_ButtonType_Text' ;
                        break ;
                case FCK_TOOLBARITEM_ICONTEXT :
                        sClass = '' ;
                        break ;
        }

        this.DOMDiv.innerHTML =
                '<table class="' + sClass + '" cellspacing="0" cellpadding="0" 
border="0" unselectable="on">' +
                        '<tr>' +
                                '<td class="TB_Text" unselectable="on" nowrap>' 
+ this.Label + '</td>' +
                                '<td unselectable="on"><select title="' + 
this.Tooltip + '"></select></td>' +
                        '</tr>' +
                '</table>' ;

        // Gets the SELECT element.
        this.SelectElement = 
this.DOMDiv.firstChild.firstChild.firstChild.childNodes.item(1).firstChild ;

        this.SelectElement.FCKToolbarCombo = this ;

        this.SelectElement.onchange = function()
        {
                this.FCKToolbarCombo.Command.Execute( this.value ) ;
                return false ;
        }

        var oCell = parentToolbar.DOMRow.insertCell(-1) ;
        oCell.appendChild( this.DOMDiv ) ;

        // Loads all combo items.
        this.RefreshItems() ;

        // Sets its initial state (probably disabled).
        this.RefreshState() ;
}

FCKToolbarCombo.prototype.RefreshItems = function()
{
        // Create the empty arrays of items to add (names and values)
        var aNames      = FCKTools.GetResultingArray( this.ItemsNames, 
this.ItemsSeparator ) ;
        var aValues     = FCKTools.GetResultingArray( this.ItemsValues, 
this.ItemsSeparator ) ;

        // Clean up the combo.
        FCKTools.RemoveAllSelectOptions( this.SelectElement ) ;

        // Verifies if the first item in the combo must be blank.
        if ( this.FirstIsBlank )
                FCKTools.AddSelectOption( document, this.SelectElement, '', '' 
) ;

        // Add all items to the combo.
        for ( var i = 0 ; i < aValues.length ; i++ )
        {
                FCKTools.AddSelectOption( document, this.SelectElement, 
aNames[i], aValues[i] ) ;
        }
}

FCKToolbarCombo.prototype.RefreshState = function()
{
        // Gets the actual state.
        var eState ;

        if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
        {
                eState = FCK_TRISTATE_DISABLED ;

                // Cleans the actual selection.
                this.SelectElement.value = '' ;
        }
        else
        {
                var sValue = this.Command.GetState() ;

                // Sets the combo value.
                FCKTools.SelectNoCase( this.SelectElement, sValue ? sValue : 
'', '' ) ;

                // Gets the actual state.
                eState = sValue == null ? FCK_TRISTATE_DISABLED : 
FCK_TRISTATE_ON ;
        }

        // If there are no state changes then do nothing and return.
        if ( eState == this.State ) return ;

        // Sets the actual state.
        this.State = eState ;

        // Updates the graphical state.
        this.DOMDiv.className           = ( eState == FCK_TRISTATE_ON ? 
'TB_Combo_Off' : 'TB_Combo_Disabled' ) ;
        this.SelectElement.disabled     = ( eState == FCK_TRISTATE_DISABLED ) ;
}


====================================================
Index: fcktoolbarfontformatcombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarfontformatcombo.js
 *      FCKToolbarPanelButton Class: Handles the Fonts combo selector.
 *
 * Version:  2.0 RC3
 * Modified: 2004-12-05 22:25:20
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarFontFormatCombo = function()
{
        this.Command =  FCKCommands.GetCommand( 'FontFormat' ) ;
}

// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ;

FCKToolbarFontFormatCombo.prototype.GetLabel = function()
{
        return FCKLang.FontFormat ;
}

FCKToolbarFontFormatCombo.prototype.CreateItems = function( targetSpecialCombo )
{
        // Get the format names from the language file.
        var aNames = FCKLang['FontFormats'].split(';') ;
        var oNames = {
                p               : aNames[0],
                pre             : aNames[1],
                address : aNames[2],
                h1              : aNames[3],
                h2              : aNames[4],
                h3              : aNames[5],
                h4              : aNames[6],
                h5              : aNames[7],
                h6              : aNames[8],
                div             : aNames[9]
        } ;

        // Get the available formats from the configuration file.
        var aTags = FCKConfig.FontFormats.split(';') ;

        for ( var i = 0 ; i < aTags.length ; i++ )
        {
                if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
                        continue ;
                this._Combo.AddItem( aTags[i], '<' + aTags[i] + '>' + 
oNames[aTags[i]] + '</' + aTags[i] + '>', oNames[aTags[i]] ) ;
        }
}

====================================================
Index: fcktoolbarfontscombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarfontscombo.js
 *      FCKToolbarPanelButton Class: Handles the Fonts combo selector.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-19 07:50:38
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarFontsCombo = function()
{
        this.Command =  FCKCommands.GetCommand( 'FontName' ) ;
}

// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontsCombo.prototype = new FCKToolbarSpecialCombo ;

FCKToolbarFontsCombo.prototype.GetLabel = function()
{
        return FCKLang.Font ;
}

FCKToolbarFontsCombo.prototype.CreateItems = function( targetSpecialCombo )
{
        var aFonts = FCKConfig.FontNames.split(';') ;

        for ( var i = 0 ; i < aFonts.length ; i++ )
                this._Combo.AddItem( aFonts[i], '<span style="font-family: \'' 
+ aFonts[i] + '\'; font-size: 12px;">' + aFonts[i] + '</span>' ) ;
}

====================================================
Index: fcktoolbarfontsizecombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarfontsizecombo.js
 *      FCKToolbarPanelButton Class: Handles the Fonts combo selector.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-19 07:50:29
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarFontSizeCombo = function()
{
        this.Command =  FCKCommands.GetCommand( 'FontSize' ) ;
}

// Inherit from FCKToolbarSpecialCombo.
FCKToolbarFontSizeCombo.prototype = new FCKToolbarSpecialCombo ;

FCKToolbarFontSizeCombo.prototype.GetLabel = function()
{
        return FCKLang.FontSize ;
}

FCKToolbarFontSizeCombo.prototype.CreateItems = function( targetSpecialCombo )
{
        targetSpecialCombo.FieldWidth = 70 ;

        var aSizes = FCKConfig.FontSizes.split(';') ;

        for ( var i = 0 ; i < aSizes.length ; i++ )
        {
                var aSizeParts = aSizes[i].split('/') ;
                this._Combo.AddItem( aSizeParts[0], '<font size="' + 
aSizeParts[0] + '">' + aSizeParts[1] + '</font>', aSizeParts[1] ) ;
        }
}

====================================================
Index: fcktoolbarbutton.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarbutton.js
 *      FCKToolbarButton Class: represents a button in the toolbar.
 *
 * Version:  2.0 RC3
 * Modified: 2005-01-18 11:07:28
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarButton = function( commandName, label, tooltip, style, 
sourceView, contextSensitive )
{
        this.Command                    = FCKCommands.GetCommand( commandName ) 
;
        this.Label                              = label ? label : commandName ;
        this.Tooltip                    = tooltip ? tooltip : ( label ? label : 
commandName) ;
        this.Style                              = style ? style : 
FCK_TOOLBARITEM_ONLYICON ;
        this.SourceView                 = sourceView ? true : false ;
        this.ContextSensitive   = contextSensitive ? true : false ;
        this.IconPath                   = FCKConfig.SkinPath + 'toolbar/' + 
commandName.toLowerCase() + '.gif' ;
        this.State                              = FCK_UNKNOWN ;
}

FCKToolbarButton.prototype.CreateInstance = function( parentToolbar )
{
/*
        <td title="Bold" class="TB_Button_Off" unselectable="on" 
onmouseover="Button_OnMouseOver(this);" onmouseout="Button_OnMouseOut(this);">
                <table class="TB_ButtonType_Icon" cellspacing="0" 
cellpadding="0" border="0">
                        <tr>
                                <td class="TB_Icon"><img src="icons/redo.gif" 
width="21" height="21"></td>
                                <td class="TB_Text" unselectable="on">Redo</td>
                        </tr>
                </table>
        </td>
*/
        this.DOMDiv = document.createElement( 'div' ) ;
        this.DOMDiv.className           = 'TB_Button_Off' ;

        this.DOMDiv.FCKToolbarButton    = this ;

        this.DOMDiv.onmouseover = function()
        {
                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED )
                {
                        this.className = 'TB_Button_On' ;
                }
        }

        this.DOMDiv.onmouseout  = function()
        {
                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED &&  
this.FCKToolbarButton.State != FCK_TRISTATE_ON )
                {
                        this.className = 'TB_Button_Off' ;
                }
        }

        this.DOMDiv.onclick = function()
        {
                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED )
                        this.FCKToolbarButton.Command.Execute() ;
                return false ;
        }

        // Gets the correct CSS class to use for the specified style (param).
        var sClass ;
        switch ( this.Style )
        {
                case FCK_TOOLBARITEM_ONLYICON :
                        sClass = 'TB_ButtonType_Icon' ;
                        break ;
                case FCK_TOOLBARITEM_ONLYTEXT :
                        sClass = 'TB_ButtonType_Text' ;
                        break ;
                case FCK_TOOLBARITEM_ICONTEXT :
                        sClass = '' ;
                        break ;
        }

        this.DOMDiv.innerHTML =
                '<table title="' + this.Tooltip + '" class="' + sClass + '" 
cellspacing="0" cellpadding="0" border="0" unselectable="on">' +
                        '<tr>' +
                                '<td class="TB_Icon" unselectable="on"><img 
src="' + this.IconPath + '" width="21" height="21" unselectable="on"></td>' +
                                '<td class="TB_Text" unselectable="on">' + 
this.Label + '</td>' +
                        '</tr>' +
                '</table>' ;


        var oCell = parentToolbar.DOMRow.insertCell(-1) ;
        oCell.appendChild( this.DOMDiv ) ;

        this.RefreshState() ;
}

FCKToolbarButton.prototype.RefreshState = function()
{
/*
        TODO: Delete this commend block on stable version.
        // Gets the actual state.
//      var eState ;

//      if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
//              eState = FCK_TRISTATE_DISABLED ;
//      else
*/
        // Gets the actual state.
        var eState = this.Command.GetState() ;

        // If there are no state changes than do nothing and return.
        if ( eState == this.State ) return ;

        // Sets the actual state.
        this.State = eState ;

        switch ( this.State )
        {
                case FCK_TRISTATE_ON :
                        this.DOMDiv.className = 'TB_Button_On' ;
                        break ;
                case FCK_TRISTATE_OFF :
                        this.DOMDiv.className = 'TB_Button_Off' ;
                        break ;
                default :
                        this.DOMDiv.className = 'TB_Button_Disabled' ;
                        break ;
        }
}

FCKToolbarButton.prototype.Enable = function()
{
        this.RefreshState() ;
}

FCKToolbarButton.prototype.Disable = function()
{
        this.State = FCK_TRISTATE_DISABLED ;
        this.DOMDiv.className = 'TB_Button_Disabled' ;
}

====================================================
Index: fcktoolbarbreak_ie.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarbreak_ie.js
 *      FCKToolbarBreak Class: breaks the toolbars.
 *      It makes it possible to force the toolbar to brak to a new line.
 *      This is the IE specific implementation.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-09 18:07:44
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarBreak = function()
{
        var oBreakDiv = document.createElement( 'div' ) ;

        oBreakDiv.className = 'TB_Break' ;

        oBreakDiv.style.clear = FCKLang.Dir == 'rtl' ? 'left' : 'right' ;

        FCKToolbarSet.DOMElement.appendChild( oBreakDiv ) ;
}

====================================================
Index: fckstylesloader.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckstylesloader.js
 *      FCKStylesLoader Class: this class define objects that are responsible
 *      for loading the styles defined in the XML file.
 *
 * Version:  2.0 RC3
 * Modified: 2004-11-22 18:08:11
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKStylesLoader = function()
{
        this.Styles = new Object() ;
        this.StyleGroups = new Object() ;
        this.Loaded = false ;
        this.HasObjectElements = false ;
}

FCKStylesLoader.prototype.Load = function( stylesXmlUrl )
{
        // Load the XML file into a FCKXml object.
        var oXml = new FCKXml() ;
        oXml.LoadUrl( stylesXmlUrl ) ;

        // Get the "Style" nodes defined in the XML file.
        var aStyleNodes = oXml.SelectNodes( 'Styles/Style' ) ;

        // Add each style to our "Styles" collection.
        for ( var i = 0 ; i < aStyleNodes.length ; i++ )
        {
                var sElement = 
aStyleNodes[i].attributes.getNamedItem('element').value.toUpperCase() ;

                // Create the style definition object.
                var oStyleDef = new FCKStyleDef( 
aStyleNodes[i].attributes.getNamedItem('name').value, sElement ) ;

                if ( oStyleDef.IsObjectElement )
                        this.HasObjectElements = true ;

                // Get the attributes defined for the style (if any).
                var aAttNodes = oXml.SelectNodes( 'Attribute', aStyleNodes[i] ) 
;

                // Add the attributes to the style definition object.
                for ( var j = 0 ; j < aAttNodes.length ; j++ )
                {
                        var sAttName    = 
aAttNodes[j].attributes.getNamedItem('name').value ;
                        var sAttValue   = 
aAttNodes[j].attributes.getNamedItem('value').value ;

                        // IE changes the "style" attribute value when applied 
to an element
                        // so we must get the final resulting value (for 
comparision issues).
                        if ( sAttName.toLowerCase() == 'style' )
                        {
                                var oTempE = document.createElement( 'SPAN' ) ;
                                oTempE.style.cssText = sAttValue ;
                                sAttValue = oTempE.style.cssText ;
                        }

                        oStyleDef.AddAttribute( sAttName, sAttValue ) ;
                }

                // Add the style to the "Styles" collection using it's name as 
the key.
                this.Styles[ oStyleDef.Name ] = oStyleDef ;

                // Add the style to the "StyleGroups" collection.
                var aGroup = this.StyleGroups[sElement] ;
                if ( aGroup == null )
                {
                        this.StyleGroups[sElement] = new Array() ;
                        aGroup = this.StyleGroups[sElement] ;
                }
                aGroup[aGroup.length] = oStyleDef ;
        }

        this.Loaded = true ;
}

====================================================
Index: fcktoolbar.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbar.js
 *      FCKToolbar Class: represents a toolbar. A toolbar is not the complete
 *      toolbar set visible, but just a strip on it... a group of items.
 *
 * Version:  2.0 RC3
 * Modified: 2004-05-31 23:07:47
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbar = function()
{
        this.Items = new Array() ;

        this.DOMTable = document.createElement( 'table' ) ;
        this.DOMTable.className = 'TB_Toolbar' ;
        with ( this.DOMTable )
        {
                // Sets the toolbar direction. IE uses "styleFloat" and Gecko 
uses "cssFloat".
                style.styleFloat = style.cssFloat = FCKLang.Dir == 'rtl' ? 
'right' : 'left' ;

                cellPadding = 0 ;
                cellSpacing = 0 ;
                border = 0 ;
        }

        this.DOMRow = this.DOMTable.insertRow(-1) ;

        var oCell = this.DOMRow.insertCell(-1) ;
        oCell.className = 'TB_Start' ;
        oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 
'images/toolbar.start.gif" width="7" height="21" style="VISIBILITY: hidden" 
onload="this.style.visibility = \'\';" unselectable="on">' ;

        FCKToolbarSet.DOMElement.appendChild( this.DOMTable ) ;
}

FCKToolbar.prototype.AddItem = function( toolbarItem )
{
        this.Items[ this.Items.length ] = toolbarItem ;
        toolbarItem.CreateInstance( this ) ;
}

FCKToolbar.prototype.AddSeparator = function()
{
        var oCell = this.DOMRow.insertCell(-1) ;
        oCell.unselectable = 'on' ;
        oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 
'images/toolbar.separator.gif" width="5" height="21" style="VISIBILITY: hidden" 
onload="this.style.visibility = \'\';" unselectable="on">' ;
}

FCKToolbar.prototype.AddTerminator = function()
{
        var oCell = this.DOMRow.insertCell(-1) ;
        oCell.className = 'TB_End' ;
        oCell.innerHTML = '<img src="' + FCKConfig.SkinPath + 
'images/toolbar.end.gif" width="12" height="21" style="VISIBILITY: hidden" 
onload="this.style.visibility = \'\';" unselectable="on">' ;
}


====================================================
Index: fcktoolbarbreak_gecko.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarbreak_gecko.js
 *      FCKToolbarBreak Class: breaks the toolbars.
 *      It makes it possible to force the toolbar to brak to a new line.
 *      This is the Gecko specific implementation.
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-09 18:04:04
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarBreak = function()
{
        var oBreakDiv = document.createElement( 'div' ) ;

        oBreakDiv.style.clear = oBreakDiv.style.cssFloat = FCKLang.Dir == 'rtl' 
? 'right' : 'left' ;

        FCKToolbarSet.DOMElement.appendChild( oBreakDiv ) ;
}

====================================================
Index: fcktoolbarpanelbutton.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarpanelbutton.js
 *      FCKToolbarPanelButton Class: represents a special button in the toolbar
 *      that shows a panel when pressed.
 *
 * Version:  2.0 RC3
 * Modified: 2005-01-10 15:28:31
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarPanelButton = function( commandName, label, tooltip, style )
{
        this.Command    = FCKCommands.GetCommand( commandName ) ;
        this.Label              = label ? label : commandName ;
        this.Tooltip    = tooltip ? tooltip : ( label ? label : commandName) ;
        this.Style              = style ? style : FCK_TOOLBARITEM_ONLYICON ;
        this.State              = FCK_UNKNOWN ;
}

FCKToolbarPanelButton.prototype.CreateInstance = function( parentToolbar )
{
/*
        <td title="Bold" class="TB_Button_Off" unselectable="on" 
onmouseover="Button_OnMouseOver(this);" onmouseout="Button_OnMouseOut(this);">
                <table class="TB_ButtonType_Icon" cellspacing="0" 
cellpadding="0" border="0">
                        <tr>
                                <td class="TB_Icon"><img src="icons/redo.gif" 
width="21" height="21" style="VISIBILITY: hidden" onload="this.style.visibility 
= '';"></td>
                                <td class="TB_Text" unselectable="on">Redo</td>
                                <td class="TB_ButtonArrow"><img 
src="skin/images/toolbar_buttonarrow.gif" width="5" height="3"></td>
                        </tr>
                </table>
        </td>
*/
        this.DOMDiv = document.createElement( 'div' ) ;
        this.DOMDiv.className = 'TB_Button_Off' ;

        this.DOMDiv.FCKToolbarButton = this ;

        this.DOMDiv.onmouseover = function()
        {
                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED )
                {
                        this.className = 'TB_Button_On' ;
                }
        }

        this.DOMDiv.onmouseout  = function()
        {
                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED &&  
this.FCKToolbarButton.State != FCK_TRISTATE_ON )
                {
                        this.className = 'TB_Button_Off' ;
                }
        }

        this.DOMDiv.onclick = function( e )
        {
                // For Mozilla we must stop the event propagation to avoid it 
hiding
                // the panel because of a click outside of it.
                if ( e )
                {
                        e.stopPropagation() ;
                        FCKPanelEventHandlers.OnDocumentClick( e ) ;
                }

                if ( this.FCKToolbarButton.State != FCK_TRISTATE_DISABLED )
                {
                        this.FCKToolbarButton.Command.Execute(0, 
this.FCKToolbarButton.DOMDiv.offsetHeight, this.FCKToolbarButton.DOMDiv) ;
//                      this.FCKToolbarButton.HandleOnClick( 
this.FCKToolbarButton, e ) ;
                }

                return false ;
        }

        // Gets the correct CSS class to use for the specified style (param).
        var sClass ;
        switch ( this.Style )
        {
                case FCK_TOOLBARITEM_ONLYICON :
                        sClass = 'TB_ButtonType_Icon' ;
                        break ;
                case FCK_TOOLBARITEM_ONLYTEXT :
                        sClass = 'TB_ButtonType_Text' ;
                        break ;
                case FCK_TOOLBARITEM_ICONTEXT :
                        sClass = '' ;
                        break ;
        }

        this.DOMDiv.innerHTML =
                '<table title="' + this.Tooltip + '" class="' + sClass + '" 
cellspacing="0" cellpadding="0" border="0" unselectable="on">' +
                        '<tr>' +
                                '<td class="TB_Icon" unselectable="on"><img 
src="' + FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + 
'.gif" width="21" height="21" unselectable="on"></td>' +
                                '<td class="TB_Text" unselectable="on">' + 
this.Label + '</td>' +
                                '<td class="TB_ButtonArrow" 
unselectable="on"><img src="' + FCKConfig.SkinPath + 
'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
                        '</tr>' +
                '</table>' ;


        var oCell = parentToolbar.DOMRow.insertCell(-1) ;
        oCell.appendChild( this.DOMDiv ) ;

        this.RefreshState() ;
}

// The Panel Button works like a normal button so the refresh state functions
// defined for the normal button can be reused here.
FCKToolbarPanelButton.prototype.RefreshState    = 
FCKToolbarButton.prototype.RefreshState ;
FCKToolbarPanelButton.prototype.Enable                  = 
FCKToolbarButton.prototype.Enable ;
FCKToolbarPanelButton.prototype.Disable                 = 
FCKToolbarButton.prototype.Disable ;

====================================================
Index: fcktoolbarspecialcombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarspecialcombo.js
 *      FCKToolbarSpecialCombo Class: This is a "abstract" base class to be used
 *      by the special combo toolbar elements like font name, font size, 
paragraph format, etc...
 *
 *      The following properties and methods must be implemented when 
inheriting from
 *      this class:
 *              - Property:     Command                                         
                [ The command to be executed ]
 *              - Method:       GetLabel()                                      
                [ Returns the label ]
 *              -                       CreateItems( targetSpecialCombo )       
[ Add all items in the special combo ]
 *
 * Version:  2.0 RC3
 * Modified: 2005-01-04 18:41:03
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarSpecialCombo = function()
{
        this.SourceView                 = false ;
        this.ContextSensitive   = true ;
}

FCKToolbarSpecialCombo.prototype.CreateInstance = function( parentToolbar )
{
        this._Combo = new FCKSpecialCombo( this.GetLabel() ) ;
        this._Combo.FieldWidth = 100 ;
        this._Combo.PanelWidth = 150 ;
        this._Combo.PanelMaxHeight = 150 ;

        this.CreateItems( this._Combo ) ;

        this._Combo.Create( parentToolbar.DOMRow.insertCell(-1) ) ;

        this._Combo.Command = this.Command ;

        this._Combo.OnSelect = function( itemId, item )
        {
                this.Command.Execute( itemId, item ) ;
        }
}

FCKToolbarSpecialCombo.prototype.RefreshState = function()
{
        // Gets the actual state.
        var eState ;

//      if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
//              eState = FCK_TRISTATE_DISABLED ;
//      else
//      {
                var sValue = this.Command.GetState() ;

                if ( sValue != FCK_TRISTATE_DISABLED )
                {
                        eState = FCK_TRISTATE_ON ;

                        if ( !this.RefreshActiveItems )
                        {
                                this.RefreshActiveItems = function( combo, 
value )
                                {
                                        this._Combo.DeselectAll() ;
                                        this._Combo.SelectItem( value ) ;
                                        this._Combo.SetLabelById( value ) ;
                                }
                        }
                        this.RefreshActiveItems( this._Combo, sValue ) ;
                }
                else
                        eState = FCK_TRISTATE_DISABLED ;
//      }

        // If there are no state changes then do nothing and return.
        if ( eState == this.State ) return ;

        if ( eState == FCK_TRISTATE_DISABLED )
        {
                this._Combo.DeselectAll() ;
                this._Combo.SetLabel( '' ) ;
        }

        // Sets the actual state.
        this.State = eState ;

        // Updates the graphical state.
        this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ;
}

FCKToolbarSpecialCombo.prototype.Enable = function()
{
        this.RefreshState() ;
}

FCKToolbarSpecialCombo.prototype.Disable = function()
{
        this.State = FCK_TRISTATE_DISABLED ;
        this._Combo.DeselectAll() ;
        this._Combo.SetLabel( '' ) ;
        this._Combo.SetEnabled( false ) ;
}

====================================================
Index: fcktoolbarstylecombo.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fcktoolbarstylecombo.js
 *      FCKToolbarPanelButton Class: Handles the Fonts combo selector.
 *
 * Version:  2.0 RC3
 * Modified: 2004-12-31 15:04:31
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKToolbarStyleCombo = function()
{
        this.Command = FCKCommands.GetCommand( 'Style' ) ;
}

// Inherit from FCKToolbarSpecialCombo.
FCKToolbarStyleCombo.prototype = new FCKToolbarSpecialCombo ;

FCKToolbarStyleCombo.prototype.GetLabel = function()
{
        return FCKLang.Style ;
}

FCKToolbarStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
{
        // Add the Editor Area CSS to the Styles panel so the style classes are 
previewed correctly.
        FCKTools.AppendStyleSheet( targetSpecialCombo._Panel.Document, 
FCKConfig.EditorAreaCSS ) ;

        // For some reason Gecko is blocking inside the "RefreshVisibleItems" 
function.
        if ( ! FCKBrowserInfo.IsGecko )
                targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ;

        // Add the styles to the special combo.
        for ( var s in this.Command.Styles )
        {
                var oStyle = this.Command.Styles[s] ;
                if ( oStyle.IsObjectElement )
                        var oItem = targetSpecialCombo.AddItem( s, s ) ;
                else
                        var oItem = targetSpecialCombo.AddItem( s, 
oStyle.GetOpenerTag() + s + oStyle.GetCloserTag() ) ;
                oItem.Style = oStyle ;
        }
}

FCKToolbarStyleCombo.prototype.RefreshActiveItems = function( 
targetSpecialCombo )
{
        // Clear the actual selection.
        targetSpecialCombo.DeselectAll() ;

        // Get the active styles.
        var aStyles = this.Command.GetActiveStyles() ;

        if ( aStyles.length > 0 )
        {
                // Select the active styles in the combo.
                for ( var i = 0 ; i < aStyles.length ; i++ )
                        targetSpecialCombo.SelectItem( aStyles[i].Name ) ;

                // Set the combo label to the first style in the collection.
                targetSpecialCombo.SetLabelById( aStyles[0].Name ) ;
        }
        else
                targetSpecialCombo.SetLabel('') ;
}

FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( 
targetSpecialCombo )
{
        if ( FCKSelection.GetType() == 'Control' )
                var sTagName = FCKSelection.GetSelectedElement().tagName ;

        for ( var i in targetSpecialCombo.Items )
        {
                var oItem = targetSpecialCombo.Items[i] ;
                if ( ( sTagName && oItem.Style.Element == sTagName ) || ( ! 
sTagName && ! oItem.Style.IsObjectElement ) )
                        oItem.style.display = '' ;
                else
                        oItem.style.display = 'none' ;  // For some reason 
Gecko is blocking here.
        }
}

====================================================
Index: fckxml_gecko.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckxml_gecko.js
 *      FCKXml Class: class to load and manipulate XML files.
 *
 * Version:  2.0 RC3
 * Modified: 2005-03-02 12:42:44
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKXml = function()
{}

FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{
        var oFCKXml = this ;

        var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ;

        var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;

        oXmlHttp.open( "GET", urlToCall, bAsync ) ;

        if ( bAsync )
        {
                oXmlHttp.onreadystatechange = function()
                {
                        if ( oXmlHttp.readyState == 4 )
                        {
                                oFCKXml.DOMDocument = oXmlHttp.responseXML ;
                                asyncFunctionPointer( oFCKXml ) ;
                        }
                }
        }

        oXmlHttp.send( null ) ;

        if ( ! bAsync )
        {
                if ( oXmlHttp.status == 200 )
                        this.DOMDocument = oXmlHttp.responseXML ;
                else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
                        this.DOMDocument = oXmlHttp.responseXML ;
                else
                        alert( 'Error loading "' + urlToCall + '"' ) ;
        }
}

FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
        var aNodeArray = new Array();

        var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? 
contextNode : this.DOMDocument,
                        
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 
XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
        if ( xPathResult )
        {
                var oNode = xPathResult.iterateNext() ;
                while( oNode )
                {
                        aNodeArray[aNodeArray.length] = oNode ;
                        oNode = xPathResult.iterateNext();
                }
        }
        return aNodeArray ;
}

FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
        var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? 
contextNode : this.DOMDocument,
                        
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);

        if ( xPathResult && xPathResult.singleNodeValue )
                return xPathResult.singleNodeValue ;
        else
                return null ;
}

====================================================
Index: fckxml_ie.js
/*
 * FCKeditor - The text editor for internet
 * Copyright (C) 2003-2004 Frederico Caldeira Knabben
 *
 * Licensed under the terms of the GNU Lesser General Public License:
 *              http://www.opensource.org/licenses/lgpl-license.php
 *
 * For further information visit:
 *              http://www.fckeditor.net/
 *
 * File Name: fckxml_ie.js
 *      FCKXml Class: class to load and manipulate XML files.
 *      (IE specific implementation)
 *
 * Version:  2.0 RC3
 * Modified: 2005-02-27 22:15:31
 *
 * File Authors:
 *              Frederico Caldeira Knabben (address@hidden)
 */

var FCKXml = function()
{}

FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
{
        var oFCKXml = this ;

        var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ;

        var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;

        oXmlHttp.open( "GET", urlToCall, bAsync ) ;

        if ( bAsync )
        {
                oXmlHttp.onreadystatechange = function()
                {
                        if ( oXmlHttp.readyState == 4 )
                        {
                                oFCKXml.DOMDocument = oXmlHttp.responseXML ;
                                asyncFunctionPointer( oFCKXml ) ;
                        }
                }
        }

        oXmlHttp.send( null ) ;

        if ( ! bAsync )
        {
                if ( oXmlHttp.status == 200 )
                        this.DOMDocument = oXmlHttp.responseXML ;
                else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
                {
                        oFCKXml.DOMDocument = FCKTools.CreateXmlObject( 
'DOMDocument' ) ;
                        oFCKXml.DOMDocument.async = false ;
                        oFCKXml.DOMDocument.resolveExternals = false ;
                        oFCKXml.DOMDocument.loadXML( oXmlHttp.responseText ) ;
                }
                else
                        alert( 'Error loading "' + urlToCall + '"' ) ;
        }
}

FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
        if ( contextNode )
                return contextNode.selectNodes( xpath ) ;
        else
                return this.DOMDocument.selectNodes( xpath ) ;
}

FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
        if ( contextNode )
                return contextNode.selectSingleNode( xpath ) ;
        else
                return this.DOMDocument.selectSingleNode( xpath ) ;
}






reply via email to

[Prev in Thread] Current Thread [Next in Thread]