removed fckeditor code.

git-svn-id: https://svn.libreccm.org/ccm/trunk@4775 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2017-06-13 04:22:17 +00:00
parent 3b8af0a6b2
commit 07d20762d8
620 changed files with 0 additions and 53497 deletions

View File

@ -1,30 +0,0 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
-->
<html>
<head>
<title>FCKeditor - Documentation</title>
<style>
BODY { FONT-FAMILY: Arial, Verdana, Sans-Serif }
P { MARGIN-LEFT: 20px }
</style>
</head>
<body>
<h1>FCKeditor Documentation</h1>
<p>You can find all the available documentation for FCKeditor online, at our wiki
web site:</p>
<blockquote dir="ltr" style="MARGIN-RIGHT: 0px">
<p><a href="http://wiki.fckeditor.net/">http://wiki.fckeditor.net/</a></p>
</blockquote>
</body>
</html>

View File

@ -1,32 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 Frederico Caldeira Knabben
*
* Custom amendments for Forum application.
*/
FCKConfig.FillEmptyBlocks = false ;
FCKConfig.ToolbarSets["Basic"] = [
['Source','-','Preview','-'],
['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
['Cut','Copy','Paste','PasteText','PasteWord','-','Print'],
'/',
['OrderedList','UnorderedList','-','Outdent','Indent'],
['Link','Unlink'],
['Undo','Redo','-','SelectAll'],
['TextColor','BGColor'],
['Rule','SpecialChar','Smiley'],
'/',
['FontFormat','FontName','FontSize']
] ;
//only licenced for private use
//FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
//FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
FCKConfig.LinkUpload = false ;
FCKConfig.LinkBrowser = false ; // forum - don't allow users to browse content centre or server file system
FCKConfig.ImageBrowser = false ;
FCKConfig.FlashBrowser = false ;
FCKConfig.SmileyImages = ['regular_smile.gif','sad_smile.gif','wink_smile.gif','teeth_smile.gif','confused_smile.gif','tounge_smile.gif','embaressed_smile.gif','omg_smile.gif','whatchutalkingabout_smile.gif','angry_smile.gif','angel_smile.gif','shades_smile.gif','devil_smile.gif','cry_smile.gif','lightbulb.gif','thumbs_down.gif','thumbs_up.gif','heart.gif','broken_heart.gif','kiss.gif','envelope.gif'] ;

View File

@ -1,61 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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: fckconfigstyledefault.js
* Default Editor configuration settings for use in admin interface in APLAWS.
* This config is loaded from the Javascript in the calling page using AFTER the
* default fckconfig.js is loaded.
*
* File Authors:
* Chris Burnett
*/
FCKConfig.ToolbarSets["AplawsBasic"] = [
['Style','-','Bold','OrderedList','UnorderedList','-','SpellCheck','Link','Unlink','RemoveFormat','-','AdvToolbar']
] ;
FCKConfig.ToolbarSets["AplawsAdvanced"] = [
['Style','-','Bold','OrderedList','UnorderedList'],
['Cut','Copy','Paste','PasteText','PasteWord','Undo','Redo','RemoveFormat'],
['Find','Replace','SelectAll', '-','SpellCheck'],
'/',
['UniversalKey'],
['Link','Unlink','Anchor','-','Source'],
['SimpleToolbar']
] ;
// Replace the Advanced toolbar with AplawsAdvanced & setup the Basic toolbar to use the AplawsBasic toolbar
// The two toolbars are used to support the dynamic toolbar switching plugin.
// Set the Default to be the Basic version so that the editor loads the basic toolbar on startup.
FCKConfig.ToolbarSets["Advanced"] = FCKConfig.ToolbarSets["AplawsAdvanced"] ;
FCKConfig.ToolbarSets["Basic"] = FCKConfig.ToolbarSets["AplawsBasic"] ;
FCKConfig.ToolbarSets["Default"] = FCKConfig.ToolbarSets["Basic"] ;
FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'config/fckconfigstyledefault.xml' ;
FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Flash','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','TableCell','Table','Form'] ;
FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
FCKConfig.ImageDlgHideLink = true ;
FCKConfig.ImageDlgHideAdvanced = true ;
FCKConfig.FlashDlgHideAdvanced = true ;
FCKConfig.LinkBrowser = true ;
FCKConfig.LinkBrowserURL = "/ccm/content/admin/search.jsp?useURL=true&widget=getElementById('txtUrl')" ;
FCKConfig.LinkBrowserWindowWidth = FCKConfig.ScreenWidth * 0.7 ; // 70%
FCKConfig.LinkBrowserWindowHeight = FCKConfig.ScreenHeight * 0.7 ; // 70%

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<Styles>
<Style name="Heading 1" element="h1" />
<Style name="Heading 2" element="h2" />
<Style name="Heading 3" element="h3" />
<Style name="Body Text" element="p" />
</Styles>

View File

@ -1,71 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKContextMenuGroup = function( addSeparator, contextMenu, firstItemCommand, firstItemLabel, hasIcon )
{
this.IsVisible = true ;
// Array with all available context menu items of this group.
this.Items = new Array() ;
if ( addSeparator )
this.Add( new FCKContextMenuSeparator() ) ;
if ( contextMenu && firstItemCommand && firstItemLabel )
this.Add( new FCKContextMenuItem( contextMenu, firstItemCommand, firstItemLabel, hasIcon ) ) ;
// This OPTIONAL function checks if the group must be shown.
this.ValidationFunction = null ;
}
// Adds an item to the group's items collecion.
FCKContextMenuGroup.prototype.Add = function( contextMenuItem )
{
this.Items[ this.Items.length ] = contextMenuItem ;
}
// Creates the <TR> elements that represent the item in a table (usually the rendered context menu).
FCKContextMenuGroup.prototype.CreateTableRows = function( table )
{
for ( var i = 0 ; i < this.Items.length ; i++ )
{
this.Items[i].CreateTableRow( table ) ;
}
}
FCKContextMenuGroup.prototype.SetVisible = function( isVisible )
{
for ( var i = 0 ; i < this.Items.length ; i++ )
{
this.Items[i].SetVisible( isVisible ) ;
}
this.IsVisible = isVisible ;
}
FCKContextMenuGroup.prototype.RefreshState = function()
{
if ( ! this.IsVisible ) return ;
for ( var i = 0 ; i < this.Items.length ; i++ )
{
this.Items[i].RefreshState() ;
}
}

View File

@ -1,103 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcontextmenuitem.js
* FCKContextMenuItem Class: represents a item in the context menu.
*
* 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 ;
}
function FCKContextMenuItem_OnMouseOver()
{
if ( this.className != 'CM_Disabled' )
this.className = 'CM_Over' ;
}
function FCKContextMenuItem_OnMouseOut()
{
if ( this.className != 'CM_Disabled' )
this.className = 'CM_Option' ;
}
function FCKContextMenuItem_OnClick()
{
if ( this.className != 'CM_Disabled' )
{
this.FCKContextMenuItem.ContextMenu.Hide() ;
this.FCKContextMenuItem.Command.Execute() ;
}
return false ;
}
FCKContextMenuItem.prototype.CreateTableRow = function( targetTable )
{
// Creates the <TR> element.
this._Row = targetTable.insertRow(-1) ;
this._Row.className = 'CM_Disabled' ;
this._Row.FCKContextMenuItem = this ;
this._Row.onmouseover = FCKContextMenuItem_OnMouseOver ;
this._Row.onmouseout = FCKContextMenuItem_OnMouseOut ;
this._Row.onclick = FCKContextMenuItem_OnClick ;
var oCell = this._Row.insertCell(-1) ;
oCell.className = 'CM_Icon' ;
if ( this.HasIcon ) oCell.innerHTML = '<img alt="" src="' + FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + '.gif" width="21" height="20">' ;
oCell = this._Row.insertCell(-1) ;
oCell.className = 'CM_Label' ;
oCell.noWrap = true ;
oCell.innerHTML = this.Label ;
}
FCKContextMenuItem.prototype.SetVisible = function( isVisible )
{
this._Row.style.display = isVisible ? '' : 'none' ;
}
FCKContextMenuItem.prototype.RefreshState = function()
{
switch ( this.Command.GetState() )
{
case FCK_TRISTATE_ON :
case FCK_TRISTATE_OFF :
this._Row.className = 'CM_Option' ;
break ;
default :
this._Row.className = 'CM_Disabled' ;
break ;
}
}
/*
Sample output.
-----------------------------------------
<tr class="CM_Disabled">
<td class="CM_Icon"><img alt="" src="icons/cut.gif" width="21" height="20"></td>
<td class="CM_Label">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>
*/

View File

@ -1,57 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcontextmenuseparator.js
* FCKContextMenuSeparator Class: represents a separator in the toolbar.
*
* 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' ;
var oDoc = targetTable.ownerDocument || targetTable.document ;
oCell = this._Row.insertCell(-1) ;
oCell.className = 'CM_Label' ;
oCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'CM_Separator_Line' ;
}
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>
*/

View File

@ -1,50 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckevents.js
* FCKEvents Class: used to handle events is a advanced way.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKEvents ;
if ( !( FCKEvents = NS.FCKEvents ) )
{
FCKEvents = NS.FCKEvents = function( eventsOwner )
{
this.Owner = eventsOwner ;
this.RegisteredEvents = new Object() ;
}
FCKEvents.prototype.AttachEvent = function( eventName, functionPointer )
{
if ( ! this.RegisteredEvents[ eventName ] ) this.RegisteredEvents[ eventName ] = new Array() ;
this.RegisteredEvents[ eventName ][ this.RegisteredEvents[ eventName ].length ] = functionPointer ;
}
FCKEvents.prototype.FireEvent = function( eventName, params )
{
var bReturnValue = true ;
var oCalls = this.RegisteredEvents[ eventName ] ;
if ( oCalls )
{
for ( var i = 0 ; i < oCalls.length ; i++ )
bReturnValue = ( oCalls[ i ]( this.Owner, params ) && bReturnValue ) ;
}
return bReturnValue ;
}
}

View File

@ -1,173 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpanel_gecko.js
* FCKPanel Class: Creates and manages floating panels in Gecko Browsers.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKPanel = function( parentWindow )
{
this.IsRTL = false ;
this.IsContextMenu = false ;
this._IsOpened = false ;
if ( parentWindow )
this._Window = parentWindow ;
else
{
this._Window = window ;
while ( this._Window != window.top )
{
// Try/Catch must be used to avoit an error when using a frameset
// on a different domain:
// "Permission denied to get property HTMLDocument.Body".
try
{
if ( this._Window.parent.document.body.tagName == 'FRAMESET' )
break ;
} catch (e) { break ; }
this._Window = this._Window.parent ;
}
}
var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
oIFrame.frameBorder = '0';
oIFrame.scrolling = 'no' ;
oIFrame.style.position = 'absolute';
oIFrame.width = oIFrame.height = 0 ;
oIFrame.style.zIndex = FCKConfig.FloatingPanelsZIndex ;
this._Window.document.body.appendChild( oIFrame ) ;
this.Document = oIFrame.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' ;
this._IFrame.contentWindow.onblur = this.Hide ;
oIFrame.contentWindow.Panel = this ;
// 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.EnableContextMenu( false ) ;
this.SetDirection( FCKLang.Dir ) ;
}
FCKPanel.prototype.EnableContextMenu = function( enabled )
{
this.Document.oncontextmenu = enabled ? null : FCKTools.CancelEvent ;
}
FCKPanel.prototype.AppendStyleSheet = function( styleSheet )
{
FCKTools.AppendStyleSheet( this.Document, styleSheet ) ;
}
FCKPanel.prototype.SetDirection = function( dir )
{
this.IsRTL = ( dir == 'rtl' ) ;
this.Document.dir = dir ;
// The "float" property must be set so Firefox calculates the size correcly.
this.PanelDiv.style.cssFloat = ( dir == 'rtl' ? 'right' : 'left' ) ;
}
FCKPanel.prototype.Load = function()
{
// This is a IE only need.
}
FCKPanel.prototype.Show = function( x, y, relElement, width, height )
{
this.PanelDiv.style.width = width ? width + 'px' : '' ;
this.PanelDiv.style.height = height ? height + 'px' : '' ;
if ( !width ) this._IFrame.width = 1 ;
if ( !height ) this._IFrame.height = 1 ;
var oPos = FCKTools.GetElementPosition( relElement, this._Window ) ;
x += oPos.X ;
y += oPos.Y ;
if ( this.IsRTL )
{
if ( this.IsContextMenu )
x = x - this.PanelDiv.offsetWidth + 1 ;
else if ( relElement )
x = x + ( relElement.offsetWidth - this.PanelDiv.offsetWidth ) ;
}
else
{
if ( ( x + this.PanelDiv.offsetWidth ) > this._Window.document.body.clientWidth )
x -= x + this.PanelDiv.offsetWidth - this._Window.document.body.clientWidth ;
}
if ( x < 0 )
x = 0 ;
// Set the context menu DIV in the specified location.
this._IFrame.style.left = x + 'px' ;
this._IFrame.style.top = y + 'px' ;
var iWidth = this.PanelDiv.offsetWidth ;
var iHeight = this.PanelDiv.offsetHeight ;
this._IFrame.width = iWidth ;
this._IFrame.height = iHeight ;
// Move the focus to the IFRAME so we catch the "onblur".
this._IFrame.contentWindow.focus() ;
this._IsOpened = true ;
}
FCKPanel.prototype.Hide = function()
{
var oPanel = this.Panel ? this.Panel : this ;
if ( !oPanel._IsOpened )
return ;
// It is better to set the sizes to 0, otherwise Firefox would have
// rendering problems.
oPanel._IFrame.width = oPanel._IFrame.height = 0 ;
if ( oPanel._OnHide )
oPanel._OnHide( oPanel ) ;
oPanel._IsOpened = false ;
}
FCKPanel.prototype.CheckIsOpened = function()
{
return this._IsOpened ;
}
FCKPanel.prototype.AttachToOnHideEvent = function( targetFunction )
{
this._OnHide = targetFunction ;
}

View File

@ -1,127 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpanel_ie.js
* FCKPanel Class: Creates and manages floating panels in IE Browsers.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKPanel = function( parentWindow )
{
this.IsRTL = false ;
this.IsContextMenu = false ;
this._IsOpened = false ;
this._Window = parentWindow ? parentWindow : window ;
// Create the Popup that will hold the panel.
this._Popup = this._Window.createPopup() ;
this.Document = this._Popup.document ;
// 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.EnableContextMenu( false ) ;
this.SetDirection( FCKLang.Dir ) ;
}
FCKPanel.prototype.EnableContextMenu = function( enabled )
{
this.Document.oncontextmenu = enabled ? null : FCKTools.CancelEvent ;
}
FCKPanel.prototype.AppendStyleSheet = function( styleSheet )
{
FCKTools.AppendStyleSheet( this.Document, styleSheet ) ;
}
FCKPanel.prototype.SetDirection = function( dir )
{
this.IsRTL = ( dir == 'rtl' ) ;
this.Document.dir = dir ;
}
FCKPanel.prototype.Load = function( x, y, relElement )
{
// 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( x, y, 0, 0, relElement ) ;
}
FCKPanel.prototype.Show = function( x, y, relElement, width, height )
{
this.Load( x, y, relElement ) ;
// The following lines must be place after the above "show", otherwise it
// doesn't has the desired effect.
this.PanelDiv.style.width = width ? width + 'px' : '' ;
this.PanelDiv.style.height = height ? height + 'px' : '' ;
if ( this.IsRTL )
{
if ( this.IsContextMenu )
x = x - this.PanelDiv.offsetWidth + 1 ;
else if ( relElement )
x = x + ( relElement.offsetWidth - this.PanelDiv.offsetWidth ) ;
}
// Second call: Show the Popup at the specified location, with the correct size.
this._Popup.show( x, y, this.PanelDiv.offsetWidth, this.PanelDiv.offsetHeight, relElement ) ;
if ( this._OnHide )
{
if ( FCKPanel_ActivePopupInfo.Timer )
CheckPopupOnHide() ;
FCKPanel_ActivePopupInfo.Timer = window.setInterval( CheckPopupOnHide, 200 ) ;
FCKPanel_ActivePopupInfo.Panel = this ;
}
this._IsOpened = true ;
}
FCKPanel.prototype.Hide = function()
{
this._Popup.hide() ;
}
FCKPanel.prototype.CheckIsOpened = function()
{
return this._Popup.isOpen ;
}
FCKPanel.prototype.AttachToOnHideEvent = function( targetFunction )
{
this._OnHide = targetFunction ;
}
var FCKPanel_ActivePopupInfo = new Object() ;
function CheckPopupOnHide()
{
var oPanel = FCKPanel_ActivePopupInfo.Panel ;
if ( oPanel && !oPanel._Popup.isOpen )
{
window.clearInterval( FCKPanel_ActivePopupInfo.Timer ) ;
if ( oPanel._OnHide )
oPanel._OnHide( oPanel ) ;
FCKPanel_ActivePopupInfo.Timer = null ;
FCKPanel_ActivePopupInfo.Panel = null ;
}
}

View File

@ -1,56 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugin.js
* FCKPlugin Class: Represents a single plugin.
*
* 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, basePath )
{
this.Name = name ;
this.BasePath = basePath ? basePath : FCKConfig.PluginsPath ;
this.Path = this.BasePath + name + '/' ;
if ( !availableLangs || availableLangs.length == 0 )
this.AvailableLangs = new Array() ;
else
this.AvailableLangs = availableLangs.split(',') ;
}
FCKPlugin.prototype.Load = function()
{
// Load the language file, if defined.
if ( this.AvailableLangs.length > 0 )
{
var sLang ;
// Check if the plugin has the language file for the active language.
if ( this.AvailableLangs.indexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
sLang = FCKLanguageManager.ActiveLanguage.Code ;
else
// Load the default language file (first one) if the current one is not available.
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' ) ;
}

View File

@ -1,318 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckspecialcombo.js
* FCKSpecialCombo Class: represents a special combo.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKSpecialCombo = function( caption, fieldWidth, panelWidth, panelMaxHeight, parentWindow )
{
// Default properties values.
this.FieldWidth = fieldWidth || 100 ;
this.PanelWidth = panelWidth || 150 ;
this.PanelMaxHeight = panelMaxHeight || 150 ;
this.Label = '&nbsp;' ;
this.Caption = caption ;
this.Tooltip = caption ;
this.Style = FCK_TOOLBARITEM_ICONTEXT ;
this.Enabled = true ;
this.Items = new Object() ;
this._Panel = new FCKPanel( parentWindow ) ;
this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
this._PanelBox = this._Panel.PanelDiv.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ;
this._PanelBox.className = 'SC_Panel' ;
this._PanelBox.style.width = this.PanelWidth + 'px' ;
this._PanelBox.innerHTML = '<table cellpadding="0" cellspacing="0" width="100%" style="TABLE-LAYOUT: fixed"><tr><td nowrap></td></tr></table>' ;
this._ItemsHolderEl = this._PanelBox.getElementsByTagName('TD')[0] ;
// 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] ;
}
function FCKSpecialCombo_ItemOnMouseOver()
{
this.className += ' SC_ItemOver' ;
}
function FCKSpecialCombo_ItemOnMouseOut()
{
this.className = this.originalClass ;
}
function FCKSpecialCombo_ItemOnClick()
{
this.FCKSpecialCombo._Panel.Hide() ;
this.FCKSpecialCombo.SetLabel( this.FCKItemLabel ) ;
if ( typeof( this.FCKSpecialCombo.OnSelect ) == 'function' )
this.FCKSpecialCombo.OnSelect( this.FCKItemID, this ) ;
}
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 = FCKSpecialCombo_ItemOnMouseOver ;
oDiv.onmouseout = FCKSpecialCombo_ItemOnMouseOut ;
oDiv.onclick = FCKSpecialCombo_ItemOnClick ;
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.SelectItemByLabel = function( itemLabel, setLabel )
{
for ( var id in this.Items )
{
var oDiv = this.Items[id] ;
if ( oDiv.FCKItemLabel == itemLabel )
{
oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ;
oDiv.Selected = true ;
if ( setLabel )
this.SetLabel( itemLabel ) ;
}
}
}
FCKSpecialCombo.prototype.DeselectAll = function( clearLabel )
{
for ( var i in this.Items )
{
this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ;
this.Items[i].Selected = false ;
}
if ( clearLabel )
this.SetLabel( '' ) ;
}
FCKSpecialCombo.prototype.SetLabelById = function( id )
{
id = id ? id.toString().toLowerCase() : '' ;
var oDiv = this.Items[ id ] ;
this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ;
}
FCKSpecialCombo.prototype.SetLabel = function( text )
{
this.Label = text.length == 0 ? '&nbsp;' : text ;
if ( this._LabelEl )
this._LabelEl.innerHTML = this.Label ;
}
FCKSpecialCombo.prototype.SetEnabled = function( isEnabled )
{
this.Enabled = isEnabled ;
this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ;
}
FCKSpecialCombo.prototype.Create = function( targetElement )
{
this._OuterTable = targetElement.appendChild( document.createElement( 'TABLE' ) ) ;
this._OuterTable.cellPadding = 0 ;
this._OuterTable.cellSpacing = 0 ;
this._OuterTable.insertRow(-1) ;
var sClass ;
var bShowLabel ;
switch ( this.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
sClass = 'TB_ButtonType_Icon' ;
bShowLabel = false;
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
sClass = 'TB_ButtonType_Text' ;
bShowLabel = false;
break ;
case FCK_TOOLBARITEM_ICONTEXT :
bShowLabel = true;
break ;
}
if ( this.Caption && this.Caption.length > 0 && bShowLabel )
{
var oCaptionCell = this._OuterTable.rows[0].insertCell(-1) ;
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' ) ) ;
if ( bShowLabel )
{
oField.className = 'SC_Field' ;
oField.style.width = this.FieldWidth + 'px' ;
oField.innerHTML = '<table width="100%" cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldLabel"><label>&nbsp;</label></td><td class="SC_FieldButton">&nbsp;</td></tr></tbody></table>' ;
this._LabelEl = oField.getElementsByTagName('label')[0] ;
this._LabelEl.innerHTML = this.Label ;
}
else
{
oField.className = 'TB_Button_Off' ;
//oField.innerHTML = '<span className="SC_FieldCaption">' + this.Caption + '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
oField.innerHTML = '<table cellpadding="0" cellspacing="0" style="TABLE-LAYOUT: fixed;"><tbody><tr><td class="SC_FieldButton" style="border-left: none;">&nbsp;</td></tr></tbody></table>' ;
// Gets the correct CSS class to use for the specified style (param).
oField.innerHTML ='<table title="' + this.Tooltip + '" class="' + sClass + '" cellspacing="0" cellpadding="0" border="0">' +
'<tr>' +
//'<td class="TB_Icon"><img src="' + FCKConfig.SkinPath + 'toolbar/' + this.Command.Name.toLowerCase() + '.gif" width="21" height="21"></td>' +
'<td class="TB_Text">' + this.Caption + '</td>' +
'<td class="TB_ButtonArrow"><img src="' + FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
'</tr>' +
'</table>' ;
}
// Events Handlers
oField.SpecialCombo = this ;
oField.onmouseover = FCKSpecialCombo_OnMouseOver ;
oField.onmouseout = FCKSpecialCombo_OnMouseOut ;
oField.onclick = FCKSpecialCombo_OnClick ;
FCKTools.DisableSelection( this._Panel.Document.body ) ;
}
function FCKSpecialCombo_OnMouseOver()
{
if ( this.SpecialCombo.Enabled )
{
switch ( this.SpecialCombo.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
this.className = 'TB_Button_On';
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
this.className = 'TB_Button_On';
break ;
case FCK_TOOLBARITEM_ICONTEXT :
this.className = 'SC_Field SC_FieldOver' ;
break ;
}
}
}
function FCKSpecialCombo_OnMouseOut()
{
switch ( this.SpecialCombo.Style )
{
case FCK_TOOLBARITEM_ONLYICON :
this.className = 'TB_Button_Off';
break ;
case FCK_TOOLBARITEM_ONLYTEXT :
this.className = 'TB_Button_Off';
break ;
case FCK_TOOLBARITEM_ICONTEXT :
this.className='SC_Field' ;
break ;
}
}
function FCKSpecialCombo_OnClick( 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 ) ;
// }
var oSpecialCombo = this.SpecialCombo ;
if ( oSpecialCombo.Enabled )
{
var oPanel = oSpecialCombo._Panel ;
var oPanelBox = oSpecialCombo._PanelBox ;
var oItemsHolder = oSpecialCombo._ItemsHolderEl ;
var iMaxHeight = oSpecialCombo.PanelMaxHeight ;
if ( oSpecialCombo.OnBeforeClick )
oSpecialCombo.OnBeforeClick( oSpecialCombo ) ;
// This is a tricky thing. We must call the "Load" function, otherwise
// it will not be possible to retrieve "oItemsHolder.offsetHeight".
oPanel.Load( 0, this.offsetHeight, this ) ;
if ( oItemsHolder.offsetHeight > iMaxHeight )
oPanelBox.style.height = iMaxHeight + 'px' ;
else
oPanelBox.style.height = oItemsHolder.offsetHeight + 'px' ;
// oPanel.PanelDiv.style.width = oSpecialCombo.PanelWidth + 'px' ;
if ( FCKBrowserInfo.IsGecko )
oPanelBox.style.overflow = '-moz-scrollbars-vertical' ;
oPanel.Show( 0, this.offsetHeight, this ) ;
}
return false ;
}
/*
Sample Combo Field HTML output:
<div class="SC_Field" style="width: 80px;">
<table width="100%" cellpadding="0" cellspacing="0" style="table-layout: fixed;">
<tbody>
<tr>
<td class="SC_FieldLabel"><label>&nbsp;</label></td>
<td class="SC_FieldButton">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
*/

View File

@ -1,55 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef.js
* FCKStyleDef Class: represents a single stylke definition.
*
* 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() ) ;
}

View File

@ -1,107 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef_gecko.js
* FCKStyleDef Class: represents a single stylke definition. (Gecko specific)
*
* 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 ) ;
}

View File

@ -1,136 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstyledef_ie.js
* FCKStyleDef Class: represents a single stylke definition. (IE specific)
*
* 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 )
{
switch ( a.toLowerCase() )
{
case 'style' :
targetElement.style.cssText = this.Attributes[a] ;
break ;
case 'class' :
targetElement.setAttribute( 'className', this.Attributes[a], 0 ) ;
break ;
default :
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 ) )
FCKTools.RemoveOuterTags( 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 ) ;
}

View File

@ -1,84 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstylesloader.js
* FCKStylesLoader Class: this class define objects that are responsible
* for loading the styles defined in the XML file.
*
* 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 ;
}

View File

@ -1,61 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbar = function()
{
this.Items = new Array() ;
var e = this.DOMTable = document.createElement( 'table' ) ;
e.className = 'TB_Toolbar' ;
// Sets the toolbar direction. IE uses "styleFloat" and Gecko uses "cssFloat".
e.style.styleFloat = e.style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
e.cellPadding = 0 ;
e.cellSpacing = 0 ;
e.border = 0 ;
this.DOMRow = e.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 = \'\';">' ;
FCKToolbarSet.DOMElement.appendChild( e ) ;
}
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.innerHTML = '<img src="' + FCKConfig.SkinPath + 'images/toolbar.separator.gif" width="5" height="21" style="VISIBILITY: hidden" onload="this.style.visibility = \'\';">' ;
}
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 = \'\';">' ;
}

View File

@ -1,29 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbreak_gecko.js
* FCKToolbarBreak Class: breaks the toolbars.
* It makes it possible to force the toolbar to brak to a new line.
* This is the Gecko specific implementation.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarBreak = function()
{
var oBreakDiv = document.createElement( 'div' ) ;
oBreakDiv.style.clear = oBreakDiv.style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
FCKToolbarSet.DOMElement.appendChild( oBreakDiv ) ;
}

View File

@ -1,31 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbreak_ie.js
* FCKToolbarBreak Class: breaks the toolbars.
* It makes it possible to force the toolbar to brak to a new line.
* This is the IE specific implementation.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarBreak = function()
{
var oBreakDiv = document.createElement( 'div' ) ;
oBreakDiv.className = 'TB_Break' ;
oBreakDiv.style.clear = FCKLang.Dir == 'rtl' ? 'left' : 'right' ;
FCKToolbarSet.DOMElement.appendChild( oBreakDiv ) ;
}

View File

