------------
1. Copy fckeditor folder to modules/.
2. Download FCKeditor 2.0 from http://www.fckeditor.net and copy the
- distribution files to modules/fckeditor/lib. (not required)
+ distribution files to modules/fckeditor/lib.
Copyright (C) 2003-2004 Frederico Caldeira Knabben
http://www.opensource.org/licenses/lgpl-license.php
http://www.fckeditor.net/
-
\ No newline at end of file
+
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-05-31 23:07:47
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKContextMenuGroup = function()
-{
- this.IsVisible = true ;
-
- // Array with all available context menu items of this group.
- this.Items = new Array() ;
-
- // 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() ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-10 17:14:48
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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()
- {
- 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/button.' + 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/button.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>
-*/
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-05-31 23:07:47
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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>
-*/
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-12-04 16:52:36
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKEvents = function( eventsOwner )
-{
- this.Owner = eventsOwner ;
- this.RegisteredEvents = new Object() ;
-}
-
-FCKEvents.prototype.AttachEvent = function( eventName, functionPointer, params )
-{
- 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 ;
-
- FCKDebug.Output( 'Firing event: ' + eventName, 'Fuchsia' ) ;
-
- var oCalls = this.RegisteredEvents[ eventName ] ;
- if ( oCalls )
- {
- for ( var i = 0 ; i < oCalls.length ; i++ )
- {
- if ( typeof( oCalls[ i ] ) == "function" ) // A Function Pointer
- bReturnValue = ( bReturnValue && oCalls[ i ]( params ) ) ;
- else // A string (code to run)
- bReturnValue = ( bReturnValue && eval( oCalls[ i ] ) ) ;
- }
- }
-
- return bReturnValue ;
-}
-
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-10 13:22:16
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKPanel = function( parentWindow )
-{
- if ( parentWindow )
- this.Window = parentWindow ;
- else
- {
- this.Window = window ;
-
- while ( this.Window != window.top && this.Window.parent.document.body.tagName != 'FRAMESET' )
- {
- 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 )
- {
- if ( targetWindow == null || ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel ) )
- return ;
-
- targetWindow.document.addEventListener( 'click', targetFunction, false ) ;
-
- 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()
-{
- 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 ;
-
- if ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel )
- targetWindow.frameElement.Panel.Hide() ;
- else
- targetWindow.document.removeEventListener( 'click', FCKPanelEventHandlers.OnDocumentClick, false ) ;
-
- for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
- RemoveOnClickListener( targetWindow.frames[i] ) ;
- }
- RemoveOnClickListener( window.top ) ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-10 13:20:42
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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() ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 11:12:10
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Certifies that the "PluginsPath" configuration ends with a slash.
-if ( !FCKConfig.PluginsPath.endsWith('/') )
- FCKConfig.PluginsPath += '/' ;
-
-var FCKPlugin = function( name, availableLangs )
-{
- this.Name = name ;
- this.Path = FCKConfig.PluginsPath + name + '/' ;
-
- if ( 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' ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 11:10:06
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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 ? ' ' : 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"> </label></td><td class="SC_FieldButton" unselectable="on"> </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' ;
- 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> </label></td>
- <td class="SC_FieldButton"> </td>
- </tr>
- </tbody>
- </table>
-</div>
-*/
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 11:09:42
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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() ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 11:09:45
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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 ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 11:09:44
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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 ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-22 18:08:11
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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 ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-05-31 23:07:47
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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">' ;
-}
-
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-16 00:40:01
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKToolbarButton = function( commandName, label, tooltip, style, sourceView )
-{
- 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.IconPath = FCKConfig.SkinPath + 'toolbar/button.' + 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/button.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()
-{
- // Gets the actual state.
- var eState ;
-
- if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
- eState = FCK_TRISTATE_DISABLED ;
- else
- 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 ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-10 17:14:48
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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 ) ;
-}
-
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-12-05 22:25:20
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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]] ) ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-19 07:50:38
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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>' ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-19 07:50:29
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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] ) ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-30 09:26:22
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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/button.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/button.' + 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 function
-// defined for the normal button can be reused here.
-FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-15 10:53:54
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKToolbarSpecialCombo = function()
-{}
-
-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 ( typeof( this.RefreshActiveItems ) == 'function' )
- this.RefreshActiveItems( this._Combo ) ;
- else
- {
- this._Combo.DeselectAll() ;
- this._Combo.SelectItem( sValue ) ;
- this._Combo.SetLabelById( 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 ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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 RC2
- * Modified: 2004-11-19 07:50:11
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-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.
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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.js
- * FCKXml Class: class to load and manipulate XML files.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 11:13:07
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKXml = function()
-{}
-
-FCKXml.prototype.GetHttpRequest = function()
-{
- if ( window.XMLHttpRequest ) // Gecko
- return new XMLHttpRequest() ;
- else if ( window.ActiveXObject ) // IE
- return new ActiveXObject("MsXml2.XmlHttp") ;
-}
-
-FCKXml.prototype.LoadUrl = function( urlToCall, asyncFunctionPointer )
-{
- var oFCKXml = this ;
-
- var bAsync = ( typeof(asyncFunctionPointer) == 'function' ) ;
-
- var oXmlHttp = this.GetHttpRequest() ;
-
- 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 && oXmlHttp.status && oXmlHttp.status == 200 )
- this.DOMDocument = oXmlHttp.responseXML ;
- else
- throw( 'Error loading "' + urlToCall + '"' ) ;
-}
-
-FCKXml.prototype.SelectNodes = function( xpath, contextNode )
-{
- if ( document.all ) // IE
- {
- if ( contextNode )
- return contextNode.selectNodes( xpath ) ;
- else
- return this.DOMDocument.selectNodes( xpath ) ;
- }
- else // Gecko
- {
- 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 )
-{
- if ( document.all ) // IE
- {
- if ( contextNode )
- return contextNode.selectSingleNode( xpath ) ;
- else
- return this.DOMDocument.selectSingleNode( xpath ) ;
- }
- else // Gecko
- {
- 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 ;
- }
-}
+++ /dev/null
-/*
- * 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: fck_othercommands.js
- * Definition of other commands that are not available internaly in the
- * browser (see FCKNamedCommand).
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-15 13:28:09
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// ### General Dialog Box Commands.
-var FCKDialogCommand = function( name, title, url, width, height, getStateFunction, getStateParam )
-{
- this.Name = name ;
- this.Title = title ;
- this.Url = url ;
- this.Width = width ;
- this.Height = height ;
-
- this.GetStateFunction = getStateFunction ;
- this.GetStateParam = getStateParam ;
-}
-
-FCKDialogCommand.prototype.Execute = function()
-{
- FCKDialog.OpenDialog( 'FCKDialog_' + this.Name , this.Title, this.Url, this.Width, this.Height ) ;
-}
-
-FCKDialogCommand.prototype.GetState = function()
-{
- if ( this.GetStateFunction )
- return this.GetStateFunction( this.GetStateParam ) ;
- else
- return FCK_TRISTATE_OFF ;
-}
-
-// Generic Undefined command (usually used when a command is under development).
-var FCKUndefinedCommand = function()
-{
- this.Name = 'Undefined' ;
-}
-
-FCKUndefinedCommand.prototype.Execute = function()
-{
- alert( FCKLang.NotImplemented ) ;
-}
-
-FCKUndefinedCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
-
-// ### FontName
-var FCKFontNameCommand = function()
-{
- this.Name = 'FontName' ;
-}
-
-FCKFontNameCommand.prototype.Execute = function( fontName )
-{
- if (fontName == null || fontName == "")
- {
- // TODO: Remove font name attribute.
- }
- else
- FCK.ExecuteNamedCommand( 'FontName', fontName ) ;
-}
-
-FCKFontNameCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandValue( 'FontName' ) ;
-}
-
-// ### FontSize
-var FCKFontSizeCommand = function()
-{
- this.Name = 'FontSize' ;
-}
-
-FCKFontSizeCommand.prototype.Execute = function( fontSize )
-{
- if ( typeof( fontSize ) == 'string' ) fontSize = parseInt(fontSize) ;
-
- if ( fontSize == null || fontSize == '' )
- {
- // TODO: Remove font size attribute (Now it works with size 3. Will it work forever?)
- FCK.ExecuteNamedCommand( 'FontSize', 3 ) ;
- }
- else
- FCK.ExecuteNamedCommand( 'FontSize', fontSize ) ;
-}
-
-FCKFontSizeCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandValue( 'FontSize' ) ;
-}
-
-// ### FormatBlock
-var FCKFormatBlockCommand = function()
-{
- this.Name = 'FormatBlock' ;
-}
-
-FCKFormatBlockCommand.prototype.Execute = function( formatName )
-{
- if ( formatName == null || formatName == '' )
- FCK.ExecuteNamedCommand( 'FormatBlock', '<P>' ) ;
- else
- FCK.ExecuteNamedCommand( 'FormatBlock', '<' + formatName + '>' ) ;
-}
-
-FCKFormatBlockCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandValue( 'FormatBlock' ) ;
-}
-
-// ### Preview
-var FCKPreviewCommand = function()
-{
- this.Name = 'Preview' ;
-}
-
-FCKPreviewCommand.prototype.Execute = function()
-{
- FCK.Preview() ;
-}
-
-FCKPreviewCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
-
-// ### Save
-var FCKSaveCommand = function()
-{
- this.Name = 'Save' ;
-}
-
-FCKSaveCommand.prototype.Execute = function()
-{
- // Get the linked field form.
- var oForm = FCK.LinkedField.form ;
-
- // Submit the form.
- oForm.submit() ;
-}
-
-FCKSaveCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
-
-// ### NewPage
-var FCKNewPageCommand = function()
-{
- this.Name = 'NewPage' ;
-}
-
-FCKNewPageCommand.prototype.Execute = function()
-{
- FCK.SetHTML( FCKBrowserInfo.IsGecko ? ' ' : '' ) ;
-}
-
-FCKNewPageCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
-
-// ### Source button
-var FCKSourceCommand = function()
-{
- this.Name = "Source" ;
-}
-
-FCKSourceCommand.prototype.Execute = function()
-{
- FCK.SwitchEditMode() ;
-}
-
-FCKSourceCommand.prototype.GetState = function()
-{
- return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcknamedcommand.js
- * FCKNamedCommand Class: represents an internal browser command.
- *
- * Version: 2.0 RC2
- * Modified: 2004-08-17 15:05:35
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKNamedCommand = function( commandName )
-{
- this.Name = commandName ;
-}
-
-FCKNamedCommand.prototype.Execute = function()
-{
- FCK.ExecuteNamedCommand( this.Name ) ;
-}
-
-FCKNamedCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandState( this.Name ) ;
-}
-
+++ /dev/null
-/*
- * 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: fckpasteplaintextcommand.js
- * FCKPastePlainTextCommand Class: represents the
- * "Paste as Plain Text" command.
- *
- * Version: 2.0 RC2
- * Modified: 2004-08-20 23:08:23
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKPastePlainTextCommand = function()
-{
- this.Name = 'PasteText' ;
-}
-
-FCKPastePlainTextCommand.prototype.Execute = function()
-{
- FCK.PasteAsPlainText() ;
-}
-
-FCKPastePlainTextCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandState( 'Paste' ) ;
-}
+++ /dev/null
-/*
- * 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: fckpastewordcommand.js
- * FCKPasteWordCommand Class: represents the "Paste from Word" command.
- *
- * Version: 2.0 RC2
- * Modified: 2004-08-30 23:20:46
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKPasteWordCommand = function()
-{
- this.Name = 'PasteWord' ;
-}
-
-FCKPasteWordCommand.prototype.Execute = function()
-{
- FCK.PasteFromWord() ;
-}
-
-FCKPasteWordCommand.prototype.GetState = function()
-{
- return FCK.GetNamedCommandState( 'Paste' ) ;
-}
+++ /dev/null
-/*
- * 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: fckstylecommand.js
- * FCKStyleCommand Class: represents the "Style" command.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 11:07:24
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKStyleCommand = function()
-{
- this.Name = 'Style' ;
-
- // Load the Styles defined in the XML file.
- this.StylesLoader = new FCKStylesLoader() ;
- this.StylesLoader.Load( FCKConfig.StylesXmlPath ) ;
- this.Styles = this.StylesLoader.Styles ;
-}
-
-FCKStyleCommand.prototype.Execute = function( styleName, styleComboItem )
-{
- if ( styleComboItem.Selected )
- styleComboItem.Style.RemoveFromSelection() ;
- else
- styleComboItem.Style.ApplyToSelection() ;
-
- FCK.Focus() ;
-
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
-}
-
-FCKStyleCommand.prototype.GetState = function()
-{
- var oSelection = FCK.EditorDocument.selection ;
-
- if ( FCKSelection.GetType() == 'Control' )
- {
- var e = FCKSelection.GetSelectedElement() ;
- if ( e )
- return this.StylesLoader.StyleGroups[ e.tagName ] ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
- else
- FCK_TRISTATE_OFF ;
- }
- else
- return FCK_TRISTATE_OFF ;
-}
-
-FCKStyleCommand.prototype.GetActiveStyles = function()
-{
- var aActiveStyles = new Array() ;
-
- if ( FCKSelection.GetType() == 'Control' )
- this._CheckStyle( FCKSelection.GetSelectedElement(), aActiveStyles, false ) ;
- else
- this._CheckStyle( FCKSelection.GetParentElement(), aActiveStyles, true ) ;
-
- return aActiveStyles ;
-}
-
-FCKStyleCommand.prototype._CheckStyle = function( element, targetArray, checkParent )
-{
- if ( ! element )
- return ;
-
- if ( element.nodeType == 1 )
- {
- var aStyleGroup = this.StylesLoader.StyleGroups[ element.tagName ] ;
- if ( aStyleGroup )
- {
- for ( var i = 0 ; i < aStyleGroup.length ; i++ )
- {
- if ( aStyleGroup[i].IsEqual( element ) )
- targetArray[ targetArray.length ] = aStyleGroup[i] ;
- }
- }
- }
-
- if ( checkParent )
- this._CheckStyle( element.parentNode, targetArray, checkParent ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcktablecommand.js
- * FCKPastePlainTextCommand Class: represents the
- * "Paste as Plain Text" command.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 15:41:58
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKTableCommand = function( command )
-{
- this.Name = command ;
-}
-
-FCKTableCommand.prototype.Execute = function()
-{
- switch ( this.Name )
- {
- case 'TableInsertRow' :
- FCKTableHandler.InsertRow() ;
- break ;
- case 'TableDeleteRows' :
- FCKTableHandler.DeleteRows() ;
- break ;
- case 'TableInsertColumn' :
- FCKTableHandler.InsertColumn() ;
- break ;
- case 'TableDeleteColumns' :
- FCKTableHandler.DeleteColumns() ;
- break ;
- case 'TableInsertCell' :
- FCKTableHandler.InsertCell() ;
- break ;
- case 'TableDeleteCells' :
- FCKTableHandler.DeleteCells() ;
- break ;
- case 'TableMergeCells' :
- FCKTableHandler.MergeCells() ;
- break ;
- case 'TableSplitCell' :
- FCKTableHandler.SplitCell() ;
- break ;
- default :
- alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ;
- }
-}
-
-FCKTableCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcktextcolorcommand.js
- * FCKTextColorCommand Class: represents the text color comand. It shows the
- * color selection panel.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-19 08:16:00
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// FCKTextColorCommand Contructor
-// type: can be 'ForeColor' or 'BackColor'.
-var FCKTextColorCommand = function( type )
-{
- this.Name = type == 'ForeColor' ? 'TextColor' : 'BGColor' ;
- this.Type = type ;
-
- /* BEGIN ###
- The panel should be created in the "Execute" method for best
- memory use, but it not works in Gecko in that way.
- */
-
- this._Panel = new FCKPanel() ;
- this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
- this._Panel.Create() ;
-
- this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ;
-
- // END ###
-}
-
-FCKTextColorCommand.prototype.Execute = function( panelX, panelY, relElement )
-{
- /*
- BEGIN ###
- This is the right code to create the panel, but it is not
- working well with Gecko, so it has been moved to the
- class contructor.
-
- // Create the Color Panel if needed.
- if ( ! this._Panel )
- {
- this._Panel = new FCKPanel() ;
- this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
- this._Panel.Create() ;
-
- this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ;
- }
- END ###
- */
-
- // We must "cache" the actual panel type to be used in the SetColor method.
- FCK._ActiveColorPanelType = this.Type ;
-
- // Show the Color Panel at the desired position.
- this._Panel.Show( panelX, panelY, relElement ) ;
-}
-
-FCKTextColorCommand.prototype.SetColor = function( color )
-{
- if ( FCK._ActiveColorPanelType == 'ForeColor' )
- FCK.ExecuteNamedCommand( 'ForeColor', color ) ;
- else if ( FCKBrowserInfo.IsGecko )
- FCK.ExecuteNamedCommand( 'hilitecolor', color ) ;
- else
- FCK.ExecuteNamedCommand( 'BackColor', color ) ;
-
- // Delete the "cached" active panel type.
- delete FCK._ActiveColorPanelType ;
-}
-
-FCKTextColorCommand.prototype.GetState = function()
-{
- return FCK_TRISTATE_OFF ;
-}
-
-FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targetDiv )
-{
- function CreateSelectionDiv()
- {
- var oDiv = targetDocument.createElement( "DIV" ) ;
- oDiv.className = 'ColorDeselected' ;
- oDiv.onmouseover = function() { this.className='ColorSelected' ; } ;
- oDiv.onmouseout = function() { this.className='ColorDeselected' ; } ;
-
- return oDiv ;
- }
-
- // Create the Table that will hold all colors.
- var oTable = targetDiv.appendChild( targetDocument.createElement( "TABLE" ) ) ;
- oTable.style.tableLayout = 'fixed' ;
- oTable.cellPadding = 0 ;
- oTable.cellSpacing = 0 ;
- oTable.border = 0 ;
- oTable.width = 150 ;
-
- var oCell = oTable.insertRow(-1).insertCell(-1) ;
- oCell.colSpan = 8 ;
-
- // Create the Button for the "Automatic" color selection.
- var oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
- oDiv.innerHTML =
- '<table cellspacing="0" cellpadding="0" width="100%" border="0">\
- <tr>\
- <td><div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #000000"></div></div></td>\
- <td nowrap width="100%" align="center" unselectable="on">' + FCKLang.ColorAutomatic + '</td>\
- </tr>\
- </table>' ;
-
- oDiv.Command = this ;
- oDiv.onclick = function()
- {
- this.className = 'ColorDeselected' ;
- this.Command.SetColor( '' ) ;
- this.Command._Panel.Hide() ;
- }
-
- // Create an array of colors based on the configuration file.
- var aColors = FCKConfig.FontColors.split(',') ;
-
- // Create the colors table based on the array.
- var iCounter = 0 ;
- while ( iCounter < aColors.length )
- {
- var oRow = oTable.insertRow(-1) ;
-
- for ( var i = 0 ; i < 8 && iCounter < aColors.length ; i++, iCounter++ )
- {
- var oDiv = oRow.insertCell(-1).appendChild( CreateSelectionDiv() ) ;
- oDiv.Color = aColors[iCounter] ;
- oDiv.innerHTML = '<div class="ColorBoxBorder"><div class="ColorBox" style="background-color: #' + aColors[iCounter] + '"></div></div>' ;
-
- oDiv.Command = this ;
- oDiv.onclick = function()
- {
- this.className = 'ColorDeselected' ;
- this.Command.SetColor( '#' + this.Color ) ;
- this.Command._Panel.Hide() ;
- }
- }
- }
-
- // Create the Row and the Cell for the "More Colors..." button.
- var oCell = oTable.insertRow(-1).insertCell(-1) ;
- oCell.colSpan = 8 ;
-
- var oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
- oDiv.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td nowrap align="center">' + FCKLang.ColorMoreColors + '</td></tr></table>' ;
-
- oDiv.Command = this ;
- oDiv.onclick = function()
- {
- this.className = 'ColorDeselected' ;
- this.Command._Panel.Hide() ;
- FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, this.Command.SetColor ) ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fck_constants.js
- * Defines some constants used by the editor. These constants are also
- * globally available in the page where the editor is placed.
- *
- * Version: 2.0 RC2
- * Modified: 2004-05-31 23:07:48
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Editor Instance Status.
-FCK_STATUS_NOTLOADED = window.parent.FCK_STATUS_NOTLOADED = 0 ;
-FCK_STATUS_ACTIVE = window.parent.FCK_STATUS_ACTIVE = 1 ;
-FCK_STATUS_COMPLETE = window.parent.FCK_STATUS_COMPLETE = 2 ;
-
-// Tristate Operations.
-FCK_TRISTATE_OFF = window.parent.FCK_TRISTATE_OFF = 0 ;
-FCK_TRISTATE_ON = window.parent.FCK_TRISTATE_ON = 1 ;
-FCK_TRISTATE_DISABLED = window.parent.FCK_TRISTATE_DISABLED = -1 ;
-
-// For unknown values.
-FCK_UNKNOWN = window.parent.FCK_UNKNOWN = -1000 ;
-
-// Toolbar Items Style.
-FCK_TOOLBARITEM_ONLYICON = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 0 ;
-FCK_TOOLBARITEM_ONLYTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 1 ;
-FCK_TOOLBARITEM_ICONTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 2 ;
-
-// Edit Mode
-FCK_EDITMODE_WYSIWYG = window.parent.FCK_EDITMODE_WYSIWYG = 0 ;
-FCK_EDITMODE_SOURCE = window.parent.FCK_EDITMODE_SOURCE = 1 ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckeditorapi.js
- * Create the FCKeditorAPI object that is available as a global object in
- * the page where the editor is placed in.
- *
- * Version: 2.0 RC2
- * Modified: 2004-05-31 23:07:48
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKeditorAPI ;
-
-if ( !window.parent.FCKeditorAPI )
-{
- // Make the FCKeditorAPI object available in the parent window.
- FCKeditorAPI = window.parent.FCKeditorAPI = new Object() ;
- FCKeditorAPI.__Instances = new Object() ;
-
- // Set the current version.
- FCKeditorAPI.Version = '2.0 RC2' ;
-
- // Function used to get a instance of an existing editor present in the
- // page.
- FCKeditorAPI.GetInstance = function( instanceName )
- {
- return this.__Instances[ instanceName ] ;
- }
-}
-else
- FCKeditorAPI = window.parent.FCKeditorAPI ;
-
-// Add the current instance to the FCKeditorAPI's instances collection.
-FCKeditorAPI.__Instances[ FCK.Name ] = FCK ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fck.js
- * Creation and initialization of the "FCK" object. This is the main object
- * that represents an editor instance.
- *
- * Version: 2.0 RC2
- * Modified: 2004-05-31 23:07:48
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// FCK represents the active editor instance
-var FCK = new Object() ;
-FCK.Name = FCKURLParams[ 'InstanceName' ] ;
-FCK.LinkedField = window.parent.document.getElementById( FCK.Name ) ;
-
-FCK.Status = FCK_STATUS_NOTLOADED ;
-FCK.EditMode = FCK_EDITMODE_WYSIWYG ;
-
-FCK.PasteEnabled = false ;
+++ /dev/null
-/*
- * 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: fck_1.js
- * This is the first part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 12:47:38
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCK.Events = new FCKEvents( FCK ) ;
-FCK.Toolbar = null ;
-
-FCK.StartEditor = function()
-{
- // Get the editor's window and document (DOM)
- this.EditorWindow = window.frames[ 'eEditorArea' ] ;
- this.EditorDocument = this.EditorWindow.document ;
-
- // TODO: Wait stable version and remove the following commented lines.
- // The Base Path of the editor is saved to rebuild relative URL (IE issue).
-// this.BaseUrl = this.EditorDocument.location.protocol + '//' + this.EditorDocument.location.host ;
-
- // Set the editor's startup contents
- this.SetHTML( FCKTools.GetLinkedFieldValue() ) ;
-
- // Set the editor area CSS file.
- FCKTools.AppendStyleSheet( this.EditorDocument, FCKConfig.EditorAreaCSS ) ;
-
- // Attach the editor to the form onsubmit event
- FCKTools.AttachToLinkedFieldFormSubmit( this.UpdateLinkedField ) ;
-
- // Initialize the default browser behaviors (browser specific).
- this.InitializeBehaviors() ;
-}
-
-FCK.SetStatus = function( newStatus )
-{
- this.Status = newStatus ;
-
- if ( newStatus == FCK_STATUS_ACTIVE )
- {
- // Force the focus in the window to go to the editor.
- window.onfocus = window.document.body.onfocus = FCK.Focus ;
-
- // Force the focus in the editor.
- if ( FCKConfig.StartupFocus )
- FCK.Focus() ;
-
-
-
- if ( FCKBrowserInfo.IsIE )
- FCKScriptLoader.AddScript( 'js/fckeditorcode_ie_2.js' ) ;
- else
- FCKScriptLoader.AddScript( 'js/fckeditorcode_gecko_2.js' ) ;
-
- }
-
- this.Events.FireEvent( 'OnStatusChange', newStatus ) ;
- if ( this.OnStatusChange ) this.OnStatusChange( newStatus ) ;
-
-}
-
-FCK.GetHTML = function()
-{
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
- {
- // TODO: Wait stable version and remove the following commented lines.
-// if ( FCKBrowserInfo.IsIE )
-// FCK.CheckRelativeLinks() ;
-
- return this.EditorDocument.body.innerHTML ;
- }
- else
- return document.getElementById('eSourceField').value ;
-}
-
-FCK.GetXHTML = function()
-{
- var bSource = ( FCK.EditMode == FCK_EDITMODE_SOURCE ) ;
-
- if ( bSource )
- this.SwitchEditMode() ;
-
- // TODO: Wait stable version and remove the following commented lines.
-// if ( FCKBrowserInfo.IsIE )
-// FCK.CheckRelativeLinks() ;
-
- var sXHTML = FCKXHtml.GetXHTML( this.EditorDocument.body ) ;
-
- if ( bSource )
- this.SwitchEditMode() ;
-
- return sXHTML ;
-}
-
-FCK.UpdateLinkedField = function()
-{
- if ( FCKConfig.EnableXHTML )
- FCKTools.SetLinkedFieldValue( FCK.GetXHTML() ) ;
- else
- FCKTools.SetLinkedFieldValue( FCK.GetHTML() ) ;
-}
-
-FCK.ShowContextMenu = function( x, y )
-{
- if ( this.Status != FCK_STATUS_COMPLETE )
- return ;
-
- FCKContextMenu.Show( x, y ) ;
- this.Events.FireEvent( "OnContextMenu" ) ;
-}
-
+++ /dev/null
-/*
- * 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: fck_1_gecko.js
- * This is the first part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- * (Gecko specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-15 13:26:29
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCK.Description = "FCKeditor for Gecko Browsers" ;
-
-FCK.InitializeBehaviors = function()
-{
- // Disable Right-Click
- var oOnContextMenu = function( e )
- {
- e.preventDefault() ;
- FCK.ShowContextMenu( e.clientX, e.clientY ) ;
- }
- this.EditorDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
-
- var oOnKeyDown = function( e )
- {
- if ( e.ctrlKey && !e.shiftKey && !e.altKey )
- {
- // Char 86/118 = V/v
- if ( e.which == 86 || e.which == 118 )
- {
- if ( FCK.Status == FCK_STATUS_COMPLETE )
- {
- if ( !FCK.Events.FireEvent( "OnPaste" ) )
- e.preventDefault() ;
- }
- else
- e.preventDefault() ;
- }
- }
- }
- this.EditorDocument.addEventListener( 'keydown', oOnKeyDown, true ) ;
-
- var oOnSelectionChange = function( e )
- {
- /*
- var bIsDifferent = false ;
- var oActualSel = FCK.EditorWindow.getSelection() ;
-
- if ( FCK.LastSelection )
- {
- if ( FCK.LastSelection.rangeCount != oActualSel.rangeCount )
- {
- bIsDifferent = true ;
- }
- else
- {
- if ( oActualSel.rangeCount == 1 )
- {
- var oRangeA = oActualSel.getRangeAt(0) ;
- var oRangeB = FCK.LastSelection.getRangeAt(0) ;
-
- FCKDebug.Output( 'collapsed: ' + oRangeA.collapsed ) ;
- if ( oRangeA.collapsed )
- {
- FCKDebug.Output( 'startContainerBranch: ' + oRangeA.startContainerBranch + ' == ' + oRangeB.startContainerBranch ) ;
- FCKDebug.Output( 'Container: ' + oRangeA.startContainer.childNodes[ oRangeA.startOffset ] + ' == ' + oRangeB.commonAncestorContainer.parent ) ;
- if
- (
- !oRangeB.collapsed ||
- oRangeA.startContainer.childNodes[ oRangeA.startOffset ] != oRangeB.startContainer.childNodes[ oRangeB.startOffset ] ||
- oRangeA.commonAncestorContainer.parent != oRangeB.commonAncestorContainer.parent )
- {
- bIsDifferent = true ;
- }
- }
- else
- {
- bIsDifferent = true ;
- }
- }
- else
- {
- bIsDifferent == true ;
- }
- }
- }
- else
- {
- bIsDifferent = true ;
- }
-
- FCK.LastSelection = oActualSel ;
-
- FCKDebug.Output( 'bIsDifferent: ' + bIsDifferent ) ;
-
- if ( bIsDifferent )
- {*/
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
- //}
- }
-
- this.EditorDocument.addEventListener( 'mouseup', oOnSelectionChange, false ) ;
- this.EditorDocument.addEventListener( 'keyup', oOnSelectionChange, false ) ;
-
- this.MakeEditable() ;
-
- this.SetStatus( FCK_STATUS_ACTIVE ) ;
-}
-
-FCK.MakeEditable = function()
-{
- this.EditorDocument.designMode = 'on' ;
-
- // Tell Gecko to use or not the <SPAN> tag for the bold, italic and underline.
- this.EditorDocument.execCommand( 'useCSS', false, !FCKConfig.GeckoUseSPAN ) ;
-}
-
-FCK.Focus = function()
-{
- try
- {
- FCK.EditorWindow.focus() ;
- }
- catch(e) {}
-}
-
-FCK.SetHTML = function( html, forceWYSIWYG )
-{
- if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG )
- {
- // On Gecko we must disable editing before setting the innerHTML.
-// FCK.EditorDocument.designMode = "off" ;
-
- FCK.EditorDocument.body.innerHTML = html ;
-
- // On Gecko we must set the desingMode on again after setting the innerHTML.
-// FCK.EditorDocument.designMode = 'on' ;
-
- // Tell Gecko to use or not the <SPAN> tag for the bold, italic and underline.
-// FCK.EditorDocument.execCommand( "useCSS", false, !FCKConfig.GeckoUseSPAN ) ;
- }
- else
- document.getElementById('eSourceField').value = html ;
-}
-
+++ /dev/null
-/*
- * 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: fck_1_ie.js
- * This is the first part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- * (IE specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-21 23:51:51
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCK.Description = "FCKeditor for Internet Explorer 5.5+" ;
-
-FCK.InitializeBehaviors = function()
-{
- // Set the focus to the editable area when clicking in the document area.
- // TODO: The cursor must be positioned at the end.
- this.EditorDocument.onmousedown = this.EditorDocument.onmouseup = function()
- {
- FCK.Focus() ;
-
- FCK.EditorWindow.event.cancelBubble = true ;
- FCK.EditorWindow.event.returnValue = false ;
- }
-
- // Intercept pasting operations
- this.EditorDocument.body.onpaste = function()
- {
- if ( FCK.Status == FCK_STATUS_COMPLETE )
- return FCK.Events.FireEvent( "OnPaste" ) ;
- else
- return false ;
- }
-
- // Disable Right-Click and shows the context menu.
- this.EditorDocument.oncontextmenu = function()
- {
- var e = this.parentWindow.event ;
- FCK.ShowContextMenu( e.screenX, e.screenY ) ;
- return false ;
- }
- // Check if key strokes must be monitored.
- if ( FCKConfig.UseBROnCarriageReturn || FCKConfig.TabSpaces > 0 )
- {
- // Build the "TAB" key replacement.
- if ( FCKConfig.TabSpaces > 0 )
- {
- window.FCKTabHTML = '' ;
- for ( i = 0 ; i < FCKConfig.TabSpaces ; i++ )
- window.FCKTabHTML += " " ;
- }
-
- this.EditorDocument.onkeydown = function()
- {
- var e = FCK.EditorWindow.event ;
-
- if ( e.keyCode == 13 && FCKConfig.UseBROnCarriageReturn ) // ENTER
- {
- if ( (e.ctrlKey || e.altKey || e.shiftKey) )
- return true ;
- else
- {
- // We must ignore it if we are inside a List.
- if ( FCK.EditorDocument.queryCommandState( 'InsertOrderedList' ) || FCK.EditorDocument.queryCommandState( 'InsertUnorderedList' ) )
- return true ;
-
- // Insert the <BR> (The must be also inserted to make it work)
- FCK.InsertHtml("<br> ") ;
-
- // Remove the
- var oRange = FCK.EditorDocument.selection.createRange() ;
- oRange.moveStart('character',-1) ;
- oRange.select() ;
- FCK.EditorDocument.selection.clear() ;
-
- return false ;
- }
- }
- else if ( e.keyCode == 9 && FCKConfig.TabSpaces > 0 && !(e.ctrlKey || e.altKey || e.shiftKey) ) // TAB
- {
- FCK.InsertHtml( window.FCKTabHTML ) ;
- return false ;
- }
-
- return true ;
- }
- }
-
- // Intercept cursor movements
- this.EditorDocument.onselectionchange = function()
- {
- FCK.Events.FireEvent( "OnSelectionChange" ) ;
- }
-
- //Enable editing
- this.EditorDocument.body.contentEditable = true ;
-
- this.SetStatus( FCK_STATUS_ACTIVE ) ;
-}
-
-FCK.Focus = function()
-{
- try
- {
- if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
- FCK.EditorDocument.body.focus() ;
- else
- document.getElementById('eSource').focus() ;
- }
- catch(e) {}
-}
-
-FCK.SetHTML = function( html, forceWYSIWYG )
-{
- if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG )
- {
- // TODO: Wait stable version and remove the following commented lines.
- // In IE, if you do document.body.innerHTML = '<p><hr></p>' it throws a "Unknow runtime error".
- // To solve it we must add a fake (safe) tag before it, and then remove it.
- // this.EditorDocument.body.innerHTML = '<div id="__fakeFCKRemove__"> </div>' + html.replace( FCKRegexLib.AposEntity, ''' ) ;
- // this.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true) ;
-
- this.EditorDocument.body.innerHTML = '' ;
- if ( html && html.length > 0 )
- this.EditorDocument.write( html ) ;
- }
- else
- document.getElementById('eSourceField').value = html ;
-}
-
-// TODO: Wait stable version and remove the following commented lines.
-/*
-FCK.CheckRelativeLinks = function()
-{
- // IE automatically change relative URLs to absolute, so we use a trick
- // to solve this problem (the document base points to "fckeditor:".
-
- for ( var i = 0 ; i < this.EditorDocument.links.length ; i++ )
- {
- var e = this.EditorDocument.links[i] ;
-
- if ( e.href.startsWith( FCK.BaseUrl ) )
- e.href = e.href.remove( 0, FCK.BaseUrl.length ) ;
- }
-
- for ( var i = 0 ; i < this.EditorDocument.images.length ; i++ )
- {
- var e = this.EditorDocument.images[i] ;
-
- if ( e.src.startsWith( FCK.BaseUrl ) )
- e.src = e.src.remove( 0, FCK.BaseUrl.length ) ;
- }
-}
-*/
-
-FCK.InsertHtml = function( html )
-{
- FCK.Focus() ;
-
- // Gets the actual selection.
- var oSel = FCK.EditorDocument.selection ;
-
- // Deletes the actual selection contents.
- if ( oSel.type.toLowerCase() != "none" )
- oSel.clear() ;
-
- // Inset the HTML.
- oSel.createRange().pasteHTML( html ) ;
-}
-
+++ /dev/null
-/*
- * 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: fck_2.js
- * This is the second part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 14:04:21
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// This collection is used by the browser specific implementations to tell
-// wich named commands must be handled separately.
-FCK.RedirectNamedCommands = new Object() ;
-
-FCK.ExecuteNamedCommand = function( commandName, commandParameter )
-{
- if ( FCK.RedirectNamedCommands[ commandName ] != null )
- FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
- else
- {
- FCK.Focus() ;
- FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
- FCK.Events.FireEvent( 'OnSelectionChange' ) ;
- }
-}
-
-FCK.GetNamedCommandState = function( commandName )
-{
- try
- {
- if ( !FCK.EditorDocument.queryCommandEnabled( commandName ) )
- return FCK_TRISTATE_DISABLED ;
- else
- return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
- }
- catch ( e )
- {
- return FCK_TRISTATE_OFF ;
- }
-}
-
-FCK.GetNamedCommandValue = function( commandName )
-{
- var sValue = '' ;
- var eState = FCK.GetNamedCommandState( commandName ) ;
-
- if ( eState == FCK_TRISTATE_DISABLED )
- return null ;
-
- try
- {
- sValue = this.EditorDocument.queryCommandValue( commandName ) ;
- }
- catch(e) {}
-
- return sValue ? sValue : '' ;
-}
-
-FCK.CleanAndPaste = function( html )
-{
- // Remove all SPAN tags
- html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
- // Remove Class attributes
- html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
- // Remove Style attributes
- html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
- // Remove Lang attributes
- html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
- // Remove XML elements and declarations
- html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
- // Remove Tags with XML namespace declarations: <o:p></o:p>
- html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
- // Replace the
- html = html.replace(/ /, " " );
- // Transform <P> to <DIV>
- var re = new RegExp("(<P)([^>]*>.*?)(<\/P>)","gi") ; // Different because of a IE 5.0 error
- html = html.replace( re, "<div$2</div>" ) ;
-
- FCK.InsertHtml( html ) ;
-}
-
-FCK.Preview = function()
-{
- var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
-
- var sHTML = '<html><head><link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" /></head><body>' + FCK.GetHTML() + '</body></html>' ;
-
- oWindow.document.write( sHTML );
- oWindow.document.close();
-
- // TODO: The CSS of the editor area must be configurable.
- // oWindow.document.createStyleSheet( config.EditorAreaCSS );
-}
-
-FCK.SwitchEditMode = function()
-{
- // Check if the actual mode is WYSIWYG.
- var bWYSIWYG = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
-
- // Display/Hide the TRs.
- document.getElementById('eWysiwyg').style.display = bWYSIWYG ? 'none' : '' ;
- document.getElementById('eSource').style.display = bWYSIWYG ? '' : 'none' ;
-
- // Update the HTML in the view output to show.
- if ( bWYSIWYG )
- document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML() : FCK.GetHTML() ) ;
- else
- {
- FCK.SetHTML( FCK.GetHTML(), true ) ;
-
- // Gecko looses the editing capabilities when hidding the IFRAME, so we must reset it.
- if ( FCKBrowserInfo.IsGecko )
- FCK.MakeEditable() ;
- }
-
- // Updates the actual mode status.
- FCK.EditMode = bWYSIWYG ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
-
- // Set the Focus.
- FCK.Focus() ;
-
- // Update the toolbar.
- FCKToolbarSet.RefreshItemsState() ;
-}
-
-
-FCK.CreateElement = function( tag )
-{
- var e = FCK.EditorDocument.createElement( tag ) ;
- e.setAttribute( '__FCKTempLabel', '1' ) ;
-
- this.InsertElement( e ) ;
-
- var aEls = FCK.EditorDocument.getElementsByTagName( tag ) ;
-
- for ( var i = 0 ; i < aEls.length ; i++ )
- {
- if ( aEls[i].attributes['__FCKTempLabel'] )
- {
- aEls[i].removeAttribute( '__FCKTempLabel' ) ;
- return aEls[i] ;
- }
- }
-}
-
+++ /dev/null
-/*
- * 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: fck_2_gecko.js
- * This is the second part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- * (Gecko specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 14:04:19
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// GetNamedCommandState overload for Gecko.
-FCK._BaseGetNamedCommandState = FCK.GetNamedCommandState ;
-FCK.GetNamedCommandState = function( commandName )
-{
- switch ( commandName )
- {
- case 'Unlink' :
- return FCKSelection.HasAncestorNode('A') ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
- default :
- return FCK._BaseGetNamedCommandState( commandName ) ;
- }
-}
-
-// Named commands to be handled by this browsers specific implementation.
-FCK.RedirectNamedCommands =
-{
- Print : true,
- Paste : true,
- Cut : true,
- Copy : true
-}
-
-// ExecuteNamedCommand overload for Gecko.
-FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
-{
- switch ( commandName )
- {
- case 'Print' :
- FCK.EditorWindow.print() ;
- break ;
- case 'Paste' :
- try { if ( FCK.Paste() ) FCK._BaseExecuteNamedCommand( 'Paste' ) ; }
- catch (e) { alert( FCKLang.PasteErrorPaste ) ; }
- break ;
- case 'Cut' :
- try { FCK._BaseExecuteNamedCommand( 'Cut' ) ; }
- catch (e) { alert( FCKLang.PasteErrorCut ) ; }
- break ;
- case 'Copy' :
- try { FCK._BaseExecuteNamedCommand( 'Copy' ) ; }
- catch (e) { alert( FCKLang.PasteErrorCopy ) ; }
- break ;
- default :
- FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
- }
-}
-
-FCK.AttachToOnSelectionChange = function( functionPointer )
-{
- this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
-}
-
-FCK.Paste = function()
-{
- if ( FCKConfig.ForcePasteAsPlainText )
- {
- FCK.PasteAsPlainText() ;
- return false ;
- }
- else if ( FCKConfig.AutoDetectPasteFromWord && FCKBrowserInfo.IsIE55OrMore )
- {
- var sHTML = FCK.GetClipboardHTML() ;
- var re = /<\w[^>]* class="?MsoNormal"?/gi ;
- if ( re.test( sHTML ) )
- {
- if ( confirm( FCKLang["PasteWordConfirm"] ) )
- {
- FCK.CleanAndPaste( sHTML ) ;
- return false ;
- }
- }
- }
- else
- return true ;
-}
-
-//**
-// FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
-// selected content if any.
-FCK.InsertHtml = function( html )
-{
- // Delete the actual selection.
- var oSel = FCKSelection.Delete() ;
-
-// var oContainer = oSel.getRangeAt(0).startContainer ;
-// var iOffSet = oSel.getRangeAt(0).startOffset ;
-
- // Get the first available range.
- var oRange = oSel.getRangeAt(0) ;
-
-// var oRange = this.EditorDocument.createRange() ;
-// oRange.setStart( oContainer, iOffSet ) ;
-// oRange.setEnd( oContainer, iOffSet ) ;
-
- // Create a fragment with the input HTML.
- var oFragment = oRange.createContextualFragment( html ) ;
-
- // Get the last available node.
- var oLastNode = oFragment.lastChild ;
-
- // Insert the fragment in the range.
- oRange.insertNode(oFragment) ;
-
- // Set the cursor after the inserted fragment.
- oRange.setEndAfter( oLastNode ) ;
- oRange.setStartAfter( oLastNode ) ;
-
- oSel.removeAllRanges() ;
- oSel = FCK.EditorWindow.getSelection() ;
- oSel.addRange( oRange ) ;
-
- this.Focus() ;
-}
-
-FCK.InsertElement = function( element )
-{
- // Deletes the actual selection.
- var oSel = FCKSelection.Delete() ;
-
- // Gets the first available range.
- var oRange = oSel.getRangeAt(0) ;
-
- // Inserts the element in the range.
- oRange.insertNode( element ) ;
-
- // Set the cursor after the inserted fragment.
- oRange.setEndAfter( element ) ;
- oRange.setStartAfter( element ) ;
-
- this.Focus() ;
-}
-
-FCK.PasteAsPlainText = function()
-{
- // TODO: Implement the "Paste as Plain Text" code.
-
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText' ) ;
-
-/*
- var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
- sText = sText.replace( /\n/g, '<BR>' ) ;
- this.InsertHtml( sText ) ;
-*/
-}
-
-FCK.PasteFromWord = function()
-{
- // TODO: Implement the "Paste as Plain Text" code.
-
- FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
-
-// FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
-}
-
-FCK.GetClipboardHTML = function()
-{
- return '' ;
-}
-
-FCK.CreateLink = function( url )
-{
- FCK.ExecuteNamedCommand( 'Unlink' ) ;
-
- if ( url.length > 0 )
- {
- // Generate a temporary name for the link.
- var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
-
- // Use the internal "CreateLink" command to create the link.
- FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl ) ;
-
- // Retrieve the just created link using XPath.
- var oLink = document.evaluate("//a[@href='" + sTempUrl + "']", this.EditorDocument.body, null, 9, null).singleNodeValue ;
-
- if ( oLink )
- {
- oLink.href = url ;
- return oLink ;
- }
- }
-}
-
+++ /dev/null
-/*
- * 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: fck_2_ie.js
- * This is the second part of the "FCK" object creation. This is the main
- * object that represents an editor instance.
- * (IE specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 14:04:16
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-/*
-if ( FCKConfig.UseBROnCarriageReturn )
-{
- // Named commands to be handled by this browsers specific implementation.
- FCK.RedirectNamedCommands =
- {
- InsertOrderedList : true,
- InsertUnorderedList : true
- }
-
- FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
- {
- if ( commandName == 'InsertOrderedList' || commandName == 'InsertUnorderedList' )
- {
- if ( !(FCK.EditorDocument.queryCommandState( 'InsertOrderedList' ) || FCK.EditorDocument.queryCommandState( 'InsertUnorderedList' )) )
- {
- }
- }
-
- FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
- }
-}
-*/
-
-FCK.Paste = function()
-{
- if ( FCKConfig.ForcePasteAsPlainText )
- {
- FCK.PasteAsPlainText() ;
- return false ;
- }
- else if ( FCKConfig.AutoDetectPasteFromWord && FCKBrowserInfo.IsIE55OrMore )
- {
- var sHTML = FCK.GetClipboardHTML() ;
- var re = /<\w[^>]* class="?MsoNormal"?/gi ;
- if ( re.test( sHTML ) )
- {
- if ( confirm( FCKLang["PasteWordConfirm"] ) )
- {
- FCK.CleanAndPaste( sHTML ) ;
- return false ;
- }
- }
- }
- else
- return true ;
-}
-
-FCK.PasteAsPlainText = function()
-{
- // Get the data available in the clipboard and encodes it in HTML.
- var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
-
- // Replace the carriage returns with <BR>
- sText = sText.replace( /\n/g, '<BR>' ) ;
-
- // Insert the resulting data in the editor.
- this.InsertHtml( sText ) ;
-}
-
-FCK.PasteFromWord = function()
-{
- FCK.CleanAndPaste( FCK.GetClipboardHTML() ) ;
-}
-
-FCK.InsertElement = function( element )
-{
- FCK.InsertHtml( element.outerHTML ) ;
-}
-
-FCK.GetClipboardHTML = function()
-{
- var oDiv = document.getElementById( '___FCKHiddenDiv' ) ;
-
- if ( !oDiv )
- {
- var oDiv = document.createElement( 'DIV' ) ;
- oDiv.id = '___FCKHiddenDiv' ;
- oDiv.style.visibility = 'hidden' ;
- oDiv.style.overflow = 'hidden' ;
- oDiv.style.position = 'absolute' ;
- oDiv.style.width = 1 ;
- oDiv.style.height = 1 ;
-
- document.body.appendChild( oDiv ) ;
- }
-
- oDiv.innerHTML = '' ;
-
- var oTextRange = document.body.createTextRange() ;
- oTextRange.moveToElementText( oDiv ) ;
- oTextRange.execCommand( 'Paste' ) ;
-
- var sData = oDiv.innerHTML ;
- oDiv.innerHTML = '' ;
-
- return sData ;
-}
-
-FCK.AttachToOnSelectionChange = function( functionPointer )
-{
- FCK.EditorDocument.attachEvent( 'onselectionchange', functionPointer ) ;
-}
-
-FCK.CreateLink = function( url )
-{
- FCK.ExecuteNamedCommand( 'Unlink' ) ;
-
- if ( url.length > 0 )
- {
- // Generate a temporary name for the link.
- var sTempUrl = 'javascript:void(0);/*' + ( new Date().getTime() ) + '*/' ;
-
- // Use the internal "CreateLink" command to create the link.
- FCK.ExecuteNamedCommand( 'CreateLink', sTempUrl ) ;
-
- // Loof for the just create link.
- var oLinks = this.EditorDocument.links ;
-
- for ( i = 0 ; i < oLinks.length ; i++ )
- {
- if ( oLinks[i].href == sTempUrl )
- {
- oLinks[i].href = url ;
- return oLinks[i] ;
- }
- }
- }
-}
-
+++ /dev/null
-/*
- * 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: fck_last.js
- * These are the last script lines executed in the editor loading process.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-04 16:53:16
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// This is the last file loaded to complete the editor initialization and activation
-
-// Just check if the document direction has been correctly applied (at fck_onload.js).
-if ( FCKLang && window.document.dir.toLowerCase() != FCKLang.Dir.toLowerCase() )
- window.document.dir = FCKLang.Dir ;
-
-// Activate pasting operations.
-if ( FCKConfig.ForcePasteAsPlainText )
- FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ;
-
-// Load Plugins.
-if ( FCKPlugins.Items.length > 0 )
-{
- FCKScriptLoader.OnEmpty = CompleteLoading ;
- FCKPlugins.Load() ;
-}
-else
- CompleteLoading() ;
-
-function CompleteLoading()
-{
- // Load the Toolbar
- FCKToolbarSet.Name = FCKURLParams['Toolbar'] || 'Default' ;
- FCKToolbarSet.Load( FCKToolbarSet.Name ) ;
- FCKToolbarSet.Restart() ;
-
- FCK.AttachToOnSelectionChange( FCKToolbarSet.RefreshItemsState ) ;
- //FCK.AttachToOnSelectionChange( FCKSelection._Reset ) ;
-
- 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 ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fck_onload.js
- * This is the script that is called when the editor page is loaded inside
- * its IFRAME. It's the editor startup.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-30 11:38:24
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Disable the context menu in the editor (areas outside the editor area).
-window.document.oncontextmenu = function( e )
-{
- if ( e )
- e.preventDefault() ; // This is the Gecko way to do that.
- return false ; // This is the IE way to do that.
-}
-
-// Gecko browsers doens't calculate well that IFRAME size so we must
-// recalculate it every time the window size changes.
-if ( ! FCKBrowserInfo.IsIE )
-{
- window.onresize = function()
- {
- var oFrame = document.getElementById('eEditorArea') ;
- oFrame.height = 0 ;
-
- var oCell = document.getElementById( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? 'eWysiwygCell' : 'eSource' ) ;
- var iHeight = oCell.offsetHeight ;
-
- oFrame.height = iHeight - 2 ;
- }
-}
-
-// Start the editor as soon as the window is loaded.
-window.onload = function()
-{
- // There is a bug on Netscape when rendering the frame. It goes over the
- // right border. So we must correct it.
- if ( FCKBrowserInfo.IsNetscape )
- document.getElementById('eWysiwygCell').style.paddingRight = '2px' ;
-
- FCKScriptLoader.OnEmpty = function()
- {
- FCKScriptLoader.OnEmpty = null ;
-
- // Override the configurations passed throw the hidden field.
- FCKConfig.LoadHiddenField() ;
-
- // Load the custom configurations file (if defined).
- if ( FCKConfig.CustomConfigurationsPath.length > 0 )
- FCKScriptLoader.AddScript( FCKConfig.CustomConfigurationsPath ) ;
-
- // Load the styles for the configured skin.
- LoadStyles() ;
- }
-
- // First of all load the configuration file.
- FCKScriptLoader.AddScript( '../fckconfig.js' ) ;
-}
-
-function LoadStyles()
-{
- FCKScriptLoader.OnEmpty = LoadScripts ;
-
- // Load the active skin CSS.
- FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_editor.css' ) ;
- FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
-}
-
-function LoadScripts()
-{
- FCKScriptLoader.OnEmpty = null ;
-
-
- if ( FCKBrowserInfo.IsIE )
- FCKScriptLoader.AddScript( 'js/fckeditorcode_ie_1.js' ) ;
- else
- FCKScriptLoader.AddScript( 'js/fckeditorcode_gecko_1.js' ) ;
-}
-
-function LoadLanguageFile()
-{
- FCKScriptLoader.OnEmpty = function()
- {
- // Removes the OnEmpty listener.
- FCKScriptLoader.OnEmpty = null ;
-
- // Correct the editor layout to the correct language direction.
- if ( FCKLang )
- window.document.dir = FCKLang.Dir ;
-
- // Starts the editor.
- FCK.StartEditor() ;
- }
-
- FCKScriptLoader.AddScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckbrowserinfo.js
- * Defines the FCKBrowserInfo object that hold some browser informations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-26 01:20:34
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKBrowserInfo = new Object() ;
-
-var sAgent = navigator.userAgent.toLowerCase() ;
-
-FCKBrowserInfo.IsIE = sAgent.indexOf("msie") != -1 ;
-FCKBrowserInfo.IsGecko = !FCKBrowserInfo.IsIE ;
-FCKBrowserInfo.IsNetscape = sAgent.indexOf("netscape") != -1 ;
-
-if ( FCKBrowserInfo.IsIE )
-{
- FCKBrowserInfo.MajorVer = navigator.appVersion.match(/MSIE (.)/)[1] ;
- FCKBrowserInfo.MinorVer = navigator.appVersion.match(/MSIE .\.(.)/)[1] ;
-}
-else
-{
- // TODO: Other browsers
- FCKBrowserInfo.MajorVer = 0 ;
- FCKBrowserInfo.MinorVer = 0 ;
-}
-
-FCKBrowserInfo.IsIE55OrMore = FCKBrowserInfo.IsIE && ( FCKBrowserInfo.MajorVer > 5 || FCKBrowserInfo.MinorVer >= 5 ) ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckcommands.js
- * Define all commands available in the editor.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-19 22:51:46
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKCommands = FCK.Commands = new Object() ;
-FCKCommands.LoadedCommands = new Object() ;
-
-FCKCommands.RegisterCommand = function( commandName, command )
-{
- this.LoadedCommands[ commandName ] = command ;
-}
-
-FCKCommands.GetCommand = function( commandName )
-{
- var oCommand = FCKCommands.LoadedCommands[ commandName ] ;
-
- if ( oCommand )
- return oCommand ;
-
- switch ( commandName )
- {
- case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 330, FCK.GetNamedCommandState, 'CreateLink' ) ; break ;
- case 'About' : oCommand = new FCKDialogCommand( 'About' , FCKLang.About , 'dialog/fck_about.html' , 400, 330 ) ; break ;
-
- case 'Find' : oCommand = new FCKDialogCommand( 'Find' , FCKLang.DlgFindTitle , 'dialog/fck_find.html' , 340, 170 ) ; break ;
- case 'Replace' : oCommand = new FCKDialogCommand( 'Replace' , FCKLang.DlgReplaceTitle , 'dialog/fck_replace.html' , 340, 200 ) ; break ;
-
- case 'Image' : oCommand = new FCKDialogCommand( 'Image' , FCKLang.DlgImgTitle , 'dialog/fck_image.html' , 450, 400, FCK.GetNamedCommandState, 'InsertImage' ) ; break ;
- case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 300, FCK.GetNamedCommandState, 'InsertImage' ) ; break ;
- case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight, FCK.GetNamedCommandState, 'InsertImage' ) ; break ;
- case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 400, 250 ) ; break ;
- case 'TableProp' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html?Parent', 400, 250 ) ; break ;
- case 'TableCellProp': oCommand = new FCKDialogCommand( 'TableCell' , FCKLang.DlgCellTitle , 'dialog/fck_tablecell.html' , 500, 250 ) ; break ;
-
- case 'Style' : oCommand = new FCKStyleCommand() ; break ;
-
- case 'FontName' : oCommand = new FCKFontNameCommand() ; break ;
- case 'FontSize' : oCommand = new FCKFontSizeCommand() ; break ;
- case 'FontFormat' : oCommand = new FCKFormatBlockCommand() ; break ;
-
- case 'Source' : oCommand = new FCKSourceCommand() ; break ;
- case 'Preview' : oCommand = new FCKPreviewCommand() ; break ;
- case 'Save' : oCommand = new FCKSaveCommand() ; break ;
- case 'NewPage' : oCommand = new FCKNewPageCommand() ; break ;
-
- case 'TextColor' : oCommand = new FCKTextColorCommand('ForeColor') ; break ;
- case 'BGColor' : oCommand = new FCKTextColorCommand('BackColor') ; break ;
-
- case 'PasteText' : oCommand = new FCKPastePlainTextCommand() ; break ;
- case 'PasteWord' : oCommand = new FCKPasteWordCommand() ; break ;
-
- case 'TableInsertRow' : oCommand = new FCKTableCommand('TableInsertRow') ; break ;
- case 'TableDeleteRows' : oCommand = new FCKTableCommand('TableDeleteRows') ; break ;
- case 'TableInsertColumn' : oCommand = new FCKTableCommand('TableInsertColumn') ; break ;
- case 'TableDeleteColumns' : oCommand = new FCKTableCommand('TableDeleteColumns') ; break ;
- case 'TableInsertCell' : oCommand = new FCKTableCommand('TableInsertCell') ; break ;
- case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ;
- case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ;
- case 'TableSplitCell' : oCommand = new FCKTableCommand('TableSplitCell') ; break ;
-
- // Generic Undefined command (usually used when a command is under development).
- case 'Undefined' : oCommand = new FCKUndefinedCommand() ; break ;
-
- // By default we assume that it is a named command.
- default:
- if ( FCKRegexLib.NamedCommands.test( commandName ) )
- oCommand = new FCKNamedCommand( commandName ) ;
- else
- {
- alert( FCKLang.UnknownCommand.replace( /%1/g, commandName ) ) ;
- return ;
- }
- }
-
- FCKCommands.LoadedCommands[ commandName ] = oCommand ;
-
- return oCommand ;
-}
-
+++ /dev/null
-/*
- * 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: fckconfig.js
- * Creates and initializes the FCKConfig object.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-16 15:56:53
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKConfig = FCK.Config = new Object() ;
-
-// Editor Base Path
-if ( document.location.protocol == 'file:' )
-{
- FCKConfig.BasePath = document.location.pathname.substr(1) ;
- FCKConfig.BasePath = FCKConfig.BasePath.replace( /\\/gi, '/' ) ;
- FCKConfig.BasePath = 'file://' + FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1) ;
-}
-else
- FCKConfig.BasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('/')+1) ;
-
-// Override the actual configuration values with the values passed throw the
-// hidden field "<InstanceName>___Config".
-FCKConfig.LoadHiddenField = function()
-{
- // Get the hidden field.
- var oConfigField = window.parent.document.getElementById( FCK.Name + '___Config' ) ;
-
- // Do nothing if the config field was not defined.
- if ( ! oConfigField ) return ;
-
- var aCouples = oConfigField.value.split('&') ;
-
- for ( var i = 0 ; i < aCouples.length ; i++ )
- {
- if ( aCouples[i].length == 0 )
- continue ;
-
- var aConfig = aCouples[i].split('=') ;
- var sConfigName = aConfig[0] ;
- var sConfigValue = aConfig[1] ;
-
- if ( sConfigValue.toLowerCase() == "true" ) // If it is a boolean TRUE.
- FCKConfig[sConfigName] = true ;
- else if ( sConfigValue.toLowerCase() == "false" ) // If it is a boolean FALSE.
- FCKConfig[sConfigName] = false ;
- else if ( ! isNaN(sConfigValue) ) // If it is a number.
- FCKConfig[sConfigName] = parseInt( sConfigValue ) ;
- else // In any other case it is a string.
- FCKConfig[sConfigName] = sConfigValue ;
- }
-}
-
-// Define toolbar sets collection.
-FCKConfig.ToolbarSets = new Object() ;
-
-// Defines the plugins collection.
-FCKConfig.Plugins = new Object() ;
-FCKConfig.Plugins.Items = new Array() ;
-
-FCKConfig.Plugins.Add = function( name, langs )
-{
- FCKConfig.Plugins.Items.addItem( [name, langs] ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckcontextmenu.js
- * Defines the FCKContextMenu object that is responsible for all
- * Context Menu operations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 00:19:50
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKContextMenu = new Object() ;
-
-// This property is internally used to indicate that the context menu has been created.
-FCKContextMenu._IsLoaded = false ;
-
-// This method creates the context menu inside a DIV tag. Take a look at the end of this file for a sample output.
-FCKContextMenu.Reload = function()
-{
- // Create the Main DIV that holds the Context Menu.
- this._Div = this._Document.createElement( 'DIV' ) ;
- this._Div.className = 'CM_ContextMenu' ;
- this._Div.style.position = 'absolute' ;
- this._Div.style.visibility = 'hidden' ;
- this._Document.body.appendChild( this._Div );
-
- // Create the main table for the menu items.
- var oTable = this._Document.createElement( 'TABLE' ) ;
- oTable.cellSpacing = 0 ;
- oTable.cellPadding = 0 ;
- oTable.border = 0 ;
- this._Div.appendChild( oTable ) ;
-
- // Create arrays with all Items to add.
-
- this.Groups = new Object() ;
-
- // Generic items that are always available.
- this.Groups['Generic'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Generic'] )
- {
- Add( new FCKContextMenuItem( this, 'Cut' , FCKLang.Cut , true ) ) ;
- Add( new FCKContextMenuItem( this, 'Copy' , FCKLang.Copy , true ) ) ;
- Add( new FCKContextMenuItem( this, 'Paste' , FCKLang.Paste , true ) ) ;
- }
-
- // Link operations.
- this.Groups['Link'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Link'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'Link' , FCKLang.EditLink , true ) ) ;
- Add( new FCKContextMenuItem( this, 'Unlink' , FCKLang.RemoveLink, true ) ) ;
- }
-
- // Table Cell operations.
- this.Groups['TableCell'] = new FCKContextMenuGroup() ;
- with ( this.Groups['TableCell'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'TableInsertRow' , FCKLang.InsertRow, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableDeleteRows' , FCKLang.DeleteRows, true ) ) ;
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'TableInsertColumn' , FCKLang.InsertColumn, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableDeleteColumns' , FCKLang.DeleteColumns, true ) ) ;
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'TableInsertCell' , FCKLang.InsertCell, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableDeleteCells' , FCKLang.DeleteCells, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableMergeCells' , FCKLang.MergeCells, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableSplitCell' , FCKLang.SplitCell, true ) ) ;
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'TableCellProp' , FCKLang.CellProperties, true ) ) ;
- Add( new FCKContextMenuItem( this, 'TableProp' , FCKLang.TableProperties, true ) ) ;
- }
-
- // Table operations.
- this.Groups['Table'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Table'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'Table', FCKLang.TableProperties, true ) ) ;
- }
-
- // Image operations.
- this.Groups['Image'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Image'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'Image', FCKLang.ImageProperties, true ) ) ;
- }
-
- // Select field operations.
- this.Groups['Select'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Select'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'Undefined', "Selection Field Properties" ) ) ;
- }
-
- // Textarea operations.
- this.Groups['Textarea'] = new FCKContextMenuGroup() ;
- with ( this.Groups['Textarea'] )
- {
- Add( new FCKContextMenuSeparator() ) ;
- Add( new FCKContextMenuItem( this, 'Undefined', "Textarea Properties" ) ) ;
- }
-
- // Create all table rows (representing the items) in the context menu.
- for ( var o in this.Groups )
- {
- this.Groups[o].CreateTableRows( oTable ) ;
- }
-
- this._IsLoaded = true ;
-}
-
-FCKContextMenu.RefreshState = function()
-{
- // Get the actual selected tag (if any).
- var oTag = FCKSelection.GetSelectedElement() ;
- var sTagName ;
-
- if ( oTag )
- {
- sTagName = oTag.tagName ;
- }
-
- // Set items visibility.
- this.Groups['Link'].SetVisible( FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED ) ;
- this.Groups['TableCell'].SetVisible( sTagName != 'TABLE' && FCKSelection.HasAncestorNode('TABLE') ) ;
- this.Groups['Table'].SetVisible( sTagName == 'TABLE' ) ;
- this.Groups['Image'].SetVisible( sTagName == 'IMG' ) ;
- this.Groups['Select'].SetVisible( sTagName == 'SELECT' ) ;
- this.Groups['Textarea'].SetVisible( sTagName == 'TEXTAREA' ) ;
-
- // Refresh the state of all visible items (active/disactive)
- for ( var o in this.Groups )
- {
- this.Groups[o].RefreshState() ;
- }
-}
-
-/*
-Sample Context Menu Output
------------------------------------------
-<div class="CM_ContextMenu">
- <table cellSpacing="0" cellPadding="0" border="0">
- <tr class="CM_Disabled">
- <td class="CM_Icon"><img alt="" src="icons/button.cut.gif" width="21" height="20" unselectable="on"></td>
- <td class="CM_Label" unselectable="on">Cut</td>
- </tr>
- <tr class="CM_Disabled">
- <td class="CM_Icon"><img height="20" alt="" src="icons/button.copy.gif" width="21"></td>
- <td class="CM_Label">Copy</td>
- </tr>
- <tr class="CM_Option" onmouseover="OnOver(this);" onmouseout="OnOut(this);">
- <td class="CM_Icon"><img height="20" alt="" src="icons/button.paste.gif" width="21"></td>
- <td class="CM_Label">Paste</td>
- </tr>
- <tr class="CM_Separator">
- <td class="CM_Icon"></td>
- <td class="CM_Label"><div></div></td>
- </tr>
- <tr class="CM_Option" onmouseover="OnOver(this);" onmouseout="OnOut(this);">
- <td class="CM_Icon"><img height="20" alt="" src="icons/button.print.gif" width="21"></td>
- <td class="CM_Label">Print</td>
- </tr>
- <tr class="CM_Separator">
- <td class="CM_Icon"></td>
- <td class="CM_Label"><div></div></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>
- <tr class="CM_Option" onmouseover="OnOver(this);" onmouseout="OnOut(this);">
- <td class="CM_Icon"></td>
- <td class="CM_Label">Just Testing</td>
- </tr>
- </table>
-</div>
-*/
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckcontextmenu_gecko.js
- * Context Menu operations. (Gecko specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-08-27 16:58:07
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// The Context Menu CSS must be added to the parent document.
-FCKTools.AppendStyleSheet( window.parent.document, FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
-
-FCKContextMenu.Show = function( x, y )
-{
- if ( ! this._Document )
- {
- this._Document = window.parent.document ;
- }
-
- // Create the context menu if needed.
- if ( !this._IsLoaded )
- {
- this.Reload() ;
- this._Div.style.zIndex = 10000 ;
- this._Div.oncontextmenu = function() { return false ; }
- }
-
- this.RefreshState() ;
-
- // Get the editor area and editor frames positions.
- var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement ) ;
- var oCoordsB = FCKTools.GetElementPosition( window.frameElement ) ;
-
- x += oCoordsA.X + oCoordsB.X ;
- y += oCoordsA.Y + oCoordsB.Y ;
-
- // Verifies if the context menu is completely visible.
- var iXSpace = x + this._Div.offsetWidth - this._Div.ownerDocument.defaultView.innerWidth ;
- var iYSpace = y + this._Div.offsetHeight - this._Div.ownerDocument.defaultView.innerHeight ;
-
- if ( iXSpace > 0 ) x -= this._Div.offsetWidth ;
- if ( iYSpace > 0 ) y -= this._Div.offsetHeight ;
-
- // Set the context menu DIV in the specified location.
- this._Div.style.left = x + 'px' ;
- this._Div.style.top = y + 'px' ;
-
- // Watch the "OnClick" event for all windows to close the Context Menu.
- var oActualWindow = FCK.EditorWindow ;
- while ( oActualWindow )
- {
- oActualWindow.document.addEventListener( 'click', FCKContextMenu._OnDocumentClick, false ) ;
- if ( oActualWindow != oActualWindow.parent )
- oActualWindow = oActualWindow.parent ;
- else if ( oActualWindow.opener == null )
- oActualWindow = oActualWindow.opener ;
- else
- break ;
- }
-
- // Show it.
- this._Div.style.visibility = '' ;
-}
-
-FCKContextMenu._OnDocumentClick = function( event )
-{
- var e = event.target ;
- while ( e )
- {
- if ( e == FCKContextMenu._Div ) return ;
- e = e.parentNode ;
- }
- FCKContextMenu.Hide() ;
-}
-
-FCKContextMenu.Hide = function()
-{
- this._Div.style.visibility = 'hidden' ;
- this._Div.style.left = this._Div.style.top = '1px' ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckcontextmenu_ie.js
- * Context Menu operations. (IE specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-08-20 22:58:12
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKContextMenu.Show = function( x, y )
-{
- // Create the Popup used to show the menu (this is a IE 5.5+ feature).
- if ( ! this._Popup )
- {
- this._Popup = window.createPopup() ;
- this._Document = this._Popup.document ;
- this._Document.createStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
- this._Document.oncontextmenu = function() { return false ; }
- }
-
- // Create the context menu if needed.
- if ( !this._IsLoaded )
- {
- this.Reload() ;
- this._Div.style.visibility = '' ;
- }
-
- this.RefreshState() ;
-
- // IE doens't get the offsetWidth and offsetHeight values if the element is not visible.
- // So the Popup must be "shown" with no size to be able to get these values.
- this._Popup.show( x, y, 0, 0 ) ;
-
- // This was the previous solution. It works well to.
- // So a temporary element is created to get this for us.
- /*
- if ( !this._DivCopy )
- {
- this._DivCopy = document.createElement( 'DIV' ) ;
- this._DivCopy.className = 'CM_ContextMenu' ;
- this._DivCopy.style.position = 'absolute' ;
- this._DivCopy.style.visibility = 'hidden' ;
- document.body.appendChild( this._DivCopy );
- }
-
- this._DivCopy.innerHTML = this._Div.innerHTML ;
- */
-
- // Show the Popup at the specified location.
- this._Popup.show( x, y, this._Div.offsetWidth, this._Div.offsetHeight ) ;
-}
-
-FCKContextMenu.Hide = function()
-{
- if ( this._Popup )
- this._Popup.hide() ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckcoreextensions.js
- * Some extensions to the Javascript Core.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-12 17:21:06
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Extends the Array object, creating a "addItem" method on it.
-Array.prototype.addItem = function( item )
-{
- this[ this.length ] = item ;
-}
-
-Array.prototype.indexOf = function( value )
-{
- for ( var i = 0 ; i < this.length ; i++ )
- {
- if ( this[i] == value )
- return i ;
- }
- return -1 ;
-}
-
-String.prototype.startsWith = function( value )
-{
- return ( this.substr( 0, value.length ) == value ) ;
-}
-
-// Extends the String object, creating a "endsWith" method on it.
-String.prototype.endsWith = function( value )
-{
- var L1 = this.length ;
- var L2 = value.length ;
-
- if ( L2 > L1 )
- return false ;
-
- return ( L2 == 0 || this.substr( L1 - L2, L2 ) == value ) ;
-}
-
-String.prototype.remove = function( start, length )
-{
- var s = '' ;
-
- if ( start > 0 )
- s = this.substring( 0, start ) ;
-
- if ( start + length < this.length )
- s += this.substring( start + length , this.length ) ;
-
- return s ;
-}
-
-String.prototype.trim = function()
-{
- return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckdebug.js
- * Debug window control and operations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-08 18:34:12
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKDebug = new Object() ;
-
-if ( FCKConfig.Debug )
-{
- FCKDebug.Output = function( message, color )
- {
- if ( ! FCKConfig.Debug ) return ;
-
- if ( message != null && isNaN( message ) )
- message = message.replace(/</g, "<") ;
-
- if ( !this.DebugWindow || this.DebugWindow.closed )
- this.DebugWindow = window.open( 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=no,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
-
- if ( this.DebugWindow.Output)
- this.DebugWindow.Output( message, color ) ;
- }
-}
-else
- FCKDebug.Output = function() {}
-
+++ /dev/null
-/*
- * 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: fckdialog.js
- * Dialog windows operations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-19 23:28:55
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKDialog = new Object() ;
-
-// This method opens a dialog window using the standard dialog template.
-FCKDialog.OpenDialog = function( dialogName, dialogTitle, dialogPage, width, height, customValue, parentWindow )
-{
- // Setup the dialog info.
- var oDialogInfo = new Object() ;
- oDialogInfo.Title = dialogTitle ;
- oDialogInfo.Page = dialogPage ;
- oDialogInfo.Editor = window ;
- oDialogInfo.CustomValue = customValue ; // Optional
-
- var sUrl = FCKConfig.BasePath + 'fckdialog.html' ;
- this.Show( oDialogInfo, dialogName, sUrl, width, height, parentWindow ) ;
-}
-
+++ /dev/null
-/*
- * 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: fckdialog_gecko.js
- * Dialog windows operations. (Gecko specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-20 00:48:06
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow )
-{
- var iTop = (screen.height - dialogHeight) / 2 ;
- var iLeft = (screen.width - dialogWidth) / 2 ;
-
- var sOption = "location=no,menubar=no,resizable=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes" +
- ",width=" + dialogWidth +
- ",height=" + dialogHeight +
- ",top=" + iTop +
- ",left=" + iLeft ;
-
- if ( !parentWindow )
- parentWindow = window ;
-
- var oWindow = parentWindow.open( '', 'FCKEditorDialog_' + dialogName, sOption, true ) ;
- oWindow.moveTo( iLeft, iTop ) ;
- oWindow.resizeTo( dialogWidth, dialogHeight ) ;
- oWindow.focus() ;
- oWindow.location.href = pageUrl ;
-
- oWindow.dialogArguments = dialogInfo ;
-
- // On some Gecko browsers (probably over slow connections) the
- // "dialogArguments" are not set to the target window so we must
- // put it in the opener window so it can be used by the target one.
- parentWindow.FCKLastDialogInfo = dialogInfo ;
-
- this.Window = oWindow ;
-
- window.top.captureEvents( Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS ) ;
- window.top.parent.addEventListener( 'mousedown', this.CheckFocus, true ) ;
- window.top.parent.addEventListener( 'mouseup', this.CheckFocus, true ) ;
- window.top.parent.addEventListener( 'click', this.CheckFocus, true ) ;
- window.top.parent.addEventListener( 'focus', this.CheckFocus, true ) ;
-}
-
-FCKDialog.CheckFocus = function()
-{
- if ( FCKDialog.Window && !FCKDialog.Window.closed )
- {
- FCKDialog.Window.focus() ;
- return false ;
- }
- else
- {
- window.top.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) ;
- window.top.parent.removeEventListener( 'onmousedown', FCKDialog.CheckFocus, true ) ;
- window.top.parent.removeEventListener( 'mouseup', FCKDialog.CheckFocus, true ) ;
- window.top.parent.removeEventListener( 'click', FCKDialog.CheckFocus, true ) ;
- window.top.parent.removeEventListener( 'onfocus', FCKDialog.CheckFocus, true ) ;
- }
-}
-
+++ /dev/null
-/*
- * 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: fckdialog_ie.js
- * Dialog windows operations. (IE specific implementations)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-19 23:28:42
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow )
-{
- if ( !parentWindow )
- parentWindow = window ;
-
- parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
-}
-
+++ /dev/null
-/*
- * 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: fcklanguagemanager.js
- * Defines the FCKLanguageManager object that is used for language
- * operations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-17 08:12:36
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKLanguageManager.GetActiveLanguage = function()
-{
- if ( FCKConfig.AutoDetectLanguage )
- {
- var sUserLang ;
-
- // IE accepts "navigator.userLanguage" while Gecko "navigator.language".
- if ( navigator.userLanguage )
- sUserLang = navigator.userLanguage.toLowerCase() ;
- else if ( navigator.language )
- sUserLang = navigator.language.toLowerCase() ;
- else
- {
- // Firefox 1.0 PR has a bug: it doens't support the "language" property.
- return FCKConfig.DefaultLanguage ;
- }
-
- FCKDebug.Output( 'Navigator Language = ' + sUserLang ) ;
-
- // Some language codes are set in 5 characters,
- // like "pt-br" for Brasilian Portuguese.
- if ( sUserLang.length >= 5 )
- {
- sUserLang = sUserLang.substr(0,5) ;
- if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
- }
-
- // If the user's browser is set to, for example, "pt-br" but only the
- // "pt" language file is available then get that file.
- if ( sUserLang.length >= 2 )
- {
- sUserLang = sUserLang.substr(0,2) ;
- if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
- }
- }
-
- return this.DefaultLanguage ;
-}
-
-FCKLanguageManager.TranslateElements = function( targetDocument, tag, propertyToSet )
-{
- var aInputs = targetDocument.getElementsByTagName(tag) ;
- for ( var i = 0 ; i < aInputs.length ; i++ )
- {
- var oAtt = aInputs[i].attributes['fckLang'] ;
- if ( oAtt )
- {
- var s = FCKLang[ oAtt.value ] ;
- if ( s )
- eval( 'aInputs[i].' + propertyToSet + ' = s' ) ;
- }
- }
-}
-
-FCKLanguageManager.TranslatePage = function( targetDocument )
-{
- this.TranslateElements( targetDocument, 'INPUT', 'value' ) ;
- this.TranslateElements( targetDocument, 'SPAN', 'innerHTML' ) ;
- this.TranslateElements( targetDocument, 'LABEL', 'innerHTML' ) ;
- this.TranslateElements( targetDocument, 'OPTION', 'innerHTML' ) ;
-}
-
-if ( FCKLanguageManager.AvailableLanguages[ FCKConfig.DefaultLanguage ] )
- FCKLanguageManager.DefaultLanguage = FCKConfig.DefaultLanguage ;
-else
- FCKLanguageManager.DefaultLanguage = 'en' ;
-
-FCKLanguageManager.ActiveLanguage = new Object() ;
-FCKLanguageManager.ActiveLanguage.Code = FCKLanguageManager.GetActiveLanguage() ;
-FCKLanguageManager.ActiveLanguage.Name = FCKLanguageManager.AvailableLanguages[ FCKLanguageManager.ActiveLanguage.Code ] ;
-
-FCK.Language = FCKLanguageManager ;
-
-
-// Load the language file and start the editor.
-LoadLanguageFile() ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckplugins.js
- * Defines the FCKPlugins object that is responsible for loading the Plugins.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 11:05:05
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKPlugins = FCK.Plugins = new Object() ;
-FCKPlugins.Loaded = false ;
-FCKPlugins.Items = new Array() ;
-
-// Set the defined plugins scripts paths.
-for ( var i = 0 ; i < FCKConfig.Plugins.Items.length ; i++ )
-{
- var oItem = FCKConfig.Plugins.Items[i] ;
- FCKPlugins.Items.addItem( new FCKPlugin( oItem[0], oItem[1] ) ) ;
-}
-
-FCKPlugins.Load = function()
-{
- // Load all items.
- for ( var i = 0 ; i < this.Items.length ; i++ )
- this.Items[i].Load() ;
-
- // Mark as loaded.
- this.Loaded = true ;
-
- // This is a self destroyable function (must be called once).
- FCKPlugins.Load = null ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckregexlib.js
- * These are some Regular Expresions used by the editor.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 11:04:22
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKRegexLib = new Object() ;
-
-// This is the Regular expression used by the SetHTML method for the "'" entity.
-FCKRegexLib.AposEntity = /'/gi ;
-
-// Used by the Styles combo to identify styles that can't be applied to text.
-FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|INPUT|SELECT|TEXTAREA|HR|OBJECT)$/i ;
-
-// List all named commands (commands that can be interpreted by the browser "execCommand" method.
-FCKRegexLib.NamedCommands = /^(?:Cut|Copy|Paste|Print|SelectAll|RemoveFormat|Unlink|Undo|Redo|Bold|Italic|Underline|StrikeThrough|Subscript|Superscript|JustifyLeft|JustifyCenter|JustifyRight|JustifyFull|Outdent|Indent|InsertOrderedList|InsertUnorderedList|InsertHorizontalRule)$/i ;
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckscriptloader.js
- * Defines the FCKScriptLoader object that is used to dynamically load
- * scripts in the editor.
- *
- * Version: 2.0 RC2
- * Modified: 2004-05-31 23:07:50
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// This object is used to download scripts and css files sequentialy.
-// A file download is not started until the previous file was not completelly
-// downloaded.
-var FCKScriptLoader = new Object() ;
-FCKScriptLoader.IsLoading = false ;
-FCKScriptLoader.Queue = new Array() ;
-
-// Adds a script or css to the queue.
-FCKScriptLoader.AddScript = function( scriptPath )
-{
- FCKScriptLoader.Queue[ FCKScriptLoader.Queue.length ] = scriptPath ;
-
- if ( !this.IsLoading )
- this.CheckQueue() ;
-}
-
-// Checks the queue to see if there is something to load.
-// This function should not be called by code. It's a internal function
-// that's called recursively.
-FCKScriptLoader.CheckQueue = function()
-{
- // Check if the queue is not empty.
- if ( this.Queue.length > 0 )
- {
- this.IsLoading = true ;
-
- // Get the first item in the queue
- var sScriptPath = this.Queue[0] ;
-
- // Removes the first item from the queue
- var oTempArray = new Array() ;
- for ( i = 1 ; i < this.Queue.length ; i++ )
- oTempArray[ i - 1 ] = this.Queue[ i ] ;
- this.Queue = oTempArray ;
-
-// window.status = ( 'Loading ' + sScriptPath + '...' ) ;
-
- // Dynamically load the file (it can be a CSS or a JS)
- var e ;
-
- // If is a CSS
- if ( sScriptPath.lastIndexOf( '.css' ) > 0 )
- {
- e = document.createElement( 'LINK' ) ;
- e.rel = 'stylesheet' ;
- e.type = 'text/css' ;
- }
- // It is a JS
- else
- {
- e = document.createElement( "script" ) ;
- e.type = "text/javascript" ;
- }
-
- // Add the new object to the HEAD.
- document.getElementsByTagName("head")[0].appendChild( e ) ;
-
- var oEvent = function()
- {
- // Gecko doesn't have a "readyState" property
- if ( this.tagName == 'LINK' || !this.readyState || this.readyState == 'loaded' )
- // Load the next script available in the queue
- FCKScriptLoader.CheckQueue() ;
- }
-
- // Start downloading it.
- if ( e.tagName == 'LINK' )
- {
- // IE must wait for the file to be downloaded.
- if ( FCKBrowserInfo.IsIE )
- e.onload = oEvent ;
- // Gecko doens't fire any event when the CSS is loaded, so we
- // can't wait for it.
- else
- FCKScriptLoader.CheckQueue() ;
-
- e.href = sScriptPath ;
- }
- else
- {
- // Gecko fires the "onload" event and IE fires "onreadystatechange"
- e.onload = e.onreadystatechange = oEvent ;
- e.src = sScriptPath ;
- }
- }
- else
- {
- this.IsLoading = false ;
-
- // Call the "OnEmpty" event.
- if ( this.OnEmpty )
- this.OnEmpty() ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckselection.js
- * Active selection functions.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-22 11:03:02
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKSelection = new Object() ;
-
-FCK.Selection = FCKSelection ;
+++ /dev/null
-/*
- * 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: fckselection_gecko.js
- * Active selection functions. (Gecko specific implementation)
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-15 13:33:14
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Get the selection type (like document.select.type in IE).
-FCKSelection.GetType = function()
-{
-// if ( ! this._Type )
-// {
- // By default set the type to "Text".
- this._Type = 'Text' ;
-
- // Check if the actual selection is a Control (IMG, TABLE, HR, etc...).
- var oSel = FCK.EditorWindow.getSelection() ;
- if ( oSel && oSel.rangeCount == 1 )
- {
- var oRange = oSel.getRangeAt(0) ;
- if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 )
- this._Type = 'Control' ;
- }
-// }
- return this._Type ;
-}
-
-// Retrieves the selected element (if any), just in the case that a single
-// element (object like and image or a table) is selected.
-FCKSelection.GetSelectedElement = function()
-{
- if ( this.GetType() == 'Control' )
- {
- var oSel = FCK.EditorWindow.getSelection() ;
- return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ;
- }
-}
-
-FCKSelection.GetParentElement = function()
-{
- if ( this.GetType() == 'Control' )
- return FCKSelection.GetSelectedElement().parentElement ;
- else
- {
- var oNode = FCK.EditorWindow.getSelection().anchorNode ;
-
- while ( oNode && oNode.nodeType != 1 )
- oNode = oNode.parentNode ;
-
- return oNode ;
- }
-}
-
-FCKSelection.MoveToNode = function( node )
-{
- var oSel = FCK.EditorWindow.getSelection() ;
-
- for ( i = oSel.rangeCount - 1 ; i >= 0 ; i-- )
- {
- if ( i == 0 )
- oSel.getRangeAt(i).selectNodeContents( node ) ;
- else
- oSel.removeRange( oSel.getRangeAt(i) ) ;
- }
-}
-
-// The "nodeTagName" parameter must be Upper Case.
-FCKSelection.HasAncestorNode = function( nodeTagName )
-{
- var oContainer = this.GetSelectedElement() ;
- if ( ! oContainer && FCK.EditorWindow )
- {
- try { oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ; }
- catch(e){}
- }
-
- while ( oContainer )
- {
- if ( oContainer.tagName == nodeTagName ) return true ;
- oContainer = oContainer.parentNode ;
- }
-
- return false ;
-}
-
-// The "nodeTagName" parameter must be Upper Case.
-FCKSelection.MoveToAncestorNode = function( nodeTagName )
-{
- var oNode ;
-
- var oContainer = this.GetSelectedElement() ;
- if ( ! oContainer )
- oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ;
-
- while ( oContainer )
- {
- if ( oContainer.tagName == nodeTagName ) return oContainer ;
- oContainer = oContainer.parentNode ;
- }
-}
-
-FCKSelection.Delete = function()
-{
- // Gets the actual selection.
- var oSel = FCK.EditorWindow.getSelection() ;
-
- // Deletes the actual selection contents.
- for ( var i = 0 ; i < oSel.rangeCount ; i++ )
- {
- oSel.getRangeAt(i).deleteContents() ;
- }
-
- return oSel ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fckselection_ie.js
- * Active selection functions. (IE specific implementation)
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-18 01:36:23
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-// Get the selection type.
-FCKSelection.GetType = function()
-{
- return FCK.EditorDocument.selection.type ;
-}
-
-// Retrieves the selected element (if any), just in the case that a single
-// element (object like and image or a table) is selected.
-FCKSelection.GetSelectedElement = function()
-{
- if ( this.GetType() == 'Control' )
- {
- var oRange = FCK.EditorDocument.selection.createRange() ;
-
- if ( oRange && oRange.item )
- return FCK.EditorDocument.selection.createRange().item(0) ;
- }
-}
-
-FCKSelection.GetParentElement = function()
-{
- if ( this.GetType() == 'Control' )
- return FCKSelection.GetSelectedElement().parentElement ;
- else
- return FCK.EditorDocument.selection.createRange().parentElement() ;
-}
-
-FCKSelection.MoveToNode = function( node )
-{
- FCK.EditorDocument.selection.empty() ;
- var oRange = FCK.EditorDocument.selection.createRange() ;
- oRange.moveToElementText( node ) ;
- oRange.select() ;
-}
-
-// The "nodeTagName" parameter must be Upper Case.
-FCKSelection.HasAncestorNode = function( nodeTagName )
-{
- var oContainer ;
-
- if ( FCK.EditorDocument.selection.type == "Control" )
- {
- oContainer = this.GetSelectedElement() ;
- }
- else
- {
- var oRange = FCK.EditorDocument.selection.createRange() ;
- oContainer = oRange.parentElement() ;
- }
-
- while ( oContainer )
- {
- if ( oContainer.tagName == nodeTagName ) return true ;
- oContainer = oContainer.parentNode ;
- }
-
- return false ;
-}
-
-// The "nodeTagName" parameter must be Upper Case.
-FCKSelection.MoveToAncestorNode = function( nodeTagName )
-{
- var oNode ;
-
- if ( FCK.EditorDocument.selection.type == "Control" )
- {
- var oRange = FCK.EditorDocument.selection.createRange() ;
- for ( i = 0 ; i < oRange.length ; i++ )
- {
- if (oRange(i).parentNode)
- {
- oNode = oRange(i).parentNode ;
- break ;
- }
- }
- }
- else
- {
- var oRange = FCK.EditorDocument.selection.createRange() ;
- oNode = oRange.parentElement() ;
- }
-
- while ( oNode && oNode.nodeName != nodeTagName )
- oNode = oNode.parentNode ;
-
- return oNode ;
-}
-
-FCKSelection.Delete = function()
-{
- // Gets the actual selection.
- var oSel = FCK.EditorDocument.selection ;
-
- // Deletes the actual selection contents.
- if ( oSel.type.toLowerCase() != "none" )
- {
- oSel.clear() ;
- }
-
- return oSel ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcktablehandler.js
- * Manage table operations.
- *
- * Version: 2.0 RC2
- * Modified: 2004-12-16 00:41:05
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKTableHandler = new Object() ;
-
-FCKTableHandler.InsertRow = function()
-{
- // Get the row where the selection is placed in.
- var oRow = FCKSelection.MoveToAncestorNode("TR") ;
- if ( !oRow ) return ;
-
- // Create a clone of the row.
- var oNewRow = oRow.cloneNode( true ) ;
-
- // Insert the new row (copy) before of it.
- oRow.parentNode.insertBefore( oNewRow, oRow ) ;
-
- // Clean the row (it seems that the new row has been added after it).
- FCKTableHandler.ClearRow( oRow ) ;
-}
-
-FCKTableHandler.DeleteRows = function( row )
-{
- // If no row has been passed as a parameer,
- // then get the row where the selection is placed in.
- if ( !row )
- row = FCKSelection.MoveToAncestorNode("TR") ;
- if ( !row ) return ;
-
- // Get the row's table.
- var oTable = FCKTools.GetElementAscensor( row, 'TABLE' ) ;
-
- // If just one row is available then delete the entire table.
- if ( oTable.rows.length == 1 )
- {
- FCKTableHandler.DeleteTable( oTable ) ;
- return ;
- }
-
- // Delete the row.
- row.parentNode.removeChild( row ) ;
-}
-
-FCKTableHandler.DeleteTable = function( table )
-{
- // If no table has been passed as a parameer,
- // then get the table where the selection is placed in.
- if ( !table )
- table = FCKSelection.MoveToAncestorNode("TABLE") ;
- if ( !table ) return ;
-
- // Delete the table.
- table.parentNode.removeChild( table ) ;
-}
-
-FCKTableHandler.InsertColumn = function()
-{
- // Get the cell where the selection is placed in.
- var oCell = FCKSelection.MoveToAncestorNode("TD") ;
- if ( !oCell ) return ;
-
- // Get the cell's table.
- var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
-
- // Get the index of the column to be created (based on the cell).
- var iIndex = oCell.cellIndex + 1 ;
-
- // Loop throw all rows available in the table.
- for ( var i = 0 ; i < oTable.rows.length ; i++ )
- {
- // Get the row.
- var oRow = oTable.rows[i] ;
-
- // If the row doens't have enought cells, ignore it.
- if ( oRow.cells.length < iIndex )
- continue ;
-
- // Create the new cell element to be added.
- oCell = FCK.EditorDocument.createElement('TD') ;
- oCell.innerHTML = ' ' ;
-
- // Get the cell that is placed in the new cell place.
- var oBaseCell = oRow.cells[iIndex] ;
-
- // If the cell is available (we are not in the last cell of the row).
- if ( oBaseCell )
- {
- // Insert the new cell just before of it.
- oRow.insertBefore( oCell, oBaseCell ) ;
- }
- else
- {
- // Append the cell at the end of the row.
- oRow.appendChild( oCell ) ;
- }
- }
-}
-
-FCKTableHandler.DeleteColumns = function()
-{
- // Get the cell where the selection is placed in.
- var oCell = FCKSelection.MoveToAncestorNode("TD") ;
- if ( !oCell ) return ;
-
- // Get the cell's table.
- var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
-
- // Get the cell index.
- var iIndex = oCell.cellIndex ;
-
- // Loop throw all rows (from down to up, because it's possible that some
- // rows will be deleted).
- for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
- {
- // Get the row.
- var oRow = oTable.rows[i] ;
-
- // If the cell to be removed is the first one and the row has just one cell.
- if ( iIndex == 0 && oRow.cells.length == 1 )
- {
- // Remove the entire row.
- FCKTableHandler.DeleteRows( oRow ) ;
- continue ;
- }
-
- // If the cell to be removed exists the delete it.
- if ( oRow.cells[iIndex] )
- oRow.removeChild( oRow.cells[iIndex] ) ;
- }
-}
-
-FCKTableHandler.InsertCell = function( cell )
-{
- // Get the cell where the selection is placed in.
- var oCell = cell ? cell : FCKSelection.MoveToAncestorNode("TD") ;
- if ( !oCell ) return ;
-
- // Create the new cell element to be added.
- var oNewCell = FCK.EditorDocument.createElement("TD");
- oNewCell.innerHTML = " " ;
-
- // If it is the last cell in the row.
- if ( oCell.cellIndex == oCell.parentNode.cells.lenght - 1 )
- {
- // Add the new cell at the end of the row.
- oCell.parentNode.appendChild( oNewCell ) ;
- }
- else
- {
- // Add the new cell before the next cell (after the active one).
- oCell.parentNode.insertBefore( oNewCell, oCell.nextSibling ) ;
- }
-
- return oNewCell ;
-}
-
-FCKTableHandler.DeleteCell = function( cell )
-{
- // If this is the last cell in the row.
- if ( cell.parentNode.cells.length == 1 )
- {
- // Delete the entire row.
- FCKTableHandler.DeleteRows( FCKTools.GetElementAscensor( cell, 'TR' ) ) ;
- return ;
- }
-
- // Delete the cell from the row.
- cell.parentNode.removeChild( cell ) ;
-}
-
-FCKTableHandler.DeleteCells = function()
-{
- var aCells = FCKTableHandler.GetSelectedCells() ;
-
- for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
- {
- FCKTableHandler.DeleteCell( aCells[i] ) ;
- }
-}
-
-FCKTableHandler.MergeCells = function()
-{
- // Get all selected cells.
- var aCells = FCKTableHandler.GetSelectedCells() ;
-
- // At least 2 cells must be selected.
- if ( aCells.length < 2 )
- return ;
-
- // The merge can occour only if the selected cells are from the same row.
- if ( aCells[0].parentNode != aCells[aCells.length-1].parentNode )
- return ;
-
- // Calculate the new colSpan for the first cell.
- var iColSpan = isNaN( aCells[0].colSpan ) ? 1 : aCells[0].colSpan ;
-
- var sHtml = '' ;
-
- for ( var i = aCells.length - 1 ; i > 0 ; i-- )
- {
- iColSpan += isNaN( aCells[i].colSpan ) ? 1 : aCells[i].colSpan ;
-
- // Append the HTML of each cell.
- sHtml = aCells[i].innerHTML + sHtml ;
-
- // Delete the cell.
- FCKTableHandler.DeleteCell( aCells[i] ) ;
- }
-
- // Set the innerHTML of the remaining cell (the first one).
- aCells[0].colSpan = iColSpan ;
- aCells[0].innerHTML += sHtml ;
-}
-
-FCKTableHandler.SplitCell = function()
-{
- // Check that just one cell is selected, otherwise return.
- var aCells = FCKTableHandler.GetSelectedCells() ;
- if ( aCells.length != 1 )
- return ;
-
- var aMap = this._CreateTableMap( aCells[0].parentNode.parentNode ) ;
- var iCellIndex = FCKTableHandler._GetCellIndexSpan( aMap, aCells[0].parentNode.rowIndex , aCells[0] ) ;
-
- var aCollCells = this._GetCollumnCells( aMap, iCellIndex ) ;
-
- for ( var i = 0 ; i < aCollCells.length ; i++ )
- {
- if ( aCollCells[i] == aCells[0] )
- {
- var oNewCell = this.InsertCell( aCells[0] ) ;
- if ( !isNaN( aCells[0].rowSpan ) && aCells[0].rowSpan > 1 )
- oNewCell.rowSpan = aCells[0].rowSpan ;
- }
- else
- {
- if ( isNaN( aCollCells[i].colSpan ) )
- aCollCells[i].colSpan = 2 ;
- else
- aCollCells[i].colSpan += 1 ;
- }
- }
-}
-
-// Get the cell index from a TableMap.
-FCKTableHandler._GetCellIndexSpan = function( tableMap, rowIndex, cell )
-{
- if ( tableMap.length < rowIndex + 1 )
- return ;
-
- var oRow = tableMap[ rowIndex ] ;
-
- for ( var c = 0 ; c < oRow.length ; c++ )
- {
- if ( oRow[c] == cell )
- return c ;
- }
-}
-
-// Get the cells available in a collumn of a TableMap.
-FCKTableHandler._GetCollumnCells = function( tableMap, collumnIndex )
-{
- var aCollCells = new Array() ;
-
- for ( var r = 0 ; r < tableMap.length ; r++ )
- {
- var oCell = tableMap[r][collumnIndex] ;
- if ( oCell && ( aCollCells.length == 0 || aCollCells[ aCollCells.length - 1 ] != oCell ) )
- aCollCells[ aCollCells.length ] = oCell ;
- }
-
- return aCollCells ;
-}
-
-// This function is quite hard to explain. It creates a matrix representing all cells in a table.
-// The difference here is that the "spanned" cells (colSpan and rowSpan) are duplicated on the matrix
-// cells that are "spanned". For example, a row with 3 cells where the second cell has colSpan=2 and rowSpan=3
-// will produce a bi-dimensional matrix with the following values (representing the cells):
-// Cell1, Cell2, Cell2, Cell 3
-// Cell4, Cell2, Cell2, Cell 5
-FCKTableHandler._CreateTableMap = function( table )
-{
- var aRows = table.rows ;
-
- // Row and Collumn counters.
- var r = -1 ;
-
- var aMap = new Array() ;
-
- for ( var i = 0 ; i < aRows.length ; i++ )
- {
- r++ ;
- if ( !aMap[r] )
- aMap[r] = new Array() ;
-
- var c = -1 ;
-
- for ( var j = 0 ; j < aRows[i].cells.length ; j++ )
- {
- var oCell = aRows[i].cells[j] ;
-
- c++ ;
- while ( aMap[r][c] )
- c++ ;
-
- var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ;
- var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ;
-
- for ( var rs = 0 ; rs < iRowSpan ; rs++ )
- {
- if ( !aMap[r + rs] )
- aMap[r + rs] = new Array() ;
-
- for ( var cs = 0 ; cs < iColSpan ; cs++ )
- {
- aMap[r + rs][c + cs] = aRows[i].cells[j] ;
- }
- }
-
- c += iColSpan - 1 ;
- }
- }
- return aMap ;
-}
-
-FCKTableHandler.ClearRow = function( tr )
-{
- // Get the array of row's cells.
- var aCells = tr.cells ;
-
- // Replace the contents of each cell with "nbsp;".
- for ( var i = 0 ; i < aCells.length ; i++ )
- {
- aCells[i].innerHTML = ' ' ;
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcktablehandler_gecko.js
- * Manage table operations (IE specific).
- *
- * Version: 2.0 RC2
- * Modified: 2004-09-07 00:52:56
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKTableHandler.GetSelectedCells = function()
-{
- var aCells = new Array() ;
-
- var oSelection = FCK.EditorWindow.getSelection() ;
-
- // If the selection is a text.
- if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
- {
- var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD' ) ;
-
- if ( oParent )
- {
- aCells[0] = oParent ;
- return aCells ;
- }
- }
-
- for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
- {
- var oRange = oSelection.getRangeAt(i) ;
- var oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
-
- if ( oCell.tagName == 'TD' )
- aCells[aCells.length] = oCell ;
- }
-
- return aCells ;
-}
+++ /dev/null
-/*
- * 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: fcktablehandler_ie.js
- * Manage table operations (IE specific).
- *
- * Version: 2.0 RC2
- * Modified: 2004-09-05 02:17:58
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-FCKTableHandler.GetSelectedCells = function()
-{
- var aCells = new Array() ;
-
- var oRange = FCK.EditorDocument.selection.createRange() ;
- var oParent = oRange.parentElement() ;
-
- if ( oParent && oParent.tagName == "TD" )
- aCells[0] = oParent ;
- else
- {
- var oParent = FCKSelection.MoveToAncestorNode( "TABLE" ) ;
-
- if ( oParent )
- {
- // Loops throw all cells checking if the cell is, or part of it, is inside the selection
- // and then add it to the selected cells collection.
- for ( var i = 0 ; i < oParent.cells.length ; i++ )
- {
- var oCellRange = FCK.EditorDocument.selection.createRange() ;
- oCellRange.moveToElementText( oParent.cells[i] ) ;
-
- if ( oRange.inRange( oCellRange )
- || ( oRange.compareEndPoints('StartToStart',oCellRange) >= 0 && oRange.compareEndPoints('StartToEnd',oCellRange) <= 0 )
- || ( oRange.compareEndPoints('EndToStart',oCellRange) >= 0 && oRange.compareEndPoints('EndToEnd',oCellRange) <= 0 ) )
- {
- aCells[aCells.length] = oParent.cells[i] ;
- }
- }
- }
- }
-
- return aCells ;
-}
+++ /dev/null
-/*
- * 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: fcktoolbaritems.js
- * Toolbar items definitions.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-23 19:42:05
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKToolbarItems = new Object() ;
-FCKToolbarItems.LoadedItems = new Object() ;
-
-FCKToolbarItems.RegisterItem = function( itemName, item )
-{
- this.LoadedItems[ itemName ] = item ;
-}
-
-FCKToolbarItems.GetItem = function( itemName )
-{
- var oItem = FCKToolbarItems.LoadedItems[ itemName ] ;
-
- if ( oItem )
- return oItem ;
-
- switch ( itemName )
- {
- case 'Source' : oItem = new FCKToolbarButton( 'Source' , FCKLang.Source, null, FCK_TOOLBARITEM_ICONTEXT, true ) ; break ;
- case 'Save' : oItem = new FCKToolbarButton( 'Save' , FCKLang.Save, null, null, true ) ; break ;
- case 'NewPage' : oItem = new FCKToolbarButton( 'NewPage' , FCKLang.NewPage, null, null, true ) ; break ;
- case 'Preview' : oItem = new FCKToolbarButton( 'Preview' , FCKLang.Preview, null, null, true ) ; break ;
- case 'About' : oItem = new FCKToolbarButton( 'About' , FCKLang.About ) ; break ;
-
- case 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, true ) ; break ;
- case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, true ) ; break ;
- case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, true ) ; break ;
- case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText ) ; break ;
- case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord ) ; break ;
- case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, true ) ; break ;
- case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, true ) ; break ;
- case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, true ) ; break ;
- case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll, null, null, true ) ; break ;
- case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat ) ; break ;
-
- case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold ) ; break ;
- case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic ) ; break ;
- case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline ) ; break ;
- case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough ) ; break ;
- case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript ) ; break ;
- case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript ) ; break ;
-
- case 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList ) ; break ;
- case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList ) ; break ;
- case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent ) ; break ;
- case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent ) ; break ;
-
- case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink ) ; break ;
- case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink ) ; break ;
-
- case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage ) ; break ;
- case 'Table' : oItem = new FCKToolbarButton( 'Table' , FCKLang.InsertTableLbl, FCKLang.InsertTable ) ; break ;
- case 'SpecialChar' : oItem = new FCKToolbarButton( 'SpecialChar' , FCKLang.InsertSpecialCharLbl, FCKLang.InsertSpecialChar ) ; break ;
- case 'Smiley' : oItem = new FCKToolbarButton( 'Smiley' , FCKLang.InsertSmileyLbl, FCKLang.InsertSmiley ) ; break ;
-
- case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine ) ; break ;
-
- case 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify ) ; break ;
- case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify ) ; break ;
- case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify ) ; break ;
- case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify ) ; break ;
-
- case 'Style' : oItem = new FCKToolbarStyleCombo() ; break ;
- case 'FontName' : oItem = new FCKToolbarFontsCombo() ; break ;
- case 'FontSize' : oItem = new FCKToolbarFontSizeCombo() ; break ;
- case 'FontFormat' : oItem = new FCKToolbarFontFormatCombo() ; break ;
-
- case 'TextColor' : oItem = new FCKToolbarPanelButton( 'TextColor', FCKLang.TextColor ) ; break ;
- case 'BGColor' : oItem = new FCKToolbarPanelButton( 'BGColor' , FCKLang.BGColor ) ; break ;
-
- case 'Find' : oItem = new FCKToolbarButton( 'Find' , FCKLang.Find ) ; break ;
- case 'Replace' : oItem = new FCKToolbarButton( 'Replace' , FCKLang.Replace ) ; break ;
-
- default:
- alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
- return ;
- }
-
- FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
-
- return oItem ;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * 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: fcktoolbarset.js
- * Defines the FCKToolbarSet object that is used to load and draw the
- * toolbar.
- *
- * Version: 2.0 RC2
- * Modified: 2004-11-23 19:53:19
- *
- * File Authors:
- * Frederico Caldeira Knabben (fredck@fckeditor.net)
- */
-
-var FCKToolbarSet = FCK.ToolbarSet = new Object() ;
-
-document.getElementById( 'ExpandHandle' ).title = FCKLang.ToolbarExpand ;
-document.getElementById( 'CollapseHandle' ).title = FCKLang.ToolbarCollapse ;
-
-FCKToolbarSet.Toolbars = new Array() ;
-
-FCKToolbarSet.Expand = function()
-{
- document.getElementById( 'Collapsed' ).style.display = 'none' ;
- document.getElementById( 'Expanded' ).style.display = '' ;
-
- if ( ! FCKBrowserInfo.IsIE )
- {
- // I had to use "setTimeout" because Gecko was not responding in a right
- // way when calling window.onresize() directly.
- window.setTimeout( "window.onresize()", 1 ) ;
- }
-}
-
-FCKToolbarSet.Collapse = function()
-{
- document.getElementById( 'Collapsed' ).style.display = '' ;
- document.getElementById( 'Expanded'