@ -1,148 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarbutton.js
* FCKToolbarButton Class: represents a button in the toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarButton = function( commandName, label, tooltip, style, sourceView, contextSensitive )
{
this.Command = FCKCommands.GetCommand( commandName ) ;
this.Label = label ? label : commandName ;
this.Tooltip = tooltip ? tooltip : ( label ? label : commandName) ;
this.Style = style ? style : FCK_TOOLBARITEM_ONLYICON ;
this.SourceView = sourceView ? true : false ;
this.ContextSensitive = contextSensitive ? true : false ;
this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
this.State = FCK_UNKNOWN ;
}
FCKToolbarButton.prototype.CreateInstance = function( parentToolbar )
{
this.DOMDiv = document.createElement( 'div' ) ;
this.DOMDiv.className = 'TB_Button_Off' ;
this.DOMDiv.FCKToolbarButton = this ;
var sHtml =
'<table title="' + this.Tooltip + '" cellspacing="0" cellpadding="0" border="0">' +
'<tr>' ;
if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
sHtml += '<td class="TB_Icon"><img src="' + this.IconPath + '" width="21" height="21"></td>' ;
if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
sHtml += '<td class="TB_Text" nowrap>' + this.Label + '</td>' ;
sHtml +=
'</tr>' +
'</table>' ;
this.DOMDiv.innerHTML = sHtml ;
var oCell = parentToolbar.DOMRow.insertCell(-1) ;
oCell.appendChild( this.DOMDiv ) ;
this.RefreshState() ;
}
FCKToolbarButton.prototype.RefreshState = function()
{
/*
TODO: Delete this comment block on stable version.
// Gets the actual state.
// var eState ;
// if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
// eState = FCK_TRISTATE_DISABLED ;
// else
*/
// Gets the actual state.
var eState = this.Command.GetState() ;
// If there are no state changes than do nothing and return.
if ( eState == this.State ) return ;
// Sets the actual state.
this.State = eState ;
switch ( this.State )
{
case FCK_TRISTATE_ON :
this.DOMDiv.className = 'TB_Button_On' ;
this.DOMDiv.onmouseover = FCKToolbarButton_OnMouseOnOver ;
this.DOMDiv.onmouseout = FCKToolbarButton_OnMouseOnOut ;
this.DOMDiv.onclick = FCKToolbarButton_OnClick ;
break ;
case FCK_TRISTATE_OFF :
this.DOMDiv.className = 'TB_Button_Off' ;
this.DOMDiv.onmouseover = FCKToolbarButton_OnMouseOffOver ;
this.DOMDiv.onmouseout = FCKToolbarButton_OnMouseOffOut ;
this.DOMDiv.onclick = FCKToolbarButton_OnClick ;
break ;
default :
this.Disable() ;
break ;
}
}
function FCKToolbarButton_OnMouseOnOver()
{
this.className = 'TB_Button_On TB_Button_On_Over' ;
}
function FCKToolbarButton_OnMouseOnOut()
{
this.className = 'TB_Button_On' ;
}
function FCKToolbarButton_OnMouseOffOver()
{
this.className = 'TB_Button_On TB_Button_Off_Over' ;
}
function FCKToolbarButton_OnMouseOffOut()
{
this.className = 'TB_Button_Off' ;
}
function FCKToolbarButton_OnClick(e)
{
this.FCKToolbarButton.Click(e) ;
return false ;
}
FCKToolbarButton.prototype.Click = function()
{
this.Command.Execute() ;
}
FCKToolbarButton.prototype.Enable = function()
{
this.RefreshState() ;
}
FCKToolbarButton.prototype.Disable = function()
{
this.State = FCK_TRISTATE_DISABLED ;
this.DOMDiv.className = 'TB_Button_Disabled' ;
this.DOMDiv.onmouseover = null ;
this.DOMDiv.onmouseout = null ;
this.DOMDiv.onclick = null ;
}

View File

@ -1,98 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontformatcombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarFontFormatCombo = function( tooltip, style )
{
this.Command = FCKCommands.GetCommand( 'FontFormat' ) ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
this.NormalLabel = 'Normal' ;
this.PanelWidth = 190 ;
}
// 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++ )
{
// Support for DIV in Firefox has been reintroduced on version 2.2.
// if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
// continue ;
var sTag = aTags[i] ;
var sLabel = oNames[sTag] ;
if ( sTag == 'p' )
this.NormalLabel = sLabel ;
this._Combo.AddItem( sTag, '<div class="BaseFont"><' + sTag + '>' + sLabel + '</' + sTag + '></div>', sLabel ) ;
}
}
if ( FCKBrowserInfo.IsIE )
{
FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value )
{
// FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ;
// IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal.
if ( value == this.NormalLabel )
{
if ( combo.Label != '&nbsp;' )
combo.DeselectAll(true) ;
}
else
{
if ( this._LastValue == value )
return ;
combo.SelectItemByLabel( value, true ) ;
}
this._LastValue = value ;
}
}

View File

@ -1,42 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontscombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarFontsCombo = function( tooltip, style )
{
this.Command = FCKCommands.GetCommand( 'FontName' ) ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// 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], '<font face="' + aFonts[i] + '" style="font-size: 12px">' + aFonts[i] + '</font>' ) ;
}

View File

@ -1,47 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarfontsizecombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarFontSizeCombo = function( tooltip, style )
{
this.Command = FCKCommands.GetCommand( 'FontSize' ) ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// 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] ) ;
}
}

View File

@ -1,84 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarpanelbutton.js
* FCKToolbarPanelButton Class: represents a special button in the toolbar
* that shows a panel when pressed.
*
* 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 ;
this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ;
}
FCKToolbarPanelButton.prototype.Click = 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.State != FCK_TRISTATE_DISABLED )
{
this.Command.Execute(0, this.DOMDiv.offsetHeight, this.DOMDiv) ;
// this.FCKToolbarButton.HandleOnClick( this, e ) ;
}
return false ;
}
FCKToolbarPanelButton.prototype.CreateInstance = function( parentToolbar )
{
this.DOMDiv = document.createElement( 'div' ) ;
this.DOMDiv.className = 'TB_Button_Off' ;
this.DOMDiv.FCKToolbarButton = this ;
var sHtml =
'<table title="' + this.Tooltip + '" cellspacing="0" cellpadding="0" border="0">' +
'<tr>' ;
if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
sHtml += '<td class="TB_Icon"><img src="' + this.IconPath + '" width="21" height="21"></td>' ;
if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
sHtml += '<td class="TB_Text" nowrap>' + this.Label + '</td>' ;
sHtml +=
'<td class="TB_ButtonArrow"><img src="' + FCKConfig.SkinPath + 'images/toolbar.buttonarrow.gif" width="5" height="3"></td>' +
'</tr>' +
'</table>' ;
this.DOMDiv.innerHTML = sHtml ;
var oCell = parentToolbar.DOMRow.insertCell(-1) ;
oCell.appendChild( this.DOMDiv ) ;
this.RefreshState() ;
}
// The Panel Button works like a normal button so the refresh state functions
// defined for the normal button can be reused here.
FCKToolbarPanelButton.prototype.RefreshState = FCKToolbarButton.prototype.RefreshState ;
FCKToolbarPanelButton.prototype.Enable = FCKToolbarButton.prototype.Enable ;
FCKToolbarPanelButton.prototype.Disable = FCKToolbarButton.prototype.Disable ;

View File

@ -1,127 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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 ]
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarSpecialCombo = function()
{
this.SourceView = false ;
this.ContextSensitive = true ;
}
function FCKToolbarSpecialCombo_OnSelect( itemId, item )
{
this.Command.Execute( itemId, item ) ;
}
FCKToolbarSpecialCombo.prototype.CreateInstance = function( parentToolbar )
{
this._Combo = new FCKSpecialCombo( this.GetLabel(), this.FieldWidth, this.PanelWidth, this.PanelMaxHeight ) ;
/*
this._Combo.FieldWidth = this.FieldWidth != null ? this.FieldWidth : 100 ;
this._Combo.PanelWidth = this.PanelWidth != null ? this.PanelWidth : 150 ;
this._Combo.PanelMaxHeight = this.PanelMaxHeight != null ? this.PanelMaxHeight : 150 ;
*/
//this._Combo.Command.Name = this.Command.Name;
// this._Combo.Label = this.Label ;
this._Combo.Tooltip = this.Tooltip ;
this._Combo.Style = this.Style ;
this.CreateItems( this._Combo ) ;
this._Combo.Create( parentToolbar.DOMRow.insertCell(-1) ) ;
this._Combo.Command = this.Command ;
this._Combo.OnSelect = FCKToolbarSpecialCombo_OnSelect ;
}
function FCKToolbarSpecialCombo_RefreshActiveItems( combo, value )
{
combo.DeselectAll() ;
combo.SelectItem( value ) ;
combo.SetLabelById( value ) ;
}
FCKToolbarSpecialCombo.prototype.RefreshState = function()
{
// Gets the actual state.
var eState ;
// if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
// eState = FCK_TRISTATE_DISABLED ;
// else
// {
var sValue = this.Command.GetState() ;
if ( sValue != FCK_TRISTATE_DISABLED )
{
eState = FCK_TRISTATE_ON ;
if ( this.RefreshActiveItems )
this.RefreshActiveItems( this._Combo, sValue ) ;
else
{
if ( this._LastValue == sValue )
return ;
this._LastValue = sValue ;
FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ;
}
}
else
eState = FCK_TRISTATE_DISABLED ;
// }
// If there are no state changes then do nothing and return.
if ( eState == this.State ) return ;
if ( eState == FCK_TRISTATE_DISABLED )
{
this._Combo.DeselectAll() ;
this._Combo.SetLabel( '' ) ;
}
// Sets the actual state.
this.State = eState ;
// Updates the graphical state.
this._Combo.SetEnabled( eState != FCK_TRISTATE_DISABLED ) ;
}
FCKToolbarSpecialCombo.prototype.Enable = function()
{
this.RefreshState() ;
}
FCKToolbarSpecialCombo.prototype.Disable = function()
{
this.State = FCK_TRISTATE_DISABLED ;
this._Combo.DeselectAll() ;
this._Combo.SetLabel( '' ) ;
this._Combo.SetEnabled( false ) ;
}

View File

@ -1,96 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarstylecombo.js
* FCKToolbarPanelButton Class: Handles the Fonts combo selector.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarStyleCombo = function( tooltip, style )
{
this.Command = FCKCommands.GetCommand( 'Style' ) ;
this.Label = this.GetLabel() ;
this.Tooltip = tooltip ? tooltip : this.Label ;
this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ;
}
// 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 ) ;
targetSpecialCombo._Panel.Document.body.className += ' ForceBaseFont' ;
// 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] ;
var oItem ;
if ( oStyle.IsObjectElement )
oItem = targetSpecialCombo.AddItem( s, s ) ;
else
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.
}
}

View File

@ -1,71 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxml_gecko.js
* FCKXml Class: class to load and manipulate XML files.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKXml ;
if ( !( FCKXml = NS.FCKXml ) )
{
FCKXml = NS.FCKXml = function()
{}
FCKXml.prototype.LoadUrl = function( urlToCall )
{
var oFCKXml = this ;
var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
oXmlHttp.open( "GET", urlToCall, false ) ;
oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
this.DOMDocument = oXmlHttp.responseXML ;
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
this.DOMDocument = oXmlHttp.responseXML ;
else
alert( 'Error loading "' + urlToCall + '"' ) ;
}
FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
var aNodeArray = new Array();
var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), XPathResult.ORDERED_NODE_ITERATOR_TYPE, null) ;
if ( xPathResult )
{
var oNode = xPathResult.iterateNext() ;
while( oNode )
{
aNodeArray[aNodeArray.length] = oNode ;
oNode = xPathResult.iterateNext();
}
}
return aNodeArray ;
}
FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
var xPathResult = this.DOMDocument.evaluate( xpath, contextNode ? contextNode : this.DOMDocument,
this.DOMDocument.createNSResolver(this.DOMDocument.documentElement), 9, null);
if ( xPathResult && xPathResult.singleNodeValue )
return xPathResult.singleNodeValue ;
else
return null ;
}
}

View File

@ -1,83 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxml_ie.js
* FCKXml Class: class to load and manipulate XML files.
* (IE specific implementation)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKXml ;
if ( !( FCKXml = NS.FCKXml ) )
{
FCKXml = NS.FCKXml = function()
{
this.Error = false ;
}
FCKXml.prototype.LoadUrl = function( urlToCall )
{
this.Error = false ;
var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
if ( !oXmlHttp )
{
this.Error = true ;
return ;
}
oXmlHttp.open( "GET", urlToCall, false ) ;
oXmlHttp.send( null ) ;
if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
this.DOMDocument = oXmlHttp.responseXML ;
else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
{
this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
this.DOMDocument.async = false ;
this.DOMDocument.resolveExternals = false ;
this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
}
else
{
this.Error = true ;
alert( 'Error loading "' + urlToCall + '"' ) ;
}
}
FCKXml.prototype.SelectNodes = function( xpath, contextNode )
{
if ( this.Error )
return new Array() ;
if ( contextNode )
return contextNode.selectNodes( xpath ) ;
else
return this.DOMDocument.selectNodes( xpath ) ;
}
FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
{
if ( this.Error )
return ;
if ( contextNode )
return contextNode.selectSingleNode( xpath ) ;
else
return this.DOMDocument.selectSingleNode( xpath ) ;
}
}

View File

@ -1,283 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_othercommands.js
* Definition of other commands that are not available internaly in the
* browser (see FCKNamedCommand).
*
* 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 if ( formatName == 'div' && FCKBrowserInfo.IsGecko )
FCK.ExecuteNamedCommand( 'FormatBlock', 'div' ) ;
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 ;
if ( typeof( oForm.onsubmit ) == 'function' )
{
var bRet = oForm.onsubmit() ;
if ( bRet != null && bRet === false )
return ;
}
// Submit the form.
oForm.submit() ;
}
FCKSaveCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
// ### NewPage
var FCKNewPageCommand = function()
{
this.Name = 'NewPage' ;
}
FCKNewPageCommand.prototype.Execute = function()
{
FCKUndo.SaveUndoStep() ;
FCK.SetHTML( '' ) ;
FCKUndo.Typing = true ;
// FCK.SetHTML( FCKBrowserInfo.IsGecko ? '&nbsp;' : '' ) ;
// FCK.SetHTML( FCKBrowserInfo.IsGecko ? GECKO_BOGUS : '' ) ;
}
FCKNewPageCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}
// ### Source button
var FCKSourceCommand = function()
{
this.Name = 'Source' ;
}
FCKSourceCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsGecko )
{
var iWidth = FCKConfig.ScreenWidth * 0.65 ;
var iHeight = FCKConfig.ScreenHeight * 0.65 ;
FCKDialog.OpenDialog( 'FCKDialog_Source', FCKLang.Source, 'dialog/fck_source.html', iWidth, iHeight, null, null, true ) ;
}
else
FCK.SwitchEditMode() ;
}
FCKSourceCommand.prototype.GetState = function()
{
return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON ) ;
}
// ### Undo
var FCKUndoCommand = function()
{
this.Name = 'Undo' ;
}
FCKUndoCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsIE )
FCKUndo.Undo() ;
else
FCK.ExecuteNamedCommand( 'Undo' ) ;
}
FCKUndoCommand.prototype.GetState = function()
{
if ( FCKBrowserInfo.IsIE )
return ( FCKUndo.CheckUndoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
else
return FCK.GetNamedCommandState( 'Undo' ) ;
}
// ### Redo
var FCKRedoCommand = function()
{
this.Name = 'Redo' ;
}
FCKRedoCommand.prototype.Execute = function()
{
if ( FCKBrowserInfo.IsIE )
FCKUndo.Redo() ;
else
FCK.ExecuteNamedCommand( 'Redo' ) ;
}
FCKRedoCommand.prototype.GetState = function()
{
if ( FCKBrowserInfo.IsIE )
return ( FCKUndo.CheckRedoState() ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
else
return FCK.GetNamedCommandState( 'Redo' ) ;
}
// ### Page Break
var FCKPageBreakCommand = function()
{
this.Name = 'PageBreak' ;
}
FCKPageBreakCommand.prototype.Execute = function()
{
// var e = FCK.EditorDocument.createElement( 'CENTER' ) ;
// e.style.pageBreakAfter = 'always' ;
// Tidy was removing the empty CENTER tags, so the following solution has
// been found. It also validates correctly as XHTML 1.0 Strict.
var e = FCK.EditorDocument.createElement( 'DIV' ) ;
e.style.pageBreakAfter = 'always' ;
e.innerHTML = '<span style="DISPLAY:none">&nbsp;</span>' ;
var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', e ) ;
oFakeImage = FCK.InsertElement( oFakeImage ) ;
}
FCKPageBreakCommand.prototype.GetState = function()
{
return 0 ; // FCK_TRISTATE_OFF
}

View File

@ -1,33 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcknamedcommand.js
* FCKNamedCommand Class: represents an internal browser command.
*
* 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 ) ;
}

View File

@ -1,34 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpasteplaintextcommand.js
* FCKPastePlainTextCommand Class: represents the
* "Paste as Plain Text" command.
*
* 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' ) ;
}

View File

@ -1,36 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckpastewordcommand.js
* FCKPasteWordCommand Class: represents the "Paste from Word" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKPasteWordCommand = function()
{
this.Name = 'PasteWord' ;
}
FCKPasteWordCommand.prototype.Execute = function()
{
FCK.PasteFromWord() ;
}
FCKPasteWordCommand.prototype.GetState = function()
{
if ( FCKConfig.ForcePasteAsPlainText )
return FCK_TRISTATE_DISABLED ;
else
return FCK.GetNamedCommandState( 'Paste' ) ;
}

View File

@ -1,15 +0,0 @@
var FCKSpellCheckCommand = function()
{
this.Name = 'SpellCheck' ;
this.IsEnabled = ( FCKConfig.SpellChecker == 'SpellerPages' ) ;
}
FCKSpellCheckCommand.prototype.Execute = function()
{
FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
}
FCKSpellCheckCommand.prototype.GetState = function()
{
return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}

View File

@ -1,43 +0,0 @@
var FCKSpellCheckCommand = function()
{
this.Name = 'SpellCheck' ;
this.IsEnabled = ( FCKConfig.SpellChecker == 'ieSpell' || FCKConfig.SpellChecker == 'SpellerPages' ) ;
}
FCKSpellCheckCommand.prototype.Execute = function()
{
switch ( FCKConfig.SpellChecker )
{
case 'ieSpell' :
this._RunIeSpell() ;
break ;
case 'SpellerPages' :
FCKDialog.OpenDialog( 'FCKDialog_SpellCheck', 'Spell Check', 'dialog/fck_spellerpages.html', 440, 480 ) ;
break ;
}
}
FCKSpellCheckCommand.prototype._RunIeSpell = function()
{
try
{
var oIeSpell = new ActiveXObject( "ieSpell.ieSpellExtension" ) ;
oIeSpell.CheckAllLinkedDocuments( FCK.EditorDocument ) ;
}
catch( e )
{
if( e.number == -2146827859 )
{
if ( confirm( FCKLang.IeSpellDownload ) )
window.open( FCKConfig.IeSpellDownloadUrl , 'IeSpellDownload' ) ;
}
else
alert( 'Error Loading ieSpell: ' + e.message + ' (' + e.number + ')' ) ;
}
}
FCKSpellCheckCommand.prototype.GetState = function()
{
return this.IsEnabled ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}

View File

@ -1,92 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckstylecommand.js
* FCKStyleCommand Class: represents the "Style" command.
*
* 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 )
{
FCKUndo.SaveUndoStep() ;
if ( styleComboItem.Selected )
styleComboItem.Style.RemoveFromSelection() ;
else
styleComboItem.Style.ApplyToSelection() ;
FCKUndo.SaveUndoStep() ;
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 ;
}
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 ) ;
}

View File

@ -1,67 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablecommand.js
* FCKPastePlainTextCommand Class: represents the
* "Paste as Plain Text" command.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKTableCommand = function( command )
{
this.Name = command ;
}
FCKTableCommand.prototype.Execute = function()
{
FCKUndo.SaveUndoStep() ;
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 ;
case 'TableDelete' :
FCKTableHandler.DeleteTable() ;
break ;
default :
alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ;
}
}
FCKTableCommand.prototype.GetState = function()
{
return FCK_TRISTATE_OFF ;
}

View File

@ -1,181 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktextcolorcommand.js
* FCKTextColorCommand Class: represents the text color comand. It shows the
* color selection panel.
*
* 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.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
// this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
// this._Panel.Create() ;
this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ;
FCKTools.DisableSelection( this._Panel.Document.body ) ;
// 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 ;
}
function FCKTextColorCommand_OnMouseOver() { this.className='ColorSelected' ; }
function FCKTextColorCommand_OnMouseOut() { this.className='ColorDeselected' ; }
function FCKTextColorCommand_OnClick()
{
this.className = 'ColorDeselected' ;
this.Command.SetColor( '#' + this.Color ) ;
this.Command._Panel.Hide() ;
}
function FCKTextColorCommand_AutoOnClick()
{
this.className = 'ColorDeselected' ;
this.Command.SetColor( '' ) ;
this.Command._Panel.Hide() ;
}
function FCKTextColorCommand_MoreOnClick()
{
this.className = 'ColorDeselected' ;
this.Command._Panel.Hide() ;
FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, this.Command.SetColor ) ;
}
FCKTextColorCommand.prototype._CreatePanelBody = function( targetDocument, targetDiv )
{
function CreateSelectionDiv()
{
var oDiv = targetDocument.createElement( "DIV" ) ;
oDiv.className = 'ColorDeselected' ;
oDiv.onmouseover = FCKTextColorCommand_OnMouseOver ;
oDiv.onmouseout = FCKTextColorCommand_OnMouseOut ;
return oDiv ;
}
// Create the Table that will hold all colors.
var oTable = targetDiv.appendChild( targetDocument.createElement( "TABLE" ) ) ;
oTable.className = 'ForceBaseFont' ; // Firefox 1.5 Bug.
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">' + FCKLang.ColorAutomatic + '</td>\
</tr>\
</table>' ;
oDiv.Command = this ;
oDiv.onclick = FCKTextColorCommand_AutoOnClick ;
// Create an array of colors based on the configuration file.
var aColors = FCKConfig.FontColors.toString().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++ )
{
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 = FCKTextColorCommand_OnClick ;
}
}
// Create the Row and the Cell for the "More Colors..." button.
oCell = oTable.insertRow(-1).insertCell(-1) ;
oCell.colSpan = 8 ;
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 = FCKTextColorCommand_MoreOnClick ;
}

View File

@ -1,41 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Editor Instance Status.
var FCK_STATUS_NOTLOADED = window.parent.FCK_STATUS_NOTLOADED = 0 ;
var FCK_STATUS_ACTIVE = window.parent.FCK_STATUS_ACTIVE = 1 ;
var FCK_STATUS_COMPLETE = window.parent.FCK_STATUS_COMPLETE = 2 ;
// Tristate Operations.
var FCK_TRISTATE_OFF = window.parent.FCK_TRISTATE_OFF = 0 ;
var FCK_TRISTATE_ON = window.parent.FCK_TRISTATE_ON = 1 ;
var FCK_TRISTATE_DISABLED = window.parent.FCK_TRISTATE_DISABLED = -1 ;
// For unknown values.
var FCK_UNKNOWN = window.parent.FCK_UNKNOWN = -1000 ;
// Toolbar Items Style.
var FCK_TOOLBARITEM_ONLYICON = window.parent.FCK_TOOLBARITEM_ONLYICON = 0 ;
var FCK_TOOLBARITEM_ONLYTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 1 ;
var FCK_TOOLBARITEM_ICONTEXT = window.parent.FCK_TOOLBARITEM_ICONTEXT = 2 ;
// Edit Mode
var FCK_EDITMODE_WYSIWYG = window.parent.FCK_EDITMODE_WYSIWYG = 0 ;
var FCK_EDITMODE_SOURCE = window.parent.FCK_EDITMODE_SOURCE = 1 ;

View File

@ -1,45 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckeditorapi.js
* Create the FCKeditorAPI object that is available as a global object in
* the page where the editor is placed in.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKeditorAPI ;
function FCKeditorAPI_GetInstance( instanceName )
{
return this.__Instances[ instanceName ] ;
}
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.2' ;
// Function used to get a instance of an existing editor present in the
// page.
FCKeditorAPI.GetInstance = FCKeditorAPI_GetInstance ;
}
else
FCKeditorAPI = window.parent.FCKeditorAPI ;
// Add the current instance to the FCKeditorAPI's instances collection.
FCKeditorAPI.__Instances[ FCK.Name ] = FCK ;

View File

@ -1,77 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck.js
* Creation and initialization of the "FCK" object. This is the main object
* that represents an editor instance.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// FCK represents the active editor instance
var FCK = new Object() ;
FCK.Name = FCKURLParams[ 'InstanceName' ] ;
FCK.Status = FCK_STATUS_NOTLOADED ;
FCK.EditMode = FCK_EDITMODE_WYSIWYG ;
FCK.LoadLinkedFile = function()
{
// There is a bug on IE... getElementById returns any META tag that has the
// name set to the ID you are looking for. So the best way in to get the array
// by names and look for the correct one.
// As ASP.Net generates a ID that is different from the Name, we must also
// look for the field based on the ID (the first one is the ID).
var oDocument = window.parent.document ;
var eLinkedField = oDocument.getElementById( FCK.Name ) ;
var colElementsByName = oDocument.getElementsByName( FCK.Name ) ;
var i = 0;
while ( eLinkedField || i == 0 )
{
if ( eLinkedField && ( eLinkedField.tagName == 'INPUT' || eLinkedField.tagName == 'TEXTAREA' ) )
{
FCK.LinkedField = eLinkedField ;
break ;
}
eLinkedField = colElementsByName[i++] ;
}
}
FCK.LoadLinkedFile() ;
var FCKTempBin = new Object() ;
FCKTempBin.Elements = new Array() ;
FCKTempBin.AddElement = function( element )
{
var iIndex = FCKTempBin.Elements.length ;
FCKTempBin.Elements[ iIndex ] = element ;
return iIndex ;
}
FCKTempBin.RemoveElement = function( index )
{
var e = FCKTempBin.Elements[ index ] ;
FCKTempBin.Elements[ index ] = null ;
return e ;
}
FCKTempBin.Reset = function()
{
var i = 0 ;
while ( i < FCKTempBin.Elements.length )
FCKTempBin.Elements[ i++ ] == null ;
FCKTempBin.Elements.length = 0 ;
}

View File

@ -1,477 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCK_StartupValue ;
FCK.Events = new FCKEvents( FCK ) ;
FCK.Toolbar = null ;
FCK.TempBaseTag = FCKConfig.BaseHref.length > 0 ? '<base href="' + FCKConfig.BaseHref + '" _fcktemp="true"></base>' : '' ;
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 ;
// if ( FCKBrowserInfo.IsGecko )
// this.MakeEditable() ;
// Set the editor's startup contents
this.SetHTML( FCKTools.GetLinkedFieldValue() ) ;
// Save the startup value for the "IsDirty()" check.
this.ResetIsDirty() ;
// Attach the editor to the form onsubmit event
FCKTools.AttachToLinkedFieldFormSubmit( this.UpdateLinkedField ) ;
FCKUndo.SaveUndoStep() ;
this.SetStatus( FCK_STATUS_ACTIVE ) ;
}
function Window_OnFocus()
{
FCK.Focus() ;
FCK.Events.FireEvent( "OnFocus" ) ;
}
function Window_OnBlur()
{
if ( !FCKDialog.IsOpened )
return FCK.Events.FireEvent( "OnBlur" ) ;
}
FCK.SetStatus = function( newStatus )
{
this.Status = newStatus ;
if ( newStatus == FCK_STATUS_ACTIVE )
{
// Force the focus in the window to go to the editor.
window.frameElement.onfocus = window.document.body.onfocus = Window_OnFocus ;
window.frameElement.onblur = Window_OnBlur ;
// Force the focus in the editor.
if ( FCKConfig.StartupFocus )
FCK.Focus() ;
// @Packager.Compactor.Remove.Start
var sBrowserSuffix = FCKBrowserInfo.IsIE ? "ie" : "gecko" ;
FCKScriptLoader.AddScript( '_source/internals/fck_2.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fck_2_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckselection.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckselection_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckpanel_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktablehandler.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktablehandler_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckxml_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckstyledef.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckstyledef_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckstylesloader.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fcknamedcommand.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fck_othercommands.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fckspellcheckcommand_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fcktextcolorcommand.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fckpasteplaintextcommand.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fckpastewordcommand.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fcktablecommand.js' ) ;
FCKScriptLoader.AddScript( '_source/commandclasses/fckstylecommand.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckcommands.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarbutton.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckspecialcombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarspecialcombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarfontscombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarfontsizecombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarfontformatcombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarstylecombo.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarpanelbutton.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktoolbaritems.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbar.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fcktoolbarbreak_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktoolbarset.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckdialog.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckdialog_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckcontextmenuitem.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckcontextmenuseparator.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckcontextmenugroup.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckcontextmenu.js' ) ;
// FCKScriptLoader.AddScript( '_source/internals/fckcontextmenu_' + sBrowserSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckplugin.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckplugins.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fck_last.js' ) ;
// @Packager.Compactor.Remove.End
/* @Packager.Compactor.RemoveLine
if ( FCKBrowserInfo.IsIE )
FCKScriptLoader.AddScript( 'js/fckeditorcode_ie_2.js' ) ;
else
FCKScriptLoader.AddScript( 'js/fckeditorcode_gecko_2.js' ) ;
@Packager.Compactor.RemoveLine */
}
this.Events.FireEvent( 'OnStatusChange', newStatus ) ;
}
// Deprecated : returns the same value as GetXHTML.
FCK.GetHTML = function( format )
{
FCK.GetXHTML( format ) ;
/*
var sHTML ;
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
// TODO: Wait stable version and remove the following commented lines.
// if ( FCKBrowserInfo.IsIE )
// FCK.CheckRelativeLinks() ;
if ( FCKBrowserInfo.IsIE )
sHTML = this.EditorDocument.body.innerHTML.replace( FCKRegexLib.ToReplace, '$1' ) ;
else
sHTML = this.EditorDocument.body.innerHTML ;
}
else
sHTML = document.getElementById('eSourceField').value ;
if ( format )
return FCKCodeFormatter.Format( sHTML ) ;
else
return sHTML ;
*/
}
FCK.GetXHTML = function( format )
{
var bSource = ( FCK.EditMode == FCK_EDITMODE_SOURCE ) ;
if ( bSource )
this.SwitchEditMode() ;
var sXHTML ;
if ( FCKConfig.FullPage )
sXHTML = FCKXHtml.GetXHTML( this.EditorDocument.getElementsByTagName( 'html' )[0], true, format ) ;
else
{
if ( FCKConfig.IgnoreEmptyParagraphValue && this.EditorDocument.body.innerHTML == '<P>&nbsp;</P>' )
sXHTML = '' ;
else
sXHTML = FCKXHtml.GetXHTML( this.EditorDocument.body, false, format ) ;
}
if ( bSource )
this.SwitchEditMode() ;
if ( FCKBrowserInfo.IsIE )
sXHTML = sXHTML.replace( FCKRegexLib.ToReplace, '$1' ) ;
if ( FCK.DocTypeDeclaration && FCK.DocTypeDeclaration.length > 0 )
sXHTML = FCK.DocTypeDeclaration + '\n' + sXHTML ;
if ( FCK.XmlDeclaration && FCK.XmlDeclaration.length > 0 )
sXHTML = FCK.XmlDeclaration + '\n' + sXHTML ;
return FCKConfig.ProtectedSource.Revert( sXHTML ) ;
}
FCK.UpdateLinkedField = function()
{
// EnableXHTML has been deprecated
// if ( FCKConfig.EnableXHTML )
FCK.LinkedField.value = FCK.GetXHTML( FCKConfig.FormatOutput ) ;
// else
// FCK.LinkedField.value = FCK.GetHTML( FCKConfig.FormatOutput ) ;
FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ;
}
FCK.ShowContextMenu = function( x, y )
{
if ( this.Status != FCK_STATUS_COMPLETE )
return ;
FCKContextMenu.Show( x, y ) ;
this.Events.FireEvent( "OnContextMenu" ) ;
}
FCK.RegisteredDoubleClickHandlers = new Object() ;
FCK.OnDoubleClick = function( element )
{
var oHandler = FCK.RegisteredDoubleClickHandlers[ element.tagName ] ;
if ( oHandler )
oHandler( element ) ;
}
// Register objects that can handle double click operations.
FCK.RegisterDoubleClickHandler = function( handlerFunction, tag )
{
FCK.RegisteredDoubleClickHandlers[ tag.toUpperCase() ] = handlerFunction ;
}
FCK.OnAfterSetHTML = function()
{
var oProcessor, i = 0 ;
while( ( oProcessor = FCKDocumentProcessors[i++] ) )
oProcessor.ProcessDocument( FCK.EditorDocument ) ;
this.Events.FireEvent( 'OnAfterSetHTML' ) ;
}
// Saves URLs on links and images on special attributes, so they don't change when
// moving around.
FCK.ProtectUrls = function( html )
{
// <A> href
html = html.replace( FCKRegexLib.ProtectUrlsAApo , '$1$2$3$2 _fcksavedurl=$2$3$2' ) ;
html = html.replace( FCKRegexLib.ProtectUrlsANoApo , '$1$2 _fcksavedurl="$2"' ) ;
// <IMG> src
html = html.replace( FCKRegexLib.ProtectUrlsImgApo , '$1$2$3$2 _fcksavedurl=$2$3$2' ) ;
html = html.replace( FCKRegexLib.ProtectUrlsImgNoApo, '$1$2 _fcksavedurl="$2"' ) ;
return html ;
}
FCK.IsDirty = function()
{
return ( FCK_StartupValue != FCK.EditorDocument.body.innerHTML ) ;
}
FCK.ResetIsDirty = function()
{
if ( FCK.EditorDocument.body )
FCK_StartupValue = FCK.EditorDocument.body.innerHTML ;
}
// Advanced document processors.
var FCKDocumentProcessors = new Array() ;
var FCKDocumentProcessors_CreateFakeImage = function( fakeClass, realElement )
{
var oImg = FCK.EditorDocument.createElement( 'IMG' ) ;
oImg.className = fakeClass ;
oImg.src = FCKConfig.FullBasePath + 'images/spacer.gif' ;
oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
return oImg ;
}
// Link Anchors
var FCKAnchorsProcessor = new Object() ;
FCKAnchorsProcessor.ProcessDocument = function( document )
{
var aLinks = document.getElementsByTagName( 'A' ) ;
var oLink ;
var i = aLinks.length - 1 ;
while ( i >= 0 && ( oLink = aLinks[i--] ) )
{
// If it is anchor.
if ( oLink.name.length > 0 && ( !oLink.getAttribute('href') || oLink.getAttribute('href').length == 0 ) )
{
var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__Anchor', oLink.cloneNode(true) ) ;
oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
oLink.parentNode.insertBefore( oImg, oLink ) ;
oLink.parentNode.removeChild( oLink ) ;
}
}
}
FCKDocumentProcessors.addItem( FCKAnchorsProcessor ) ;
// Page Breaks
var FCKPageBreaksProcessor = new Object() ;
FCKPageBreaksProcessor.ProcessDocument = function( document )
{
var aDIVs = document.getElementsByTagName( 'DIV' ) ;
var eDIV ;
var i = aDIVs.length - 1 ;
while ( i >= 0 && ( eDIV = aDIVs[i--] ) )
{
if ( eDIV.style.pageBreakAfter == 'always' && eDIV.childNodes.length == 1 && eDIV.childNodes[0].style && eDIV.childNodes[0].style.display == 'none' )
{
var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', eDIV.cloneNode(true) ) ;
eDIV.parentNode.insertBefore( oFakeImage, eDIV ) ;
eDIV.parentNode.removeChild( eDIV ) ;
}
}
/*
var aCenters = document.getElementsByTagName( 'CENTER' ) ;
var oCenter ;
var i = aCenters.length - 1 ;
while ( i >= 0 && ( oCenter = aCenters[i--] ) )
{
if ( oCenter.style.pageBreakAfter == 'always' && oCenter.innerHTML.trim().length == 0 )
{
var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', oCenter.cloneNode(true) ) ;
oCenter.parentNode.insertBefore( oFakeImage, oCenter ) ;
oCenter.parentNode.removeChild( oCenter ) ;
}
}
*/
}
FCKDocumentProcessors.addItem( FCKPageBreaksProcessor ) ;
// Flash Embeds.
var FCKFlashProcessor = new Object() ;
FCKFlashProcessor.ProcessDocument = function( document )
{
/*
Sample code:
This is some <embed src="/UserFiles/Flash/Yellow_Runners.swf"></embed><strong>sample text</strong>. You are&nbsp;<a name="fred"></a> using <a href="http://www.fckeditor.net/">FCKeditor</a>.
*/
var aEmbeds = document.getElementsByTagName( 'EMBED' ) ;
var oEmbed ;
var i = aEmbeds.length - 1 ;
while ( i >= 0 && ( oEmbed = aEmbeds[i--] ) )
{
if ( oEmbed.src.endsWith( '.swf', true ) )
{
var oCloned = oEmbed.cloneNode( true ) ;
// On IE, some properties are not getting clonned properly, so we
// must fix it. Thanks to Alfonso Martinez.
if ( FCKBrowserInfo.IsIE )
{
oCloned.setAttribute( 'scale', oEmbed.getAttribute( 'scale' ) );
oCloned.setAttribute( 'play', oEmbed.getAttribute( 'play' ) );
oCloned.setAttribute( 'loop', oEmbed.getAttribute( 'loop' ) );
oCloned.setAttribute( 'menu', oEmbed.getAttribute( 'menu' ) );
}
var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__Flash', oCloned ) ;
oImg.setAttribute( '_fckflash', 'true', 0 ) ;
FCKFlashProcessor.RefreshView( oImg, oEmbed ) ;
oEmbed.parentNode.insertBefore( oImg, oEmbed ) ;
oEmbed.parentNode.removeChild( oEmbed ) ;
// oEmbed.setAttribute( '_fckdelete', 'true', 0) ;
// oEmbed.style.display = 'none' ;
// oEmbed.hidden = true ;
}
}
}
FCKFlashProcessor.RefreshView = function( placholderImage, originalEmbed )
{
if ( originalEmbed.width > 0 )
placholderImage.style.width = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.width ) ;
if ( originalEmbed.height > 0 )
placholderImage.style.height = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.height ) ;
}
FCKDocumentProcessors.addItem( FCKFlashProcessor ) ;
FCK.GetRealElement = function( fakeElement )
{
var e = FCKTempBin.Elements[ fakeElement.getAttribute('_fckrealelement') ] ;
if ( fakeElement.getAttribute('_fckflash') )
{
if ( fakeElement.style.width.length > 0 )
e.width = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.width ) ;
if ( fakeElement.style.height.length > 0 )
e.height = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.height ) ;
}
return e ;
}
// START iCM MODIFICATIONS
/*
var FCKTablesProcessor = new Object() ;
FCKTablesProcessor.ProcessDocument = function( document )
{
FCKTablesProcessor.CheckTablesNesting( document ) ;
}
// Ensure that tables are not incorrectly nested within P, H1, H2, etc tags
FCKTablesProcessor.CheckTablesNesting = function( document )
{
var aTables = document.getElementsByTagName( "TABLE" ) ;
var oParentNode ;
for ( var i=0; i<aTables.length; i++ )
{
FCKTablesProcessor.CheckTableNesting( aTables[i] ) ;
}
}
// Corrects nesting of the supplied table as necessary.
// Also called by fck_table.html to check that a newly inserted table is correctly nested.
FCKTablesProcessor.CheckTableNesting = function( oTableNode )
{
var oParentBlockNode = FCKTools.GetParentBlockNode( oTableNode.parentNode ) ;
if ( oParentBlockNode && !FCKRegexLib.TableBlockElements.test( oParentBlockNode.nodeName ) )
{
// Create a new tag which holds the content of the child nodes located before the table
var oNode1 = FCK.EditorDocument.createElement( oParentBlockNode.tagName ) ;
var oFragment1 = FCKTools.GetDocumentFragment( oParentBlockNode, oParentBlockNode.firstChild, oTableNode, true, false, true ) ;
oNode1.appendChild( oFragment1 ) ;
FCKTools.SetElementAttributes( oNode1, oParentBlockNode.attributes ) ; // Transfer across any class attributes, etc
// Create a new tag which holds the content of the child nodes located after the table
var oNode2 = FCK.EditorDocument.createElement( oParentBlockNode.tagName );
var oFragment2 = FCKTools.GetDocumentFragment( oParentBlockNode, oTableNode, oParentBlockNode.lastChild, false, true, true ) ;
oNode2.appendChild( oFragment2 ) ;
FCKTools.SetElementAttributes( oNode2, oParentBlockNode.attributes ) ; // Transfer across any class attributes, etc
// Create a document fragment that contains the two new elements with the table element inbetween
var oNewNode = FCK.EditorDocument.createDocumentFragment() ;
if ( !FCKTools.NodeIsEmpty( oNode1 ) )
oNewNode.appendChild( oNode1 ) ;
oNewNode.appendChild( oTableNode ) ;
if ( !FCKTools.NodeIsEmpty( oNode2 ) )
oNewNode.appendChild( oNode2 ) ;
// Replace the existing parent node with the nodes in the fragment
oParentBlockNode.parentNode.replaceChild( oNewNode, oParentBlockNode ) ;
}
}
FCKDocumentProcessors.addItem( FCKTablesProcessor ) ;
*/
// END iCM MODIFICATIONS

View File

@ -1,337 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCK.Description = "FCKeditor for Gecko Browsers" ;
FCK.InitializeBehaviors = function()
{
/*
window.document.onblur = function(e)
{
return FCK.Events.FireEvent( "OnBlur" ) ;
}
window.document.onfocus = function()
{
return FCK.Events.FireEvent( "OnFocus" ) ;
}
*/
// Enable table borders visibility.
if ( FCKConfig.ShowBorders )
{
var oStyle = FCKTools.AppendStyleSheet( this.EditorDocument, FCKConfig.FullBasePath + 'css/fck_showtableborders_gecko.css' ) ;
oStyle.setAttribute( '_fcktemp', 'true' ) ;
}
// Disable Right-Click
var oOnContextMenu = function( e )
{
e.preventDefault() ;
FCK.ShowContextMenu( e.clientX, e.clientY ) ;
}
this.EditorDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
// Handle pasting operations.
var oOnKeyDown = function( e )
{
// START iCM Modifications
/*
// Need to amend carriage return key handling so inserts block element tags rather than BR all the time
if ( e.which == 13 && !e.shiftKey && !e.ctrlKey && !e.altKey && !FCKConfig.UseBROnCarriageReturn && !FCK.Events.FireEvent( "OnEnter" ) )
{
e.preventDefault() ;
e.stopPropagation() ;
}
// Amend backspace handling so correctly removes empty block elements i.e. those block elements containing nothing or
// just the bogus BR node
if ( e.which == 8 && !e.shiftKey && !e.ctrlKey && !e.altKey && !FCKConfig.UseBROnCarriageReturn && !FCK.Events.FireEvent( "OnBackSpace" ) )
{
e.preventDefault() ;
e.stopPropagation() ;
}
*/
// END iCM Modifications
var bPrevent ;
if ( e.ctrlKey && !e.shiftKey && !e.altKey )
{
switch ( e.which )
{
case 66 : // B
case 98 : // b
FCK.ExecuteNamedCommand( 'bold' ) ; bPrevent = true ;
break;
case 105 : // i
case 73 : // I
FCK.ExecuteNamedCommand( 'italic' ) ; bPrevent = true ;
break;
case 117 : // u
case 85 : // U
FCK.ExecuteNamedCommand( 'underline' ) ; bPrevent = true ;
break;
case 86 : // V
case 118 : // v
bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ;
break ;
}
}
else if ( e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 45 ) // SHIFT + <INS>
bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ;
if ( bPrevent )
{
e.preventDefault() ;
e.stopPropagation() ;
}
}
this.EditorDocument.addEventListener( 'keypress', oOnKeyDown, true ) ;
this.ExecOnSelectionChange = function()
{
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
this.ExecOnSelectionChangeTimer = function()
{
if ( FCK.LastOnChangeTimer )
window.clearTimeout( FCK.LastOnChangeTimer ) ;
FCK.LastOnChangeTimer = window.setTimeout( FCK.ExecOnSelectionChange, 100 ) ;
}
this.EditorDocument.addEventListener( 'mouseup', this.ExecOnSelectionChange, false ) ;
// On Gecko, firing the "OnSelectionChange" event on every key press started to be too much
// slow. So, a timer has been implemented to solve performance issues when tipying to quickly.
this.EditorDocument.addEventListener( 'keyup', this.ExecOnSelectionChangeTimer, false ) ;
this._DblClickListener = function( e )
{
FCK.OnDoubleClick( e.target ) ;
e.stopPropagation() ;
}
this.EditorDocument.addEventListener( 'dblclick', this._DblClickListener, true ) ;
this._OnLoad = function()
{
if ( this._FCK_HTML )
{
this.document.body.innerHTML = this._FCK_HTML ;
this._FCK_HTML = null ;
if ( !FCK_StartupValue )
FCK.ResetIsDirty() ;
}
}
this.EditorWindow.addEventListener( 'load', this._OnLoad, true ) ;
// var oEditorWindow_OnUnload = function()
// {
// FCK.EditorWindow.location = 'fckblank.html' ;
// }
// this.EditorWindow.addEventListener( 'unload', oEditorWindow_OnUnload, true ) ;
// var oEditorWindow_OnFocus = function()
// {
// FCK.MakeEditable() ;
// }
// this.EditorWindow.addEventListener( 'focus', oEditorWindow_OnFocus, true ) ;
}
FCK.MakeEditable = function()
{
try
{
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 ) ;
// Analysing Firefox 1.5 source code, it seams that there is support for a
// "insertBrOnReturn" command. Applying it gives no error, but it doesn't
// gives the same behavior that you have with IE. It works only if you are
// already inside a paragraph and it doesn't render correctly in the first enter.
// FCK.EditorDocument.execCommand( 'insertBrOnReturn', false, false ) ;
// Tell Gecko (Firefox 1.5+) to enable or not live resizing of objects (by Alfonso Martinez)
FCK.EditorDocument.execCommand( 'enableObjectResizing', false, !FCKConfig.DisableImageHandles ) ;
// Disable the standard table editing features of Firefox.
FCK.EditorDocument.execCommand( 'enableInlineTableEditing', false, !FCKConfig.DisableTableHandles ) ;
}
catch (e) {}
}
FCK.Focus = function()
{
try
{
// window.focus() ;
FCK.EditorWindow.focus() ;
}
catch(e) {}
}
// @Packager.Compactor.Remove.Start
if ( FCKBrowserInfo.IsSafari )
{
FCK.SetHTML = function( html, forceWYSIWYG )
{
if( window.console ) window.console.log( 'FCK.SetHTML()' ) ; // @Packager.Compactor.RemoveLine
sHtml =
FCKConfig.DocType +
'<html dir="' + FCKConfig.ContentLangDirection + '">' +
'<head><title></title>' +
'<link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" />' +
'<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
// sHtml += FCK.TempBaseTag ;
sHtml += '</head><body>' + html + '</body></html>' ;
this.EditorDocument.open() ;
this.EditorDocument.write( sHtml ) ;
this.EditorDocument.close() ;
// this.InitializeBehaviors() ;
// FCK.MakeEditable() ;
FCK.EditorDocument.designMode = 'on' ;
FCK.OnAfterSetHTML() ;
}
}
else
{
// @Packager.Compactor.Remove.End
FCK.SetHTML = function( html, forceWYSIWYG )
{
// Firefox can't handle correctly the editing of the STRONG and EM tags.
// We must replace them with B and I.
html = html.replace( FCKRegexLib.StrongOpener, '<b$1' ) ;
html = html.replace( FCKRegexLib.StrongCloser, '<\/b>' ) ;
html = html.replace( FCKRegexLib.EmOpener, '<i$1' ) ;
html = html.replace( FCKRegexLib.EmCloser, '<\/i>' ) ;
if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
// Gecko has a lot of bugs mainly when handling editing features.
// To avoid an Aplication Exception (that closes the browser!) we
// must first write the <HTML> contents with an empty body, and
// then insert the body contents.
// (Oh yes... it took me a lot of time to find out this workaround)
if ( FCKConfig.FullPage && FCKRegexLib.BodyContents.test( html ) )
{
// Add the <BASE> tag to the input HTML.
if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( html ) )
html = html.replace( FCKRegexLib.HeadOpener, '$&' + FCK.TempBaseTag ) ;
html = html.replace( FCKRegexLib.HeadCloser, '<link href="' + FCKConfig.BasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" /></head>' ) ;
// Extract the BODY contents from the html.
var oMatch = html.match( FCKRegexLib.BodyContents ) ;
var sOpener = oMatch[1] ; // This is the HTML until the <body...> tag, inclusive.
var sContents = oMatch[2] ; // This is the BODY tag contents.
var sCloser = oMatch[3] ; // This is the HTML from the </body> tag, inclusive.
var sHtml = sOpener + '&nbsp;' + sCloser ;
/*
if ( !this._Initialized )
{
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 ) ;
this._Initialized = true ;
}
*/
FCK.MakeEditable() ;
this.EditorDocument.open() ;
this.EditorDocument.write( sHtml ) ;
this.EditorDocument.close() ;
if ( this.EditorDocument.body )
this.EditorDocument.body.innerHTML = sContents ;
else
this.EditorWindow._FCK_HTML = sContents ;
this.InitializeBehaviors() ;
}
else
{
/* TODO: Wait stable and remove it.
sHtml =
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">' +
'<html dir="' + FCKConfig.ContentLangDirection + '">' +
'<head><title></title>' +
'<link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" />' +
'<link href="' + FCKConfig.BasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
sHtml += FCK.TempBaseTag ;
sHtml += '</head><body>&nbsp;</body></html>' ;
*/
if ( !this._Initialized )
{
this.EditorDocument.dir = FCKConfig.ContentLangDirection ;
var sHtml =
'<title></title>' +
'<link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" />' +
'<link href="' + FCKConfig.BasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' +
FCK.TempBaseTag ;
this.EditorDocument.getElementsByTagName("HEAD")[0].innerHTML = sHtml ;
this.InitializeBehaviors() ;
this._Initialized = true ;
}
// On Gecko we must disable editing before setting the BODY innerHTML.
// FCK.EditorDocument.designMode = 'off' ;
if ( html.length == 0 )
FCK.EditorDocument.body.innerHTML = GECKO_BOGUS ;
else if ( FCKRegexLib.EmptyParagraph.test( html ) )
FCK.EditorDocument.body.innerHTML = html.replace( FCKRegexLib.TagBody, '>' + GECKO_BOGUS + '<' ) ;
else
FCK.EditorDocument.body.innerHTML = html ;
FCK.MakeEditable() ;
}
FCK.OnAfterSetHTML() ;
}
else
document.getElementById('eSourceField').value = html ;
}
} // @Packager.Compactor.RemoveLine

View File

@ -1,292 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCK.Description = "FCKeditor for Internet Explorer 5.5+" ;
// The behaviors should be pointed using the FullBasePath to avoid security
// errors when using a differente BaseHref.
FCK._BehaviorsStyle =
'<style type="text/css" _fcktemp="true"> \
INPUT { behavior: url(' + FCKConfig.FullBasePath + 'css/behaviors/hiddenfield.htc) ; } ' ;
if ( FCKConfig.ShowBorders )
FCK._BehaviorsStyle += 'TABLE { behavior: url(' + FCKConfig.FullBasePath + 'css/behaviors/showtableborders.htc) ; }' ;
// Disable resize handlers.
var sNoHandlers = 'INPUT, TEXTAREA, SELECT, .FCK__Anchor, .FCK__PageBreak' ;
if ( FCKConfig.DisableImageHandles )
sNoHandlers += ', IMG' ;
if ( FCKConfig.DisableTableHandles )
sNoHandlers += ', TABLE' ;
FCK._BehaviorsStyle += sNoHandlers + ' { behavior: url(' + FCKConfig.FullBasePath + 'css/behaviors/disablehandles.htc) ; }' ;
FCK._BehaviorsStyle += '</style>' ;
function Doc_OnMouseUp()
{
if ( FCK.EditorWindow.event.srcElement.tagName == 'HTML' )
{
FCK.Focus() ;
FCK.EditorWindow.event.cancelBubble = true ;
FCK.EditorWindow.event.returnValue = false ;
}
}
function Doc_OnPaste()
{
if ( FCK.Status == FCK_STATUS_COMPLETE )
return FCK.Events.FireEvent( "OnPaste" ) ;
else
return false ;
}
function Doc_OnContextMenu()
{
var e = FCK.EditorWindow.event ;
FCK.ShowContextMenu( e.screenX, e.screenY ) ;
return false ;
}
function Doc_OnKeyDown()
{
var e = FCK.EditorWindow.event ;
switch ( e.keyCode )
{
case 13 : // ENTER
if ( FCKConfig.UseBROnCarriageReturn && !(e.ctrlKey || e.altKey || e.shiftKey) )
{
Doc_OnKeyDownUndo() ;
// 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 &nbsp; must be also inserted to make it work)
FCK.InsertHtml( '<br>&nbsp;' ) ;
// Remove the &nbsp;
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveStart( 'character', -1 ) ;
oRange.select() ;
FCK.EditorDocument.selection.clear() ;
return false ;
}
break ;
case 8 : // BACKSPACE
// We must delete a control selection by code and cancels the
// keystroke, otherwise IE will execute the browser's "back" button.
if ( FCKSelection.GetType() == 'Control' )
{
FCKSelection.Delete() ;
return false ;
}
break ;
case 9 : // TAB
if ( FCKConfig.TabSpaces > 0 && !(e.ctrlKey || e.altKey || e.shiftKey) )
{
Doc_OnKeyDownUndo() ;
FCK.InsertHtml( window.FCKTabHTML ) ;
return false ;
}
break ;
case 90 : // Z
if ( e.ctrlKey && !(e.altKey || e.shiftKey) )
{
FCKUndo.Undo() ;
return false ;
}
break ;
case 89 : // Y
if ( e.ctrlKey && !(e.altKey || e.shiftKey) )
{
FCKUndo.Redo() ;
return false ;
}
break ;
}
if ( !( e.keyCode >=16 && e.keyCode <= 18 ) )
Doc_OnKeyDownUndo() ;
return true ;
}
function Doc_OnKeyDownUndo()
{
if ( !FCKUndo.Typing )
{
FCKUndo.SaveUndoStep() ;
FCKUndo.Typing = true ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
FCKUndo.TypesCount++ ;
if ( FCKUndo.TypesCount > FCKUndo.MaxTypes )
{
FCKUndo.TypesCount = 0 ;
FCKUndo.SaveUndoStep() ;
}
}
function Doc_OnDblClick()
{
FCK.OnDoubleClick( FCK.EditorWindow.event.srcElement ) ;
FCK.EditorWindow.event.cancelBubble = true ;
}
function Doc_OnSelectionChange()
{
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
FCK.InitializeBehaviors = function( dontReturn )
{
// Set the focus to the editable area when clicking in the document area.
// TODO: The cursor must be positioned at the end.
this.EditorDocument.attachEvent( 'onmouseup', Doc_OnMouseUp ) ;
// Intercept pasting operations
this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ;
// Disable Right-Click and shows the context menu.
this.EditorDocument.attachEvent('oncontextmenu', Doc_OnContextMenu ) ;
// Build the "TAB" key replacement (if necessary).
if ( FCKConfig.TabSpaces > 0 )
{
window.FCKTabHTML = '' ;
for ( i = 0 ; i < FCKConfig.TabSpaces ; i++ )
window.FCKTabHTML += "&nbsp;" ;
}
this.EditorDocument.attachEvent("onkeydown", Doc_OnKeyDown ) ;
this.EditorDocument.attachEvent("ondblclick", Doc_OnDblClick ) ;
// Catch cursor movements
this.EditorDocument.attachEvent("onselectionchange", Doc_OnSelectionChange ) ;
//Enable editing
// this.EditorDocument.body.contentEditable = true ;
}
FCK.Focus = function()
{
try
{
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
FCK.EditorDocument.body.focus() ;
else
document.getElementById('eSourceField').focus() ;
}
catch(e) {}
}
FCK.SetHTML = function( html, forceWYSIWYG )
{
if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
var sHtml ;
if ( FCKConfig.FullPage )
{
var sHtml =
FCK._BehaviorsStyle +
'<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( html ) )
sHtml += FCK.TempBaseTag ;
sHtml = html.replace( FCKRegexLib.HeadOpener, '$&' + sHtml ) ;
}
else
{
sHtml =
FCKConfig.DocType +
'<html dir="' + FCKConfig.ContentLangDirection + '"' ;
if ( FCKConfig.IEForceVScroll )
sHtml += ' style="overflow-y: scroll"' ;
sHtml +=
'><head><title></title>' +
'<link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" />' +
'<link href="' + FCKConfig.FullBasePath + 'css/fck_internal.css' + '" rel="stylesheet" type="text/css" _fcktemp="true" />' ;
sHtml += FCK._BehaviorsStyle ;
sHtml += FCK.TempBaseTag ;
sHtml += '</head><body>' + html + '</body></html>' ;
}
// this.EditorDocument.open( '', '_self', '', true ) ; // This one opens popups in IE 5.5 - BUG 1204220 (I was not able to reproduce the problem).
this.EditorDocument.open( '', 'replace' ) ;
this.EditorDocument.write( sHtml ) ;
this.EditorDocument.close() ;
this.InitializeBehaviors() ;
this.EditorDocument.body.contentEditable = true ;
FCK.OnAfterSetHTML() ;
}
else
document.getElementById('eSourceField').value = html ;
}
FCK.InsertHtml = function( html )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
FCK.Focus() ;
FCKUndo.SaveUndoStep() ;
// Gets the actual selection.
var oSel = FCK.EditorDocument.selection ;
// Deletes the actual selection contents.
if ( oSel.type.toLowerCase() != "none" )
oSel.clear() ;
// Insert the HTML.
oSel.createRange().pasteHTML( html ) ;
}
FCK.SetInnerHtml = function( html ) // IE Only
{
var oDoc = FCK.EditorDocument ;
// Using the following trick, any comment in the begining of the HTML will
// be preserved.
oDoc.body.innerHTML = '<div id="__fakeFCKRemove__">&nbsp;</div>' + html ;
oDoc.getElementById('__fakeFCKRemove__').removeNode( true ) ;
}

View File

@ -1,205 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* 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, noRedirect )
{
FCKUndo.SaveUndoStep() ;
if ( !noRedirect && FCK.RedirectNamedCommands[ commandName ] != null )
FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
else
{
FCK.Focus() ;
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
}
FCKUndo.SaveUndoStep() ;
}
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.PasteFromWord = function()
{
FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteFromWord, 'dialog/fck_paste.html', 400, 330, 'Word' ) ;
}
// TODO: Wait Stable and remove this block.
//FCK.CleanAndPaste = function( html )
//{
// Remove all SPAN tags
// html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
// html = html.replace(/<o:p>&nbsp;<\/o:p>/g, "") ;
// html = html.replace(/<o:p><\/o:p>/g, "") ;
// Remove mso-xxx styles.
// html = html.replace( /mso-.[^:]:.[^;"]/g, "" ) ;
// 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 &nbsp;
// html = html.replace(/&nbsp;/, " " );
// Replace the &nbsp; from the beggining.
// html = html.replace(/^&nbsp;[\s\r\n]*/, "");
// 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 iWidth = FCKConfig.ScreenWidth * 0.8 ;
var iHeight = FCKConfig.ScreenHeight * 0.7 ;
var iLeft = ( FCKConfig.ScreenWidth - iWidth ) / 2 ;
var oWindow = window.open( '', null, 'toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=' + iWidth + ',height=' + iHeight + ',left=' + iLeft ) ;
var sHTML ;
if ( FCKConfig.FullPage )
{
if ( FCK.TempBaseTag.length > 0 )
sHTML = FCK.GetXHTML().replace( FCKRegexLib.HeadOpener, '$&' + FCK.TempBaseTag ) ;
else
sHTML = FCK.GetXHTML() ;
}
else
{
sHTML =
FCKConfig.DocType +
'<html dir="' + FCKConfig.ContentLangDirection + '">' +
'<head><title>' + FCKLang.Preview + '</title>' +
'<link href="' + FCKConfig.EditorAreaCSS + '" rel="stylesheet" type="text/css" />' +
FCK.TempBaseTag +
'</head><body>' +
FCK.GetXHTML() +
'</body></html>' ;
}
oWindow.document.write( sHTML );
oWindow.document.close();
}
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 )
{
if ( FCKBrowserInfo.IsIE )
FCKUndo.SaveUndoStep() ;
// EnableXHTML and EnableSourceXHTML has been deprecated
// document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
document.getElementById('eSourceField').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
}
else
FCK.SetHTML( document.getElementById('eSourceField').value, true ) ;
// Updates the actual mode status.
FCK.EditMode = bWYSIWYG ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
// Update the toolbar.
FCKToolbarSet.RefreshModeState() ;
// Set the Focus.
FCK.Focus() ;
}
FCK.CreateElement = function( tag )
{
var e = FCK.EditorDocument.createElement( tag ) ;
return FCK.InsertElementAndGetIt( e ) ;
}
FCK.InsertElementAndGetIt = function( e )
{
e.setAttribute( '__FCKTempLabel', 1 ) ;
this.InsertElement( e ) ;
var aEls = FCK.EditorDocument.getElementsByTagName( e.tagName ) ;
for ( var i = 0 ; i < aEls.length ; i++ )
{
if ( aEls[i].getAttribute( '__FCKTempLabel' ) )
{
aEls[i].removeAttribute( '__FCKTempLabel' ) ;
return aEls[i] ;
}
}
return null ;
}

View File

@ -1,461 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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)
*
* 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
// START iCM MODIFICATIONS
// Include list functions so we can ensure content is wrapped
// with P tags if not using BRs on carriage return, etc
/*
InsertOrderedList : true,
InsertUnorderedList : true
*/
// END iCM MODIFICATIONS
}
// ExecuteNamedCommand overload for Gecko.
FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
{
switch ( commandName )
{
case 'Print' :
FCK.EditorWindow.print() ;
break ;
case 'Paste' :
try { if ( FCK.Paste() ) FCK.ExecuteNamedCommand( 'Paste', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorPaste) ; }
break ;
case 'Cut' :
try { FCK.ExecuteNamedCommand( 'Cut', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorCut) ; }
break ;
case 'Copy' :
try { FCK.ExecuteNamedCommand( 'Copy', null, true ) ; }
catch (e) { alert(FCKLang.PasteErrorCopy) ; }
break ;
// START iCM MODIFICATIONS
/*
case 'InsertOrderedList' :
case 'InsertUnorderedList' :
if ( !FCKConfig.UseBROnCarriageReturn && FCK.EditorDocument.queryCommandState( commandName ) )
{
// We're in a list item which is in the same type of list as the toolbar button clicked
// Therefore, move the selected list item out of the list as is done on an ENTER key within
// an empty list item.
var oSel = FCK.EditorWindow.getSelection() ;
var oSelNode = oSel.focusNode ;
var oLINode = FCKTools.GetElementAscensor( oSelNode, "LI" ) ;
FCK.ToggleListItem( oLINode, oSelNode ) ;
}
else
{
// Let the default handler do its stuff
FCK.Focus() ;
FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
}
FCK.Events.FireEvent( 'OnSelectionChange' ) ;
break ;
*/
// END iCM MODIFICATIONS
default :
FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
}
}
FCK.AttachToOnSelectionChange = function( functionPointer )
{
this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
}
FCK.Paste = function()
{
if ( FCKConfig.ForcePasteAsPlainText )
{
FCK.PasteAsPlainText() ;
return false ;
}
/* For now, the AutoDetectPasteFromWord feature is IE only.
else if ( FCKConfig.AutoDetectPasteFromWord )
{
var sHTML = FCK.GetClipboardHTML() ;
var re = /<\w[^>]* class="?MsoNormal"?/gi ;
if ( re.test( sHTML ) )
{
if ( confirm( FCKLang["PasteWordConfirm"] ) )
{
FCK.PasteFromWord() ;
return false ;
}
}
}
*/
else
return true ;
}
//**
// FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
// selected content if any.
FCK.InsertHtml = function( html )
{
html = FCKConfig.ProtectedSource.Protect( html ) ;
html = FCK.ProtectUrls( html ) ;
// Delete the actual selection.
var oSel = FCKSelection.Delete() ;
// Get the first available range.
var oRange = oSel.getRangeAt(0) ;
// 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.
FCKSelection.SelectNode( oLastNode ) ;
FCKSelection.Collapse( false ) ;
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.
FCKSelection.SelectNode( element ) ;
FCKSelection.Collapse( false ) ;
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 ;
}
}
}
// START iCM Modifications
/*
// Ensure that behaviour of the ENTER key or the list toolbar button works correctly for a list item.
// ENTER in empty list item at top of list should result in the empty list item being
// removed and selection being moved out of the list into a P tag above it.
// ENTER in empty list item at bottom of list should result in the empty list item being
// removed and selection being moved out of the list into a P tag below it.
// ENTER in empty list item in middle of the list should result in the list being split
// into two and the selection being moved into a P tag between the two resulting lists.
// Clicking the list toolbar button in a list item at top of list should result in the list item's contents being
// moved out of the list into a P tag above it.
// Clicking the list toolbar button in a list item at the bottom of list should result in the list item's contents being
// moved out of the list into a P tag below it.
// Clicking the list toolbar button in a list item in the middle of the list should result in the list being split
// into two and the list item's contents being moved into a P tag between the two resulting lists.
FCK.ToggleListItem = function( oLINode, oSelNode )
{
var oListNode = FCKTools.GetElementAscensor( oLINode, "UL,OL" ) ;
var oRange = FCK.EditorDocument.createRange() ;
// Create a new block element
var oBlockNode = FCK.EditorDocument.createElement( "P" ) ;
oBlockNode.innerHTML = oLINode.innerHTML ; // Transfer any list item contents
if ( FCKTools.NodeIsEmpty( oBlockNode ) )
oBlockNode.innerHTML = GECKO_BOGUS ; // Ensure it has some content, required for Gecko
if ( oLINode.className && oLINode.className != '' )
oBlockNode.className = oLINode.className ; // Transfer across any class attribute
var oCursorNode = oBlockNode ;
// Then, perform list processing and locate the point at which the new P tag is to be inserted
if ( oListNode.childNodes[0] == oLINode )
{
// First LI was empty so want to leave list and insert P above it
oListNode.removeChild( oLINode );
// Need to insert a new P tag (or other suitable block element) just before the list
oRange.setStartBefore( oListNode ) ;
oRange.setEndBefore( oListNode ) ;
}
else if ( oListNode.childNodes[oListNode.childNodes.length-1] == oLINode )
{
// Last LI was empty so want to leave list and insert new block element in the parent
oListNode.removeChild( oLINode );
// Need to insert a new P tag (or other suitable block element) just after the list
oRange.setEndAfter( oListNode ) ;
oRange.setStartAfter( oListNode ) ;
}
else
{
// A middle LI was empty so want to break list into two and insert the new block/text node in between them
oListNode = FCKTools.SplitNode( oListNode, oSelNode, 0 ) ;
oListNode.removeChild( oListNode.childNodes[0] ) ;
oRange.setStartBefore( oListNode ) ;
oRange.setEndBefore( oListNode ) ;
}
// Insert new block/text node
oRange.insertNode( oBlockNode ) ;
// Ensure that we don't leave empty UL/OL tags behind
if ( oListNode.childNodes.length == 0 )
oListNode.parentNode.removeChild( oListNode ) ;
// Reset cursor position to start of the new P tag's contents ready for typing
FCK.Selection.SetCursorPosition( oCursorNode ) ;
}
FCK.ListItemEnter = function( oLINode, oSelNode, nSelOffset )
{
// Ensure that behaviour of ENTER key within an empty list element works correctly.
// ENTER in empty list item at top of list should result in the empty list item being
// removed and selection being moved out of the list into a P tag above it.
// ENTER in empty list item at bottom of list should result in the empty list item being
// removed and selection being moved out of the list into a P tag below it.
// ENTER in empty list item in middle of the list should result in the list being split
// into two and the selection being moved into a P tag between the two resulting lists.
if ( FCKTools.NodeIsEmpty( oLINode ) )
{
FCK.ToggleListItem( oLINode, oSelNode ) ;
return false ; // Job done, perform no default handling
}
return true ; // If non-empty list item, let default handler do its stuff
}
FCK.ListItemBackSpace = function( oSelNode, nSelOffset )
{
// Ensure that behaviour of BACKSPACE key within an empty list element works correctly.
// BACKSPACE in empty list item at top of list should result in the empty list item being
// removed and selection being moved out of the list into a P tag above it.
// Allow the default handler to do its stuff for backspace in other list elements.
var oListNode = oSelNode.parentNode ;
if ( FCKTools.NodeIsEmpty( oSelNode ) && ( oListNode.childNodes[0] == oSelNode ) )
{
var oRange = FCK.EditorDocument.createRange() ;
// Create a new P element
var oBlockNode = FCK.EditorDocument.createElement( "P" ) ;
if ( FCKTools.NodeIsEmpty( oBlockNode ) )
oBlockNode.innerHTML = GECKO_BOGUS ; // Ensure it has some content, required for Gecko
// First LI was empty so want to leave list and insert P above it
oListNode.removeChild( oSelNode );
oRange.setStartBefore( oListNode ) ;
oRange.setEndBefore( oListNode ) ;
// Insert new P tag
oRange.insertNode( oBlockNode ) ;
// Ensure that we don't leave empty UL/OL tags behind
if ( oListNode.childNodes.length == 0 )
oListNode.parentNode.removeChild( oListNode ) ;
// Reset cursor position to start of the new P tag's contents ready for typing
FCK.Selection.SetCursorPosition( oBlockNode ) ;
return false ; // Job done, perform no default handling
}
return true ; // Let default handler do its stuff if not backspacing in an empty first LI
}
FCK.Enter = function()
{
// Remove any selected content before we begin so we end up with a single selection point
FCK.Selection.Delete() ;
// Determine the current cursor (selection) point, the node it's within and the offset
// position of the cursor within that node
var oSel = FCK.EditorWindow.getSelection() ;
var nSelOffset = oSel.focusOffset;
var oSelNode = oSel.focusNode ;
// Guard against a null focus node.
if ( !oSelNode )
return false ;
var oLINode = FCKTools.GetElementAscensor( oSelNode, "LI" ) ;
if ( oLINode ) // An LI element is selected
{
// Handle list items separately as need to handle termination of the list, etc
return FCK.ListItemEnter( oLINode, oSelNode, nSelOffset ) ;
}
else if ( oSelNode.nodeType == 3 ) // A TEXT node is selected
{
// Split it at the selection point and ensure both halves have a suitable enclosing block element
var oParentBlockNode = FCKTools.GetParentBlockNode( oSelNode ) ;
var oBlockNode2 = FCKTools.SplitNode( oParentBlockNode ? oParentBlockNode : FCK.EditorDocument.body, oSelNode, nSelOffset ) ;
FCK.Selection.SetCursorPosition( oBlockNode2 );
return false ;
}
else // An ELEMENT node is selected
{
// Cater for ENTER being pressed after very last element in the editor e.g. pressing ENTER after table element at very end of the editor's content
if ( nSelOffset >= oSelNode.childNodes.length )
{
var oBlockNode = FCK.EditorDocument.createElement( "P" ) ;
if ( FCKTools.NodeIsEmpty( oBlockNode ) )
oBlockNode.innerHTML = GECKO_BOGUS ; // Ensure it has some content, required for Gecko
oSelNode.appendChild( oBlockNode ) ;
FCK.Selection.SetCursorPosition( oBlockNode ) ;
return false ;
}
var oBlockNode2 = FCKTools.SplitNode( oSelNode, oSelNode.childNodes[nSelOffset] ) ;
FCK.Selection.SetCursorPosition( oBlockNode2 );
return false ;
}
return true ;
}
FCK.BackSpace = function()
{
var oSel = FCK.EditorWindow.getSelection() ;
var oSelNode = oSel.focusNode ;
var nSelOffset = oSel.focusOffset;
var oParentNode = null ;
// Guard against a null focus node.
if ( !oSelNode )
return false ;
if ( oSelNode.nodeName.toUpperCase() == "LI" ) // An LI element is selected
{
// Handle list items separately as need to handle termination of the list, etc
return FCK.ListItemBackSpace( oSelNode, nSelOffset ) ;
}
else
{
// If we are anything other than a TEXT node, move to the child indicated by the selection offset
if ( oSelNode.nodeType != 3 )
{
oSelNode = oSelNode.childNodes[nSelOffset] ;
nSelOffset = 0 ;
}
// If we are the first child and the previous sibling of the parent is an empty block element (containing nothing or just the filler element)
// want the backspace to completely remove the empty block element
if ( !oSelNode.previousSibling && nSelOffset <= 0 )
{
oParentNode = oSelNode.parentNode ;
if ( oParentNode && oParentNode.previousSibling && FCKRegexLib.BlockElements.test( oParentNode.previousSibling.nodeName ) )
{
if ( FCKTools.NodeIsEmpty( oParentNode.previousSibling ) )
{
var oRange = FCK.EditorDocument.createRange() ;
oRange.selectNode ( oParentNode.previousSibling );
oRange.deleteContents() ;
// Don't do any default processing
return false ;
}
}
}
}
return true ; // Let default processing do its stuff
}
*/
// END iCM Modifications

View File

@ -1,157 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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)
*
* 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 )
{
var sHTML = FCK.GetClipboardHTML() ;
var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ;
if ( re.test( sHTML ) )
{
if ( confirm( FCKLang["PasteWordConfirm"] ) )
{
FCK.PasteFromWord() ;
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 )
{
this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
}
/*
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] ;
}
}
}
}

View File

@ -1,69 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_last.js
* These are the last script lines executed in the editor loading process.
*
* 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 || FCKConfig.AutoDetectPasteFromWord )
FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ;
// START iCM Modifications
// Override default ENTER key handler for Gecko/Mozilla so
// it acts more like IE browsers.
/*
if ( FCKBrowserInfo.IsGecko && !FCKConfig.UseBROnCarriageReturn )
{
FCK.Events.AttachEvent( "OnEnter", FCK.Enter ) ;
FCK.Events.AttachEvent( "OnBackSpace", FCK.BackSpace ) ;
}
*/
// END iCM Modifications
// Load Plugins.
if ( FCKPlugins.ItemsCount > 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 ) ;
FCKTools.DisableSelection( document.body ) ;
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 ) ;
}

View File

@ -1,231 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* 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.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Disable the context menu in the editor (areas outside the editor area).
function Window_OnContextMenu( e )
{
if ( e )
e.preventDefault() ; // The Gecko way.
else
{
if ( event.srcElement == document.getElementById('eSourceField') )
return true ;
}
return false ; // The IE way.
}
window.document.oncontextmenu = Window_OnContextMenu ;
// Gecko browsers doens't calculate well that IFRAME size so we must
// recalculate it every time the window size changes.
if ( FCKBrowserInfo.IsGecko )
{
function Window_OnResize()
{
var 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 ;
}
window.onresize = Window_OnResize ;
}
if ( FCKBrowserInfo.IsIE )
{
var aCleanupDocs = new Array() ;
aCleanupDocs[0] = document ;
// On IE, some circular references must be cleared to avoid memory leak.
function Window_OnBeforeUnload()
{
// if ( typeof( FCKToolbarSet ) != 'undefined' )
// FCKToolbarSet.Collapse() ;
var d, e ;
var j = 0 ;
while ( ( d = aCleanupDocs[j++] ) )
{
var i = 0 ;
while ( ( e = d.getElementsByTagName("DIV").item(i++) ) )
{
if ( e.FCKToolbarButton )
e.FCKToolbarButton = null ;
if ( e.FCKSpecialCombo )
e.FCKSpecialCombo = null ;
if ( e.Command )
e.Command = null ;
}
i = 0 ;
while ( ( e = d.getElementsByTagName("TR").item(i++) ) )
{
if ( e.FCKContextMenuItem )
e.FCKContextMenuItem = null ;
}
aCleanupDocs[j] = null ;
}
if ( typeof( FCKTempBin ) != 'undefined' )
FCKTempBin.Reset() ;
}
window.attachEvent( "onunload", Window_OnBeforeUnload ) ;
}
// The editor startup follows these steps:
// 1. Load the editor main page (fckeditor.html).
// 2. Load the main configuration file (fckconfig.js)
// 3. Process the configurations set directly in the page code (just load then).
// 4. Override the configurations with the custom config file (if set).
// 5. Override the configurations with that ones set directly in the page code.
// 6. Load the editor skin styles CSS files.
// 7. Load the first part of tha main scripts.
// 8. Load the language file.
// 9. Start the editor.
// Start the editor as soon as the window is loaded.
function Window_OnLoad()
{
// 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' ;
LoadConfigFile() ;
}
window.onload = Window_OnLoad ;
function LoadConfigFile()
{
FCKScriptLoader.OnEmpty = ProcessHiddenField ;
// First of all load the configuration file.
FCKScriptLoader.AddScript( '../fckconfig.js' ) ;
}
function ProcessHiddenField()
{
FCKConfig.ProcessHiddenField() ;
LoadCustomConfigFile() ;
}
function LoadCustomConfigFile()
{
// Load the custom configurations file (if defined).
if ( FCKConfig.CustomConfigurationsPath.length > 0 )
{
// Wait for the configuration file to be loaded to call the "LoadPageConfig".
FCKScriptLoader.OnEmpty = LoadPageConfig ;
FCKScriptLoader.AddScript( FCKConfig.CustomConfigurationsPath ) ;
}
else
{
// Load the page defined configurations immediately.
LoadPageConfig() ;
}
}
function LoadPageConfig()
{
FCKConfig.LoadPageConfig() ;
if ( FCKConfig.AllowQueryStringDebug && (/fckdebug=true/i).test( window.top.location.search ) )
FCKConfig.Debug = true ;
// Load the styles for the configured skin.
LoadStyles() ;
}
function LoadStyles()
{
if( window.console ) window.console.log( 'LoadStyles()' ) ; // @Packager.Compactor.RemoveLine
FCKScriptLoader.OnEmpty = LoadScripts ;
// Load the active skin CSS.
FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_editor.css' ) ;
FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
}
function LoadScripts()
{
if( window.console ) window.console.log( 'LoadScripts()' ) ; // @Packager.Compactor.RemoveLine
FCKScriptLoader.OnEmpty = null ;
// @Packager.Compactor.Remove.Start
var sSuffix = FCKBrowserInfo.IsIE ? 'ie' : 'gecko' ;
FCKScriptLoader.AddScript( '_source/internals/fckdebug.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktools.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckregexlib.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fcklanguagemanager.js' ) ;
FCKScriptLoader.AddScript( '_source/classes/fckevents.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckxhtmlentities.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckxhtml.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckcodeformatter.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fckundo_' + sSuffix + '.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fck_1.js' ) ;
FCKScriptLoader.AddScript( '_source/internals/fck_1_' + sSuffix + '.js' ) ;
// @Packager.Compactor.Remove.End
/* @Packager.Compactor.RemoveLine
if ( FCKBrowserInfo.IsIE )
FCKScriptLoader.AddScript( 'js/fckeditorcode_ie_1.js' ) ;
else
FCKScriptLoader.AddScript( 'js/fckeditorcode_gecko_1.js' ) ;
@Packager.Compactor.RemoveLine */
}
function LoadLanguageFile()
{
if( window.console ) window.console.log( 'LoadLanguageFile()' ) ; // @Packager.Compactor.RemoveLine
FCKScriptLoader.OnEmpty = LoadEditor ;
if( window.console ) window.console.log( 'Active Language: ' + FCKLanguageManager.ActiveLanguage.Code ) ; // @Packager.Compactor.RemoveLine
FCKScriptLoader.AddScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
}
function LoadEditor()
{
if( window.console ) window.console.log( 'LoadEditor()' ) ; // @Packager.Compactor.RemoveLine
// 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() ;
}

View File

@ -1,32 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckbrowserinfo.js
* Defines the FCKBrowserInfo object that hold some browser informations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKBrowserInfo ;
if ( !( FCKBrowserInfo = NS.FCKBrowserInfo ) )
{
FCKBrowserInfo = NS.FCKBrowserInfo = new Object() ;
var sAgent = navigator.userAgent.toLowerCase() ;
FCKBrowserInfo.IsIE = ( sAgent.indexOf("msie") != -1 ) ;
FCKBrowserInfo.IsGecko = !FCKBrowserInfo.IsIE ;
FCKBrowserInfo.IsSafari = ( sAgent.indexOf("safari") != -1 ) ;
FCKBrowserInfo.IsNetscape = ( sAgent.indexOf("netscape") != -1 ) ;
}

View File

@ -1,95 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcodeformatter.js
* Format the HTML.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKCodeFormatter ;
if ( !( FCKCodeFormatter = NS.FCKCodeFormatter ) )
{
FCKCodeFormatter = NS.FCKCodeFormatter = new Object() ;
FCKCodeFormatter.Regex = new Object() ;
// Regex for line breaks.
FCKCodeFormatter.Regex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
FCKCodeFormatter.Regex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
FCKCodeFormatter.Regex.NewLineTags = /\<(BR|HR)[^\>]\>/gi ;
FCKCodeFormatter.Regex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ;
FCKCodeFormatter.Regex.LineSplitter = /\s*\n+\s*/g ;
// Regex for indentation.
FCKCodeFormatter.Regex.IncreaseIndent = /^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i ;
FCKCodeFormatter.Regex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i ;
FCKCodeFormatter.Regex.FormatIndentatorRemove = new RegExp( FCKConfig.FormatIndentator ) ;
FCKCodeFormatter.Regex.ProtectedTags = /(<PRE[^>]*>)([\s\S]*?)(<\/PRE>)/gi ;
FCKCodeFormatter._ProtectData = function( outer, opener, data, closer )
{
return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.addItem( data ) + closer ;
}
FCKCodeFormatter.Format = function( html )
{
// Protected content that remain untouched during the
// process go in the following array.
FCKCodeFormatter.ProtectedData = new Array() ;
var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ;
// Line breaks.
sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ; ;
sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ;
sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ;
sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ;
// Indentation.
var sIndentation = '' ;
var asLines = sFormatted.split( this.Regex.LineSplitter ) ;
sFormatted = '' ;
for ( var i = 0 ; i < asLines.length ; i++ )
{
var sLine = asLines[i] ;
if ( sLine.length == 0 )
continue ;
if ( this.Regex.DecreaseIndent.test( sLine ) )
sIndentation = sIndentation.replace( this.Regex.FormatIndentatorRemove, '' ) ;
sFormatted += sIndentation + sLine + '\n' ;
if ( this.Regex.IncreaseIndent.test( sLine ) )
sIndentation += FCKConfig.FormatIndentator ;
}
// Now we put back the protected data.
for ( var i = 0 ; i < FCKCodeFormatter.ProtectedData.length ; i++ )
{
var oRegex = new RegExp( '___FCKpd___' + i ) ;
sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[i] ) ;
}
return sFormatted.trim() ;
}
}

View File

@ -1,124 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcommands.js
* Define all commands available in the editor.
*
* 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 'DocProps' : oCommand = new FCKDialogCommand( 'DocProps' , FCKLang.DocProps , 'dialog/fck_docprops.html' , 400, 390, FCKCommands.GetFullPageState ) ; break ;
case 'Templates' : oCommand = new FCKDialogCommand( 'Templates' , FCKLang.DlgTemplatesTitle , 'dialog/fck_template.html' , 380, 450 ) ; break ;
case 'Link' : oCommand = new FCKDialogCommand( 'Link' , FCKLang.DlgLnkWindowTitle , 'dialog/fck_link.html' , 400, 330, FCK.GetNamedCommandState, 'CreateLink' ) ; break ;
case 'Anchor' : oCommand = new FCKDialogCommand( 'Anchor' , FCKLang.DlgAnchorTitle , 'dialog/fck_anchor.html' , 370, 170 ) ; break ;
case 'BulletedList' : oCommand = new FCKDialogCommand( 'BulletedList', FCKLang.BulletedListProp , 'dialog/fck_listprop.html' , 370, 170 ) ; break ;
case 'NumberedList' : oCommand = new FCKDialogCommand( 'NumberedList', FCKLang.NumberedListProp , 'dialog/fck_listprop.html' , 370, 170 ) ; 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 ) ; break ;
case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 400 ) ; break ;
case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 320 ) ; break ;
case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; 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 'UniversalKey' : oCommand = new FCKDialogCommand( 'UniversalKey', FCKLang.UniversalKeyboard , 'dialog/fck_universalkey.html', 415, 300 ) ; 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 'PageBreak' : oCommand = new FCKPageBreakCommand() ; 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 ;
case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ;
case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 230 ) ; break ;
case 'Checkbox' : oCommand = new FCKDialogCommand( 'Checkbox' , FCKLang.Checkbox , 'dialog/fck_checkbox.html' , 380, 230 ) ; break ;
case 'Radio' : oCommand = new FCKDialogCommand( 'Radio' , FCKLang.RadioButton , 'dialog/fck_radiobutton.html' , 380, 230 ) ; break ;
case 'TextField' : oCommand = new FCKDialogCommand( 'TextField' , FCKLang.TextField , 'dialog/fck_textfield.html' , 380, 230 ) ; break ;
case 'Textarea' : oCommand = new FCKDialogCommand( 'Textarea' , FCKLang.Textarea , 'dialog/fck_textarea.html' , 380, 230 ) ; break ;
case 'HiddenField' : oCommand = new FCKDialogCommand( 'HiddenField', FCKLang.HiddenField , 'dialog/fck_hiddenfield.html' , 380, 230 ) ; break ;
case 'Button' : oCommand = new FCKDialogCommand( 'Button' , FCKLang.Button , 'dialog/fck_button.html' , 380, 230 ) ; break ;
case 'Select' : oCommand = new FCKDialogCommand( 'Select' , FCKLang.SelectionField, 'dialog/fck_select.html' , 400, 380 ) ; break ;
case 'ImageButton' : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton , 'dialog/fck_image.html?ImageButton', 450, 400 ) ; break ;
case 'SpellCheck' : oCommand = new FCKSpellCheckCommand() ; break ;
case 'Undo' : oCommand = new FCKUndoCommand() ; break ;
case 'Redo' : oCommand = new FCKRedoCommand() ; 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 null ;
}
}
FCKCommands.LoadedCommands[ commandName ] = oCommand ;
return oCommand ;
}
// Gets the state of the "Document Properties" button. It must be enabled only
// when "Full Page" editing is available.
FCKCommands.GetFullPageState = function()
{
return FCKConfig.FullPage ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
}

View File

@ -1,150 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckconfig.js
* Creates and initializes the FCKConfig object.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKConfig = FCK.Config = new Object() ;
// Editor Base Path
if ( document.location.protocol == 'file:' )
{
FCKConfig.BasePath = unescape( 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) ;
FCKConfig.FullBasePath = document.location.protocol + '//' + document.location.host + FCKConfig.BasePath ;
}
FCKConfig.EditorPath = FCKConfig.BasePath.replace( /editor\/$/, '' ) ;
// There is a bug in Gecko. If the editor is hidden on startup, an error is
// thrown when trying to get the screen dimentions.
try
{
FCKConfig.ScreenWidth = screen.width ;
FCKConfig.ScreenHeight = screen.height ;
}
catch (e)
{
FCKConfig.ScreenWidth = 800 ;
FCKConfig.ScreenHeight = 600 ;
}
// Override the actual configuration values with the values passed throw the
// hidden field "<InstanceName>___Config".
FCKConfig.ProcessHiddenField = function()
{
this.PageConfig = new Object() ;
// 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 sKey = unescape( aConfig[0] ) ;
var sVal = unescape( aConfig[1] ) ;
if ( sKey == 'CustomConfigurationsPath' ) // The Custom Config File path must be loaded immediately.
FCKConfig[ sKey ] = sVal ;
else if ( sVal.toLowerCase() == "true" ) // If it is a boolean TRUE.
this.PageConfig[ sKey ] = true ;
else if ( sVal.toLowerCase() == "false" ) // If it is a boolean FALSE.
this.PageConfig[ sKey ] = false ;
else if ( ! isNaN( sVal ) ) // If it is a number.
this.PageConfig[ sKey ] = parseInt( sVal ) ;
else // In any other case it is a string.
this.PageConfig[ sKey ] = sVal ;
}
}
FCKConfig.LoadPageConfig = function()
{
for ( var sKey in this.PageConfig )
FCKConfig[ sKey ] = this.PageConfig[ sKey ] ;
}
// 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, path )
{
FCKConfig.Plugins.Items.addItem( [name, langs, path] ) ;
}
// FCKConfig.ProtectedSource: object that holds a collection of Regular
// Expressions that defined parts of the raw HTML that must remain untouched
// like custom tags, scripts, server side code, etc...
FCKConfig.ProtectedSource = new Object() ;
FCKConfig.ProtectedSource.RegexEntries = new Array() ;
FCKConfig.ProtectedSource.Add = function( regexPattern )
{
this.RegexEntries.addItem( regexPattern ) ;
}
FCKConfig.ProtectedSource.Protect = function( html )
{
function _Replace( protectedSource )
{
var index = FCKTempBin.AddElement( protectedSource ) ;
return '<!--{PS..' + index + '}-->' ;
}
for ( var i = 0 ; i < this.RegexEntries.length ; i++ )
{
html = html.replace( this.RegexEntries[i], _Replace ) ;
}
return html ;
}
FCKConfig.ProtectedSource.Revert = function( html, clearBin )
{
function _Replace( m, opener, index )
{
var protectedValue = clearBin ? FCKTempBin.RemoveElement( index ) : FCKTempBin.Elements[ index ] ;
// There could be protected source inside another one.
return FCKConfig.ProtectedSource.Revert( protectedValue, clearBin ) ;
}
return html.replace( /(<|&lt;)!--\{PS..(\d+)\}--(>|&gt;)/g, _Replace ) ;
}
// First of any other protection, we must protect all comments to avoid
// loosing them (of course, IE related).
FCKConfig.ProtectedSource.Add( /<!--[\s\S]*?-->/g ) ;

View File

@ -1,273 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcontextmenu.js
* Defines the FCKContextMenu object that is responsible for all
* Context Menu operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKContextMenu = new Object() ;
FCKContextMenu._Panel = new FCKPanel( FCKBrowserInfo.IsIE ? window : window.parent ) ;
FCKContextMenu._Panel.PanelDiv.className = 'CM_ContextMenu' ;
FCKContextMenu._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
FCKContextMenu._Panel.IsContextMenu = true ;
FCKContextMenu._Document = FCKContextMenu._Panel.Document ;
// This property is internally used to indicate that the context menu has been created.
FCKContextMenu._IsLoaded = false ;
FCKContextMenu.Show = function( x, y )
{
if ( !this._IsLoaded )
this.Reload() ;
this.RefreshState() ;
// If not IE, x and y are relative to the editing area, so we must "fix" it.
if ( !FCKBrowserInfo.IsIE )
{
var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement, this._Panel._Window ) ;
x += oCoordsA.X ;
y += oCoordsA.Y ;
}
this._Panel.Show( x, y ) ;
}
FCKContextMenu.Hide = function()
{
this._Panel.Hide() ;
}
// 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 ;
this._Panel.PanelDiv.appendChild( oTable ) ;
// this._Div.appendChild( oTable ) ;
// Load all configured groups.
this.Groups = new Object() ;
for ( var i = 0 ; i < FCKConfig.ContextMenu.length ; i++ )
{
var sGroup = FCKConfig.ContextMenu[i] ;
this.Groups[ sGroup ] = this._GetGroup( sGroup ) ;
this.Groups[ sGroup ].CreateTableRows( oTable ) ;
}
FCKTools.DisableSelection( this._Panel.Document.body ) ;
this._IsLoaded = true ;
}
FCKContextMenu._GetGroup = function( groupName )
{
var oGroup ;
switch ( groupName )
{
case 'Generic' :
// Generic items that are always available.
oGroup = new FCKContextMenuGroup() ;
oGroup.Add( new FCKContextMenuItem( this, 'Cut' , FCKLang.Cut , true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'Copy' , FCKLang.Copy , true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'Paste' , FCKLang.Paste , true ) ) ;
break ;
case 'Link' :
oGroup = new FCKContextMenuGroup() ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'Link' , FCKLang.EditLink , true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'Unlink' , FCKLang.RemoveLink, true ) ) ;
break ;
case 'TableCell' :
oGroup = new FCKContextMenuGroup() ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableInsertRow' , FCKLang.InsertRow, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableDeleteRows' , FCKLang.DeleteRows, true ) ) ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableInsertColumn' , FCKLang.InsertColumn, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableDeleteColumns' , FCKLang.DeleteColumns, true ) ) ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableInsertCell' , FCKLang.InsertCell, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableDeleteCells' , FCKLang.DeleteCells, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableMergeCells' , FCKLang.MergeCells, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableSplitCell' , FCKLang.SplitCell, true ) ) ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableCellProp' , FCKLang.CellProperties, true ) ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableProp' , FCKLang.TableProperties, true ) ) ;
break ;
case 'Table' :
oGroup = new FCKContextMenuGroup() ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ;
oGroup.Add( new FCKContextMenuSeparator() ) ;
oGroup.Add( new FCKContextMenuItem( this, 'Table' , FCKLang.TableProperties, true ) ) ;
break ;
case 'Image' :
return new FCKContextMenuGroup( true, this, 'Image', FCKLang.ImageProperties, true ) ;
case 'Flash' :
return new FCKContextMenuGroup( true, this, 'Flash', FCKLang.FlashProperties, true ) ;
case 'Form' :
return new FCKContextMenuGroup( true, this, 'Form', FCKLang.FormProp, true ) ;
case 'Checkbox' :
return new FCKContextMenuGroup( true, this, 'Checkbox', FCKLang.CheckboxProp, true ) ;
case 'Radio' :
return new FCKContextMenuGroup( true, this, 'Radio', FCKLang.RadioButtonProp, true ) ;
case 'TextField' :
return new FCKContextMenuGroup( true, this, 'TextField', FCKLang.TextFieldProp, true ) ;
case 'HiddenField' :
return new FCKContextMenuGroup( true, this, 'HiddenField', FCKLang.HiddenFieldProp, true ) ;
case 'ImageButton' :
return new FCKContextMenuGroup( true, this, 'ImageButton', FCKLang.ImageButtonProp, true ) ;
case 'Button' :
return new FCKContextMenuGroup( true, this, 'Button', FCKLang.ButtonProp, true ) ;
case 'Select' :
return new FCKContextMenuGroup( true, this, 'Select', FCKLang.SelectionFieldProp, true ) ;
case 'Textarea' :
return new FCKContextMenuGroup( true, this, 'Textarea', FCKLang.TextareaProp, true ) ;
case 'BulletedList' :
return new FCKContextMenuGroup( true, this, 'BulletedList', FCKLang.BulletedListProp, true ) ;
case 'NumberedList' :
return new FCKContextMenuGroup( true, this, 'NumberedList', FCKLang.NumberedListProp, true ) ;
case 'Anchor' :
return new FCKContextMenuGroup( true, this, 'Anchor', FCKLang.AnchorProp, true ) ;
}
return oGroup ;
}
FCKContextMenu.RefreshState = function()
{
// Get the actual selected tag (if any).
var oTag = FCKSelection.GetSelectedElement() ;
var sTagName ;
if ( oTag )
sTagName = oTag.tagName ;
// Set items visibility.
// var bIsAnchor = ( sTagName == 'A' && oTag.name.length > 0 && oTag.href.length == 0 ) ;
// if ( this.Groups['Link'] ) this.Groups['Link'].SetVisible( !bIsAnchor && FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED ) ;
if ( this.Groups['Link'] ) this.Groups['Link'].SetVisible( FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED ) ;
if ( this.Groups['TableCell'] ) this.Groups['TableCell'].SetVisible( sTagName != 'TABLE' && FCKSelection.HasAncestorNode('TABLE') ) ;
if ( this.Groups['Table'] ) this.Groups['Table'].SetVisible( sTagName == 'TABLE' ) ;
if ( this.Groups['Image'] ) this.Groups['Image'].SetVisible( sTagName == 'IMG' && !oTag.getAttribute('_fckfakelement') ) ;
if ( this.Groups['Flash'] ) this.Groups['Flash'].SetVisible( sTagName == 'IMG' && oTag.getAttribute('_fckflash') ) ;
if ( this.Groups['Anchor'] ) this.Groups['Anchor'].SetVisible( sTagName == 'IMG' && oTag.getAttribute('_fckanchor') ) ;
if ( this.Groups['BulletedList'] ) this.Groups['BulletedList'].SetVisible( FCKSelection.HasAncestorNode('UL') ) ;
if ( this.Groups['NumberedList'] ) this.Groups['NumberedList'].SetVisible( FCKSelection.HasAncestorNode('OL') ) ;
if ( this.Groups['Select'] ) this.Groups['Select'].SetVisible( sTagName == 'SELECT' ) ;
if ( this.Groups['Textarea'] ) this.Groups['Textarea'].SetVisible( sTagName == 'TEXTAREA' ) ;
if ( this.Groups['Form'] ) this.Groups['Form'].SetVisible( FCKSelection.HasAncestorNode('FORM') ) ;
if ( this.Groups['Checkbox'] ) this.Groups['Checkbox'].SetVisible( sTagName == 'INPUT' && oTag.type == 'checkbox' ) ;
if ( this.Groups['Radio'] ) this.Groups['Radio'].SetVisible( sTagName == 'INPUT' && oTag.type == 'radio' ) ;
if ( this.Groups['TextField'] ) this.Groups['TextField'].SetVisible( sTagName == 'INPUT' && ( oTag.type == 'text' || oTag.type == 'password' ) ) ;
if ( this.Groups['HiddenField'] ) this.Groups['HiddenField'].SetVisible( sTagName == 'INPUT' && oTag.type == 'hidden' ) ;
if ( this.Groups['ImageButton'] ) this.Groups['ImageButton'].SetVisible( sTagName == 'INPUT' && oTag.type == 'image' ) ;
if ( this.Groups['Button'] ) this.Groups['Button'].SetVisible( sTagName == 'INPUT' && ( oTag.type == 'button' || oTag.type == 'submit' || oTag.type == 'reset' ) ) ;
// 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/cut.gif" width="21" height="20"></td>
<td class="CM_Label">Cut</td>
</tr>
<tr class="CM_Disabled">
<td class="CM_Icon"><img height="20" alt="" src="icons/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/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/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>
*/

View File

@ -1,92 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckcoreextensions.js
* Some extensions to the Javascript Core.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Extends the Array object, creating a "addItem" method on it.
Array.prototype.addItem = function( item )
{
var i = this.length ;
this[ i ] = item ;
return i ;
}
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, ignoreCase )
{
var L1 = this.length ;
var L2 = value.length ;
if ( L2 > L1 )
return false ;
if ( ignoreCase )
{
var oRegex = new RegExp( value + '$' , 'i' ) ;
return oRegex.test( this ) ;
}
else
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, '' ) ;
}
String.prototype.ltrim = function()
{
return this.replace( /^\s*/g, '' ) ;
}
String.prototype.rtrim = function()
{
return this.replace( /\s*$/g, '' ) ;
}
String.prototype.replaceNewLineChars = function( replacement )
{
return this.replace( /\n/g, replacement ) ;
}

View File

@ -1,76 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdebug.js
* Debug window control and operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKDebug = new Object() ;
if ( FCKConfig.Debug )
{
FCKDebug.Output = function( message, color, noParse )
{
if ( ! FCKConfig.Debug ) return ;
if ( !noParse && message != null && isNaN( message ) )
message = message.replace(/</g, "&lt;") ;
if ( !this.DebugWindow || this.DebugWindow.closed )
this.DebugWindow = window.open( FCKConfig.BasePath + 'fckdebug.html', 'FCKeditorDebug', 'menubar=no,scrollbars=no,resizable=yes,location=no,toolbar=no,width=600,height=500', true ) ;
if ( this.DebugWindow.Output)
{
try
{
this.DebugWindow.Output( message, color ) ;
}
catch ( e ) {} // Ignore errors
}
}
FCKDebug.OutputObject = function( anyObject, color )
{
var message ;
if ( anyObject != null )
{
message = 'Properties of: ' + anyObject + '</b><blockquote>' ;
for (var prop in anyObject)
{
var sVal = anyObject[ prop ] ? anyObject[ prop ] + '' : '[null]' ;
try
{
message += '<b>' + prop + '</b> : ' + sVal.replace(/</g, '&lt;') + '<br>' ;
}
catch (e)
{
message += '<b>' + prop + '</b> : [' + typeof( anyObject[ prop ] ) + ']<br>' ;
}
}
message += '</blockquote><b>' ;
} else
message = 'OutputObject : Object is "null".' ;
FCKDebug.Output( message, color, true ) ;
}
}
else
{
FCKDebug.Output = function() {}
FCKDebug.OutputObject = function() {}
}

View File

@ -1,34 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog.js
* Dialog windows operations.
*
* 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, resizable )
{
// 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, resizable ) ;
}

View File

@ -1,98 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog_gecko.js
* Dialog windows operations. (Gecko specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow, resizable )
{
var iTop = (FCKConfig.ScreenHeight - dialogHeight) / 2 ;
var iLeft = (FCKConfig.ScreenWidth - dialogWidth) / 2 ;
var sOption = "location=no,menubar=no,toolbar=no,dependent=yes,dialog=yes,minimizable=no,modal=yes,alwaysRaised=yes" +
",resizable=" + ( resizable ? 'yes' : 'no' ) +
",width=" + dialogWidth +
",height=" + dialogHeight +
",top=" + iTop +
",left=" + iLeft ;
if ( !parentWindow )
parentWindow = window ;
var oWindow = parentWindow.open( '', 'FCKeditorDialog_' + dialogName, sOption, true ) ;
if ( !oWindow )
{
alert( FCKLang.DialogBlocked ) ;
return ;
}
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 ;
// Try/Catch must be used to avoit an error when using a frameset
// on a different domain:
// "Permission denied to get property Window.releaseEvents".
try
{
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 ) ;
}
catch (e)
{}
}
FCKDialog.CheckFocus = function()
{
// It is strange, but we have to check the FCKDialog existence to avoid a
// random error: "FCKDialog is not defined".
if ( typeof( FCKDialog ) != "object" )
return false ;
if ( FCKDialog.Window && !FCKDialog.Window.closed )
FCKDialog.Window.focus() ;
else
{
// Try/Catch must be used to avoit an error when using a frameset
// on a different domain:
// "Permission denied to get property Window.releaseEvents".
try
{
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 ) ;
}
catch (e)
{}
}
return false ;
}

View File

@ -1,30 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckdialog_ie.js
* Dialog windows operations. (IE specific implementations)
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKDialog.Show = function( dialogInfo, dialogName, pageUrl, dialogWidth, dialogHeight, parentWindow )
{
if ( !parentWindow )
parentWindow = window ;
this.IsOpened = true ;
parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
this.IsOpened = false ;
}

View File

@ -1,95 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcklanguagemanager.js
* Defines the FCKLanguageManager object that is used for language
* operations.
*
* 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 ;
}
// 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 e = targetDocument.getElementsByTagName(tag) ;
for ( var i = 0 ; i < e.length ; i++ )
{
var sKey = e[i].getAttribute( 'fckLang' ) ;
if ( sKey )
{
var s = FCKLang[ sKey ] ;
if ( s )
eval( 'e[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() ;

View File

@ -1,27 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcknamespace.js
* This file declares the namespace (object holder) where the common editor
* objects and classes are defined.
* The namespace is located in the page the editor is running on, so it is
* shared by all editor instances.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var NS ;
if ( !( NS = window.parent.__FCKeditorNS ) )
NS = window.parent.__FCKeditorNS = new Object() ;

View File

@ -1,44 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckplugins.js
* Defines the FCKPlugins object that is responsible for loading the Plugins.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKPlugins = FCK.Plugins = new Object() ;
FCKPlugins.ItemsCount = 0 ;
FCKPlugins.Loaded = false ;
FCKPlugins.Items = new Object() ;
// Set the defined plugins scripts paths.
for ( var i = 0 ; i < FCKConfig.Plugins.Items.length ; i++ )
{
var oItem = FCKConfig.Plugins.Items[i] ;
FCKPlugins.Items[ oItem[0] ] = new FCKPlugin( oItem[0], oItem[1], oItem[2] ) ;
FCKPlugins.ItemsCount++ ;
}
FCKPlugins.Load = function()
{
// Load all items.
for ( var s in this.Items )
this.Items[s].Load() ;
// Mark as loaded.
this.Loaded = true ;
// This is a self destroyable function (must be called once).
FCKPlugins.Load = null ;
}

View File

@ -1,98 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckregexlib.js
* These are some Regular Expresions used by the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKRegexLib = new Object() ;
// This is the Regular expression used by the SetHTML method for the "&apos;" entity.
FCKRegexLib.AposEntity = /&apos;/gi ;
// Used by the Styles combo to identify styles that can't be applied to text.
FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i ;
// START iCM MODIFICATIONS
// Added TABLE and CAPTION to the block elements for ENTER key handling
// Block Elements.
/*
FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TABLE|CAPTION)$/i ;
*/
// END iCM MODIFICATIONS
FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i ;
// Elements marked as empty "Empty" in the XHTML DTD.
FCKRegexLib.EmptyElements = /^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/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 ;
FCKRegexLib.BodyContents = /([\s\S]*\<body[^\>]*\>)([\s\S]*)(\<\/body\>[\s\S]*)/i ;
// Temporary text used to solve some browser specific limitations.
FCKRegexLib.ToReplace = /___fcktoreplace:([\w]+)/ig ;
// Get the META http-equiv attribute from the tag.
FCKRegexLib.MetaHttpEquiv = /http-equiv\s*=\s*["']?([^"' ]+)/i ;
FCKRegexLib.HasBaseTag = /<base /i ;
FCKRegexLib.HeadOpener = /<head\s?[^>]*>/i ;
FCKRegexLib.HeadCloser = /<\/head\s*>/i ;
FCKRegexLib.TableBorderClass = /\s*FCK__ShowTableBorders\s*/ ;
// Validate element names.
FCKRegexLib.ElementName = /^[A-Za-z_:][\w.\-:]*$/ ;
// Used in conjuction with the FCKConfig.ForceSimpleAmpersand configuration option.
FCKRegexLib.ForceSimpleAmpersand = /___FCKAmp___/g ;
// Get the closing parts of the tags with no closing tags, like <br/>... gets the "/>" part.
FCKRegexLib.SpaceNoClose = /\/>/g ;
FCKRegexLib.EmptyParagraph = /^<(p|div)>\s*<\/\1>$/i ;
FCKRegexLib.TagBody = /></ ;
// START iCM MODIFICATIONS
/*
// HTML table cell elements
FCKRegexLib.TableCellElements = /^(?:TD|TH)$/i ;
// Block elements that can themselves contain block elements - used within the FCKTools.SplitNode
// function. I know BODY isn't really a block element but means can do the check in one hit.
FCKRegexLib.SpecialBlockElements = /^(?:BODY|TH|TD|CAPTION)$/i ;
// Block elements that can validly contain a nested table. Ditto above for the BODY entry.
FCKRegexLib.TableBlockElements = /^(?:BODY|DIV|LI|TD|TH)$/i ;
// List elements
FCKRegexLib.ListElements = /^(?:OL|UL)$/i ;
// Used to remove empty tags after the split process used on ENTER key press
FCKRegexLib.EmptyElement = /<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|SPAN|A)[^\>]*>\s*<\/\1>/gi ;
*/
// END iCM MODIFICATIONS
FCKRegexLib.StrongOpener = /<STRONG([ \>])/gi ;
FCKRegexLib.StrongCloser = /<\/STRONG>/gi ;
FCKRegexLib.EmOpener = /<EM([ \>])/gi ;
FCKRegexLib.EmCloser = /<\/EM>/gi ;
FCKRegexLib.GeckoEntitiesMarker = /#\?-\:/g ;
FCKRegexLib.ProtectUrlsAApo = /(<a\s.*?href=)("|')(.+?)\2/gi ;
FCKRegexLib.ProtectUrlsANoApo = /(<a\s.*?href=)([^"'][^ >]+)/gi ;
FCKRegexLib.ProtectUrlsImgApo = /(<img\s.*?src=)("|')(.+?)\2/gi ;
FCKRegexLib.ProtectUrlsImgNoApo = /(<img\s.*?src=)([^"'][^ >]+)/gi ;

View File

@ -1,119 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckscriptloader.js
* Defines the FCKScriptLoader object that is used to dynamically load
* scripts in the editor.
*
* 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 ;
this.LoadFile( sScriptPath ) ;
}
else
{
this.IsLoading = false ;
// Call the "OnEmpty" event.
if ( this.OnEmpty )
this.OnEmpty() ;
}
}
FCKScriptLoader.LoadFile = function( filePath )
{
//window.status = ( 'Loading ' + filePath + '...' ) ;
// Dynamically load the file (it can be a CSS or a JS)
var e ;
// If it is a CSS
if ( filePath.lastIndexOf( '.css' ) > 0 )
{
e = document.createElement( 'LINK' ) ;
e.rel = 'stylesheet' ;
e.type = 'text/css' ;
}
// It 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 ) ;
// Start downloading it.
if ( e.tagName == 'LINK' )
{
// IE must wait for the file to be downloaded.
if ( FCKBrowserInfo.IsIE )
e.onload = FCKScriptLoader_OnLoad ;
// Gecko doens't fire any event when the CSS is loaded, so we
// can't wait for it.
else
FCKScriptLoader.CheckQueue() ;
e.href = filePath ;
}
else
{
// Gecko fires the "onload" event and IE fires "onreadystatechange"
e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ;
e.src = filePath ;
}
}
function FCKScriptLoader_OnLoad()
{
// 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() ;
}

View File

@ -1,22 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection.js
* Active selection functions.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKSelection = new Object() ;
FCK.Selection = FCKSelection ;

View File

@ -1,168 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection_gecko.js
* Active selection functions. (Gecko specific implementation)
*
* 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 ;
try { oSel = FCK.EditorWindow.getSelection() ; }
catch (e) {}
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().parentNode ;
else
{
var oSel = FCK.EditorWindow.getSelection() ;
if ( oSel )
{
var oNode = oSel.anchorNode ;
while ( oNode && oNode.nodeType != 1 )
oNode = oNode.parentNode ;
return oNode ;
}
}
}
FCKSelection.SelectNode = function( element )
{
FCK.Focus() ;
var oRange = FCK.EditorDocument.createRange() ;
oRange.selectNode( element ) ;
var oSel = FCK.EditorWindow.getSelection() ;
oSel.removeAllRanges() ;
oSel.addRange( oRange ) ;
}
FCKSelection.Collapse = function( toStart )
{
var oSel = FCK.EditorWindow.getSelection() ;
if ( toStart == null || toStart === true )
oSel.collapseToStart() ;
else
oSel.collapseToEnd() ;
}
// 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.nodeType == 1 && 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 ;
}
return null ;
}
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 ;
}
// START iCM MODIFICATIONS
/*
// Move the cursor position (the selection point) to a specific offset within a specific node
// If no offset specified, the start of the node is assumed
FCKSelection.SetCursorPosition = function ( oNode, nOffset )
{
if ( typeof nOffset == "undefined" ) nOffset = 0 ;
var oSel = FCK.EditorWindow.getSelection() ;
var oRange = FCK.EditorDocument.createRange() ;
oRange.setStart( oNode, nOffset ) ;
oRange.collapse( true ) ;
oSel.removeAllRanges() ;
oSel.addRange( oRange );
if ( oNode.scrollIntoView )
oNode.scrollIntoView( false );
}
*/
// END iCM MODIFICATIONS

View File

@ -1,150 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckselection_ie.js
* Active selection functions. (IE specific implementation)
*
* 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()
{
switch ( this.GetType() )
{
case 'Control' :
return FCKSelection.GetSelectedElement().parentElement ;
case 'None' :
return ;
default :
return FCK.EditorDocument.selection.createRange().parentElement() ;
}
}
FCKSelection.SelectNode = function( node )
{
FCK.Focus() ;
FCK.EditorDocument.selection.empty() ;
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveToElementText( node ) ;
oRange.select() ;
}
FCKSelection.Collapse = function( toStart )
{
FCK.Focus() ;
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.collapse( toStart == null || toStart === true ) ;
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 ;
}
// START iCM Modifications
/*
// Move the cursor position (the selection point) to a specific offset within a specific node
// If no offset specified, the start of the node is assumed
FCKSelection.SetCursorPosition = function ( oNode, nOffset )
{
if ( typeof nOffset == "undefined" ) nOffset = 0 ;
FCK.Selection.SelectNode( oNode ) ; // Doesn't handle offsets currently but offset always zero at mo
FCK.Selection.Collapse( true ) ;
oNode.scrollIntoView( false );
}
*/
// END iCM Modifications

View File

@ -1,364 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler.js
* Manage table operations.
*
* 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 )
{
var table = FCKSelection.GetSelectedElement() ;
if ( !table || table.tagName != 'TABLE' )
table = FCKSelection.MoveToAncestorNode("TABLE") ;
}
if ( !table ) return ;
// Delete the table.
FCKSelection.SelectNode( table ) ;
FCKSelection.Collapse();
table.parentNode.removeChild( table ) ;
}
FCKTableHandler.InsertColumn = function()
{
// Get the cell where the selection is placed in.
var oCell = FCKSelection.MoveToAncestorNode("TD") ;
if ( !oCell )
oCell = FCKSelection.MoveToAncestorNode("TH") ;
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 ;
oCell = oRow.cells[iIndex-1].cloneNode(false) ;
if ( FCKBrowserInfo.IsGecko )
oCell.innerHTML = FCKBrowserInfo.IsGecko ? GECKO_BOGUS : '' ;
// 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 )
oRow.insertBefore( oCell, oBaseCell ) ; // Insert the new cell just before of it.
else
oRow.appendChild( oCell ) ; // Append the cell at the end of the row.
}
}
FCKTableHandler.DeleteColumns = function()
{
// Get the cell where the selection is placed in.
var oCell = FCKSelection.MoveToAncestorNode('TD') || FCKSelection.MoveToAncestorNode('TH') ;
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");
if ( FCKBrowserInfo.IsGecko )
oNewCell.innerHTML = GECKO_BOGUS ;
// oNewCell.innerHTML = "&nbsp;" ;
// If it is the last cell in the row.
if ( oCell.cellIndex == oCell.parentNode.cells.length - 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 null ;
var oRow = tableMap[ rowIndex ] ;
for ( var c = 0 ; c < oRow.length ; c++ )
{
if ( oRow[c] == cell )
return c ;
}
return null ;
}
// 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 "nothing".
for ( var i = 0 ; i < aCells.length ; i++ )
{
if ( FCKBrowserInfo.IsGecko )
aCells[i].innerHTML = GECKO_BOGUS ;
else
aCells[i].innerHTML = '' ;
}
}

View File

@ -1,48 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler_gecko.js
* Manage table operations (IE specific).
*
* 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 ;
}

View File

@ -1,54 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktablehandler_ie.js
* Manage table operations (IE specific).
*
* 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() ;
var oParent = FCKSelection.GetParentElement() ;
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 ;
}

View File

@ -1,122 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbaritems.js
* Toolbar items definitions.
*
* 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, true ) ; break ;
case 'DocProps' : oItem = new FCKToolbarButton( 'DocProps' , FCKLang.DocProps ) ; break ;
case 'Templates' : oItem = new FCKToolbarButton( 'Templates' , FCKLang.Templates ) ; 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, null, null, true ) ; break ;
case 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, false, true ) ; break ;
case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, false, true ) ; break ;
case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, false, true ) ; break ;
case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText, null, null, false, true ) ; break ;
case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord, null, null, false, true ) ; break ;
case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, false, true ) ; break ;
case 'SpellCheck' : oItem = new FCKToolbarButton( 'SpellCheck', FCKLang.SpellCheck ) ; break ;
case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, false, true ) ; break ;
case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, false, true ) ; break ;
case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll ) ; break ;
case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat, null, null, false, true ) ; break ;
case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, false, true ) ; break ;
case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, false, true ) ; break ;
case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, false, true ) ; break ;
case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, false, true ) ; break ;
case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript, null, null, false, true ) ; break ;
case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript, null, null, false, true ) ; break ;
case 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList, null, false, true ) ; break ;
case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true ) ; break ;
case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true ) ; break ;
case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true ) ; break ;
case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true ) ; break ;
case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true ) ; break ;
case 'Anchor' : oItem = new FCKToolbarButton( 'Anchor' , FCKLang.Anchor ) ; break ;
case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage ) ; break ;
case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash ) ; 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 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak ) ; break ;
case 'UniversalKey' : oItem = new FCKToolbarButton( 'UniversalKey' , FCKLang.UniversalKeyboard ) ; break ;
case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true ) ; break ;
case 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify, null, null, false, true ) ; break ;
case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify, null, null, false, true ) ; break ;
case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify, null, null, false, true ) ; break ;
case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify, null, null, false, true ) ; 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 ;
case 'Form' : oItem = new FCKToolbarButton( 'Form' , FCKLang.Form ) ; break ;
case 'Checkbox' : oItem = new FCKToolbarButton( 'Checkbox' , FCKLang.Checkbox ) ; break ;
case 'Radio' : oItem = new FCKToolbarButton( 'Radio' , FCKLang.RadioButton ) ; break ;
case 'TextField' : oItem = new FCKToolbarButton( 'TextField' , FCKLang.TextField ) ; break ;
case 'Textarea' : oItem = new FCKToolbarButton( 'Textarea' , FCKLang.Textarea ) ; break ;
case 'HiddenField' : oItem = new FCKToolbarButton( 'HiddenField' , FCKLang.HiddenField ) ; break ;
case 'Button' : oItem = new FCKToolbarButton( 'Button' , FCKLang.Button ) ; break ;
case 'Select' : oItem = new FCKToolbarButton( 'Select' , FCKLang.SelectionField ) ; break ;
case 'ImageButton' : oItem = new FCKToolbarButton( 'ImageButton' , FCKLang.ImageButton ) ; break ;
default:
alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
return null ;
}
// to enable the toolbar switch, we have to stop to cache the toolbar items
// Please note, that we still need FCKToolbarItems.LoadedItems, to register
// plug in buttons there. But be aware, that plug in buttons can not be
// shared between different Toolbars!!! It will be better, to think about
// a button factory register instead of this.
// FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
return oItem ;
}

View File

@ -1,292 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarset.js
* Defines the FCKToolbarSet object that is used to load and draw the
* toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarSet = FCK.ToolbarSet = new Object() ;
// A map of toolbar sets, key is the name, value is the state of the toolbar set.
// It is used to save and restore states, when the toolbars are switched.
FCKToolbarSet.LoadedSets = new Object();
document.getElementById( 'ExpandHandle' ).title = FCKLang.ToolbarExpand ;
document.getElementById( 'CollapseHandle' ).title = FCKLang.ToolbarCollapse ;
FCKToolbarSet.Toolbars = new Array() ;
// Array of toolbat items that are active only on WYSIWYG mode.
FCKToolbarSet.ItemsWysiwygOnly = new Array() ;
// Array of toolbar items that are sensitive to the cursor position.
FCKToolbarSet.ItemsContextSensitive = 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' ).style.display = 'none' ;
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.Restart = function()
{
if ( !FCKConfig.ToolbarCanCollapse || FCKConfig.ToolbarStartExpanded )
this.Expand() ;
else
this.Collapse() ;
document.getElementById( 'CollapseHandle' ).style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
}
FCKToolbarSet.Load = function( toolbarSetName )
{
this.DOMElement = document.getElementById( 'eToolbar' ) ;
// first, save the current state, if any
this.SaveCurrentState();
// try to restore a saved state (if it has been already loaded)
if (this.RestoreState(toolbarSetName)) {
// the toolbar set is completely restored...
return;
}
// we have to create a new toolbar set
this.ToolbarSetName = toolbarSetName;
this.ItemsWysiwygOnly = new Array();
this.ItemsContextSensitive = new Array() ;
var ToolbarSet = FCKConfig.ToolbarSets[toolbarSetName] ;
if (! ToolbarSet)
{
alert( FCKLang.UnknownToolbarSet.replace( /%1/g, toolbarSetName ) ) ;
return ;
}
this.Toolbars = new Array() ;
for ( var x = 0 ; x < ToolbarSet.length ; x++ )
{
var oToolbarItems = ToolbarSet[x] ;
var oToolbar ;
if ( typeof( oToolbarItems ) == 'string' )
{
if ( oToolbarItems == '/' )
oToolbar = new FCKToolbarBreak() ;
}
else
{
oToolbar = new FCKToolbar() ;
for ( var j = 0 ; j < oToolbarItems.length ; j++ )
{
var sItem = oToolbarItems[j] ;
if ( sItem == '-')
oToolbar.AddSeparator() ;
else
{
var oItem = FCKToolbarItems.GetItem( sItem ) ;
if ( oItem )
{
oToolbar.AddItem( oItem ) ;
if ( !oItem.SourceView )
this.ItemsWysiwygOnly[this.ItemsWysiwygOnly.length] = oItem ;
if ( oItem.ContextSensitive )
this.ItemsContextSensitive[this.ItemsContextSensitive.length] = oItem ;
}
}
}
oToolbar.AddTerminator() ;
}
this.Toolbars[ this.Toolbars.length ] = oToolbar ;
}
FCKToolbarSet.EnableItems();
}
FCKToolbarSet.RefreshModeState = function()
{
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
// Enable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < FCKToolbarSet.ItemsWysiwygOnly.length ; i++ )
FCKToolbarSet.ItemsWysiwygOnly[i].Enable() ;
// Refresh the buttons state.
FCKToolbarSet.RefreshItemsState() ;
}
else
{
// Refresh the buttons state.
FCKToolbarSet.RefreshItemsState() ;
// Disable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < FCKToolbarSet.ItemsWysiwygOnly.length ; i++ )
FCKToolbarSet.ItemsWysiwygOnly[i].Disable() ;
}
}
FCKToolbarSet.RefreshItemsState = function()
{
for ( var i = 0 ; i < FCKToolbarSet.ItemsContextSensitive.length ; i++ )
FCKToolbarSet.ItemsContextSensitive[i].RefreshState() ;
/*
TODO: Delete this commented block on stable version.
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
oToolbar.Items[j].RefreshState() ;
}
}
*/
}
// Saves the current toolbar set (if any)
FCKToolbarSet.SaveCurrentState = function()
{
// Do we have a current toolbar?
if (this.ToolbarSetName) {
FCKToolbarSet.DisableItems();
if (!this.LoadedSets[this.ToolbarSetName]) {
// Save some toolbar set properties, this can be done only once..
this.LoadedSets[this.ToolbarSetName] = new Object();
this.LoadedSets[this.ToolbarSetName].Toolbars = this.Toolbars;
this.LoadedSets[this.ToolbarSetName].ItemsWysiwygOnly = this.ItemsWysiwygOnly;
this.LoadedSets[this.ToolbarSetName].ItemsContextSensitive = this.ItemsContextSensitive;
}
// move all its elements to a hidden div.
var oHiddenToolbarsDiv = document.getElementById('hiddenToolbars_' + this.ToolbarSetName);
if (!oHiddenToolbarsDiv) {
// create a hidden div with the name of the toolbarset..
oHiddenToolbarsDiv = document.createElement('DIV');
oHiddenToolbarsDiv.id = 'hiddenToolbars_' + this.ToolbarSetName;
// NOTE: We need a hidden div, because some elements should be deinitialized, when the editor is unloaded.
var oHiddenDiv = document.getElementById('hiddenDiv');
if (!oHiddenDiv) {
oHiddenDiv = document.createElement('DIV');
oHiddenDiv.style.display = 'none';
oHiddenDiv.style.visibility = 'hidden';
oHiddenDiv.id = 'hiddenDiv';
document.body.appendChild(oHiddenDiv);
}
oHiddenDiv.appendChild(oHiddenToolbarsDiv);
}
var f = true;
var e = this.DOMElement.firstChild;
while (e) {
var oElementToMove = e;
e = e.nextSibling;
this.DOMElement.removeChild(oElementToMove);
oHiddenToolbarsDiv.appendChild(oElementToMove);
}
}
}
// Try to restore one (if it has been already saved),
// returns true, if the restoration was succesfull else and false
FCKToolbarSet.RestoreState = function( toolbarSetName )
{
// Do we have a saved state?
if (this.LoadedSets[toolbarSetName]) {
this.ToolbarSetName = toolbarSetName;
// than simply restore it'state
this.Toolbars = this.LoadedSets[toolbarSetName].Toolbars;
this.ItemsWysiwygOnly = this.LoadedSets[toolbarSetName].ItemsWysiwygOnly;
this.ItemsContextSensitive = this.LoadedSets[toolbarSetName].ItemsContextSensitive;
//
var oHiddenToolbarsDiv = document.getElementById('hiddenToolbars_' + toolbarSetName);
var e = oHiddenToolbarsDiv.firstChild;
while (e) {
var oElementToMove = e;
e = e.nextSibling;
// oHiddenToolbarsDiv.removeChild(oElementToMove);
this.DOMElement.appendChild(oElementToMove);
}
// refresh its state...
FCKToolbarSet.EnableItems();
FCKToolbarSet.Restart();
// that's all
return true;
}
return false;
}
FCKToolbarSet.EnableItems = function()
{
FCK.Focus();
window.setTimeout('FCKToolbarSet.DoEnableItems();', 100);
}
FCKToolbarSet.DoEnableItems = function()
{
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
if (oToolbar && oToolbar.Items) {
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
oToolbar.Items[j].RefreshState() ;
}
}
}
}
FCKToolbarSet.DisableItems = function()
{
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
if (oToolbar && oToolbar.Items) {
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
if (oToolbar.Items[j].Disable) {
oToolbar.Items[j].Disable() ;
}
}
}
}
}

View File

@ -1,328 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools.js
* Utility functions.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKTools = new Object() ;
//**
// FCKTools.GetLinkedFieldValue: Gets the value of the hidden INPUT element
// that is associated to the editor. This element has its ID set to the
// editor's instance name so the user reffers to the instance name when getting
// the posted data.
FCKTools.GetLinkedFieldValue = function()
{
return FCK.LinkedField.value ;
}
//**
// FCKTools.AttachToLinkedFieldFormSubmit: attaches a function call to the
// submit event of the linked field form. This function us generally used to
// update the linked field value before submitting the form.
FCKTools.AttachToLinkedFieldFormSubmit = function( functionPointer )
{
// Gets the linked field form
var oForm = FCK.LinkedField.form ;
// Return now if no form is available
if (!oForm) return ;
// Attaches the functionPointer call to the onsubmit event
if ( FCKBrowserInfo.IsIE )
oForm.attachEvent( "onsubmit", functionPointer ) ;
else
oForm.addEventListener( 'submit', functionPointer, true ) ;
//**
// Attaches the functionPointer call to the submit method
// This is done because IE doesn't fire onsubmit when the submit method is called
// BEGIN --
// Creates a Array in the form object that will hold all Attached function call
// (in the case there are more than one editor in the same page)
if (! oForm.updateFCKeditor) oForm.updateFCKeditor = new Array() ;
// Adds the function pointer to the array of functions to call when "submit" is called
oForm.updateFCKeditor[oForm.updateFCKeditor.length] = functionPointer ;
// Switches the original submit method with a new one that first call all functions
// on the above array and the call the original submit
// IE sees it oForm.submit function as an 'object'.
if (! oForm.originalSubmit && ( typeof( oForm.submit ) == 'function' || ( !oForm.submit.tagName && !oForm.submit.length ) ) )
{
// Creates a copy of the original submit
oForm.originalSubmit = oForm.submit ;
// Creates our replacement for the submit
oForm.submit = FCKTools_SubmitReplacer ;
}
// END --
}
function FCKTools_SubmitReplacer()
{
if (this.updateFCKeditor)
{
// Calls all functions in the functions array
for (var i = 0 ; i < this.updateFCKeditor.length ; i++)
this.updateFCKeditor[i]() ;
}
// Calls the original "submit"
this.originalSubmit() ;
}
//**
// FCKTools.AddSelectOption: Adds a option to a SELECT element.
FCKTools.AddSelectOption = function( targetDocument, selectElement, optionText, optionValue )
{
var oOption = targetDocument.createElement("OPTION") ;
oOption.text = optionText ;
oOption.value = optionValue ;
selectElement.options.add(oOption) ;
return oOption ;
}
/*
FCKTools.RemoveAllSelectOptions = function( selectElement )
{
for ( var i = selectElement.options.length - 1 ; i >= 0 ; i-- )
{
selectElement.options.remove(i) ;
}
}
FCKTools.SelectNoCase = function( selectElement, value, defaultValue )
{
var sNoCaseValue = value.toString().toLowerCase() ;
for ( var i = 0 ; i < selectElement.options.length ; i++ )
{
if ( sNoCaseValue == selectElement.options[i].value.toLowerCase() )
{
selectElement.selectedIndex = i ;
return ;
}
}
if ( defaultValue != null ) FCKTools.SelectNoCase( selectElement, defaultValue ) ;
}
*/
FCKTools.HTMLEncode = function( text )
{
if ( !text )
return '' ;
text = text.replace( /&/g, "&amp;" ) ;
text = text.replace( /"/g, "&quot;" ) ;
text = text.replace( /</g, "&lt;" ) ;
text = text.replace( />/g, "&gt;" ) ;
text = text.replace( /'/g, "&#39;" ) ;
return text ;
}
/*
//**
// FCKTools.GetResultingArray: Gets a array from a string (where the elements
// are separated by a character), a fuction (that returns a array) or a array.
FCKTools.GetResultingArray = function( arraySource, separator )
{
switch ( typeof( arraySource ) )
{
case "string" :
return arraySource.split( separator ) ;
case "function" :
return separator() ;
default :
if ( isArray( arraySource ) ) return arraySource ;
else return new Array() ;
}
}
*/
FCKTools.GetElementPosition = function( el, relativeWindow )
{
// Initializes the Coordinates object that will be returned by the function.
var c = { X:0, Y:0 } ;
var oWindow = relativeWindow || window ;
// Loop throw the offset chain.
while ( el )
{
c.X += el.offsetLeft ;
c.Y += el.offsetTop ;
if ( el.offsetParent == null )
{
var oOwnerWindow = FCKTools.GetElementWindow( el ) ;
if ( oOwnerWindow != oWindow )
el = oOwnerWindow.frameElement ;
else
break ;
}
else
el = el.offsetParent ;
}
// Return the Coordinates object
return c ;
}
// START iCM MODIFICATIONS
// Amended to accept a list of one or more ascensor tag names
// Amended to check the element itself before working back up through the parent hierarchy
FCKTools.GetElementAscensor = function( element, ascensorTagNames )
{
// var e = element.parentNode ;
var e = element ;
var lstTags = "," + ascensorTagNames.toUpperCase() + "," ;
while ( e )
{
if ( lstTags.indexOf( "," + e.nodeName.toUpperCase() + "," ) != -1 )
return e ;
e = e.parentNode ;
}
return null ;
}
// END iCM MODIFICATIONS
FCKTools.Pause = function( miliseconds )
{
var oStart = new Date() ;
while (true)
{
var oNow = new Date() ;
if ( miliseconds < oNow - oStart )
return ;
}
}
FCKTools.ConvertStyleSizeToHtml = function( size )
{
return size.endsWith( '%' ) ? size : parseInt( size ) ;
}
FCKTools.ConvertHtmlSizeToStyle = function( size )
{
return size.endsWith( '%' ) ? size : ( size + 'px' ) ;
}
// Get the window object where the element is placed in.
FCKTools.GetElementWindow = function( element )
{
var oDocument = element.ownerDocument || element.document ;
// With Safari, there is not way to retrieve the window from the document, so we must fix it.
if ( FCKBrowserInfo.IsSafari && !oDocument.parentWindow )
FCKTools._FixDocumentParentWindow( window.top ) ;
return oDocument.parentWindow || oDocument.defaultView ;
}
/*
This is a Safari specific function that fix the reference to the parent
window from the document object.
*/
FCKTools._FixDocumentParentWindow = function( targetWindow )
{
targetWindow.document.parentWindow = targetWindow ;
for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
FCKTools._FixDocumentParentWindow( targetWindow.frames[i] ) ;
}
FCKTools.CancelEvent = function( e )
{
return false ;
}
// START iCM MODIFICATIONS
/*
// Transfers the supplied attributes to the supplied node
FCKTools.SetElementAttributes = function( oElement, oAttributes )
{
for ( var i = 0; i < oAttributes.length; i++ )
{
if ( oAttributes[i].specified ) // Needed for IE which always returns all attributes whether set or not
oElement.setAttribute( oAttributes[i].nodeName, oAttributes[i].nodeValue, 0 ) ;
}
}
// Get immediate block node (P, H1, for example) for the supplied node - the supplied node may itself be a block node in which
// case it will be returned. If no block node found, returns null.
FCKTools.GetParentBlockNode = function( oNode )
{
if ( oNode.nodeName.toUpperCase() == "BODY" )
return null ;
else if ( oNode.nodeType == 1 && FCKRegexLib.BlockElements.test(oNode.tagName) )
return oNode ;
else
return FCKTools.GetParentBlockNode( oNode.parentNode ) ;
}
// Run through any children of the supplied node. If there are none, or they only comprise
// empty text nodes and BR nodes, then the node is effectively empty.
// Sometimes (on Gecko) a seemingly empty node is coming back with several children that are solely
// empty text nodes and BRs e.g. the first item in an OL list, for example, when
// UseBROnCarriageReturn is set to false.
// Seems to be due to the use of the <br _moz_editor_bogus_node="TRUE"> (GECKO_BOGUS) as fillers both
// in fck_gecko_1.js when html is empty and in ENTER key handler ? If normal BR tags are
// used instead this doesn't seem to happen....
FCKTools.NodeIsEmpty = function( oNode )
{
var oSibling = oNode.childNodes[0] ;
while ( oSibling )
{
if ( ( oSibling.nodeType != 1 && oSibling.nodeType != 3 ) || ( oSibling.nodeType == 1 && oSibling.nodeName.toUpperCase() != "BR" ) || ( oSibling.nodeType == 3 && oSibling.nodeValue && oSibling.nodeValue.trim() != '' ) )
return false ;
oSibling = oSibling.nextSibling ;
}
return true ;
}
// Returns a document fragment that contains a copy of the specified range of nodes
FCKTools.GetDocumentFragment = function( oParentNode, oFromNode, oToNode, bIncludeFromNode, bIncludeToNode, bClone )
{
if ( typeof bIncludeFromNode == "undefined" ) bIncludeFromNode = true ;
if ( typeof bIncludeToNode == "undefined" ) bIncludeToNode = true ;
if ( typeof bClone == "undefined" ) bClone = true ;
var oFragment = FCK.EditorDocument.createDocumentFragment() ;
var oNode = oFromNode ;
while ( oNode && oNode != oToNode )
{
if ( oNode != oFromNode || bIncludeFromNode )
oFragment.appendChild( bClone ? oNode.cloneNode( true ) : oNode ) ;
oNode = oNode.nextSibling ;
}
if ( oNode && (oFromNode != oToNode && bIncludeToNode) )
oFragment.appendChild( bClone ? oNode.cloneNode( true ) : oNode ) ; // Include To Node
return oFragment ;
}
*/
// END iCM MODIFICATIONS

View File

@ -1,261 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools_gecko.js
* Utility functions. (Gecko version).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Constant for the Gecko Bogus Node.
var GECKO_BOGUS = '<br _moz_editor_bogus_node="TRUE">' ;
// Appends a CSS file to a document.
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrl )
{
var e = documentElement.createElement( 'LINK' ) ;
e.rel = 'stylesheet' ;
e.type = 'text/css' ;
e.href = cssFileUrl ;
documentElement.getElementsByTagName("HEAD")[0].appendChild( e ) ;
return e ;
}
// Removes all attributes and values from the element.
FCKTools.ClearElementAttributes = function( element )
{
// Loop throw all attributes in the element
for ( var i = 0 ; i < element.attributes.length ; i++ )
{
// Remove the element by name.
element.removeAttribute( element.attributes[i].name, 0 ) ; // 0 : Case Insensitive
}
}
// Returns an Array of strings with all defined in the elements inside another element.
FCKTools.GetAllChildrenIds = function( parentElement )
{
// Create the array that will hold all Ids.
var aIds = new Array() ;
// Define a recursive function that search for the Ids.
var fGetIds = function( parent )
{
for ( var i = 0 ; i < parent.childNodes.length ; i++ )
{
var sId = parent.childNodes[i].id ;
// Check if the Id is defined for the element.
if ( sId && sId.length > 0 ) aIds[ aIds.length ] = sId ;
// Recursive call.
fGetIds( parent.childNodes[i] ) ;
}
}
// Start the recursive calls.
fGetIds( parentElement ) ;
return aIds ;
}
FCKTools.RemoveOuterTags = function( e )
{
var oFragment = e.ownerDocument.createDocumentFragment() ;
for ( var i = 0 ; i < e.childNodes.length ; i++ )
oFragment.appendChild( e.childNodes[i] ) ;
e.parentNode.replaceChild( oFragment, e ) ;
}
FCKTools.CreateXmlObject = function( object )
{
switch ( object )
{
case 'XmlHttp' :
return new XMLHttpRequest() ;
case 'DOMDocument' :
return document.implementation.createDocument( '', '', null ) ;
}
return null ;
}
FCKTools.DisableSelection = function( element )
{
element.style.MozUserSelect = 'none' ; // Gecko only.
// element.style.userSelect = 'none' ; // CSS3 (not supported yet).
}
// START iCM Modifications
/*
// Starting at the specified node, find the first inline node of the sequence
// For example, assume we have the following elements : <p>Some text <span>some more text</span> and <a href="href">some link</a> yet some more text</p>
// If the "some link" text node is the one specified, then the "Some text" text node will be the first inline node returned.
FCKTools.GetFirstInlineNode = function( oNode )
{
if ( FCKRegexLib.BlockElements.test( oNode.nodeName ) )
return oNode ;
else if ( oNode.previousSibling && !FCKRegexLib.BlockElements.test( oNode.previousSibling.nodeName ) )
return FCKTools.GetFirstInlineNode( oNode.previousSibling ) ;
else if ( oNode.parentNode && !FCKRegexLib.BlockElements.test( oNode.parentNode.nodeName ) && oNode.parentNode.nodeName.toUpperCase() != "BODY" )
return FCKTools.GetFirstInlineNode( oNode.parentNode ) ;
else
return oNode ;
}
// Starting at the specified node, find the last inline node of the sequence
// For example, assume we have the following elements : <p>Some text <span>some more text</span> and <a href="href">some link</a> yet some more text</p>
// If the "some link" text node is the one specified, then the " yet some more text" text node will be the last inline node returned.
FCKTools.GetLastInlineNode = function( oNode )
{
if ( FCKRegexLib.BlockElements.test( oNode.nodeName ) )
return oNode ;
else if ( oNode.nextSibling && !FCKRegexLib.BlockElements.test( oNode.nextSibling.nodeName ) )
return FCKTools.GetLastInlineNode( oNode.nextSibling ) ;
else if ( oNode.parentNode && !FCKRegexLib.BlockElements.test( oNode.parentNode.nodeName ) && oNode.parentNode.nodeName.toUpperCase() != "BODY" )
return FCKTools.GetLastInlineNode( oNode.parentNode ) ;
else
return oNode ;
}
// Split the supplied parent at the specified child and (optionally) offset.
// Ensure that enclosing block elements are created where missing but that existing
// block elements (table for example) don't get incorrectly nested.
FCKTools.SplitNode = function( oParentBlockNode, oChildNode, nOffset )
{
if ( typeof nOffset == "undefined" ) nOffset = 0 ;
var oFragment = FCK.EditorDocument.createDocumentFragment() ;
var oRange = FCK.EditorDocument.createRange() ;
if ( FCKRegexLib.ListElements.test( oParentBlockNode.nodeName ) )
{
// Treat OL/UL parents differently as want to split at the specified
// child LI node to create to OL/UL lists.
oStartNode = oParentBlockNode.firstChild ;
oEndNode = oParentBlockNode.lastChild ;
}
else
{
// Locate the inline nodes adjacent to the specified child node so that these can
// be kept together.
oStartNode = FCKTools.GetFirstInlineNode( oChildNode ) ;
oEndNode = FCKTools.GetLastInlineNode( oChildNode ) ;
}
// Create a new tag which holds the content of the affected node(s) located before (but not including) the child node and offset
if ( FCKRegexLib.BlockElements.test( oStartNode.nodeName ) && !FCKRegexLib.ListElements.test( oParentBlockNode.nodeName ) )
{
// First element of the bunch is already a block element so we don't want to wrap it with a new block element.
// Just use this first node provided it is not the same as the last node (to prevent duplication), otherwise
// create a new empty P element.
if ( oStartNode != oEndNode )
{
oBlockNode1 = oStartNode.cloneNode( true ) ;
}
else
{
oBlockNode1 = FCK.EditorDocument.createElement( "P" ) ;
oBlockNode1.innerHTML = GECKO_BOGUS ;
if ( !FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) )
FCKTools.SetElementAttributes( oBlockNode1, oParentBlockNode.attributes ) ; // Transfer across any class attributes, etc
}
}
else
{
// First element of the bunch is not a block element (or it is a LI element which is a special case).
// So ensure all of the inline nodes before the selection are wrapped with a suitable block element.
var oBlockNode1 = FCK.EditorDocument.createElement( FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) ? "P" : oParentBlockNode.tagName ) ;
oRange.setStartBefore( oStartNode ) ;
if ( nOffset == 0 )
oRange.setEndBefore( oChildNode ) ;
else
oRange.setEnd( oChildNode, nOffset ) ;
oBlockNode1.appendChild( oRange.cloneContents() ) ;
oBlockNode1.innerHTML = oBlockNode1.innerHTML.replace(/[\x00-\x1F]/g, "") ; // Prevent any control characters returned within the innerHTML from causing problems
if ( FCKTools.NodeIsEmpty( oBlockNode1 ) )
oBlockNode1.innerHTML = GECKO_BOGUS ; // Ensure it has some content, required for Gecko
else
oBlockNode1.innerHTML = oBlockNode1.innerHTML.replace( FCKRegexLib.EmptyElement, "" ) ; // Strip out any empty tags that may have been generated by the split
if ( !FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) )
FCKTools.SetElementAttributes( oBlockNode1, oParentBlockNode.attributes ) ; // Transfer across any class attributes, etc
}
// Create a new tag which holds the content of the affected node(s) located after (and including) the child node
if ( FCKRegexLib.BlockElements.test( oEndNode.nodeName ) && !FCKRegexLib.ListElements.test( oParentBlockNode.nodeName ) )
{
// Last element of the bunch is already a block element so we don't want to wrap it with a new block element.
oBlockNode2 = oEndNode.cloneNode( true ) ;
}
else
{
// Last element of the bunch is not a block element (or it is a LI element which is a special case).
// So ensure all of the inline nodes after and including the child/offset are wrapped with a suitable block element.
var oBlockNode2 = FCK.EditorDocument.createElement( FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) ? "P" : oParentBlockNode.tagName );
oRange.setEndAfter( oEndNode );
if ( nOffset == 0 )
oRange.setStartBefore( oChildNode ) ;
else
oRange.setStart( oChildNode, nOffset );
oBlockNode2.appendChild( oRange.cloneContents() ) ;
oBlockNode2.innerHTML = oBlockNode2.innerHTML.replace(/[\x00-\x1F]/g, "") ; // Prevent any control characters returned within the innerHTML from causing problems
if ( FCKTools.NodeIsEmpty( oBlockNode2 ) )
oBlockNode2.innerHTML = GECKO_BOGUS ; // Ensure it has some content, required for Gecko
else
oBlockNode2.innerHTML = oBlockNode2.innerHTML.replace( FCKRegexLib.EmptyElement, "" ) ; // Strip out any empty tags that may have been generated by the split
if ( !FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) )
FCKTools.SetElementAttributes( oBlockNode2, oParentBlockNode.attributes ) ; // Transfer across any class attributes, etc
}
// Insert the resulting nodes into a document fragment
oFragment.appendChild( oBlockNode1 );
oFragment.appendChild( oBlockNode2 );
// Replace the affected nodes with the new nodes (fragment)
FCKTools.ReplaceNodes( oParentBlockNode, oStartNode, oEndNode, oFragment ) ;
// Return the second node so it can be used for setting cursor position, etc
return oBlockNode2 ;
}
// Function that replaces the specified range of nodes (inclusive) within the supplied parent
// with the nodes stored in the supplied document fragment.
FCKTools.ReplaceNodes = function( oParentBlockNode, oStartNode, oEndNode, oFragment )
{
var oRange = FCK.EditorDocument.createRange() ;
// Delete the affected node(s)
if ( !FCKRegexLib.SpecialBlockElements.test( oParentBlockNode.nodeName ) && (oParentBlockNode.firstChild == oStartNode) && (oParentBlockNode.lastChild == oEndNode) )
{
// Entire parent block node is to be replaced so insert the two new block elements before it
// and then remove the old node
oRange.selectNode ( oParentBlockNode );
}
else
{
// Only part of the parent block node is to be replaced so insert the two new block elements
// before the first inline node of the affected content and then remove the old nodes
oRange.setEndAfter( oEndNode ) ;
oRange.setStartBefore( oStartNode ) ;
}
// Insert the replacement nodes
oRange.deleteContents() ;
oRange.insertNode( oFragment ) ;
}
*/
// END iCM Modifications

View File

@ -1,98 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktools_ie.js
* Utility functions. (IE version).
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Appends a CSS file to a document.
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrl )
{
return documentElement.createStyleSheet( cssFileUrl ) ;
}
// Removes all attributes and values from the element.
FCKTools.ClearElementAttributes = function( element )
{
element.clearAttributes() ;
}
FCKTools.GetAllChildrenIds = function( parentElement )
{
var aIds = new Array() ;
for ( var i = 0 ; i < parentElement.all.length ; i++ )
{
var sId = parentElement.all[i].id ;
if ( sId && sId.length > 0 )
aIds[ aIds.length ] = sId ;
}
return aIds ;
}
FCKTools.RemoveOuterTags = function( e )
{
e.insertAdjacentHTML( 'beforeBegin', e.innerHTML ) ;
e.parentNode.removeChild( e ) ;
}
FCKTools.CreateXmlObject = function( object )
{
var aObjs ;
switch ( object )
{
case 'XmlHttp' :
aObjs = [ 'MSXML2.XmlHttp', 'Microsoft.XmlHttp' ] ;
break ;
case 'DOMDocument' :
aObjs = [ 'MSXML2.DOMDocument', 'Microsoft.XmlDom' ] ;
break ;
}
for ( var i = 0 ; i < 2 ; i++ )
{
try { return new ActiveXObject( aObjs[i] ) ; }
catch (e)
{}
}
if ( FCKLang.NoActiveX )
{
alert( FCKLang.NoActiveX ) ;
FCKLang.NoActiveX = null ;
}
}
FCKTools.DisableSelection = function( element )
{
element.unselectable = 'on' ;
var e, i = 0 ;
while ( e = element.all[ i++ ] )
{
switch ( e.tagName )
{
case 'IFRAME' :
case 'TEXTAREA' :
case 'INPUT' :
case 'SELECT' :
/* Ignore the above tags */
break ;
default :
e.unselectable = 'on' ;
}
}
}

View File

@ -1,4 +0,0 @@
var FCKUndo = new Object() ;
FCKUndo.SaveUndoStep = function()
{}

View File

@ -1,97 +0,0 @@
var FCKUndo = new Object() ;
FCKUndo.SavedData = new Array() ;
FCKUndo.CurrentIndex = -1 ;
FCKUndo.TypesCount = FCKUndo.MaxTypes = 25 ;
FCKUndo.Typing = false ;
FCKUndo.SaveUndoStep = function()
{
// Shrink the array to the current level.
FCKUndo.SavedData = FCKUndo.SavedData.slice( 0, FCKUndo.CurrentIndex + 1 ) ;
// Get the Actual HTML.
var sHtml = FCK.EditorDocument.body.innerHTML ;
// Cancel operation if the new step is identical to the previous one.
if ( FCKUndo.CurrentIndex >= 0 && sHtml == FCKUndo.SavedData[ FCKUndo.CurrentIndex ][0] )
return ;
// If we reach the Maximun number of undo levels, we must remove the first
// entry of the list shifting all elements.
if ( FCKUndo.CurrentIndex + 1 >= FCKConfig.MaxUndoLevels )
FCKUndo.SavedData.shift() ;
else
FCKUndo.CurrentIndex++ ;
// Get the actual selection.
var sBookmark ;
if ( FCK.EditorDocument.selection.type == 'Text' )
sBookmark = FCK.EditorDocument.selection.createRange().getBookmark() ;
// Save the new level in front of the actual position.
FCKUndo.SavedData[ FCKUndo.CurrentIndex ] = [ sHtml, sBookmark ] ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
FCKUndo.CheckUndoState = function()
{
return ( FCKUndo.Typing || FCKUndo.CurrentIndex > 0 ) ;
}
FCKUndo.CheckRedoState = function()
{
return ( !FCKUndo.Typing && FCKUndo.CurrentIndex < ( FCKUndo.SavedData.length - 1 ) ) ;
}
FCKUndo.Undo = function()
{
if ( FCKUndo.CheckUndoState() )
{
// If it is the first step.
if ( FCKUndo.CurrentIndex == ( FCKUndo.SavedData.length - 1 ) )
{
// Save the actual state for a possible "Redo" call.
FCKUndo.SaveUndoStep() ;
}
// Go a step back.
FCKUndo._ApplyUndoLevel( --FCKUndo.CurrentIndex ) ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
}
FCKUndo.Redo = function()
{
if ( FCKUndo.CheckRedoState() )
{
// Go a step forward.
FCKUndo._ApplyUndoLevel( ++FCKUndo.CurrentIndex ) ;
FCK.Events.FireEvent( "OnSelectionChange" ) ;
}
}
FCKUndo._ApplyUndoLevel = function(level)
{
var oData = FCKUndo.SavedData[ level ] ;
if ( !oData )
return ;
// Update the editor contents with that step data.
FCK.SetInnerHtml( oData[0] ) ;
// FCK.EditorDocument.body.innerHTML = oData[0] ;
if ( oData[1] )
{
var oRange = FCK.EditorDocument.selection.createRange() ;
oRange.moveToBookmark( oData[1] ) ;
oRange.select() ;
}
FCKUndo.TypesCount = 0 ;
FCKUndo.Typing = false ;
}

View File

@ -1,32 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckurlparams.js
* Defines the FCKURLParams object that is used to get all parameters
* passed by the URL QueryString (after the "?").
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// #### URLParams: holds all URL passed parameters (like ?Param1=Value1&Param2=Value2)
var FCKURLParams = new Object() ;
var aParams = document.location.search.substr(1).split('&') ;
for ( var i = 0 ; i < aParams.length ; i++ )
{
var aParam = aParams[i].split('=') ;
var sParamName = aParam[0] ;
var sParamValue = aParam[1] ;
FCKURLParams[ sParamName ] = sParamValue ;
}

View File

@ -1,371 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKXHtml = new Object() ;
FCKXHtml.CurrentJobNum = 0 ;
FCKXHtml.GetXHTML = function( node, includeNode, format )
{
// Special blocks are blocks of content that remain untouched during the
// process. It is used for SCRIPTs and STYLEs.
FCKXHtml.SpecialBlocks = new Array() ;
// Create the XML DOMDocument object.
this.XML = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
// Add a root element that holds all child nodes.
this.MainNode = this.XML.appendChild( this.XML.createElement( 'xhtml' ) ) ;
FCKXHtml.CurrentJobNum++ ;
if ( includeNode )
this._AppendNode( this.MainNode, node ) ;
else
this._AppendChildNodes( this.MainNode, node, false ) ;
// Get the resulting XHTML as a string.
var sXHTML = this._GetMainXmlString() ;
// Strip the "XHTML" root node.
sXHTML = sXHTML.substr( 7, sXHTML.length - 15 ).trim() ;
// Remove the trailing <br> added by Gecko.
if ( FCKBrowserInfo.IsGecko )
sXHTML = sXHTML.replace( /<br\/>$/, '' ) ;
// Add a space in the tags with no closing tags, like <br/> -> <br />
sXHTML = sXHTML.replace( FCKRegexLib.SpaceNoClose, ' />');
if ( FCKConfig.ForceSimpleAmpersand )
sXHTML = sXHTML.replace( FCKRegexLib.ForceSimpleAmpersand, '&' ) ;
if ( format )
sXHTML = FCKCodeFormatter.Format( sXHTML ) ;
// Now we put back the SpecialBlocks contents.
for ( var i = 0 ; i < FCKXHtml.SpecialBlocks.length ; i++ )
{
var oRegex = new RegExp( '___FCKsi___' + i ) ;
sXHTML = sXHTML.replace( oRegex, FCKXHtml.SpecialBlocks[i] ) ;
}
this.XML = null ;
return sXHTML
}
FCKXHtml._AppendAttribute = function( xmlNode, attributeName, attributeValue )
{
try
{
// Create the attribute.
var oXmlAtt = this.XML.createAttribute( attributeName ) ;
oXmlAtt.value = attributeValue ? attributeValue : '' ;
// Set the attribute in the node.
xmlNode.attributes.setNamedItem( oXmlAtt ) ;
}
catch (e)
{}
}
FCKXHtml._AppendChildNodes = function( xmlNode, htmlNode, isBlockElement )
{
var iCount = 0 ;
var oNode = htmlNode.firstChild ;
while ( oNode )
{
if ( this._AppendNode( xmlNode, oNode ) )
iCount++ ;
oNode = oNode.nextSibling ;
}
if ( iCount == 0 )
{
if ( isBlockElement && FCKConfig.FillEmptyBlocks )
{
this._AppendEntity( xmlNode, 'nbsp' ) ;
return ;
}
// We can't use short representation of empty elements that are not marked
// as empty in th XHTML DTD.
if ( !FCKRegexLib.EmptyElements.test( htmlNode.nodeName ) )
xmlNode.appendChild( this.XML.createTextNode('') ) ;
}
}
FCKXHtml._AppendNode = function( xmlNode, htmlNode )
{
if ( !htmlNode )
return ;
switch ( htmlNode.nodeType )
{
// Element Node.
case 1 :
if ( htmlNode.getAttribute('_fckfakelement') )
return FCKXHtml._AppendNode( xmlNode, FCK.GetRealElement( htmlNode ) ) ;
// Mozilla insert custom nodes in the DOM.
if ( FCKBrowserInfo.IsGecko && htmlNode.hasAttribute('_moz_editor_bogus_node') )
return false ;
if ( htmlNode.getAttribute('_fckdelete') )
return false ;
// Get the element name.
var sNodeName = htmlNode.nodeName ;
//Add namespace:
if ( FCKBrowserInfo.IsIE && htmlNode.scopeName && htmlNode.scopeName != 'HTML' )
sNodeName = htmlNode.scopeName + ':' + sNodeName ;
// Check if the node name is valid, otherwise ignore this tag.
// If the nodeName starts with a slash, it is a orphan closing tag.
// On some strange cases, the nodeName is empty, even if the node exists.
if ( !FCKRegexLib.ElementName.test( sNodeName ) )
return false ;
sNodeName = sNodeName.toLowerCase() ;
if ( FCKBrowserInfo.IsGecko && sNodeName == 'br' && htmlNode.hasAttribute('type') && htmlNode.getAttribute( 'type', 2 ) == '_moz' )
return false ;
// The already processed nodes must be marked to avoid then to be duplicated (bad formatted HTML).
// So here, the "mark" is checked... if the element is Ok, then mark it.
if ( htmlNode._fckxhtmljob && htmlNode._fckxhtmljob == FCKXHtml.CurrentJobNum )
return false ;
var oNode = this._CreateNode( sNodeName ) ;
// Add all attributes.
FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ;
htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ;
// Tag specific processing.
var oTagProcessor = FCKXHtml.TagProcessors[ sNodeName ] ;
if ( oTagProcessor )
{
oNode = oTagProcessor( oNode, htmlNode ) ;
if ( !oNode ) break ;
}
else
this._AppendChildNodes( oNode, htmlNode, FCKRegexLib.BlockElements.test( sNodeName ) ) ;
xmlNode.appendChild( oNode ) ;
break ;
// Text Node.
case 3 :
this._AppendTextNode( xmlNode, htmlNode.nodeValue.replaceNewLineChars(' ') ) ;
break ;
// Comment
case 8 :
try { xmlNode.appendChild( this.XML.createComment( htmlNode.nodeValue ) ) ; }
catch (e) { /* Do nothing... probably this is a wrong format comment. */ }
break ;
// Unknown Node type.
default :
xmlNode.appendChild( this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ) ) ;
break ;
}
return true ;
}
if ( FCKConfig.ForceStrongEm )
{
FCKXHtml._CreateNode = function( nodeName )
{
switch ( nodeName )
{
case 'b' :
nodeName = 'strong' ;
break ;
case 'i' :
nodeName = 'em' ;
break ;
}
return this.XML.createElement( nodeName ) ;
}
}
else
{
FCKXHtml._CreateNode = function( nodeName )
{
return this.XML.createElement( nodeName ) ;
}
}
// Append an item to the SpecialBlocks array and returns the tag to be used.
FCKXHtml._AppendSpecialItem = function( item )
{
return '___FCKsi___' + FCKXHtml.SpecialBlocks.addItem( item ) ;
}
//if ( FCKConfig.ProcessHTMLEntities )
//{
FCKXHtml._AppendTextNode = function( targetNode, textValue )
{
// We can't just replace the special chars with entities and create a
// text node with it. We must split the text isolating the special chars
// and add each piece a time.
var asPieces = textValue.match( FCKXHtmlEntities.EntitiesRegex ) ;
if ( asPieces )
{
for ( var i = 0 ; i < asPieces.length ; i++ )
{
if ( asPieces[i].length == 1 )
{
var sEntity = FCKXHtmlEntities.Entities[ asPieces[i] ] ;
if ( sEntity != null )
{
this._AppendEntity( targetNode, sEntity ) ;
continue ;
}
}
targetNode.appendChild( this.XML.createTextNode( asPieces[i] ) ) ;
}
}
}
//}
//else
//{
// FCKXHtml._AppendTextNode = function( targetNode, textValue )
// {
// targetNode.appendChild( this.XML.createTextNode( textValue ) ) ;
// }
//}
// An object that hold tag specific operations.
FCKXHtml.TagProcessors = new Object() ;
FCKXHtml.TagProcessors['img'] = function( node, htmlNode )
{
// The "ALT" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'alt' ) )
FCKXHtml._AppendAttribute( node, 'alt', '' ) ;
var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
if ( sSavedUrl && sSavedUrl.length > 0 )
FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ;
return node ;
}
FCKXHtml.TagProcessors['a'] = function( node, htmlNode )
{
var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ;
if ( sSavedUrl && sSavedUrl.length > 0 )
FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ;
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
return node ;
}
FCKXHtml.TagProcessors['script'] = function( node, htmlNode )
{
// The "TYPE" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'type' ) )
FCKXHtml._AppendAttribute( node, 'type', 'text/javascript' ) ;
node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.text ) ) ) ;
return node ;
}
FCKXHtml.TagProcessors['style'] = function( node, htmlNode )
{
// The "_fcktemp" attribute is used to mark the <STYLE> used by the editor
// to set some behaviors.
if ( htmlNode.getAttribute( '_fcktemp' ) )
return null ;
// The "TYPE" attribute is required in XHTML.
if ( ! node.attributes.getNamedItem( 'type' ) )
FCKXHtml._AppendAttribute( node, 'type', 'text/css' ) ;
node.appendChild( FCKXHtml.XML.createTextNode( FCKXHtml._AppendSpecialItem( htmlNode.innerHTML ) ) ) ;
return node ;
}
FCKXHtml.TagProcessors['title'] = function( node, htmlNode )
{
node.appendChild( FCKXHtml.XML.createTextNode( FCK.EditorDocument.title ) ) ;
return node ;
}
FCKXHtml.TagProcessors['base'] = function( node, htmlNode )
{
// The "_fcktemp" attribute is used to mark the <BASE> tag when the editor
// automatically sets it using the FCKConfig.BaseHref configuration.
if ( htmlNode.getAttribute( '_fcktemp' ) )
return null ;
// IE duplicates the BODY inside the <BASE /> tag (don't ask me why!).
// This tag processor does nothing... in this way, no child nodes are added
// (also because the BASE tag must be empty).
return node ;
}
FCKXHtml.TagProcessors['link'] = function( node, htmlNode )
{
// The "_fcktemp" attribute is used to mark the fck_internal.css <LINK>
// reference.
if ( htmlNode.getAttribute( '_fcktemp' ) )
return null ;
return node ;
}
FCKXHtml.TagProcessors['table'] = function( node, htmlNode )
{
// There is a trick to show table borders when border=0. We add to the
// table class the FCK__ShowTableBorders rule. So now we must remove it.
var oClassAtt = node.attributes.getNamedItem( 'class' ) ;
if ( oClassAtt && FCKRegexLib.TableBorderClass.test( oClassAtt.nodeValue ) )
{
var sClass = oClassAtt.nodeValue.replace( FCKRegexLib.TableBorderClass, '' ) ;
if ( sClass.length == 0 )
node.attributes.removeNamedItem( 'class' ) ;
else
FCKXHtml._AppendAttribute( node, 'class', sClass ) ;
}
FCKXHtml._AppendChildNodes( node, htmlNode, false ) ;
return node ;
}

View File

@ -1,74 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml_gecko.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
* Gecko specific.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKXHtml._GetMainXmlString = function()
{
// Create the XMLSerializer.
var oSerializer = new XMLSerializer() ;
// Return the serialized XML as a string.
// Due to a BUG on Gecko, the special chars sequence "#?-:" must be replaced with "&"
// for the XHTML entities.
return oSerializer.serializeToString( this.MainNode ).replace( FCKRegexLib.GeckoEntitiesMarker, '&' ) ;
}
// There is a BUG on Gecko... createEntityReference returns null.
// So we use a trick to append entities on it.
FCKXHtml._AppendEntity = function( xmlNode, entity )
{
xmlNode.appendChild( this.XML.createTextNode( '#?-:' + entity + ';' ) ) ;
}
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node )
{
var aAttributes = htmlNode.attributes ;
for ( var n = 0 ; n < aAttributes.length ; n++ )
{
var oAttribute = aAttributes[n] ;
if ( oAttribute.specified )
{
var sAttName = oAttribute.nodeName.toLowerCase() ;
var sAttValue ;
// Ignore any attribute starting with "_fck".
if ( sAttName.startsWith( '_fck' ) )
continue ;
// There is a bug in Mozilla that returns '_moz_xxx' attributes as specified.
else if ( sAttName.indexOf( '_moz' ) == 0 )
continue ;
// There are one cases (on Gecko) when the oAttribute.nodeValue must be used:
// - for the "class" attribute
else if ( sAttName == 'class' )
sAttValue = oAttribute.nodeValue ;
// XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
else if ( oAttribute.nodeValue === true )
sAttValue = sAttName ;
else
sAttValue = htmlNode.getAttribute( sAttName, 2 ) ; // We must use getAttribute to get it exactly as it is defined.
if ( FCKConfig.ForceSimpleAmpersand && sAttValue.replace )
sAttValue = sAttValue.replace( /&/g, '___FCKAmp___' ) ;
this._AppendAttribute( node, sAttName, sAttValue ) ;
}
}
}

View File

@ -1,212 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtml_ie.js
* Defines the FCKXHtml object, responsible for the XHTML operations.
* IE specific.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
FCKXHtml._GetMainXmlString = function()
{
return this.MainNode.xml ;
}
FCKXHtml._AppendEntity = function( xmlNode, entity )
{
xmlNode.appendChild( this.XML.createEntityReference( entity ) ) ;
}
FCKXHtml._AppendAttributes = function( xmlNode, htmlNode, node, nodeName )
{
var aAttributes = htmlNode.attributes ;
for ( var n = 0 ; n < aAttributes.length ; n++ )
{
var oAttribute = aAttributes[n] ;
if ( oAttribute.specified )
{
var sAttName = oAttribute.nodeName.toLowerCase() ;
var sAttValue ;
// Ignore any attribute starting with "_fck".
if ( sAttName.startsWith( '_fck' ) )
continue ;
// The following must be done because of a bug on IE regarding the style
// attribute. It returns "null" for the nodeValue.
else if ( sAttName == 'style' )
sAttValue = htmlNode.style.cssText ;
// There are two cases when the oAttribute.nodeValue must be used:
// - for the "class" attribute
// - for events attributes (on IE only).
else if ( sAttName == 'class' || sAttName.indexOf('on') == 0 )
sAttValue = oAttribute.nodeValue ;
else if ( nodeName == 'body' && sAttName == 'contenteditable' )
continue ;
// XHTML doens't support attribute minimization like "CHECKED". It must be trasformed to cheched="checked".
else if ( oAttribute.nodeValue === true )
sAttValue = sAttName ;
// We must use getAttribute to get it exactly as it is defined.
else if ( ! (sAttValue = htmlNode.getAttribute( sAttName, 2 ) ) )
sAttValue = oAttribute.nodeValue ;
if ( FCKConfig.ForceSimpleAmpersand && sAttValue.replace )
sAttValue = sAttValue.replace( /&/g, '___FCKAmp___' ) ;
this._AppendAttribute( node, sAttName, sAttValue ) ;
}
}
}
FCKXHtml.TagProcessors['meta'] = function( node, htmlNode )
{
var oHttpEquiv = node.attributes.getNamedItem( 'http-equiv' ) ;
if ( oHttpEquiv == null || oHttpEquiv.value.length == 0 )
{
// Get the http-equiv value from the outerHTML.
var sHttpEquiv = htmlNode.outerHTML.match( FCKRegexLib.MetaHttpEquiv ) ;
if ( sHttpEquiv )
{
sHttpEquiv = sHttpEquiv[1] ;
FCKXHtml._AppendAttribute( node, 'http-equiv', sHttpEquiv ) ;
}
}
return node ;
}
// IE automaticaly changes <FONT> tags to <FONT size=+0>.
FCKXHtml.TagProcessors['font'] = function( node, htmlNode )
{
if ( node.attributes.length == 0 )
node = FCKXHtml.XML.createDocumentFragment() ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
// IE doens't see the value attribute as an attribute for the <INPUT> tag.
FCKXHtml.TagProcessors['input'] = function( node, htmlNode )
{
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
if ( htmlNode.value && !node.attributes.getNamedItem( 'value' ) )
FCKXHtml._AppendAttribute( node, 'value', htmlNode.value ) ;
return node ;
}
// IE ignores the "SELECTED" attribute so we must add it manually.
FCKXHtml.TagProcessors['option'] = function( node, htmlNode )
{
if ( htmlNode.selected && !node.attributes.getNamedItem( 'selected' ) )
FCKXHtml._AppendAttribute( node, 'selected', 'selected' ) ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
// There is a BUG in IE regarding the ABBR tag (it has no support for it).
FCKXHtml.TagProcessors['abbr'] = function( node, htmlNode )
{
// TODO: The XHTML processor duplicates the ABBR contents because of this
// code. We should find some way to move to the node after the /ABBR in the
// _AppendChildNodes loop.
var oNextNode = htmlNode.nextSibling ;
while ( true )
{
if ( oNextNode && oNextNode.nodeName != '/ABBR' )
{
FCKXHtml._AppendNode( node, oNextNode ) ;
oNextNode = oNextNode.nextSibling ;
}
else
break ;
}
return node ;
}
// IE ignores the "COORDS" and "SHAPE" attribute so we must add it manually.
FCKXHtml.TagProcessors['area'] = function( node, htmlNode )
{
if ( ! node.attributes.getNamedItem( 'coords' ) )
{
var sCoords = htmlNode.getAttribute( 'coords', 2 ) ;
if ( sCoords && sCoords != '0,0,0' )
FCKXHtml._AppendAttribute( node, 'coords', sCoords ) ;
}
if ( ! node.attributes.getNamedItem( 'shape' ) )
{
var sCoords = htmlNode.getAttribute( 'shape', 2 ) ;
if ( sCoords && sCoords.length > 0 )
FCKXHtml._AppendAttribute( node, 'shape', sCoords ) ;
}
return node ;
}
FCKXHtml.TagProcessors['label'] = function( node, htmlNode )
{
if ( htmlNode.htmlFor.length > 0 )
FCKXHtml._AppendAttribute( node, 'for', htmlNode.htmlFor ) ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
FCKXHtml.TagProcessors['form'] = function( node, htmlNode )
{
if ( htmlNode.acceptCharset && htmlNode.acceptCharset.length > 0 && htmlNode.acceptCharset != 'UNKNOWN' )
FCKXHtml._AppendAttribute( node, 'accept-charset', htmlNode.acceptCharset ) ;
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
// IE doens't hold the name attribute as an attribute for the <TEXTAREA> and <SELECT> tags.
FCKXHtml.TagProcessors['textarea'] = FCKXHtml.TagProcessors['select'] = function( node, htmlNode )
{
if ( htmlNode.name )
FCKXHtml._AppendAttribute( node, 'name', htmlNode.name ) ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}
// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list)
FCKXHtml.TagProcessors['div'] = function( node, htmlNode )
{
if ( htmlNode.align.length > 0 )
FCKXHtml._AppendAttribute( node, 'align', htmlNode.align ) ;
FCKXHtml._AppendChildNodes( node, htmlNode ) ;
return node ;
}

View File

@ -1,322 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fckxhtmlentities.js
* This file define the HTML entities handled by the editor.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKXHtmlEntities = new Object() ;
if ( FCKConfig.ProcessHTMLEntities )
{
FCKXHtmlEntities.Entities = {
// Latin-1 Entities
' ':'nbsp',
'¡':'iexcl',
'¢':'cent',
'£':'pound',
'¤':'curren',
'¥':'yen',
'¦':'brvbar',
'§':'sect',
'¨':'uml',
'©':'copy',
'ª':'ordf',
'«':'laquo',
'¬':'not',
'­':'shy',
'®':'reg',
'¯':'macr',
'°':'deg',
'±':'plusmn',
'²':'sup2',
'³':'sup3',
'´':'acute',
'µ':'micro',
'¶':'para',
'·':'middot',
'¸':'cedil',
'¹':'sup1',
'º':'ordm',
'»':'raquo',
'¼':'frac14',
'½':'frac12',
'¾':'frac34',
'¿':'iquest',
'×':'times',
'÷':'divide',
// Symbols and Greek Letters
'ƒ':'fnof',
'•':'bull',
'…':'hellip',
'':'prime',
'″':'Prime',
'‾':'oline',
'':'frasl',
'℘':'weierp',
'':'image',
'':'real',
'™':'trade',
'ℵ':'alefsym',
'←':'larr',
'↑':'uarr',
'→':'rarr',
'↓':'darr',
'↔':'harr',
'↵':'crarr',
'⇐':'lArr',
'⇑':'uArr',
'⇒':'rArr',
'⇓':'dArr',
'⇔':'hArr',
'∀':'forall',
'∂':'part',
'∃':'exist',
'∅':'empty',
'∇':'nabla',
'∈':'isin',
'∉':'notin',
'∋':'ni',
'∏':'prod',
'∑':'sum',
'':'minus',
'':'lowast',
'√':'radic',
'∝':'prop',
'∞':'infin',
'∠':'ang',
'∧':'and',
'':'or',
'∩':'cap',
'':'cup',
'∫':'int',
'∴':'there4',
'':'sim',
'≅':'cong',
'≈':'asymp',
'≠':'ne',
'≡':'equiv',
'≤':'le',
'≥':'ge',
'⊂':'sub',
'⊃':'sup',
'⊄':'nsub',
'⊆':'sube',
'⊇':'supe',
'⊕':'oplus',
'⊗':'otimes',
'⊥':'perp',
'⋅':'sdot',
'◊':'loz',
'♠':'spades',
'♣':'clubs',
'♥':'hearts',
'♦':'diams',
// Other Special Characters
'"':'quot',
// '&':'amp', // This entity is automatically handled by the XHTML parser.
// '<':'lt', // This entity is automatically handled by the XHTML parser.
// '>':'gt', // This entity is automatically handled by the XHTML parser.
'ˆ':'circ',
'˜':'tilde',
'':'ensp',
'':'emsp',
'':'thinsp',
'':'zwnj',
'':'zwj',
'':'lrm',
'':'rlm',
'':'ndash',
'—':'mdash',
'':'lsquo',
'':'rsquo',
'':'sbquo',
'“':'ldquo',
'”':'rdquo',
'„':'bdquo',
'†':'dagger',
'‡':'Dagger',
'‰':'permil',
'':'lsaquo',
'':'rsaquo',
'€':'euro'
} ;
FCKXHtmlEntities.Chars = '' ;
// Process Base Entities.
for ( var e in FCKXHtmlEntities.Entities )
FCKXHtmlEntities.Chars += e ;
// Include Latin Letters Entities.
if ( FCKConfig.IncludeLatinEntities )
{
var oEntities = {
'À':'Agrave',
'Á':'Aacute',
'Â':'Acirc',
'Ã':'Atilde',
'Ä':'Auml',
'Å':'Aring',
'Æ':'AElig',
'Ç':'Ccedil',
'È':'Egrave',
'É':'Eacute',
'Ê':'Ecirc',
'Ë':'Euml',
'Ì':'Igrave',
'Í':'Iacute',
'Î':'Icirc',
'Ï':'Iuml',
'Ð':'ETH',
'Ñ':'Ntilde',
'Ò':'Ograve',
'Ó':'Oacute',
'Ô':'Ocirc',
'Õ':'Otilde',
'Ö':'Ouml',
'Ø':'Oslash',
'Ù':'Ugrave',
'Ú':'Uacute',
'Û':'Ucirc',
'Ü':'Uuml',
'Ý':'Yacute',
'Þ':'THORN',
'ß':'szlig',
'à':'agrave',
'á':'aacute',
'â':'acirc',
'ã':'atilde',
'ä':'auml',
'å':'aring',
'æ':'aelig',
'ç':'ccedil',
'è':'egrave',
'é':'eacute',
'ê':'ecirc',
'ë':'euml',
'ì':'igrave',
'í':'iacute',
'î':'icirc',
'ï':'iuml',
'ð':'eth',
'ñ':'ntilde',
'ò':'ograve',
'ó':'oacute',
'ô':'ocirc',
'õ':'otilde',
'ö':'ouml',
'ø':'oslash',
'ù':'ugrave',
'ú':'uacute',
'û':'ucirc',
'ü':'uuml',
'ý':'yacute',
'þ':'thorn',
'ÿ':'yuml',
'Œ':'OElig',
'œ':'oelig',
'Š':'Scaron',
'š':'scaron',
'Ÿ':'Yuml'
} ;
for ( var e in oEntities )
{
FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
FCKXHtmlEntities.Chars += e ;
}
oEntities = null ;
}
// Include Greek Letters Entities.
if ( FCKConfig.IncludeGreekEntities )
{
var oEntities = {
'Α':'Alpha',
'Β':'Beta',
'Γ':'Gamma',
'Δ':'Delta',
'Ε':'Epsilon',
'Ζ':'Zeta',
'Η':'Eta',
'Θ':'Theta',
'Ι':'Iota',
'Κ':'Kappa',
'Λ':'Lambda',
'Μ':'Mu',
'Ν':'Nu',
'Ξ':'Xi',
'Ο':'Omicron',
'Π':'Pi',
'Ρ':'Rho',
'Σ':'Sigma',
'Τ':'Tau',
'Υ':'Upsilon',
'Φ':'Phi',
'Χ':'Chi',
'Ψ':'Psi',
'Ω':'Omega',
'α':'alpha',
'β':'beta',
'γ':'gamma',
'δ':'delta',
'ε':'epsilon',
'ζ':'zeta',
'η':'eta',
'θ':'theta',
'ι':'iota',
'κ':'kappa',
'λ':'lambda',
'μ':'mu',
'ν':'nu',
'ξ':'xi',
'ο':'omicron',
'π':'pi',
'ρ':'rho',
'ς':'sigmaf',
'σ':'sigma',
'τ':'tau',
'υ':'upsilon',
'φ':'phi',
'χ':'chi',
'ψ':'psi',
'ω':'omega'
} ;
for ( var e in oEntities )
{
FCKXHtmlEntities.Entities[ e ] = oEntities[ e ] ;
FCKXHtmlEntities.Chars += e ;
}
oEntities = null ;
}
// Create and Compile the Regex used to separate the entities from the text.
FCKXHtmlEntities.EntitiesRegex = new RegExp('[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+','g') ;
// FCKXHtmlEntities.EntitiesRegex.compile( '[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+', 'g' ) ;
}
else
{
// Even if we are not processing the entities, we must respect the &nbsp;.
FCKXHtmlEntities.Entities = { ' ':'nbsp' } ;
FCKXHtmlEntities.EntitiesRegex = /[ ]|[^ ]+/g ;
}

View File

@ -1,15 +0,0 @@
<public:component lightweight="true">
<script language="javascript">
function CancelEvent()
{
return false ;
}
this.onresizestart = CancelEvent ;
this.onbeforeeditfocus = CancelEvent ;
</script>
</public:component>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

View File

@ -1,30 +0,0 @@
<public:component lightweight="true">
<public:attach event="oncontentready" onevent="ShowField()" />
<public:attach event="ondoubleclick" onevent="EditField()" />
<script language="javascript">
var bIsHiddenField = this.type == 'hidden' ;
function ShowField()
{
if ( bIsHiddenField )
{
this.runtimeStyle.width = '20px' ;
this.runtimeStyle.height = '20px' ;
this.runtimeStyle.border = '1px dotted #FF0000' ;
this.runtimeStyle.backgroundImage = 'url(css/behaviors/hiddenfield.gif)' ;
this.runtimeStyle.fontSize = '99px' ;
}
}
function EditField()
{
if ( bIsHiddenField )
alert( this.outerHTML ) ;
}
</script>
</public:component>

View File

@ -1,36 +0,0 @@
<public:component lightweight="true">
<public:attach event="oncontentready" onevent="ShowBorders()" />
<public:attach event="onpropertychange" onevent="OnPropertyChange()" />
<script language="javascript">
var oClassRegex = /\s*FCK__ShowTableBorders/ ;
var FCKConfig = window.parent.FCKConfig ;
function ShowBorders()
{
if ( this.border == 0 )
{
if ( !oClassRegex.test( this.className ) )
this.className += ' FCK__ShowTableBorders' ;
}
else
{
if ( oClassRegex.test( this.className ) )
{
this.className = this.className.replace( oClassRegex, '' ) ;
if ( this.className.length == 0 )
this.removeAttribute( 'className', 0 ) ;
}
}
}
function OnPropertyChange()
{
if ( event.propertyName == 'border' || event.propertyName == 'className' )
ShowBorders() ;
}
</script>
</public:component>

View File

@ -1,67 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_editorarea.css
* This is the default CSS file used by the editor area. It defines the
* initial font of the editor and background color.
*
* A user can configure the editor to use another CSS file. Just change
* the value of the FCKConfig.EditorAreaCSS key in the configuration
* file.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
body
{
font-family: Arial, Verdana, Sans-Serif;
font-size: 12px;
padding: 5px 5px 5px 5px;
margin: 0px;
border-style: none;
background-color: #ffffff;
}
/*
Just uncomment the following block if you want to avoid spaces between
paragraphs. Remember to apply the same style in your output front end page.
*/
/*
P, UL, LI
{
margin-top: 0px;
margin-bottom: 0px;
}
*/
.Bold
{
font-weight: bold;
}
.Title
{
font-weight: bold;
font-size: 18px;
color: #cc3300;
}
.Code
{
border: #8b4513 1px solid;
padding-right: 5px;
padding-left: 5px;
color: #000066;
font-family: 'Courier New' , Monospace;
background-color: #ff9933;
}

View File

@ -1,80 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_internal.css
* This CSS Style Sheet defines rules used by the editor for its internal use.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
TABLE.FCK__ShowTableBorders, TABLE.FCK__ShowTableBorders TD, TABLE.FCK__ShowTableBorders TH
{
border: #d3d3d3 1px solid;
}
FORM
{
border: 1px dotted #FF0000;
padding: 2px;
}
.FCK__Flash
{
border: darkgray 1px solid;
background-position: center center;
background-image: url(images/fck_flashlogo.gif);
background-repeat: no-repeat;
width: 80px;
height: 80px;
}
.FCK__Anchor
{
background-position: center center;
background-image: url(images/fck_anchor.gif);
background-repeat: no-repeat;
width: 16px;
height: 15px;
}
.FCK__PageBreak
{
background-position: center center;
background-image: url(images/fck_pagebreak.gif);
background-repeat: no-repeat;
clear: both;
display: block;
float: none;
width: 100%;
border-top: #999999 1px dotted;
border-bottom: #999999 1px dotted;
border-right: 0px;
border-left: 0px;
height: 5px;
}
input[type="hidden"]
{
display: inline;
width:20px;
height:20px;
border:1px dotted #FF0000 ;
background-image: url(behaviors/hiddenfield.gif);
background-repeat: no-repeat;
}
input[type="hidden"]:after
{
padding-left: 20px;
content: "" ;
}

View File

@ -1,31 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_showtableborders_gecko.css
* This CSS Style Sheet defines the rules to show table borders on Gecko.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
TABLE[border="0"],
TABLE[border="0"] > TR > TD, TABLE[border="0"] > TR > TH,
TABLE[border="0"] > TBODY > TR > TD, TABLE[border="0"] > TBODY > TR > TH,
TABLE[border="0"] > THEAD > TR > TD, TABLE[border="0"] > THEAD > TR > TH,
TABLE[border="0"] > TFOOT > TR > TD, TABLE[border="0"] > TFOOT > TR > TH,
TABLE:not([border]),
TABLE:not([border]) > TR > TD, TABLE:not([border]) > TR > TH,
TABLE:not([border]) > TBODY > TR > TD, TABLE:not([border]) > TBODY > TR > TH,
TABLE:not([border]) > THEAD > TR > TD, TABLE:not([border]) > THEAD > TR > TH,
TABLE:not([border]) > TFOOT > TR > TD, TABLE:not([border]) > TFOOT > TR > TH
{
border: #d3d3d3 1px dotted ;
}

View File

@ -1,122 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbaritems.js
* Toolbar items definitions.
*
* 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, true ) ; break ;
case 'DocProps' : oItem = new FCKToolbarButton( 'DocProps' , FCKLang.DocProps ) ; break ;
case 'Templates' : oItem = new FCKToolbarButton( 'Templates' , FCKLang.Templates ) ; 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, null, null, true ) ; break ;
case 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, false, true ) ; break ;
case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, false, true ) ; break ;
case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, false, true ) ; break ;
case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText, null, null, false, true ) ; break ;
case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord, null, null, false, true ) ; break ;
case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, false, true ) ; break ;
case 'SpellCheck' : oItem = new FCKToolbarButton( 'SpellCheck', FCKLang.SpellCheck ) ; break ;
case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, false, true ) ; break ;
case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, false, true ) ; break ;
case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll ) ; break ;
case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat, null, null, false, true ) ; break ;
case 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, false, true ) ; break ;
case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, false, true ) ; break ;
case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, false, true ) ; break ;
case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, false, true ) ; break ;
case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript, null, null, false, true ) ; break ;
case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript, null, null, false, true ) ; break ;
case 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList, null, false, true ) ; break ;
case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true ) ; break ;
case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true ) ; break ;
case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true ) ; break ;
case 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true ) ; break ;
case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true ) ; break ;
case 'Anchor' : oItem = new FCKToolbarButton( 'Anchor' , FCKLang.Anchor ) ; break ;
case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage ) ; break ;
case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash ) ; 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 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak ) ; break ;
case 'UniversalKey' : oItem = new FCKToolbarButton( 'UniversalKey' , FCKLang.UniversalKeyboard ) ; break ;
case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true ) ; break ;
case 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify, null, null, false, true ) ; break ;
case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify, null, null, false, true ) ; break ;
case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify, null, null, false, true ) ; break ;
case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify, null, null, false, true ) ; 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 ;
case 'Form' : oItem = new FCKToolbarButton( 'Form' , FCKLang.Form ) ; break ;
case 'Checkbox' : oItem = new FCKToolbarButton( 'Checkbox' , FCKLang.Checkbox ) ; break ;
case 'Radio' : oItem = new FCKToolbarButton( 'Radio' , FCKLang.RadioButton ) ; break ;
case 'TextField' : oItem = new FCKToolbarButton( 'TextField' , FCKLang.TextField ) ; break ;
case 'Textarea' : oItem = new FCKToolbarButton( 'Textarea' , FCKLang.Textarea ) ; break ;
case 'HiddenField' : oItem = new FCKToolbarButton( 'HiddenField' , FCKLang.HiddenField ) ; break ;
case 'Button' : oItem = new FCKToolbarButton( 'Button' , FCKLang.Button ) ; break ;
case 'Select' : oItem = new FCKToolbarButton( 'Select' , FCKLang.SelectionField ) ; break ;
case 'ImageButton' : oItem = new FCKToolbarButton( 'ImageButton' , FCKLang.ImageButton ) ; break ;
default:
alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
return null ;
}
// to enable the toolbar switch, we have to stop to cache the toolbar items
// Please note, that we still need FCKToolbarItems.LoadedItems, to register
// plug in buttons there. But be aware, that plug in buttons can not be
// shared between different Toolbars!!! It will be better, to think about
// a button factory register instead of this.
// FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
return oItem ;
}

View File

@ -1,292 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fcktoolbarset.js
* Defines the FCKToolbarSet object that is used to load and draw the
* toolbar.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
var FCKToolbarSet = FCK.ToolbarSet = new Object() ;
// A map of toolbar sets, key is the name, value is the state of the toolbar set.
// It is used to save and restore states, when the toolbars are switched.
FCKToolbarSet.LoadedSets = new Object();
document.getElementById( 'ExpandHandle' ).title = FCKLang.ToolbarExpand ;
document.getElementById( 'CollapseHandle' ).title = FCKLang.ToolbarCollapse ;
FCKToolbarSet.Toolbars = new Array() ;
// Array of toolbat items that are active only on WYSIWYG mode.
FCKToolbarSet.ItemsWysiwygOnly = new Array() ;
// Array of toolbar items that are sensitive to the cursor position.
FCKToolbarSet.ItemsContextSensitive = 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' ).style.display = 'none' ;
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.Restart = function()
{
if ( !FCKConfig.ToolbarCanCollapse || FCKConfig.ToolbarStartExpanded )
this.Expand() ;
else
this.Collapse() ;
document.getElementById( 'CollapseHandle' ).style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
}
FCKToolbarSet.Load = function( toolbarSetName )
{
this.DOMElement = document.getElementById( 'eToolbar' ) ;
// first, save the current state, if any
this.SaveCurrentState();
// try to restore a saved state (if it has been already loaded)
if (this.RestoreState(toolbarSetName)) {
// the toolbar set is completely restored...
return;
}
// we have to create a new toolbar set
this.ToolbarSetName = toolbarSetName;
this.ItemsWysiwygOnly = new Array();
this.ItemsContextSensitive = new Array() ;
var ToolbarSet = FCKConfig.ToolbarSets[toolbarSetName] ;
if (! ToolbarSet)
{
alert( FCKLang.UnknownToolbarSet.replace( /%1/g, toolbarSetName ) ) ;
return ;
}
this.Toolbars = new Array() ;
for ( var x = 0 ; x < ToolbarSet.length ; x++ )
{
var oToolbarItems = ToolbarSet[x] ;
var oToolbar ;
if ( typeof( oToolbarItems ) == 'string' )
{
if ( oToolbarItems == '/' )
oToolbar = new FCKToolbarBreak() ;
}
else
{
oToolbar = new FCKToolbar() ;
for ( var j = 0 ; j < oToolbarItems.length ; j++ )
{
var sItem = oToolbarItems[j] ;
if ( sItem == '-')
oToolbar.AddSeparator() ;
else
{
var oItem = FCKToolbarItems.GetItem( sItem ) ;
if ( oItem )
{
oToolbar.AddItem( oItem ) ;
if ( !oItem.SourceView )
this.ItemsWysiwygOnly[this.ItemsWysiwygOnly.length] = oItem ;
if ( oItem.ContextSensitive )
this.ItemsContextSensitive[this.ItemsContextSensitive.length] = oItem ;
}
}
}
oToolbar.AddTerminator() ;
}
this.Toolbars[ this.Toolbars.length ] = oToolbar ;
}
FCKToolbarSet.EnableItems();
}
FCKToolbarSet.RefreshModeState = function()
{
if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG )
{
// Enable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < FCKToolbarSet.ItemsWysiwygOnly.length ; i++ )
FCKToolbarSet.ItemsWysiwygOnly[i].Enable() ;
// Refresh the buttons state.
FCKToolbarSet.RefreshItemsState() ;
}
else
{
// Refresh the buttons state.
FCKToolbarSet.RefreshItemsState() ;
// Disable all buttons that are available on WYSIWYG mode only.
for ( var i = 0 ; i < FCKToolbarSet.ItemsWysiwygOnly.length ; i++ )
FCKToolbarSet.ItemsWysiwygOnly[i].Disable() ;
}
}
FCKToolbarSet.RefreshItemsState = function()
{
for ( var i = 0 ; i < FCKToolbarSet.ItemsContextSensitive.length ; i++ )
FCKToolbarSet.ItemsContextSensitive[i].RefreshState() ;
/*
TODO: Delete this commented block on stable version.
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
oToolbar.Items[j].RefreshState() ;
}
}
*/
}
// Saves the current toolbar set (if any)
FCKToolbarSet.SaveCurrentState = function()
{
// Do we have a current toolbar?
if (this.ToolbarSetName) {
FCKToolbarSet.DisableItems();
if (!this.LoadedSets[this.ToolbarSetName]) {
// Save some toolbar set properties, this can be done only once..
this.LoadedSets[this.ToolbarSetName] = new Object();
this.LoadedSets[this.ToolbarSetName].Toolbars = this.Toolbars;
this.LoadedSets[this.ToolbarSetName].ItemsWysiwygOnly = this.ItemsWysiwygOnly;
this.LoadedSets[this.ToolbarSetName].ItemsContextSensitive = this.ItemsContextSensitive;
}
// move all its elements to a hidden div.
var oHiddenToolbarsDiv = document.getElementById('hiddenToolbars_' + this.ToolbarSetName);
if (!oHiddenToolbarsDiv) {
// create a hidden div with the name of the toolbarset..
oHiddenToolbarsDiv = document.createElement('DIV');
oHiddenToolbarsDiv.id = 'hiddenToolbars_' + this.ToolbarSetName;
// NOTE: We need a hidden div, because some elements should be deinitialized, when the editor is unloaded.
var oHiddenDiv = document.getElementById('hiddenDiv');
if (!oHiddenDiv) {
oHiddenDiv = document.createElement('DIV');
oHiddenDiv.style.display = 'none';
oHiddenDiv.style.visibility = 'hidden';
oHiddenDiv.id = 'hiddenDiv';
document.body.appendChild(oHiddenDiv);
}
oHiddenDiv.appendChild(oHiddenToolbarsDiv);
}
var f = true;
var e = this.DOMElement.firstChild;
while (e) {
var oElementToMove = e;
e = e.nextSibling;
this.DOMElement.removeChild(oElementToMove);
oHiddenToolbarsDiv.appendChild(oElementToMove);
}
}
}
// Try to restore one (if it has been already saved),
// returns true, if the restoration was succesfull else and false
FCKToolbarSet.RestoreState = function( toolbarSetName )
{
// Do we have a saved state?
if (this.LoadedSets[toolbarSetName]) {
this.ToolbarSetName = toolbarSetName;
// than simply restore it'state
this.Toolbars = this.LoadedSets[toolbarSetName].Toolbars;
this.ItemsWysiwygOnly = this.LoadedSets[toolbarSetName].ItemsWysiwygOnly;
this.ItemsContextSensitive = this.LoadedSets[toolbarSetName].ItemsContextSensitive;
//
var oHiddenToolbarsDiv = document.getElementById('hiddenToolbars_' + toolbarSetName);
var e = oHiddenToolbarsDiv.firstChild;
while (e) {
var oElementToMove = e;
e = e.nextSibling;
// oHiddenToolbarsDiv.removeChild(oElementToMove);
this.DOMElement.appendChild(oElementToMove);
}
// refresh its state...
FCKToolbarSet.EnableItems();
FCKToolbarSet.Restart();
// that's all
return true;
}
return false;
}
FCKToolbarSet.EnableItems = function()
{
FCK.Focus();
window.setTimeout('FCKToolbarSet.DoEnableItems();', 100);
}
FCKToolbarSet.DoEnableItems = function()
{
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
if (oToolbar && oToolbar.Items) {
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
oToolbar.Items[j].RefreshState() ;
}
}
}
}
FCKToolbarSet.DisableItems = function()
{
for ( var i = 0 ; i < FCKToolbarSet.Toolbars.length ; i++ )
{
var oToolbar = FCKToolbarSet.Toolbars[i] ;
if (oToolbar && oToolbar.Items) {
for ( var j = 0 ; j < oToolbar.Items.length ; j++ )
{
if (oToolbar.Items[j].Disable) {
oToolbar.Items[j].Disable() ;
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 B

View File

@ -1,79 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog_common.css
* This is the CSS file used for interface details in some dialog
* windows.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
.ImagePreviewArea
{
border: #000000 1px solid;
overflow: auto;
width: 100%;
height: 170px;
background-color: #ffffff;
}
.FlashPreviewArea
{
border: #000000 1px solid;
padding: 5px;
overflow: auto;
width: 100%;
height: 170px;
background-color: #ffffff;
}
.BtnReset
{
float: left;
background-position: center center;
background-image: url(images/reset.gif);
width: 16px;
height: 16px;
background-repeat: no-repeat;
border: 1px none;
font-size: 1px ;
}
.BtnLocked, .BtnUnlocked
{
float: left;
background-position: center center;
background-image: url(images/locked.gif);
width: 16px;
height: 16px;
background-repeat: no-repeat;
border: 1px none;
font-size: 1px ;
}
.BtnUnlocked
{
background-image: url(images/unlocked.gif);
}
.BtnOver
{
border: 1px outset;
cursor: pointer;
cursor: hand;
}
.FCK__FieldNumeric
{
behavior: url(common/fcknumericfield.htc) ;
}

View File

@ -1,125 +0,0 @@
/*
* FCKeditor - The text editor for internet
* Copyright (C) 2003-2005 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/
*
* "Support Open Source software. What about a donation today?"
*
* File Name: fck_dialog_common.js
* Useful functions used by almost all dialog window pages.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
// Gets a element by its Id. Used for shorter coding.
function GetE( elementId )
{
return document.getElementById( elementId ) ;
}
function ShowE( element, isVisible )
{
if ( typeof( element ) == 'string' )
element = GetE( element ) ;
element.style.display = isVisible ? '' : 'none' ;
}
function SetAttribute( element, attName, attValue )
{
if ( attValue == null || attValue.length == 0 )
element.removeAttribute( attName, 0 ) ; // 0 : Case Insensitive
else
element.setAttribute( attName, attValue, 0 ) ; // 0 : Case Insensitive
}
function GetAttribute( element, attName, valueIfNull )
{
var oAtt = element.attributes[attName] ;
if ( oAtt == null || !oAtt.specified )
return valueIfNull ? valueIfNull : '' ;
var oValue ;
if ( !( oValue = element.getAttribute( attName, 2 ) ) )
oValue = oAtt.nodeValue ;
return ( oValue == null ? valueIfNull : oValue ) ;
}
// Functions used by text fiels to accept numbers only.
function IsDigit( e )
{
e = e || event ;
var iCode = ( e.keyCode || e.charCode ) ;
event.returnValue =
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
return event.returnValue ;
}
String.prototype.trim = function()
{
return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
}
String.prototype.startsWith = function( value )
{
return ( this.substr( 0, value.length ) == 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 ;
}
function OpenFileBrowser( url, width, height )
{
// oEditor must be defined.
var iLeft = ( oEditor.FCKConfig.ScreenWidth - width ) / 2 ;
var iTop = ( oEditor.FCKConfig.ScreenHeight - height ) / 2 ;
var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ;
sOptions += ",width=" + width ;
sOptions += ",height=" + height ;
sOptions += ",left=" + iLeft ;
sOptions += ",top=" + iTop ;
// The "PreserveSessionOnFileBrowser" because the above code could be
// blocked by popup blockers.
if ( oEditor.FCKConfig.PreserveSessionOnFileBrowser && oEditor.FCKBrowserInfo.IsIE )
{
// The following change has been made otherwise IE will open the file
// browser on a different server session (on some cases):
// http://support.microsoft.com/default.aspx?scid=kb;en-us;831678
// by Simone Chiaretta.
var oWindow = oEditor.window.open( url, 'FCKBrowseWindow', sOptions ) ;
if ( oWindow )
oWindow.opener = window ;
else
alert( oEditor.FCKLang.BrowseServerBlocked ) ;
}
else
window.open( url, 'FCKBrowseWindow', sOptions ) ;
}

View File

@ -1,24 +0,0 @@
<public:component lightweight="true">
<script language="javascript">
function CheckIsDigit()
{
var iCode = event.keyCode ;
event.returnValue =
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
return event.returnValue ;
}
this.onkeypress = CheckIsDigit ;
</script>
</public:component>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 B

View File

@ -1,28 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<bindings xmlns="http://www.mozilla.org/xbl">
<binding id="numericfield">
<implementation>
<constructor>
this.keypress = CheckIsDigit ;
</constructor>
<method name="CheckIsDigit">
<body>
var iCode = keyCode ;
var bAccepted =
(
( iCode >= 48 && iCode <= 57 ) // Numbers
|| (iCode >= 37 && iCode <= 40) // Arrows
|| iCode == 8 // Backspace
|| iCode == 46 // Delete
) ;
return bAccepted ;
</body>
</method>
</implementation>
<events>
<event type="keypress" value="CheckIsDigit()" />
</events>
</binding>
</bindings>

Some files were not shown because too many files have changed in this diff Show More