Index: lams_central/web/fckeditor/fckconfig.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/Attic/fckconfig.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/fckconfig.js 11 Aug 2005 06:26:06 -0000 1.1
@@ -0,0 +1,148 @@
+/*
+ * 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: fckconfig.js
+ * Editor configuration settings.
+ * See the documentation for more info.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+FCKConfig.CustomConfigurationsPath = '' ;
+
+FCKConfig.EditorAreaCSS = FCKConfig.BasePath + 'css/fck_editorarea.css' ;
+
+FCKConfig.DocType = '' ;
+
+FCKConfig.BaseHref = '' ;
+
+FCKConfig.FullPage = false ;
+
+FCKConfig.Debug = false ;
+
+FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;
+
+FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;
+
+// FCKConfig.Plugins.Add( 'placeholder', 'en,it' ) ;
+
+FCKConfig.AutoDetectLanguage = true ;
+FCKConfig.DefaultLanguage = 'en' ;
+FCKConfig.ContentLangDirection = 'ltr' ;
+
+FCKConfig.EnableXHTML = true ;
+FCKConfig.EnableSourceXHTML = true ;
+
+FCKConfig.ProcessHTMLEntities = true ;
+FCKConfig.IncludeLatinEntities = true ;
+FCKConfig.IncludeGreekEntities = true ;
+
+FCKConfig.FillEmptyBlocks = true ;
+
+FCKConfig.FormatSource = true ;
+FCKConfig.FormatOutput = true ;
+FCKConfig.FormatIndentator = ' ' ;
+
+FCKConfig.GeckoUseSPAN = true ;
+FCKConfig.StartupFocus = false ;
+FCKConfig.ForcePasteAsPlainText = false ;
+FCKConfig.ForceSimpleAmpersand = false ;
+FCKConfig.TabSpaces = 0 ;
+FCKConfig.ShowBorders = true ;
+FCKConfig.UseBROnCarriageReturn = false ;
+FCKConfig.ToolbarStartExpanded = false ;
+FCKConfig.ToolbarCanCollapse = true ;
+
+FCKConfig.ToolbarSets["Default_original"] = [
+ ['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
+ ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
+ ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
+ ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
+ ['OrderedList','UnorderedList','-','Outdent','Indent'],
+ ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
+ ['Link','Unlink','Anchor'],
+ ['Image','Table','Rule','Smiley','SpecialChar','UniversalKey'],
+ ['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
+ '/',
+ ['Style','FontFormat','FontName','FontSize'],
+ ['TextColor','BGColor'],
+ ['About']
+] ;
+
+FCKConfig.ToolbarSets["Basic"] = [
+ ['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About']
+] ;
+
+FCKConfig.ToolbarSets["Default"] = [
+ ['Source','-','NewPage','Preview','-','Templates'],
+ ['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
+ ['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
+ ['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
+ ['OrderedList','UnorderedList','-','Outdent','Indent'],
+ ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
+ ['TextColor','BGColor'],
+ ['Style','FontFormat','FontName','FontSize']
+] ;
+
+FCKConfig.ContextMenu = ['Generic','Link','Anchor','Image','Select','Textarea','Checkbox','Radio','TextField','HiddenField','ImageButton','Button','BulletedList','NumberedList','TableCell','Table','Form'] ;
+
+FCKConfig.FontColors = '000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,808080,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF' ;
+
+FCKConfig.FontNames = 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana' ;
+FCKConfig.FontSizes = '1/xx-small;2/x-small;3/small;4/medium;5/large;6/x-large;7/xx-large' ;
+FCKConfig.FontFormats = 'p;div;pre;address;h1;h2;h3;h4;h5;h6' ;
+
+FCKConfig.StylesXmlPath = FCKConfig.EditorPath + 'fckstyles.xml' ;
+FCKConfig.TemplatesXmlPath = FCKConfig.EditorPath + 'fcktemplates.xml' ;
+
+FCKConfig.SpellChecker = 'ieSpell' ; // 'ieSpell' | 'SpellerPages'
+FCKConfig.IeSpellDownloadUrl = 'http://www.iespell.com/rel/ieSpellSetup211325.exe' ;
+
+FCKConfig.MaxUndoLevels = 15 ;
+
+FCKConfig.LinkDlgHideTarget = false ;
+FCKConfig.LinkDlgHideAdvanced = false ;
+
+FCKConfig.ImageDlgHideLink = false ;
+FCKConfig.ImageDlgHideAdvanced = false ;
+
+FCKConfig.LinkBrowser = true ;
+FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;
+
+//FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp' ;
+//FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/asp/connector.asp&ServerPath=/CustomFiles/' ;
+// ASP.Net // FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/aspx/connector.aspx' ;
+// ColdFusion // FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/cfm/connector.cfm' ;
+// Perl // FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/perl/connector.cgi' ;
+// PHP // FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Connector=connectors/php/connector.php' ;
+// PHP - mcpuk // FCKConfig.LinkBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?Connector=connectors/php/connector.php' ;
+FCKConfig.LinkBrowserWindowWidth = screen.width * 0.7 ; // 70%
+FCKConfig.LinkBrowserWindowHeight = screen.height * 0.7 ; // 70%
+
+FCKConfig.ImageBrowser = true ;
+//FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/asp/connector.asp' ;
+//JSP
+FCKConfig.imageBrowserURL= FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector';
+
+
+// ASP.Net // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/aspx/connector.aspx' ;
+// ColdFusion // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/cfm/connector.cfm' ;
+// Perl // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/perl/connector.cgi' ;
+// PHP // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/default/browser.html?Type=Image&Connector=connectors/php/connector.php' ;
+// PHP - mcpuk // FCKConfig.ImageBrowserURL = FCKConfig.BasePath + 'filemanager/browser/mcpuk/browser.html?Type=Image&Connector=connectors/php/connector.php' ;
+FCKConfig.ImageBrowserWindowWidth = screen.width * 0.7 ; // 70% ;
+FCKConfig.ImageBrowserWindowHeight = screen.height * 0.7 ; // 70% ;
+
+FCKConfig.SmileyPath = FCKConfig.BasePath + 'images/smiley/msn/' ;
+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'] ;
+FCKConfig.SmileyColumns = 8 ;
+FCKConfig.SmileyWindowWidth = 320 ;
+FCKConfig.SmileyWindowHeight = 240 ;
\ No newline at end of file
Index: lams_central/web/fckeditor/fckeditor.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/Attic/fckeditor.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/fckeditor.js 11 Aug 2005 06:26:06 -0000 1.1
@@ -0,0 +1,167 @@
+/*
+ * 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: fckeditor.js
+ * This is the integration file for JavaScript.
+ *
+ * It defines the FCKeditor class that can be used to create editor
+ * instances in a HTML page in the client side. For server side
+ * operations, use the specific integration system.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+// FCKeditor Class
+var FCKeditor = function( instanceName, width, height, toolbarSet, value )
+{
+ // Properties
+ this.InstanceName = instanceName ;
+ this.Width = width || '100%' ;
+ this.Height = height || '200' ;
+ this.ToolbarSet = toolbarSet || 'Default' ;
+ this.Value = value || '' ;
+ this.BasePath = '/fckeditor/' ;
+ this.CheckBrowser = true ;
+ this.DisplayErrors = true ;
+
+ this.Config = new Object() ;
+
+ // Events
+ this.OnError = null ; // function( source, errorNumber, errorDescription )
+}
+
+FCKeditor.prototype.Create = function()
+{
+ // Check for errors
+ if ( !this.InstanceName || this.InstanceName.length == 0 )
+ {
+ this._ThrowError( 701, 'You must specify a instance name.' ) ;
+ return ;
+ }
+
+ document.write( '
' ) ;
+
+ if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
+ {
+ document.write( ' ' ) ;
+ document.write( this._GetConfigHtml() ) ;
+ document.write( this._GetIFrameHtml() ) ;
+ }
+ else
+ {
+ var sWidth = this.Width.toString().indexOf('%') > 0 ? this.Width : this.Width + 'px' ;
+ var sHeight = this.Height.toString().indexOf('%') > 0 ? this.Height : this.Height + 'px' ;
+ document.write('
' ) ;
+}
+
+FCKeditor.prototype.ReplaceTextarea = function()
+{
+ if ( !this.CheckBrowser || this._IsCompatibleBrowser() )
+ {
+ var oTextarea = document.getElementById( this.InstanceName ) ;
+
+ if ( !oTextarea )
+ oTextarea = document.getElementsByName( this.InstanceName )[0] ;
+
+ if ( !oTextarea || oTextarea.tagName != 'TEXTAREA' )
+ {
+ alert( 'Error: The TEXTAREA id "' + this.InstanceName + '" was not found' ) ;
+ return ;
+ }
+
+ oTextarea.style.display = 'none' ;
+ this._InsertHtmlBefore( this._GetConfigHtml(), oTextarea ) ;
+ this._InsertHtmlBefore( this._GetIFrameHtml(), oTextarea ) ;
+ }
+}
+
+FCKeditor.prototype._InsertHtmlBefore = function( html, element )
+{
+ if ( element.insertAdjacentHTML ) // IE
+ element.insertAdjacentHTML( 'beforeBegin', html ) ;
+ else // Gecko
+ {
+ var oRange = document.createRange() ;
+ oRange.setStartBefore( element ) ;
+ var oFragment = oRange.createContextualFragment( html );
+ element.parentNode.insertBefore( oFragment, element ) ;
+ }
+}
+
+FCKeditor.prototype._GetConfigHtml = function()
+{
+ var sConfig = '' ;
+ for ( var o in this.Config )
+ {
+ if ( sConfig.length > 0 ) sConfig += '&' ;
+ sConfig += escape(o) + '=' + escape( this.Config[o] ) ;
+ }
+
+ return ' ' ;
+}
+
+FCKeditor.prototype._GetIFrameHtml = function()
+{
+ var sLink = this.BasePath + 'editor/fckeditor.html?InstanceName=' + this.InstanceName ;
+ if (this.ToolbarSet) sLink += '&Toolbar=' + this.ToolbarSet ;
+
+ return '' ;
+}
+
+FCKeditor.prototype._IsCompatibleBrowser = function()
+{
+ var sAgent = navigator.userAgent.toLowerCase() ;
+
+ // Internet Explorer
+ if ( sAgent.indexOf("msie") != -1 && sAgent.indexOf("mac") == -1 && sAgent.indexOf("opera") == -1 )
+ {
+ var sBrowserVersion = navigator.appVersion.match(/MSIE (.\..)/)[1] ;
+ return ( sBrowserVersion >= 5.5 ) ;
+ }
+ // Gecko
+ else if ( navigator.product == "Gecko" && navigator.productSub >= 20030210 )
+ return true ;
+ else
+ return false ;
+}
+
+FCKeditor.prototype._ThrowError = function( errorNumber, errorDescription )
+{
+ this.ErrorNumber = errorNumber ;
+ this.ErrorDescription = errorDescription ;
+
+ if ( this.DisplayErrors )
+ {
+ document.write( '' ) ;
+ document.write( '[ FCKeditor Error ' + this.ErrorNumber + ': ' + this.ErrorDescription + ' ]' ) ;
+ document.write( '
' ) ;
+ }
+
+ if ( typeof( this.OnError ) == 'function' )
+ this.OnError( this, errorNumber, errorDescription ) ;
+}
+
+FCKeditor.prototype._HTMLEncode = function( text )
+{
+ if ( typeof( text ) != "string" )
+ text = text.toString() ;
+
+ text = text.replace(/&/g, "&") ;
+ text = text.replace(/"/g, """) ;
+ text = text.replace(//g, ">") ;
+ text = text.replace(/'/g, "'") ;
+
+ return text ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/fckstyles.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/Attic/fckstyles.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/fckstyles.xml 11 Aug 2005 06:26:06 -0000 1.1
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_central/web/fckeditor/fcktemplates.xml
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/Attic/fcktemplates.xml,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/fcktemplates.xml 11 Aug 2005 06:26:06 -0000 1.1
@@ -0,0 +1,78 @@
+
+
+
+ One main image with a title and text that surround the image.
+
+
+ Type the title here
+ Type the text here
+ ]]>
+
+
+
+ A template that defines two colums, each one with a title, and some text.
+
+
+
+
+
+ Title 1
+
+
+
+ Title 2
+
+
+
+ Text 1
+
+ Text 2
+
+
+
+ More text goes here.
+ ]]>
+
+
+
+ A title with some text and a table.
+
+
+ Title goes here
+
+
+
+
+ Table title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Type the text here
+
+ ]]>
+
+
+
Index: lams_central/web/fckeditor/editor/fckblank.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckblank.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/fckblank.html 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/fckdebug.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckdebug.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/fckdebug.html 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,106 @@
+
+
+
+
+
+ FCKeditor Debug Window
+
+
+
+
+
+
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/fckdialog.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckdialog.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/fckdialog.html 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,306 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/fckeditor.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckeditor.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/fckeditor.html 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,56 @@
+
+
+
+
+ FCKeditor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_central/web/fckeditor/editor/fckeditor.original.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckeditor.original.html,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/fckeditor.original.html 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,73 @@
+
+
+
+
+ FCKeditor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Index: lams_central/web/fckeditor/editor/_source/classes/fckcontextmenugroup.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckcontextmenugroup.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckcontextmenugroup.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,69 @@
+/*
+ * 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: 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 elements that represent the item in a table (usually the rendered context menu).
+FCKContextMenuGroup.prototype.CreateTableRows = function( table )
+{
+ for ( var i = 0 ; i < this.Items.length ; i++ )
+ {
+ this.Items[i].CreateTableRow( table ) ;
+ }
+}
+
+FCKContextMenuGroup.prototype.SetVisible = function( isVisible )
+{
+ for ( var i = 0 ; i < this.Items.length ; i++ )
+ {
+ this.Items[i].SetVisible( isVisible ) ;
+ }
+
+ this.IsVisible = isVisible ;
+}
+
+FCKContextMenuGroup.prototype.RefreshState = function()
+{
+ if ( ! this.IsVisible ) return ;
+
+ for ( var i = 0 ; i < this.Items.length ; i++ )
+ {
+ this.Items[i].RefreshState() ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuitem.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckcontextmenuitem.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuitem.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,102 @@
+/*
+ * 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: 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 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 = ' ' ;
+
+ oCell = this._Row.insertCell(-1) ;
+ oCell.className = 'CM_Label' ;
+ oCell.unselectable = 'on' ;
+ oCell.noWrap = true ;
+ oCell.innerHTML = this.Label ;
+}
+
+FCKContextMenuItem.prototype.SetVisible = function( isVisible )
+{
+ this._Row.style.display = isVisible ? '' : 'none' ;
+}
+
+FCKContextMenuItem.prototype.RefreshState = function()
+{
+ switch ( this.Command.GetState() )
+ {
+ case FCK_TRISTATE_ON :
+ case FCK_TRISTATE_OFF :
+ this._Row.className = 'CM_Option' ;
+ break ;
+ default :
+ this._Row.className = 'CM_Disabled' ;
+ break ;
+ }
+}
+
+/*
+Sample output.
+-----------------------------------------
+
+
+ Cut
+
+-----------------------------------------
+
+
+ Do Something
+
+*/
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuseparator.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckcontextmenuseparator.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuseparator.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,53 @@
+/*
+ * 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: 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 element.
+ this._Row = targetTable.insertRow(-1) ;
+ this._Row.className = 'CM_Separator' ;
+
+ var oCell = this._Row.insertCell(-1) ;
+ oCell.className = 'CM_Icon' ;
+
+ oCell = this._Row.insertCell(-1) ;
+ oCell.className = 'CM_Label' ;
+ oCell.innerHTML = '
' ;
+}
+
+FCKContextMenuSeparator.prototype.SetVisible = function( isVisible )
+{
+ this._Row.style.display = isVisible ? '' : 'none' ;
+}
+
+FCKContextMenuSeparator.prototype.RefreshState = function()
+{
+ // Do nothing... its state doesn't change.
+}
+
+/*
+Sample output.
+-----------------------------------------
+
+
+
+
+*/
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckevents.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckevents.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckevents.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,48 @@
+/*
+ * 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: 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 ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckpanel_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckpanel_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckpanel_gecko.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,202 @@
+/*
+ * 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: 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 )
+{
+ if ( parentWindow )
+ this.Window = parentWindow ;
+ else
+ {
+ this.Window = window ;
+
+ while ( this.Window != window.top )
+ {
+ // Try/Catch must be used to avoit an error when using a frameset
+ // on a different domain:
+ // "Permission denied to get property HTMLDocument.Body".
+ try
+ {
+ if ( this.Window.parent.document.body.tagName == 'FRAMESET' )
+ break ;
+ }
+ catch (e)
+ {
+ break ;
+ }
+
+ this.Window = this.Window.parent ;
+ }
+ }
+}
+
+FCKPanel.prototype.Create = function()
+{
+ this._IFrame = this.Window.document.body.appendChild( this.Window.document.createElement('iframe') ) ;
+ this._IFrame.src = 'about:blank' ;
+ this._IFrame.frameBorder = '0';
+ this._IFrame.scrolling = 'no' ;
+ this._IFrame.style.left = '0px' ;
+ this._IFrame.style.top = '0px' ;
+ this._IFrame.width = 10 ;
+ this._IFrame.height = 10 ;
+ this._IFrame.style.position = 'absolute';
+ this._IFrame.style.visibility = 'hidden' ;
+
+ this._IFrame.IsFCKPanel = true ;
+ this._IFrame.Panel = this ;
+
+ this.Document = this._IFrame.contentWindow.document ;
+
+ // Initialize the IFRAME document body.
+ this.Document.open() ;
+ this.Document.write( '<\/body><\/html>' ) ;
+ this.Document.close() ;
+
+ // Remove the default margins.
+ this.Document.body.style.margin = this.Document.body.style.padding = '0px' ;
+
+ // Add the defined Style Sheet to the document.
+ if ( this.StyleSheet )
+ FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ;
+
+
+ this.OuterDiv = this.Document.body.appendChild( this.Document.createElement('DIV') ) ;
+ this.OuterDiv.style.cssFloat = 'left' ;
+
+ this.PanelDiv = this.OuterDiv.appendChild( this.Document.createElement('DIV') ) ;
+ this.PanelDiv.className = 'FCK_Panel' ;
+
+ this.Created = true ;
+}
+
+FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, autoSize )
+{
+ if ( ! this.Created )
+ this.Create() ;
+
+ if ( width != null && autoSize && width < this.OuterDiv.offsetWidth )
+ this.PanelDiv.style.width = width ;
+
+ if ( height != null && autoSize && height < this.PanelDiv.offsetHeight )
+ this.PanelDiv.style.height = height + 'px' ;
+
+ var oPos = this.GetElementPosition( relElement ) ;
+
+ panelX += oPos.X ;
+ panelY += oPos.Y ;
+
+ if ( panelX + this.OuterDiv.offsetWidth > this.Window.innerWidth )
+ {
+ // The following line aligns the panel to the other side of the refElement.
+ // panelX = oPos.X - ( this.PanelDiv.offsetWidth - relElement.offsetWidth ) ;
+
+ panelX -= panelX + this.OuterDiv.offsetWidth - this.Window.innerWidth ;
+ }
+
+ // Set the context menu DIV in the specified location.
+ this._IFrame.style.left = panelX + 'px' ;
+ this._IFrame.style.top = panelY + 'px' ;
+
+ // Watch the "OnClick" event for all windows to close the Context Menu.
+ function SetOnClickListener( targetWindow, targetFunction )
+ {
+ // Try/Catch must be used to avoit an error when using a frameset
+ // on a different domain:
+ // "Permission denied to get property Window.frameElement".
+ try
+ {
+ if ( targetWindow == null || ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel ) )
+ return ;
+
+ targetWindow.document.addEventListener( 'click', targetFunction, false ) ;
+ }
+ catch (e) {}
+
+ for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
+ SetOnClickListener( targetWindow.frames[i], targetFunction ) ;
+ }
+ SetOnClickListener( window.top, FCKPanelEventHandlers.OnDocumentClick ) ;
+
+ this._IFrame.width = this.OuterDiv.offsetWidth ;
+ this._IFrame.height = this.OuterDiv.offsetHeight ;
+
+ // Show it.
+ this._IFrame.style.visibility = '' ;
+}
+
+FCKPanel.prototype.GetElementPosition = function( el )
+{
+ // Initializes the Coordinates object that will be returned by the function.
+ var c = { X:0, Y:0 } ;
+
+ // Loop throw the offset chain.
+ while ( el )
+ {
+ c.X += el.offsetLeft ;
+ c.Y += el.offsetTop ;
+
+ if ( el.offsetParent == null && el.ownerDocument.defaultView != this.Window )
+ el = el.ownerDocument.defaultView.frameElement ;
+ else
+ el = el.offsetParent ;
+ }
+
+ // Return the Coordinates object
+ return c ;
+}
+
+FCKPanel.prototype.Hide = function()
+{
+ // There is a bug on Firefox over Mac. It doesn't hide the Panel
+ // scrollbars, so we must force it.
+ this.PanelDiv.style.overflow = 'visible' ;
+
+ this._IFrame.style.visibility = 'hidden' ;
+// this._IFrame.style.left = this._IFrame.style.top = '0px' ;
+}
+
+var FCKPanelEventHandlers = new Object() ;
+
+FCKPanelEventHandlers.OnDocumentClick = function( e )
+{
+ var oWindow = e.target.ownerDocument.defaultView ;
+
+ if ( ! oWindow.IsFCKPanel )
+ {
+ function RemoveOnClickListener( targetWindow )
+ {
+ if ( targetWindow == null )
+ return ;
+
+ // Try/Catch must be used to avoit an error when using a frameset
+ // on a different domain:
+ // "Permission denied to get property Window.frameElement".
+ try
+ {
+ if ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel )
+ targetWindow.frameElement.Panel.Hide() ;
+ else
+ targetWindow.document.removeEventListener( 'click', FCKPanelEventHandlers.OnDocumentClick, false ) ;
+ }
+ catch (e) {}
+
+ for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
+ RemoveOnClickListener( targetWindow.frames[i] ) ;
+ }
+ RemoveOnClickListener( window.top ) ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckpanel_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckpanel_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckpanel_ie.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,76 @@
+/*
+ * 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: 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.Window = parentWindow ? parentWindow : window ;
+}
+
+function FCKPanel_OnContextMenu() { return false ; }
+
+FCKPanel.prototype.Create = function()
+{
+ // Create the Popup that will hold the panel.
+ this._Popup = this.Window.createPopup() ;
+
+ this.Document = this._Popup.document ;
+
+ aCleanupDocs[ aCleanupDocs.length ] = this.Document ;
+
+ this.Document.oncontextmenu = FCKPanel_OnContextMenu ;
+
+ if ( this.StyleSheet )
+ FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ;
+
+ // Create the main DIV that is used as the panel base.
+ this.PanelDiv = this.Document.body.appendChild( this.Document.createElement('DIV') ) ;
+ this.PanelDiv.className = 'FCK_Panel' ;
+
+ this.Created = true ;
+}
+
+FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, autoSize )
+{
+ if ( ! this.Created )
+ this._Create() ;
+
+ // The offsetWidth and offsetHeight properties are not available if the
+ // element is not visible. So we must "show" the popup with no size to
+ // be able to use that values in the second call.
+ this._Popup.show( panelX, panelY, 0, 0, relElement ) ;
+
+ if ( width == null || ( autoSize && width > this.PanelDiv.offsetWidth ) )
+ var iWidth = this.PanelDiv.offsetWidth ;
+ else
+ var iWidth = width ;
+
+ if ( height == null || ( autoSize && height > this.PanelDiv.offsetHeight ) )
+ var iHeight = this.PanelDiv.offsetHeight ;
+ else
+ var iHeight = height ;
+
+ this.PanelDiv.style.height = iHeight ;
+
+ // Second call: Show the Popup at the specified location.
+ this._Popup.show( panelX, panelY, iWidth, iHeight, relElement ) ;
+}
+
+FCKPanel.prototype.Hide = function()
+{
+ if ( this._Popup )
+ this._Popup.hide() ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckplugin.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckplugin.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckplugin.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,52 @@
+/*
+ * 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: 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 )
+ {
+ // Check if the plugin has the language file for the active language.
+ if ( this.AvailableLangs.indexOf( FCKLanguageManager.ActiveLanguage.Code ) >= 0 )
+ var sLang = FCKLanguageManager.ActiveLanguage.Code ;
+ else
+ // Load the default language file (first one) if the current one is not available.
+ var sLang = this.AvailableLangs[0] ;
+
+ // Add the main plugin script.
+ FCKScriptLoader.AddScript( this.Path + 'lang/' + sLang + '.js' ) ;
+ }
+
+ // Add the main plugin script.
+ FCKScriptLoader.AddScript( this.Path + 'fckplugin.js' ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckspecialcombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckspecialcombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckspecialcombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,213 @@
+/*
+ * 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: fckspecialcombo.js
+ * FCKSpecialCombo Class: represents a special combo.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKSpecialCombo = function( caption )
+{
+ // Default properties values.
+ this.FieldWidth = 80 ;
+ this.PanelWidth = 130 ;
+ this.PanelMaxHeight = 150 ;
+ this.Label = ' ' ;
+ this.Caption = caption ;
+
+ this.Enabled = true ;
+
+ this.Items = new Object() ;
+
+ this._Panel = new FCKPanel() ;
+ this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
+ this._Panel.Create() ;
+ this._Panel.PanelDiv.className += ' SC_Panel' ;
+ this._Panel.PanelDiv.innerHTML = '' ;
+
+ 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 )
+{
+ // Bold 1
+ 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.DeselectAll = function()
+{
+ for ( var i in this.Items )
+ {
+ this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ;
+ this.Items[i].Selected = false ;
+ }
+}
+
+FCKSpecialCombo.prototype.SetLabelById = function( id )
+{
+ id = id ? id.toString().toLowerCase() : '' ;
+
+ var oDiv = this.Items[ id ] ;
+ this.SetLabel( oDiv ? oDiv.FCKItemLabel : '' ) ;
+}
+
+FCKSpecialCombo.prototype.SetLabel = function( text )
+{
+ this.Label = text.length == 0 ? ' ' : text ;
+
+ if ( this._LabelEl )
+ this._LabelEl.innerHTML = this.Label ;
+}
+
+FCKSpecialCombo.prototype.SetEnabled = function( isEnabled )
+{
+ this.Enabled = isEnabled ;
+
+ this._OuterTable.className = isEnabled ? '' : 'SC_FieldDisabled' ;
+}
+
+FCKSpecialCombo.prototype.Create = function( targetElement )
+{
+ this._OuterTable = targetElement.appendChild( document.createElement( 'TABLE' ) ) ;
+ this._OuterTable.cellPadding = 0 ;
+ this._OuterTable.cellSpacing = 0 ;
+
+ this._OuterTable.insertRow(-1) ;
+
+ if ( this.Caption && this.Caption.length > 0 )
+ {
+ var oCaptionCell = this._OuterTable.rows[0].insertCell(-1) ;
+ oCaptionCell.unselectable = 'on' ;
+ oCaptionCell.innerHTML = this.Caption ;
+ oCaptionCell.className = 'SC_FieldCaption' ;
+ }
+
+ // Create the main DIV element.
+ var oField = this._OuterTable.rows[0].insertCell(-1).appendChild( document.createElement( 'DIV' ) ) ;
+ oField.className = 'SC_Field' ;
+ oField.style.width = this.FieldWidth + 'px' ;
+ oField.innerHTML = '' ;
+
+ this._LabelEl = oField.getElementsByTagName('label')[0] ;
+ this._LabelEl.innerHTML = this.Label ;
+
+ /* Events Handlers */
+
+ oField.SpecialCombo = this ;
+
+ oField.onmouseover = FCKSpecialCombo_OnMouseOver ;
+ oField.onmouseout = FCKSpecialCombo_OnMouseOut ;
+ oField.onclick = FCKSpecialCombo_OnClick ;
+}
+
+function FCKSpecialCombo_OnMouseOver()
+{
+ if ( this.SpecialCombo.Enabled )
+ this.className = 'SC_Field SC_FieldOver' ;
+}
+
+function FCKSpecialCombo_OnMouseOut()
+{
+ this.className='SC_Field' ;
+}
+
+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 ) ;
+ }
+
+ if ( this.SpecialCombo.Enabled )
+ {
+ if ( typeof( this.SpecialCombo.OnBeforeClick ) == 'function' )
+ this.SpecialCombo.OnBeforeClick( this.SpecialCombo ) ;
+
+ if ( this.SpecialCombo._ItemsHolderEl.offsetHeight > this.SpecialCombo.PanelMaxHeight )
+ this.SpecialCombo._Panel.PanelDiv.style.height = this.SpecialCombo.PanelMaxHeight + 'px' ;
+ else
+ this.SpecialCombo._Panel.PanelDiv.style.height = this.SpecialCombo._ItemsHolderEl.offsetHeight + 'px' ;
+
+ this.SpecialCombo._Panel.PanelDiv.style.width = this.SpecialCombo.PanelWidth + 'px' ;
+
+ if ( FCKBrowserInfo.IsGecko )
+ this.SpecialCombo._Panel.PanelDiv.style.overflow = '-moz-scrollbars-vertical' ;
+
+ this.SpecialCombo._Panel.Show( 0, this.offsetHeight, this, null, this.SpecialCombo.PanelMaxHeight, true ) ;
+ }
+
+ return false ;
+}
+
+/*
+Sample Combo Field HTML output:
+
+
+*/
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckstyledef.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckstyledef.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckstyledef.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,53 @@
+/*
+ * 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: 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() ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckstyledef_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckstyledef_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckstyledef_gecko.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,105 @@
+/*
+ * 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: 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 ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckstyledef_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckstyledef_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckstyledef_ie.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,128 @@
+/*
+ * 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: 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 )
+ {
+ if ( a.toLowerCase() == 'style' )
+ targetElement.style.cssText = this.Attributes[a] ;
+ else
+ targetElement.setAttribute( a, this.Attributes[a], 0 ) ;
+ }
+}
+
+FCKStyleDef.prototype._RemoveDuplicates = function( parent )
+{
+ for ( var i = 0 ; i < parent.children.length ; i++ )
+ {
+ var oChild = parent.children[i] ;
+ this._RemoveDuplicates( oChild ) ;
+
+ if ( this.IsEqual( oChild ) )
+ {
+ oChild.insertAdjacentHTML( 'beforeBegin', oChild.innerHTML ) ;
+ oChild.parentElement.removeChild( oChild ) ;
+ }
+ }
+}
+
+FCKStyleDef.prototype.IsEqual = function( e )
+{
+ if ( e.tagName != this.Element )
+ return false ;
+
+ for ( var a in this.Attributes )
+ {
+ switch ( a.toLowerCase() )
+ {
+ case 'style' :
+ if ( e.style.cssText.toLowerCase() != this.Attributes[a].toLowerCase() )
+ return false ;
+ break ;
+ case 'class' :
+ if ( e.getAttribute( 'className', 0 ) != this.Attributes[a] )
+ return false ;
+ break ;
+ default :
+ if ( e.getAttribute( a, 0 ) != this.Attributes[a] )
+ return false ;
+ }
+ }
+
+ return true ;
+}
+
+FCKStyleDef.prototype._RemoveMe = function( elementToCheck )
+{
+ if ( ! elementToCheck )
+ return ;
+
+ var oParent = elementToCheck.parentElement ;
+
+ if ( this.IsEqual( elementToCheck ) )
+ {
+ if ( this.IsObjectElement )
+ {
+ for ( var a in this.Attributes )
+ {
+ switch ( a.toLowerCase() )
+ {
+ case 'class' :
+ elementToCheck.removeAttribute( 'className', 0 ) ;
+ break ;
+ default :
+ elementToCheck.removeAttribute( a, 0 ) ;
+ }
+ }
+ return ;
+ }
+ else
+ FCKTools.RemoveOuterTags( elementToCheck ) ;
+ }
+
+ this._RemoveMe( oParent ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckstylesloader.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckstylesloader.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckstylesloader.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,82 @@
+/*
+ * 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: 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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbar.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbar.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbar.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * 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: 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() ;
+
+ this.DOMTable = document.createElement( 'table' ) ;
+ this.DOMTable.className = 'TB_Toolbar' ;
+ with ( this.DOMTable )
+ {
+ // Sets the toolbar direction. IE uses "styleFloat" and Gecko uses "cssFloat".
+ style.styleFloat = style.cssFloat = FCKLang.Dir == 'rtl' ? 'right' : 'left' ;
+
+ cellPadding = 0 ;
+ cellSpacing = 0 ;
+ border = 0 ;
+ }
+
+ this.DOMRow = this.DOMTable.insertRow(-1) ;
+
+ var oCell = this.DOMRow.insertCell(-1) ;
+ oCell.className = 'TB_Start' ;
+ oCell.innerHTML = ' ' ;
+
+ FCKToolbarSet.DOMElement.appendChild( this.DOMTable ) ;
+}
+
+FCKToolbar.prototype.AddItem = function( toolbarItem )
+{
+ this.Items[ this.Items.length ] = toolbarItem ;
+ toolbarItem.CreateInstance( this ) ;
+}
+
+FCKToolbar.prototype.AddSeparator = function()
+{
+ var oCell = this.DOMRow.insertCell(-1) ;
+ oCell.unselectable = 'on' ;
+ oCell.innerHTML = ' ' ;
+}
+
+FCKToolbar.prototype.AddTerminator = function()
+{
+ var oCell = this.DOMRow.insertCell(-1) ;
+ oCell.className = 'TB_End' ;
+ oCell.innerHTML = ' ' ;
+}
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarbreak_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbreak_gecko.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,27 @@
+/*
+ * 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: 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 ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarbreak_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbreak_ie.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,29 @@
+/*
+ * 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: 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 ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbutton.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarbutton.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbutton.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,146 @@
+/*
+ * 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: 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 =
+ '' +
+ '' ;
+
+ if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
+ sHtml += ' ' ;
+
+ if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
+ sHtml += '' + this.Label + ' ' ;
+
+ sHtml +=
+ ' ' +
+ '
' ;
+
+ this.DOMDiv.innerHTML = sHtml ;
+
+ var oCell = parentToolbar.DOMRow.insertCell(-1) ;
+ oCell.appendChild( this.DOMDiv ) ;
+
+ this.RefreshState() ;
+}
+
+FCKToolbarButton.prototype.RefreshState = function()
+{
+/*
+ TODO: Delete this commend block on stable version.
+ // Gets the actual state.
+// var eState ;
+
+// if ( FCK.EditMode == FCK_EDITMODE_SOURCE && ! this.SourceView )
+// eState = FCK_TRISTATE_DISABLED ;
+// else
+*/
+ // Gets the actual state.
+ var eState = this.Command.GetState() ;
+
+ // If there are no state changes than do nothing and return.
+ if ( eState == this.State ) return ;
+
+ // Sets the actual state.
+ this.State = eState ;
+
+ switch ( this.State )
+ {
+ case FCK_TRISTATE_ON :
+ this.DOMDiv.className = 'TB_Button_On' ;
+
+ 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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarfontformatcombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,57 @@
+/*
+ * 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: fcktoolbarfontformatcombo.js
+ * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKToolbarFontFormatCombo = function()
+{
+ this.Command = FCKCommands.GetCommand( 'FontFormat' ) ;
+}
+
+// Inherit from FCKToolbarSpecialCombo.
+FCKToolbarFontFormatCombo.prototype = new FCKToolbarSpecialCombo ;
+
+FCKToolbarFontFormatCombo.prototype.GetLabel = function()
+{
+ return FCKLang.FontFormat ;
+}
+
+FCKToolbarFontFormatCombo.prototype.CreateItems = function( targetSpecialCombo )
+{
+ // Get the format names from the language file.
+ var aNames = FCKLang['FontFormats'].split(';') ;
+ var oNames = {
+ p : aNames[0],
+ pre : aNames[1],
+ address : aNames[2],
+ h1 : aNames[3],
+ h2 : aNames[4],
+ h3 : aNames[5],
+ h4 : aNames[6],
+ h5 : aNames[7],
+ h6 : aNames[8],
+ div : aNames[9]
+ } ;
+
+ // Get the available formats from the configuration file.
+ var aTags = FCKConfig.FontFormats.split(';') ;
+
+ for ( var i = 0 ; i < aTags.length ; i++ )
+ {
+ if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko )
+ continue ;
+ this._Combo.AddItem( aTags[i], '<' + aTags[i] + '>' + oNames[aTags[i]] + '' + aTags[i] + '>', oNames[aTags[i]] ) ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarfontscombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,37 @@
+/*
+ * 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: fcktoolbarfontscombo.js
+ * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKToolbarFontsCombo = function()
+{
+ this.Command = FCKCommands.GetCommand( 'FontName' ) ;
+}
+
+// Inherit from FCKToolbarSpecialCombo.
+FCKToolbarFontsCombo.prototype = new FCKToolbarSpecialCombo ;
+
+FCKToolbarFontsCombo.prototype.GetLabel = function()
+{
+ return FCKLang.Font ;
+}
+
+FCKToolbarFontsCombo.prototype.CreateItems = function( targetSpecialCombo )
+{
+ var aFonts = FCKConfig.FontNames.split(';') ;
+
+ for ( var i = 0 ; i < aFonts.length ; i++ )
+ this._Combo.AddItem( aFonts[i], '' + aFonts[i] + ' ' ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarfontsizecombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontsizecombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * 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: fcktoolbarfontsizecombo.js
+ * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKToolbarFontSizeCombo = function()
+{
+ this.Command = FCKCommands.GetCommand( 'FontSize' ) ;
+}
+
+// Inherit from FCKToolbarSpecialCombo.
+FCKToolbarFontSizeCombo.prototype = new FCKToolbarSpecialCombo ;
+
+FCKToolbarFontSizeCombo.prototype.GetLabel = function()
+{
+ return FCKLang.FontSize ;
+}
+
+FCKToolbarFontSizeCombo.prototype.CreateItems = function( targetSpecialCombo )
+{
+ targetSpecialCombo.FieldWidth = 70 ;
+
+ var aSizes = FCKConfig.FontSizes.split(';') ;
+
+ for ( var i = 0 ; i < aSizes.length ; i++ )
+ {
+ var aSizeParts = aSizes[i].split('/') ;
+ this._Combo.AddItem( aSizeParts[0], '' + aSizeParts[1] + ' ', aSizeParts[1] ) ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarpanelbutton.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,81 @@
+/*
+ * 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: 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 ;
+}
+
+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 =
+ '' +
+ '' ;
+
+ if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
+ sHtml += ' ' ;
+
+ if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
+ sHtml += '' + this.Label + ' ' ;
+
+ sHtml +=
+ ' ' +
+ ' ' +
+ '
' ;
+
+ 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 ;
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarspecialcombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,110 @@
+/*
+ * 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: 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._Combo.FieldWidth = 100 ;
+ this._Combo.PanelWidth = 150 ;
+ this._Combo.PanelMaxHeight = 150 ;
+
+ this.CreateItems( this._Combo ) ;
+
+ this._Combo.Create( parentToolbar.DOMRow.insertCell(-1) ) ;
+
+ this._Combo.Command = this.Command ;
+
+ this._Combo.OnSelect = 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
+ 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 ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarstylecombo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,86 @@
+/*
+ * 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: fcktoolbarstylecombo.js
+ * FCKToolbarPanelButton Class: Handles the Fonts combo selector.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKToolbarStyleCombo = function()
+{
+ this.Command = FCKCommands.GetCommand( 'Style' ) ;
+}
+
+// Inherit from FCKToolbarSpecialCombo.
+FCKToolbarStyleCombo.prototype = new FCKToolbarSpecialCombo ;
+
+FCKToolbarStyleCombo.prototype.GetLabel = function()
+{
+ return FCKLang.Style ;
+}
+
+FCKToolbarStyleCombo.prototype.CreateItems = function( targetSpecialCombo )
+{
+ // Add the Editor Area CSS to the Styles panel so the style classes are previewed correctly.
+ FCKTools.AppendStyleSheet( targetSpecialCombo._Panel.Document, FCKConfig.EditorAreaCSS ) ;
+
+ // For some reason Gecko is blocking inside the "RefreshVisibleItems" function.
+ if ( ! FCKBrowserInfo.IsGecko )
+ targetSpecialCombo.OnBeforeClick = this.RefreshVisibleItems ;
+
+ // Add the styles to the special combo.
+ for ( var s in this.Command.Styles )
+ {
+ var oStyle = this.Command.Styles[s] ;
+ if ( oStyle.IsObjectElement )
+ var oItem = targetSpecialCombo.AddItem( s, s ) ;
+ else
+ var oItem = targetSpecialCombo.AddItem( s, oStyle.GetOpenerTag() + s + oStyle.GetCloserTag() ) ;
+ oItem.Style = oStyle ;
+ }
+}
+
+FCKToolbarStyleCombo.prototype.RefreshActiveItems = function( targetSpecialCombo )
+{
+ // Clear the actual selection.
+ targetSpecialCombo.DeselectAll() ;
+
+ // Get the active styles.
+ var aStyles = this.Command.GetActiveStyles() ;
+
+ if ( aStyles.length > 0 )
+ {
+ // Select the active styles in the combo.
+ for ( var i = 0 ; i < aStyles.length ; i++ )
+ targetSpecialCombo.SelectItem( aStyles[i].Name ) ;
+
+ // Set the combo label to the first style in the collection.
+ targetSpecialCombo.SetLabelById( aStyles[0].Name ) ;
+ }
+ else
+ targetSpecialCombo.SetLabel('') ;
+}
+
+FCKToolbarStyleCombo.prototype.RefreshVisibleItems = function( targetSpecialCombo )
+{
+ if ( FCKSelection.GetType() == 'Control' )
+ var sTagName = FCKSelection.GetSelectedElement().tagName ;
+
+ for ( var i in targetSpecialCombo.Items )
+ {
+ var oItem = targetSpecialCombo.Items[i] ;
+ if ( ( sTagName && oItem.Style.Element == sTagName ) || ( ! sTagName && ! oItem.Style.IsObjectElement ) )
+ oItem.style.display = '' ;
+ else
+ oItem.style.display = 'none' ; // For some reason Gecko is blocking here.
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckxml_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckxml_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckxml_gecko.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,69 @@
+/*
+ * 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: 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 )
+ 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 ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/classes/fckxml_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckxml_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/classes/fckxml_ie.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,62 @@
+/*
+ * 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: 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()
+ {}
+
+ FCKXml.prototype.LoadUrl = function( urlToCall )
+ {
+ var oXmlHttp = FCKTools.CreateXmlObject( 'XmlHttp' ) ;
+
+ oXmlHttp.open( "GET", urlToCall, false ) ;
+
+ oXmlHttp.send( null ) ;
+
+ if ( oXmlHttp.status == 200 )
+ 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
+ alert( 'Error loading "' + urlToCall + '"' ) ;
+ }
+
+ FCKXml.prototype.SelectNodes = function( xpath, contextNode )
+ {
+ if ( contextNode )
+ return contextNode.selectNodes( xpath ) ;
+ else
+ return this.DOMDocument.selectNodes( xpath ) ;
+ }
+
+ FCKXml.prototype.SelectSingleNode = function( xpath, contextNode )
+ {
+ if ( contextNode )
+ return contextNode.selectSingleNode( xpath ) ;
+ else
+ return this.DOMDocument.selectSingleNode( xpath ) ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fck_othercommands.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fck_othercommands.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fck_othercommands.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,236 @@
+/*
+ * 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: 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', '' ) ;
+ else
+ FCK.ExecuteNamedCommand( 'FormatBlock', '<' + formatName + '>' ) ;
+}
+
+FCKFormatBlockCommand.prototype.GetState = function()
+{
+ return FCK.GetNamedCommandValue( 'FormatBlock' ) ;
+}
+
+// ### Preview
+var FCKPreviewCommand = function()
+{
+ this.Name = 'Preview' ;
+}
+
+FCKPreviewCommand.prototype.Execute = function()
+{
+ FCK.Preview() ;
+}
+
+FCKPreviewCommand.prototype.GetState = function()
+{
+ return FCK_TRISTATE_OFF ;
+}
+
+// ### Save
+var FCKSaveCommand = function()
+{
+ this.Name = 'Save' ;
+}
+
+FCKSaveCommand.prototype.Execute = function()
+{
+ // Get the linked field form.
+ var oForm = FCK.LinkedField.form ;
+
+ // Submit the form.
+ oForm.submit() ;
+}
+
+FCKSaveCommand.prototype.GetState = function()
+{
+ return FCK_TRISTATE_OFF ;
+}
+
+// ### NewPage
+var FCKNewPageCommand = function()
+{
+ this.Name = 'NewPage' ;
+}
+
+FCKNewPageCommand.prototype.Execute = function()
+{
+ FCKUndo.SaveUndoStep() ;
+ FCK.SetHTML( FCKBrowserInfo.IsGecko ? ' ' : '' ) ;
+}
+
+FCKNewPageCommand.prototype.GetState = function()
+{
+ return FCK_TRISTATE_OFF ;
+}
+
+// ### Source button
+var FCKSourceCommand = function()
+{
+ this.Name = 'Source' ;
+}
+
+FCKSourceCommand.prototype.Execute = function()
+{
+ FCK.SwitchEditMode() ;
+}
+
+FCKSourceCommand.prototype.GetState = function()
+{
+ return ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ? FCK_TRISTATE_OFF : FCK_TRISTATE_ON ) ;
+}
+
+// ### 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.CurrentIndex > 0 ? 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.CurrentIndex < ( FCKUndo.SavedData.length - 1 ) ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ) ;
+ else
+ return FCK.GetNamedCommandState( 'Redo' ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fcknamedcommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fcknamedcommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fcknamedcommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,31 @@
+/*
+ * 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: 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 ) ;
+}
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fckpasteplaintextcommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fckpasteplaintextcommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,32 @@
+/*
+ * 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: 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' ) ;
+}
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fckpastewordcommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fckpastewordcommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fckpastewordcommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,31 @@
+/*
+ * 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: 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()
+{
+ return FCK.GetNamedCommandState( 'Paste' ) ;
+}
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fckspellcheckcommand_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_gecko.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,15 @@
+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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fckspellcheckcommand_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fckspellcheckcommand_ie.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,43 @@
+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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fckstylecommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fckstylecommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fckstylecommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,88 @@
+/*
+ * 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: 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 )
+{
+ if ( styleComboItem.Selected )
+ styleComboItem.Style.RemoveFromSelection() ;
+ else
+ styleComboItem.Style.ApplyToSelection() ;
+
+ FCK.Focus() ;
+
+ FCK.Events.FireEvent( "OnSelectionChange" ) ;
+}
+
+FCKStyleCommand.prototype.GetState = function()
+{
+ var oSelection = FCK.EditorDocument.selection ;
+
+ if ( FCKSelection.GetType() == 'Control' )
+ {
+ var e = FCKSelection.GetSelectedElement() ;
+ if ( e )
+ return this.StylesLoader.StyleGroups[ e.tagName ] ? FCK_TRISTATE_OFF : FCK_TRISTATE_DISABLED ;
+ else
+ FCK_TRISTATE_OFF ;
+ }
+ else
+ return FCK_TRISTATE_OFF ;
+}
+
+FCKStyleCommand.prototype.GetActiveStyles = function()
+{
+ var aActiveStyles = new Array() ;
+
+ if ( FCKSelection.GetType() == 'Control' )
+ this._CheckStyle( FCKSelection.GetSelectedElement(), aActiveStyles, false ) ;
+ else
+ this._CheckStyle( FCKSelection.GetParentElement(), aActiveStyles, true ) ;
+
+ return aActiveStyles ;
+}
+
+FCKStyleCommand.prototype._CheckStyle = function( element, targetArray, checkParent )
+{
+ if ( ! element )
+ return ;
+
+ if ( element.nodeType == 1 )
+ {
+ var aStyleGroup = this.StylesLoader.StyleGroups[ element.tagName ] ;
+ if ( aStyleGroup )
+ {
+ for ( var i = 0 ; i < aStyleGroup.length ; i++ )
+ {
+ if ( aStyleGroup[i].IsEqual( element ) )
+ targetArray[ targetArray.length ] = aStyleGroup[i] ;
+ }
+ }
+ }
+
+ if ( checkParent )
+ this._CheckStyle( element.parentNode, targetArray, checkParent ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fcktablecommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fcktablecommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fcktablecommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,60 @@
+/*
+ * 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: 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()
+{
+ switch ( this.Name )
+ {
+ case 'TableInsertRow' :
+ FCKTableHandler.InsertRow() ;
+ break ;
+ case 'TableDeleteRows' :
+ FCKTableHandler.DeleteRows() ;
+ break ;
+ case 'TableInsertColumn' :
+ FCKTableHandler.InsertColumn() ;
+ break ;
+ case 'TableDeleteColumns' :
+ FCKTableHandler.DeleteColumns() ;
+ break ;
+ case 'TableInsertCell' :
+ FCKTableHandler.InsertCell() ;
+ break ;
+ case 'TableDeleteCells' :
+ FCKTableHandler.DeleteCells() ;
+ break ;
+ case 'TableMergeCells' :
+ FCKTableHandler.MergeCells() ;
+ break ;
+ case 'TableSplitCell' :
+ FCKTableHandler.SplitCell() ;
+ break ;
+ default :
+ alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ;
+ }
+}
+
+FCKTableCommand.prototype.GetState = function()
+{
+ return FCK_TRISTATE_OFF ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fcktextcolorcommand.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js 11 Aug 2005 06:26:02 -0000 1.1
@@ -0,0 +1,175 @@
+/*
+ * 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: 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.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
+ this._Panel.Create() ;
+
+ this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ;
+
+ // END ###
+}
+
+FCKTextColorCommand.prototype.Execute = function( panelX, panelY, relElement )
+{
+ /*
+ BEGIN ###
+ This is the right code to create the panel, but it is not
+ working well with Gecko, so it has been moved to the
+ class contructor.
+
+ // Create the Color Panel if needed.
+ if ( ! this._Panel )
+ {
+ this._Panel = new FCKPanel() ;
+ this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ;
+ this._Panel.Create() ;
+
+ this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ;
+ }
+ END ###
+ */
+
+ // We must "cache" the actual panel type to be used in the SetColor method.
+ FCK._ActiveColorPanelType = this.Type ;
+
+ // Show the Color Panel at the desired position.
+ this._Panel.Show( panelX, panelY, relElement ) ;
+}
+
+FCKTextColorCommand.prototype.SetColor = function( color )
+{
+ if ( FCK._ActiveColorPanelType == 'ForeColor' )
+ FCK.ExecuteNamedCommand( 'ForeColor', color ) ;
+ else if ( FCKBrowserInfo.IsGecko )
+ FCK.ExecuteNamedCommand( 'hilitecolor', color ) ;
+ else
+ FCK.ExecuteNamedCommand( 'BackColor', color ) ;
+
+ // Delete the "cached" active panel type.
+ delete FCK._ActiveColorPanelType ;
+}
+
+FCKTextColorCommand.prototype.GetState = function()
+{
+ return FCK_TRISTATE_OFF ;
+}
+
+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.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 =
+ '
\
+ \
+ \
+ ' + FCKLang.ColorAutomatic + ' \
+ \
+
' ;
+
+ 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++ )
+ {
+ var oDiv = oRow.insertCell(-1).appendChild( CreateSelectionDiv() ) ;
+ oDiv.Color = aColors[iCounter] ;
+ oDiv.innerHTML = '' ;
+
+ oDiv.Command = this ;
+ oDiv.onclick = FCKTextColorCommand_OnClick ;
+ }
+ }
+
+ // Create the Row and the Cell for the "More Colors..." button.
+ var oCell = oTable.insertRow(-1).insertCell(-1) ;
+ oCell.colSpan = 8 ;
+
+ var oDiv = oCell.appendChild( CreateSelectionDiv() ) ;
+ oDiv.innerHTML = '' + FCKLang.ColorMoreColors + '
' ;
+
+ oDiv.Command = this ;
+ oDiv.onclick = FCKTextColorCommand_MoreOnClick ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/globals/fck_constants.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/globals/Attic/fck_constants.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/globals/fck_constants.js 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,39 @@
+/*
+ * 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: 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.
+FCK_STATUS_NOTLOADED = window.parent.FCK_STATUS_NOTLOADED = 0 ;
+FCK_STATUS_ACTIVE = window.parent.FCK_STATUS_ACTIVE = 1 ;
+FCK_STATUS_COMPLETE = window.parent.FCK_STATUS_COMPLETE = 2 ;
+
+// Tristate Operations.
+FCK_TRISTATE_OFF = window.parent.FCK_TRISTATE_OFF = 0 ;
+FCK_TRISTATE_ON = window.parent.FCK_TRISTATE_ON = 1 ;
+FCK_TRISTATE_DISABLED = window.parent.FCK_TRISTATE_DISABLED = -1 ;
+
+// For unknown values.
+FCK_UNKNOWN = window.parent.FCK_UNKNOWN = -1000 ;
+
+// Toolbar Items Style.
+FCK_TOOLBARITEM_ONLYICON = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 0 ;
+FCK_TOOLBARITEM_ONLYTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 1 ;
+FCK_TOOLBARITEM_ICONTEXT = window.parent.FCK_TOOLBARITEM_ONLYTEXT = 2 ;
+
+// Edit Mode
+FCK_EDITMODE_WYSIWYG = window.parent.FCK_EDITMODE_WYSIWYG = 0 ;
+FCK_EDITMODE_SOURCE = window.parent.FCK_EDITMODE_SOURCE = 1 ;
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/globals/fckeditorapi.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/globals/Attic/fckeditorapi.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/globals/fckeditorapi.js 11 Aug 2005 06:26:04 -0000 1.1
@@ -0,0 +1,43 @@
+/*
+ * 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: 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.0 FC' ;
+
+ // 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 ;
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fck.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,31 @@
+/*
+ * 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: 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 ;
+
+// First try to get the Linked field using its ID.
+FCK.LinkedField = window.parent.document.getElementById( FCK.Name ) ;
+
+// If no linked field is available with that ID, try with the "Name".
+if ( !FCK.LinkedField )
+ FCK.LinkedField = window.parent.document.getElementsByName( FCK.Name )[0] ;
Index: lams_central/web/fckeditor/editor/_source/internals/fck_1.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_1.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_1.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,213 @@
+/*
+ * 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: 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)
+ */
+
+FCK.Events = new FCKEvents( FCK ) ;
+FCK.Toolbar = null ;
+
+FCK.TempBaseTag = FCKConfig.BaseHref.length > 0 ? ' ' : '' ;
+
+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() ) ;
+
+ // 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.SetStatus = function( newStatus )
+{
+ this.Status = newStatus ;
+
+ if ( newStatus == FCK_STATUS_ACTIVE )
+ {
+ // Force the focus in the window to go to the editor.
+ window.onfocus = window.document.body.onfocus = Window_OnFocus ;
+
+ // 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 ) ;
+}
+
+FCK.GetHTML = function( 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() ;
+
+ // TODO: Wait stable version and remove the following commented lines.
+// if ( FCKBrowserInfo.IsIE )
+// FCK.CheckRelativeLinks() ;
+
+ if ( FCKConfig.FullPage )
+ var sXHTML = FCKXHtml.GetXHTML( this.EditorDocument.getElementsByTagName( 'html' )[0], true, format ) ;
+ else
+ var 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 sXHTML ;
+}
+
+FCK.UpdateLinkedField = function()
+{
+ if ( FCKConfig.EnableXHTML )
+ FCKTools.SetLinkedFieldValue( FCK.GetXHTML( FCKConfig.FormatOutput ) ) ;
+ else
+ FCKTools.SetLinkedFieldValue( FCK.GetHTML( FCKConfig.FormatOutput ) ) ;
+}
+
+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 ;
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fck_1_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_1_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_1_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,225 @@
+/*
+ * 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: 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()
+{
+ // Disable Right-Click
+ var oOnContextMenu = function( e )
+ {
+ e.preventDefault() ;
+ FCK.ShowContextMenu( e.clientX, e.clientY ) ;
+ }
+ this.EditorDocument.addEventListener( 'contextmenu', oOnContextMenu, true ) ;
+
+ /*
+ TODO:
+ This is not working... on Gecko there is no "OnPaste" event that
+ can prevent the user to paste.
+ I've tried with the OnKeyDown event for the "CTRL-V" key "down", but the
+ paste still occours (preventDefault does nothing in this case).
+
+ var oOnKeyDown = function( e )
+ {
+ if ( e.ctrlKey && !e.shiftKey && !e.altKey )
+ {
+ // Char 86/118 = V/v
+ if ( e.which == 86 || e.which == 118 )
+ {
+ if ( FCK.Status == FCK_STATUS_COMPLETE )
+ {
+ if ( !FCK.Events.FireEvent( "OnPaste" ) )
+ e.preventDefault() ;
+ }
+ else
+ e.preventDefault() ;
+ }
+ }
+ }
+ this.EditorDocument.addEventListener( 'keydown', oOnKeyDown, true ) ;
+ */
+
+ 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 ;
+ }
+ }
+ this.EditorWindow.addEventListener( 'load', this._OnLoad, true ) ;
+
+// var oEditorWindow_OnUnload = function()
+// {
+// FCK.EditorWindow.location = 'fckblank.html' ;
+// }
+// this.EditorWindow.addEventListener( 'unload', oEditorWindow_OnUnload, true ) ;
+
+// var oEditorDocument_OnFocus = function()
+// {
+// FCK.MakeEditable() ;
+// }
+// this.EditorDocument.addEventListener( 'focus', oEditorDocument_OnFocus, true ) ;
+}
+
+FCK.MakeEditable = function()
+{
+ if ( this.EditorWindow.document.designMode == 'on' )
+ return ;
+
+ this.EditorWindow.document.designMode = 'on' ;
+
+ // Tell Gecko to use or not the tag for the bold, italic and underline.
+ this.EditorWindow.document.execCommand( 'useCSS', false, !FCKConfig.GeckoUseSPAN ) ;
+}
+
+FCK.Focus = function()
+{
+ try
+ {
+// window.focus() ;
+ FCK.EditorWindow.focus() ;
+ }
+ catch(e) {}
+}
+
+FCK.SetHTML = function( html, forceWYSIWYG )
+{
+ if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG )
+ {
+ // 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 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 tag to the input HTML.
+ if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( html ) )
+ html = html.replace( FCKRegexLib.HeadCloser, FCK.TempBaseTag + '' ) ;
+
+ html = html.replace( FCKRegexLib.HeadCloser, ' ' ) ;
+
+ // Extract the BODY contents from the html.
+ var oMatch = html.match( FCKRegexLib.BodyContents ) ;
+ var sOpener = oMatch[1] ; // This is the HTML until the tag, inclusive.
+ var sContents = oMatch[2] ; // This is the BODY tag contents.
+ var sCloser = oMatch[3] ; // This is the HTML from the tag, inclusive.
+
+ var sHtml = sOpener + ' ' + sCloser ;
+
+ if ( !this._Initialized )
+ {
+ FCK.EditorDocument.designMode = "on" ;
+
+ // Tell Gecko to use or not the tag for the bold, italic and underline.
+ FCK.EditorDocument.execCommand( "useCSS", false, !FCKConfig.GeckoUseSPAN ) ;
+
+ this._Initialized = true ;
+ }
+
+ 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 =
+ '' +
+ '' +
+ ' ' +
+ ' ' +
+ ' ' ;
+
+ sHtml += FCK.TempBaseTag ;
+
+ sHtml += ' ' ;
+ */
+
+ if ( !this._Initialized )
+ {
+ this.EditorDocument.dir = FCKConfig.ContentLangDirection ;
+
+ var sHtml =
+ ' ' +
+ ' ' +
+ ' ' ;
+
+ sHtml += 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' ;
+
+ FCK.EditorDocument.body.innerHTML = html ;
+
+ // On Gecko we must set the desingMode on again after setting the BODY innerHTML.
+ FCK.EditorDocument.designMode = 'on' ;
+
+ // Tell Gecko to use or not the tag for the bold, italic and underline.
+ FCK.EditorDocument.execCommand( 'useCSS', false, !FCKConfig.GeckoUseSPAN ) ;
+ }
+
+ this.Events.FireEvent( 'OnAfterSetHTML' ) ;
+ }
+ else
+ document.getElementById('eSourceField').value = html ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fck_1_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_1_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_1_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,245 @@
+/*
+ * 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: 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 =
+ '' ;
+
+function Doc_OnMouseDown()
+{
+ 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 ;
+
+ if ( e.keyCode == 13 && FCKConfig.UseBROnCarriageReturn ) // ENTER
+ {
+ if ( (e.ctrlKey || e.altKey || e.shiftKey) )
+ return true ;
+ else
+ {
+ // We must ignore it if we are inside a List.
+ if ( FCK.EditorDocument.queryCommandState( 'InsertOrderedList' ) || FCK.EditorDocument.queryCommandState( 'InsertUnorderedList' ) )
+ return true ;
+
+ // Insert the (The must be also inserted to make it work)
+ FCK.InsertHtml(" ") ;
+
+ // Remove the
+ var oRange = FCK.EditorDocument.selection.createRange() ;
+ oRange.moveStart('character',-1) ;
+ oRange.select() ;
+ FCK.EditorDocument.selection.clear() ;
+
+ return false ;
+ }
+ }
+ else if ( e.keyCode == 9 && FCKConfig.TabSpaces > 0 && !(e.ctrlKey || e.altKey || e.shiftKey) ) // TAB
+ {
+ FCK.InsertHtml( window.FCKTabHTML ) ;
+ return false ;
+ }
+
+ return true ;
+}
+
+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( 'onmousedown', Doc_OnMouseDown ) ;
+ this.EditorDocument.attachEvent( 'onmouseup', Doc_OnMouseDown ) ;
+
+ // Intercept pasting operations
+ this.EditorDocument.body.attachEvent( 'onpaste', Doc_OnPaste ) ;
+
+ // Disable Right-Click and shows the context menu.
+ this.EditorDocument.attachEvent('oncontextmenu', Doc_OnContextMenu ) ;
+
+ // Check if key strokes must be monitored.
+ if ( FCKConfig.UseBROnCarriageReturn || FCKConfig.TabSpaces > 0 )
+ {
+ // Build the "TAB" key replacement.
+ if ( FCKConfig.TabSpaces > 0 )
+ {
+ window.FCKTabHTML = '' ;
+ for ( i = 0 ; i < FCKConfig.TabSpaces ; i++ )
+ window.FCKTabHTML += " " ;
+ }
+
+ this.EditorDocument.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 )
+ {
+ // TODO: Wait stable version and remove the following commented lines.
+ // In IE, if you do document.body.innerHTML = '
' it throws a "Unknow runtime error".
+ // To solve it we must add a fake (safe) tag before it, and then remove it.
+ // this.EditorDocument.body.innerHTML = '
' + html.replace( FCKRegexLib.AposEntity, ''' ) ;
+ // this.EditorDocument.getElementById('__fakeFCKRemove__').removeNode(true) ;
+
+ var sHtml ;
+
+ if ( FCKConfig.FullPage )
+ {
+ var sHtml =
+ FCK._BehaviorsStyle +
+ ' ' ;
+
+ if ( FCK.TempBaseTag.length > 0 && !FCKRegexLib.HasBaseTag.test( html ) )
+ sHtml += FCK.TempBaseTag ;
+
+ sHtml = html.replace( FCKRegexLib.HeadCloser, sHtml + '' ) ;
+ }
+ else
+ {
+ sHtml =
+ FCKConfig.DocType +
+ '' +
+ ' ' +
+ ' ' +
+ ' ' ;
+
+ sHtml += FCK._BehaviorsStyle ;
+ sHtml += FCK.TempBaseTag ;
+ sHtml += '' + html + '' ;
+ }
+
+ this.EditorDocument.open( '', '_self', '', true ) ;
+ this.EditorDocument.write( sHtml ) ;
+ this.EditorDocument.close() ;
+
+ this.InitializeBehaviors() ;
+ this.EditorDocument.body.contentEditable = true ;
+
+ this.Events.FireEvent( 'OnAfterSetHTML' ) ;
+
+ // TODO: Wait stable version and remove the following commented lines.
+// this.EditorDocument.body.innerHTML = '' ;
+// if ( html && html.length > 0 )
+// this.EditorDocument.write( html ) ;
+
+// this.EditorDocument.dir = FCKConfig.ContentLangDirection ;
+ }
+ else
+ document.getElementById('eSourceField').value = html ;
+}
+
+// TODO: Wait stable version and remove the following commented lines.
+/*
+FCK.CheckRelativeLinks = function()
+{
+ // IE automatically change relative URLs to absolute, so we use a trick
+ // to solve this problem (the document base points to "fckeditor:".
+
+ for ( var i = 0 ; i < this.EditorDocument.links.length ; i++ )
+ {
+ var e = this.EditorDocument.links[i] ;
+
+ if ( e.href.startsWith( FCK.BaseUrl ) )
+ e.href = e.href.remove( 0, FCK.BaseUrl.length ) ;
+ }
+
+ for ( var i = 0 ; i < this.EditorDocument.images.length ; i++ )
+ {
+ var e = this.EditorDocument.images[i] ;
+
+ if ( e.src.startsWith( FCK.BaseUrl ) )
+ e.src = e.src.remove( 0, FCK.BaseUrl.length ) ;
+ }
+}
+*/
+
+FCK.InsertHtml = function( html )
+{
+ FCK.Focus() ;
+
+ FCKUndo.SaveUndoStep() ;
+
+ // Gets the actual selection.
+ var oSel = FCK.EditorDocument.selection ;
+
+ // Deletes the actual selection contents.
+ if ( oSel.type.toLowerCase() != "none" )
+ oSel.clear() ;
+
+ // Inset the HTML.
+ oSel.createRange().pasteHTML( html ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fck_2.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_2.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,156 @@
+/*
+ * 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: 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 )
+{
+ FCKUndo.SaveUndoStep() ;
+
+ if ( FCK.RedirectNamedCommands[ commandName ] != null )
+ FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ;
+ else
+ {
+ FCK.Focus() ;
+ FCK.EditorDocument.execCommand( commandName, false, commandParameter ) ;
+ FCK.Events.FireEvent( 'OnSelectionChange' ) ;
+ }
+}
+
+FCK.GetNamedCommandState = function( commandName )
+{
+ try
+ {
+ if ( !FCK.EditorDocument.queryCommandEnabled( commandName ) )
+ return FCK_TRISTATE_DISABLED ;
+ else
+ return FCK.EditorDocument.queryCommandState( commandName ) ? FCK_TRISTATE_ON : FCK_TRISTATE_OFF ;
+ }
+ catch ( e )
+ {
+ return FCK_TRISTATE_OFF ;
+ }
+}
+
+FCK.GetNamedCommandValue = function( commandName )
+{
+ var sValue = '' ;
+ var eState = FCK.GetNamedCommandState( commandName ) ;
+
+ if ( eState == FCK_TRISTATE_DISABLED )
+ return null ;
+
+ try
+ {
+ sValue = this.EditorDocument.queryCommandValue( commandName ) ;
+ }
+ catch(e) {}
+
+ return sValue ? sValue : '' ;
+}
+
+FCK.CleanAndPaste = function( html )
+{
+ // Remove all SPAN tags
+ html = html.replace(/<\/?SPAN[^>]*>/gi, "" );
+ // Remove Class attributes
+ html = html.replace(/<(\w[^>]*) class=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+ // Remove Style attributes
+ html = html.replace(/<(\w[^>]*) style="([^"]*)"([^>]*)/gi, "<$1$3") ;
+ // Remove Lang attributes
+ html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+ // Remove XML elements and declarations
+ html = html.replace(/<\\?\?xml[^>]*>/gi, "") ;
+ // Remove Tags with XML namespace declarations:
+ html = html.replace(/<\/?\w+:[^>]*>/gi, "") ;
+ // Replace the
+ html = html.replace(/ /, " " );
+ // Transform to
+ var re = new RegExp("(
]*>.*?)(<\/P>)","gi") ; // Different because of a IE 5.0 error
+ html = html.replace( re, "
" ) ;
+
+ FCK.InsertHtml( html ) ;
+}
+
+FCK.Preview = function()
+{
+ var oWindow = window.open( '', null, 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' ) ;
+
+ var sHTML = '
' + FCK.GetHTML() + '' ;
+
+ oWindow.document.write( sHTML );
+ oWindow.document.close();
+
+ // TODO: The CSS of the editor area must be configurable.
+ // oWindow.document.createStyleSheet( config.EditorAreaCSS );
+}
+
+FCK.SwitchEditMode = function()
+{
+ // Check if the actual mode is WYSIWYG.
+ var bWYSIWYG = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
+
+ // Display/Hide the TRs.
+ document.getElementById('eWysiwyg').style.display = bWYSIWYG ? 'none' : '' ;
+ document.getElementById('eSource').style.display = bWYSIWYG ? '' : 'none' ;
+
+ // Update the HTML in the view output to show.
+ if ( bWYSIWYG )
+ {
+ if ( FCKBrowserInfo.IsIE )
+ FCKUndo.SaveUndoStep() ;
+ document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
+ }
+ else
+ FCK.SetHTML( FCK.GetHTML(), 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] ;
+ }
+ }
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,200 @@
+/*
+ * 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: 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
+}
+
+// ExecuteNamedCommand overload for Gecko.
+FCK.ExecuteRedirectedNamedCommand = function( commandName, commandParameter )
+{
+ switch ( commandName )
+ {
+ case 'Print' :
+ FCK.EditorWindow.print() ;
+ break ;
+ case 'Paste' :
+ try { if ( FCK.Paste() ) FCK._BaseExecuteNamedCommand( 'Paste' ) ; }
+ catch (e) { alert( FCKLang.PasteErrorPaste ) ; }
+ break ;
+ case 'Cut' :
+ try { FCK._BaseExecuteNamedCommand( 'Cut' ) ; }
+ catch (e) { alert( FCKLang.PasteErrorCut ) ; }
+ break ;
+ case 'Copy' :
+ try { FCK._BaseExecuteNamedCommand( 'Copy' ) ; }
+ catch (e) { alert( FCKLang.PasteErrorCopy ) ; }
+ break ;
+ default :
+ FCK.ExecuteNamedCommand( commandName, commandParameter ) ;
+ }
+}
+
+FCK.AttachToOnSelectionChange = function( functionPointer )
+{
+ this.Events.AttachEvent( 'OnSelectionChange', functionPointer ) ;
+}
+
+FCK.Paste = function()
+{
+ if ( FCKConfig.ForcePasteAsPlainText )
+ {
+ FCK.PasteAsPlainText() ;
+ return false ;
+ }
+ else if ( FCKConfig.AutoDetectPasteFromWord )
+ {
+ var sHTML = FCK.GetClipboardHTML() ;
+ var re = /<\w[^>]* class="?MsoNormal"?/gi ;
+ if ( re.test( sHTML ) )
+ {
+ if ( confirm( FCKLang["PasteWordConfirm"] ) )
+ {
+ FCK.CleanAndPaste( sHTML ) ;
+ return false ;
+ }
+ }
+ }
+ else
+ return true ;
+}
+
+//**
+// FCK.InsertHtml: Inserts HTML at the current cursor location. Deletes the
+// selected content if any.
+FCK.InsertHtml = function( html )
+{
+ // Delete the actual selection.
+ var oSel = FCKSelection.Delete() ;
+
+// var oContainer = oSel.getRangeAt(0).startContainer ;
+// var iOffSet = oSel.getRangeAt(0).startOffset ;
+
+ // Get the first available range.
+ var oRange = oSel.getRangeAt(0) ;
+
+// var oRange = this.EditorDocument.createRange() ;
+// oRange.setStart( oContainer, iOffSet ) ;
+// oRange.setEnd( oContainer, iOffSet ) ;
+
+ // Create a fragment with the input HTML.
+ var oFragment = oRange.createContextualFragment( html ) ;
+
+ // Get the last available node.
+ var oLastNode = oFragment.lastChild ;
+
+ // Insert the fragment in the range.
+ oRange.insertNode(oFragment) ;
+
+ // Set the cursor after the inserted fragment.
+ oRange.setEndAfter( oLastNode ) ;
+ oRange.setStartAfter( oLastNode ) ;
+
+ oSel.removeAllRanges() ;
+ oSel = FCK.EditorWindow.getSelection() ;
+ oSel.addRange( oRange ) ;
+
+ this.Focus() ;
+}
+
+FCK.InsertElement = function( element )
+{
+ // Deletes the actual selection.
+ var oSel = FCKSelection.Delete() ;
+
+ // Gets the first available range.
+ var oRange = oSel.getRangeAt(0) ;
+
+ // Inserts the element in the range.
+ oRange.insertNode( element ) ;
+
+ // Set the cursor after the inserted fragment.
+ oRange.setEndAfter( element ) ;
+ oRange.setStartAfter( element ) ;
+
+ this.Focus() ;
+}
+
+FCK.PasteAsPlainText = function()
+{
+ // TODO: Implement the "Paste as Plain Text" code.
+
+ FCKDialog.OpenDialog( 'FCKDialog_Paste', FCKLang.PasteAsText, 'dialog/fck_paste.html', 400, 330, 'PlainText' ) ;
+
+/*
+ var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
+ sText = sText.replace( /\n/g, '
' ) ;
+ 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 ;
+ }
+ }
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,155 @@
+/*
+ * 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: 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"?/gi ;
+ if ( re.test( sHTML ) )
+ {
+ if ( confirm( FCKLang["PasteWordConfirm"] ) )
+ {
+ FCK.CleanAndPaste( sHTML ) ;
+ return false ;
+ }
+ }
+ }
+ else
+ return true ;
+}
+
+FCK.PasteAsPlainText = function()
+{
+ // Get the data available in the clipboard and encodes it in HTML.
+ var sText = FCKTools.HTMLEncode( clipboardData.getData("Text") ) ;
+
+ // Replace the carriage returns with
+ sText = sText.replace( /\n/g, '
' ) ;
+
+ // 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] ;
+ }
+ }
+ }
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fck_last.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_last.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_last.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,53 @@
+/*
+ * 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: 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 )
+ FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ;
+
+// 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 ) ;
+
+ FCK.SetStatus( FCK_STATUS_COMPLETE ) ;
+
+ // Call the special "FCKeditor_OnComplete" function that should be present in
+ // the HTML page where the editor is located.
+ if ( typeof( window.parent.FCKeditor_OnComplete ) == 'function' )
+ window.parent.FCKeditor_OnComplete( FCK ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fck_onload.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_onload.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fck_onload.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,212 @@
+/*
+ * 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: 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.
+
+ 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()
+ {
+ FCKToolbarSet.Collapse() ;
+
+ var e ;
+
+ for ( var j = 0 ; j < aCleanupDocs.length ; j++ )
+ {
+ var 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 ;
+ d = null ;
+ }
+ }
+ window.attachEvent( "onbeforeunload", 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() ;
+
+ // Load the styles for the configured skin.
+ LoadStyles() ;
+}
+
+function LoadStyles()
+{
+ FCKScriptLoader.OnEmpty = LoadScripts ;
+
+ // Load the active skin CSS.
+ FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_editor.css' ) ;
+ FCKScriptLoader.AddScript( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
+}
+
+function LoadScripts()
+{
+ FCKScriptLoader.OnEmpty = null ;
+
+ // @Packager.Compactor.Remove.Start
+ var sSuffix = FCKBrowserInfo.IsIE ? 'ie' : 'gecko' ;
+
+ with ( FCKScriptLoader )
+ {
+ AddScript( '_source/internals/fckdebug.js' ) ;
+ AddScript( '_source/internals/fcktools.js' ) ;
+ AddScript( '_source/internals/fcktools_' + sSuffix + '.js' ) ;
+ AddScript( '_source/internals/fckregexlib.js' ) ;
+ AddScript( '_source/internals/fcklanguagemanager.js' ) ;
+ AddScript( '_source/classes/fckevents.js' ) ;
+ AddScript( '_source/internals/fckxhtmlentities.js' ) ;
+ AddScript( '_source/internals/fckxhtml.js' ) ;
+ AddScript( '_source/internals/fckxhtml_' + sSuffix + '.js' ) ;
+ AddScript( '_source/internals/fckcodeformatter.js' ) ;
+ AddScript( '_source/internals/fckundo_' + sSuffix + '.js' ) ;
+ AddScript( '_source/internals/fck_1.js' ) ;
+ 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()
+{
+ FCKScriptLoader.OnEmpty = LoadEditor ;
+
+ FCKScriptLoader.AddScript( 'lang/' + FCKLanguageManager.ActiveLanguage.Code + '.js' ) ;
+}
+
+function LoadEditor()
+{
+ // 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() ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckbrowserinfo.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckbrowserinfo.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckbrowserinfo.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,29 @@
+/*
+ * 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: 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.IsNetscape = sAgent.indexOf("netscape") != -1 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcodeformatter.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,73 @@
+/*
+ * 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: 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|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|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.Format = function( html )
+ {
+ // Line breaks.
+ var sFormatted = html.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 ;
+ }
+
+ return sFormatted.trim() ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcommands.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcommands.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcommands.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,119 @@
+/*
+ * 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: 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 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 300 ) ; 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 '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 '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 ;
+ }
+ }
+
+ 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 ;
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fckconfig.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckconfig.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckconfig.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,91 @@
+/*
+ * 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: 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 = 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\/$/, '' ) ;
+
+// Override the actual configuration values with the values passed throw the
+// hidden field "
___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] ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcontextmenu.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,232 @@
+/*
+ * 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: 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() ;
+
+// This property is internally used to indicate that the context menu has been created.
+FCKContextMenu._IsLoaded = false ;
+
+// This method creates the context menu inside a DIV tag. Take a look at the end of this file for a sample output.
+FCKContextMenu.Reload = function()
+{
+ // Create the Main DIV that holds the Context Menu.
+ this._Div = this._Document.createElement( 'DIV' ) ;
+ this._Div.className = 'CM_ContextMenu' ;
+ this._Div.style.position = 'absolute' ;
+ this._Div.style.visibility = 'hidden' ;
+ this._Document.body.appendChild( this._Div );
+
+ // Create the main table for the menu items.
+ var oTable = this._Document.createElement( 'TABLE' ) ;
+ oTable.cellSpacing = 0 ;
+ oTable.cellPadding = 0 ;
+ oTable.border = 0 ;
+ this._Div.appendChild( oTable ) ;
+
+ // 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 ) ;
+ }
+
+ this._IsLoaded = true ;
+}
+
+FCKContextMenu._GetGroup = function( groupName )
+{
+ var oGroup ;
+
+ switch ( groupName )
+ {
+ case 'Generic' :
+ // Generic items that are always available.
+ oGroup = new FCKContextMenuGroup() ;
+ with ( oGroup )
+ {
+ Add( new FCKContextMenuItem( this, 'Cut' , FCKLang.Cut , true ) ) ;
+ Add( new FCKContextMenuItem( this, 'Copy' , FCKLang.Copy , true ) ) ;
+ Add( new FCKContextMenuItem( this, 'Paste' , FCKLang.Paste , true ) ) ;
+ }
+
+ break ;
+
+ case 'Link' :
+ oGroup = new FCKContextMenuGroup() ;
+ with ( oGroup )
+ {
+ Add( new FCKContextMenuSeparator() ) ;
+ Add( new FCKContextMenuItem( this, 'Link' , FCKLang.EditLink , true ) ) ;
+ Add( new FCKContextMenuItem( this, 'Unlink' , FCKLang.RemoveLink, true ) ) ;
+ }
+
+ break ;
+
+ case 'TableCell' :
+ oGroup = new FCKContextMenuGroup() ;
+ with ( oGroup )
+ {
+ Add( new FCKContextMenuSeparator() ) ;
+ Add( new FCKContextMenuItem( this, 'TableInsertRow' , FCKLang.InsertRow, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableDeleteRows' , FCKLang.DeleteRows, true ) ) ;
+ Add( new FCKContextMenuSeparator() ) ;
+ Add( new FCKContextMenuItem( this, 'TableInsertColumn' , FCKLang.InsertColumn, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableDeleteColumns' , FCKLang.DeleteColumns, true ) ) ;
+ Add( new FCKContextMenuSeparator() ) ;
+ Add( new FCKContextMenuItem( this, 'TableInsertCell' , FCKLang.InsertCell, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableDeleteCells' , FCKLang.DeleteCells, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableMergeCells' , FCKLang.MergeCells, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableSplitCell' , FCKLang.SplitCell, true ) ) ;
+ Add( new FCKContextMenuSeparator() ) ;
+ Add( new FCKContextMenuItem( this, 'TableCellProp' , FCKLang.CellProperties, true ) ) ;
+ Add( new FCKContextMenuItem( this, 'TableProp' , FCKLang.TableProperties, true ) ) ;
+ }
+
+ break ;
+
+ case 'Table' :
+ return new FCKContextMenuGroup( true, this, 'Table', FCKLang.TableProperties, true ) ;
+
+ case 'Image' :
+ return new FCKContextMenuGroup( true, this, 'Image', FCKLang.ImageProperties, 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['Anchor'] ) this.Groups['Anchor'].SetVisible( bIsAnchor ) ;
+ if ( this.Groups['Link'] ) this.Groups['Link'].SetVisible( !bIsAnchor && 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' ) ;
+
+ 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
+-----------------------------------------
+
+*/
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcontextmenu_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,88 @@
+/*
+ * 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: fckcontextmenu_gecko.js
+ * Context Menu operations. (Gecko specific implementations)
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+// The Context Menu CSS must be added to the parent document.
+FCKTools.AppendStyleSheet( window.parent.document, FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
+
+FCKContextMenu.Show = function( x, y )
+{
+ if ( ! this._Document )
+ {
+ this._Document = window.parent.document ;
+ }
+
+ // Create the context menu if needed.
+ if ( !this._IsLoaded )
+ {
+ this.Reload() ;
+ this._Div.style.zIndex = 10000 ;
+ this._Div.oncontextmenu = function() { return false ; }
+ }
+
+ this.RefreshState() ;
+
+ // Get the editor area and editor frames positions.
+ var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement ) ;
+ var oCoordsB = FCKTools.GetElementPosition( window.frameElement ) ;
+
+ x += oCoordsA.X + oCoordsB.X ;
+ y += oCoordsA.Y + oCoordsB.Y ;
+
+ // Verifies if the context menu is completely visible.
+ var iXSpace = x + this._Div.offsetWidth - this._Div.ownerDocument.defaultView.innerWidth ;
+ var iYSpace = y + this._Div.offsetHeight - this._Div.ownerDocument.defaultView.innerHeight ;
+
+ if ( iXSpace > 0 ) x -= this._Div.offsetWidth ;
+ if ( iYSpace > 0 ) y -= this._Div.offsetHeight ;
+
+ // Set the context menu DIV in the specified location.
+ this._Div.style.left = x + 'px' ;
+ this._Div.style.top = y + 'px' ;
+
+ // Watch the "OnClick" event for all windows to close the Context Menu.
+ var oActualWindow = FCK.EditorWindow ;
+ while ( oActualWindow )
+ {
+ oActualWindow.document.addEventListener( 'click', FCKContextMenu._OnDocumentClick, false ) ;
+ if ( oActualWindow != oActualWindow.parent )
+ oActualWindow = oActualWindow.parent ;
+ else if ( oActualWindow.opener == null )
+ oActualWindow = oActualWindow.opener ;
+ else
+ break ;
+ }
+
+ // Show it.
+ this._Div.style.visibility = '' ;
+}
+
+FCKContextMenu._OnDocumentClick = function( event )
+{
+ var e = event.target ;
+ while ( e )
+ {
+ if ( e == FCKContextMenu._Div ) return ;
+ e = e.parentNode ;
+ }
+ FCKContextMenu.Hide() ;
+}
+
+FCKContextMenu.Hide = function()
+{
+ this._Div.style.visibility = 'hidden' ;
+ this._Div.style.left = this._Div.style.top = '1px' ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcontextmenu_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,69 @@
+/*
+ * 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: fckcontextmenu_ie.js
+ * Context Menu operations. (IE specific implementations)
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+function FCKContextMenu_OnContextMenu() { return false ; }
+
+FCKContextMenu.Show = function( x, y )
+{
+ // Create the Popup used to show the menu (this is a IE 5.5+ feature).
+ if ( ! this._Popup )
+ {
+ this._Popup = window.createPopup() ;
+ this._Document = this._Popup.document ;
+ this._Document.createStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ;
+ this._Document.oncontextmenu = FCKContextMenu_OnContextMenu ;
+
+ aCleanupDocs[ aCleanupDocs.length ] = this._Document ;
+ }
+
+ // Create the context menu if needed.
+ if ( !this._IsLoaded )
+ {
+ this.Reload() ;
+ this._Div.style.visibility = '' ;
+ }
+
+ this.RefreshState() ;
+
+ // IE doens't get the offsetWidth and offsetHeight values if the element is not visible.
+ // So the Popup must be "shown" with no size to be able to get these values.
+ this._Popup.show( x, y, 0, 0 ) ;
+
+ // This was the previous solution. It works well to.
+ // So a temporary element is created to get this for us.
+ /*
+ if ( !this._DivCopy )
+ {
+ this._DivCopy = document.createElement( 'DIV' ) ;
+ this._DivCopy.className = 'CM_ContextMenu' ;
+ this._DivCopy.style.position = 'absolute' ;
+ this._DivCopy.style.visibility = 'hidden' ;
+ document.body.appendChild( this._DivCopy );
+ }
+
+ this._DivCopy.innerHTML = this._Div.innerHTML ;
+ */
+
+ // Show the Popup at the specified location.
+ this._Popup.show( x, y, this._Div.offsetWidth, this._Div.offsetHeight ) ;
+}
+
+FCKContextMenu.Hide = function()
+{
+ if ( this._Popup )
+ this._Popup.hide() ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcoreextensions.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcoreextensions.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckcoreextensions.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,84 @@
+/*
+ * 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: 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 )
+{
+ var L1 = this.length ;
+ var L2 = value.length ;
+
+ if ( L2 > L1 )
+ return false ;
+
+ return ( L2 == 0 || this.substr( L1 - L2, L2 ) == value ) ;
+}
+
+String.prototype.remove = function( start, length )
+{
+ var s = '' ;
+
+ if ( start > 0 )
+ s = this.substring( 0, start ) ;
+
+ if ( start + length < this.length )
+ s += this.substring( start + length , this.length ) ;
+
+ return s ;
+}
+
+String.prototype.trim = function()
+{
+ return this.replace( /(^\s*)|(\s*$)/g, '' ) ;
+}
+
+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 ) ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckdebug.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckdebug.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckdebug.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,37 @@
+/*
+ * 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: 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 )
+ {
+ if ( ! FCKConfig.Debug ) return ;
+
+ if ( message != null && isNaN( message ) )
+ message = message.replace(/= 5 )
+ {
+ sUserLang = sUserLang.substr(0,5) ;
+ if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
+ }
+
+ // If the user's browser is set to, for example, "pt-br" but only the
+ // "pt" language file is available then get that file.
+ if ( sUserLang.length >= 2 )
+ {
+ sUserLang = sUserLang.substr(0,2) ;
+ if ( this.AvailableLanguages[sUserLang] ) return sUserLang ;
+ }
+ }
+
+ return this.DefaultLanguage ;
+}
+
+FCKLanguageManager.TranslateElements = function( targetDocument, tag, propertyToSet )
+{
+ var aInputs = targetDocument.getElementsByTagName(tag) ;
+
+ for ( var i = 0 ; i < aInputs.length ; i++ )
+ {
+ var sKey = aInputs[i].getAttribute( 'fckLang' ) ;
+
+ if ( sKey )
+ {
+ var s = FCKLang[ sKey ] ;
+ if ( s )
+ eval( 'aInputs[i].' + propertyToSet + ' = s' ) ;
+ }
+ }
+}
+
+FCKLanguageManager.TranslatePage = function( targetDocument )
+{
+ this.TranslateElements( targetDocument, 'INPUT', 'value' ) ;
+ this.TranslateElements( targetDocument, 'SPAN', 'innerHTML' ) ;
+ this.TranslateElements( targetDocument, 'LABEL', 'innerHTML' ) ;
+ this.TranslateElements( targetDocument, 'OPTION', 'innerHTML' ) ;
+}
+
+if ( FCKLanguageManager.AvailableLanguages[ FCKConfig.DefaultLanguage ] )
+ FCKLanguageManager.DefaultLanguage = FCKConfig.DefaultLanguage ;
+else
+ FCKLanguageManager.DefaultLanguage = 'en' ;
+
+FCKLanguageManager.ActiveLanguage = new Object() ;
+FCKLanguageManager.ActiveLanguage.Code = FCKLanguageManager.GetActiveLanguage() ;
+FCKLanguageManager.ActiveLanguage.Name = FCKLanguageManager.AvailableLanguages[ FCKLanguageManager.ActiveLanguage.Code ] ;
+
+FCK.Language = FCKLanguageManager ;
+
+// Load the language file and start the editor.
+LoadLanguageFile() ;
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcknamespace.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcknamespace.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcknamespace.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,25 @@
+/*
+ * 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: 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() ;
+
Index: lams_central/web/fckeditor/editor/_source/internals/fckplugins.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckplugins.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckplugins.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,42 @@
+/*
+ * 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: 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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckregexlib.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckregexlib.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckregexlib.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,49 @@
+/*
+ * 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: 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 "'" entity.
+FCKRegexLib.AposEntity = /'/gi ;
+
+// Used by the Styles combo to identify styles that can't be applied to text.
+FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|INPUT|SELECT|TEXTAREA|HR|OBJECT)$/i ;
+
+// Block Elements.
+FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI)$/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]*\]*\>)([\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 = / /i ;
+
+FCKRegexLib.TableBorderClass = /\s*FCK__ShowTableBorders\s*/ ;
+
+FCKRegexLib.ElementName = /^[A-Za-z_:][\w.-:]*$/ ;
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckscriptloader.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,112 @@
+/*
+ * 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: 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 ;
+
+// window.status = ( 'Loading ' + sScriptPath + '...' ) ;
+
+ // Dynamically load the file (it can be a CSS or a JS)
+ var e ;
+
+ // If is a CSS
+ if ( sScriptPath.lastIndexOf( '.css' ) > 0 )
+ {
+ e = document.createElement( 'LINK' ) ;
+ e.rel = 'stylesheet' ;
+ e.type = 'text/css' ;
+ }
+ // It is a JS
+ else
+ {
+ e = document.createElement( "script" ) ;
+ e.type = "text/javascript" ;
+ }
+
+ // Add the new object to the HEAD.
+ document.getElementsByTagName("head")[0].appendChild( e ) ;
+
+ // 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 = sScriptPath ;
+ }
+ else
+ {
+ // Gecko fires the "onload" event and IE fires "onreadystatechange"
+ e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ;
+ e.src = sScriptPath ;
+ }
+ }
+ else
+ {
+ this.IsLoading = false ;
+
+ // Call the "OnEmpty" event.
+ if ( this.OnEmpty )
+ this.OnEmpty() ;
+ }
+}
+
+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() ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckselection.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,20 @@
+/*
+ * 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: fckselection.js
+ * Active selection functions.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKSelection = new Object() ;
+
+FCK.Selection = FCKSelection ;
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckselection_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,137 @@
+/*
+ * 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: 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 = FCK.EditorWindow.getSelection() ;
+ if ( oSel && oSel.rangeCount == 1 )
+ {
+ var oRange = oSel.getRangeAt(0) ;
+ if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 )
+ this._Type = 'Control' ;
+ }
+// }
+ return this._Type ;
+}
+
+// Retrieves the selected element (if any), just in the case that a single
+// element (object like and image or a table) is selected.
+FCKSelection.GetSelectedElement = function()
+{
+ if ( this.GetType() == 'Control' )
+ {
+ var oSel = FCK.EditorWindow.getSelection() ;
+ return oSel.anchorNode.childNodes[ oSel.anchorOffset ] ;
+ }
+}
+
+FCKSelection.GetParentElement = function()
+{
+ if ( this.GetType() == 'Control' )
+ return FCKSelection.GetSelectedElement().parentElement ;
+ else
+ {
+ var 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.tagName == nodeTagName ) return true ;
+ oContainer = oContainer.parentNode ;
+ }
+
+ return false ;
+}
+
+// The "nodeTagName" parameter must be Upper Case.
+FCKSelection.MoveToAncestorNode = function( nodeTagName )
+{
+ var oNode ;
+
+ var oContainer = this.GetSelectedElement() ;
+ if ( ! oContainer )
+ oContainer = FCK.EditorWindow.getSelection().getRangeAt(0).startContainer ;
+
+ while ( oContainer )
+ {
+ if ( oContainer.tagName == nodeTagName ) return oContainer ;
+ oContainer = oContainer.parentNode ;
+ }
+}
+
+FCKSelection.Delete = function()
+{
+ // Gets the actual selection.
+ var oSel = FCK.EditorWindow.getSelection() ;
+
+ // Deletes the actual selection contents.
+ for ( var i = 0 ; i < oSel.rangeCount ; i++ )
+ {
+ oSel.getRangeAt(i).deleteContents() ;
+ }
+
+ return oSel ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckselection_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,127 @@
+/*
+ * 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: 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()
+{
+ if ( this.GetType() == 'Control' )
+ return FCKSelection.GetSelectedElement().parentElement ;
+ else
+ 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 ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktablehandler.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,350 @@
+/*
+ * 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: 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 )
+ table = FCKSelection.MoveToAncestorNode("TABLE") ;
+ if ( !table ) return ;
+
+ // Delete the table.
+ table.parentNode.removeChild( table ) ;
+}
+
+FCKTableHandler.InsertColumn = function()
+{
+ // Get the cell where the selection is placed in.
+ var oCell = FCKSelection.MoveToAncestorNode("TD") ;
+ if ( !oCell ) return ;
+
+ // Get the cell's table.
+ var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
+
+ // Get the index of the column to be created (based on the cell).
+ var iIndex = oCell.cellIndex + 1 ;
+
+ // Loop throw all rows available in the table.
+ for ( var i = 0 ; i < oTable.rows.length ; i++ )
+ {
+ // Get the row.
+ var oRow = oTable.rows[i] ;
+
+ // If the row doens't have enought cells, ignore it.
+ if ( oRow.cells.length < iIndex )
+ continue ;
+
+ // Create the new cell element to be added.
+ oCell = FCK.EditorDocument.createElement('TD') ;
+ oCell.innerHTML = ' ' ;
+
+ // Get the cell that is placed in the new cell place.
+ var oBaseCell = oRow.cells[iIndex] ;
+
+ // If the cell is available (we are not in the last cell of the row).
+ if ( oBaseCell )
+ {
+ // Insert the new cell just before of it.
+ oRow.insertBefore( oCell, oBaseCell ) ;
+ }
+ else
+ {
+ // Append the cell at the end of the row.
+ oRow.appendChild( oCell ) ;
+ }
+ }
+}
+
+FCKTableHandler.DeleteColumns = function()
+{
+ // Get the cell where the selection is placed in.
+ var oCell = FCKSelection.MoveToAncestorNode("TD") ;
+ if ( !oCell ) return ;
+
+ // Get the cell's table.
+ var oTable = FCKTools.GetElementAscensor( oCell, 'TABLE' ) ;
+
+ // Get the cell index.
+ var iIndex = oCell.cellIndex ;
+
+ // Loop throw all rows (from down to up, because it's possible that some
+ // rows will be deleted).
+ for ( var i = oTable.rows.length - 1 ; i >= 0 ; i-- )
+ {
+ // Get the row.
+ var oRow = oTable.rows[i] ;
+
+ // If the cell to be removed is the first one and the row has just one cell.
+ if ( iIndex == 0 && oRow.cells.length == 1 )
+ {
+ // Remove the entire row.
+ FCKTableHandler.DeleteRows( oRow ) ;
+ continue ;
+ }
+
+ // If the cell to be removed exists the delete it.
+ if ( oRow.cells[iIndex] )
+ oRow.removeChild( oRow.cells[iIndex] ) ;
+ }
+}
+
+FCKTableHandler.InsertCell = function( cell )
+{
+ // Get the cell where the selection is placed in.
+ var oCell = cell ? cell : FCKSelection.MoveToAncestorNode("TD") ;
+ if ( !oCell ) return ;
+
+ // Create the new cell element to be added.
+ var oNewCell = FCK.EditorDocument.createElement("TD");
+ oNewCell.innerHTML = " " ;
+
+ // If it is the last cell in the row.
+ if ( oCell.cellIndex == oCell.parentNode.cells.lenght - 1 )
+ {
+ // Add the new cell at the end of the row.
+ oCell.parentNode.appendChild( oNewCell ) ;
+ }
+ else
+ {
+ // Add the new cell before the next cell (after the active one).
+ oCell.parentNode.insertBefore( oNewCell, oCell.nextSibling ) ;
+ }
+
+ return oNewCell ;
+}
+
+FCKTableHandler.DeleteCell = function( cell )
+{
+ // If this is the last cell in the row.
+ if ( cell.parentNode.cells.length == 1 )
+ {
+ // Delete the entire row.
+ FCKTableHandler.DeleteRows( FCKTools.GetElementAscensor( cell, 'TR' ) ) ;
+ return ;
+ }
+
+ // Delete the cell from the row.
+ cell.parentNode.removeChild( cell ) ;
+}
+
+FCKTableHandler.DeleteCells = function()
+{
+ var aCells = FCKTableHandler.GetSelectedCells() ;
+
+ for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
+ {
+ FCKTableHandler.DeleteCell( aCells[i] ) ;
+ }
+}
+
+FCKTableHandler.MergeCells = function()
+{
+ // Get all selected cells.
+ var aCells = FCKTableHandler.GetSelectedCells() ;
+
+ // At least 2 cells must be selected.
+ if ( aCells.length < 2 )
+ return ;
+
+ // The merge can occour only if the selected cells are from the same row.
+ if ( aCells[0].parentNode != aCells[aCells.length-1].parentNode )
+ return ;
+
+ // Calculate the new colSpan for the first cell.
+ var iColSpan = isNaN( aCells[0].colSpan ) ? 1 : aCells[0].colSpan ;
+
+ var sHtml = '' ;
+
+ for ( var i = aCells.length - 1 ; i > 0 ; i-- )
+ {
+ iColSpan += isNaN( aCells[i].colSpan ) ? 1 : aCells[i].colSpan ;
+
+ // Append the HTML of each cell.
+ sHtml = aCells[i].innerHTML + sHtml ;
+
+ // Delete the cell.
+ FCKTableHandler.DeleteCell( aCells[i] ) ;
+ }
+
+ // Set the innerHTML of the remaining cell (the first one).
+ aCells[0].colSpan = iColSpan ;
+ aCells[0].innerHTML += sHtml ;
+}
+
+FCKTableHandler.SplitCell = function()
+{
+ // Check that just one cell is selected, otherwise return.
+ var aCells = FCKTableHandler.GetSelectedCells() ;
+ if ( aCells.length != 1 )
+ return ;
+
+ var aMap = this._CreateTableMap( aCells[0].parentNode.parentNode ) ;
+ var iCellIndex = FCKTableHandler._GetCellIndexSpan( aMap, aCells[0].parentNode.rowIndex , aCells[0] ) ;
+
+ var aCollCells = this._GetCollumnCells( aMap, iCellIndex ) ;
+
+ for ( var i = 0 ; i < aCollCells.length ; i++ )
+ {
+ if ( aCollCells[i] == aCells[0] )
+ {
+ var oNewCell = this.InsertCell( aCells[0] ) ;
+ if ( !isNaN( aCells[0].rowSpan ) && aCells[0].rowSpan > 1 )
+ oNewCell.rowSpan = aCells[0].rowSpan ;
+ }
+ else
+ {
+ if ( isNaN( aCollCells[i].colSpan ) )
+ aCollCells[i].colSpan = 2 ;
+ else
+ aCollCells[i].colSpan += 1 ;
+ }
+ }
+}
+
+// Get the cell index from a TableMap.
+FCKTableHandler._GetCellIndexSpan = function( tableMap, rowIndex, cell )
+{
+ if ( tableMap.length < rowIndex + 1 )
+ return ;
+
+ var oRow = tableMap[ rowIndex ] ;
+
+ for ( var c = 0 ; c < oRow.length ; c++ )
+ {
+ if ( oRow[c] == cell )
+ return c ;
+ }
+}
+
+// Get the cells available in a collumn of a TableMap.
+FCKTableHandler._GetCollumnCells = function( tableMap, collumnIndex )
+{
+ var aCollCells = new Array() ;
+
+ for ( var r = 0 ; r < tableMap.length ; r++ )
+ {
+ var oCell = tableMap[r][collumnIndex] ;
+ if ( oCell && ( aCollCells.length == 0 || aCollCells[ aCollCells.length - 1 ] != oCell ) )
+ aCollCells[ aCollCells.length ] = oCell ;
+ }
+
+ return aCollCells ;
+}
+
+// This function is quite hard to explain. It creates a matrix representing all cells in a table.
+// The difference here is that the "spanned" cells (colSpan and rowSpan) are duplicated on the matrix
+// cells that are "spanned". For example, a row with 3 cells where the second cell has colSpan=2 and rowSpan=3
+// will produce a bi-dimensional matrix with the following values (representing the cells):
+// Cell1, Cell2, Cell2, Cell 3
+// Cell4, Cell2, Cell2, Cell 5
+FCKTableHandler._CreateTableMap = function( table )
+{
+ var aRows = table.rows ;
+
+ // Row and Collumn counters.
+ var r = -1 ;
+
+ var aMap = new Array() ;
+
+ for ( var i = 0 ; i < aRows.length ; i++ )
+ {
+ r++ ;
+ if ( !aMap[r] )
+ aMap[r] = new Array() ;
+
+ var c = -1 ;
+
+ for ( var j = 0 ; j < aRows[i].cells.length ; j++ )
+ {
+ var oCell = aRows[i].cells[j] ;
+
+ c++ ;
+ while ( aMap[r][c] )
+ c++ ;
+
+ var iColSpan = isNaN( oCell.colSpan ) ? 1 : oCell.colSpan ;
+ var iRowSpan = isNaN( oCell.rowSpan ) ? 1 : oCell.rowSpan ;
+
+ for ( var rs = 0 ; rs < iRowSpan ; rs++ )
+ {
+ if ( !aMap[r + rs] )
+ aMap[r + rs] = new Array() ;
+
+ for ( var cs = 0 ; cs < iColSpan ; cs++ )
+ {
+ aMap[r + rs][c + cs] = aRows[i].cells[j] ;
+ }
+ }
+
+ c += iColSpan - 1 ;
+ }
+ }
+ return aMap ;
+}
+
+FCKTableHandler.ClearRow = function( tr )
+{
+ // Get the array of row's cells.
+ var aCells = tr.cells ;
+
+ // Replace the contents of each cell with "nbsp;".
+ for ( var i = 0 ; i < aCells.length ; i++ )
+ {
+ aCells[i].innerHTML = ' ' ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktablehandler_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,46 @@
+/*
+ * 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: 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 ;
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktablehandler_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,51 @@
+/*
+ * 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: 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() ;
+
+ 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 ;
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fcktoolbaritems.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktoolbaritems.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktoolbaritems.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,113 @@
+/*
+ * 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: 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 '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 '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 ;
+ }
+
+ FCKToolbarItems.LoadedItems[ itemName ] = oItem ;
+
+ return oItem ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktoolbarset.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktoolbarset.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktoolbarset.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,164 @@
+/*
+ * 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: 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() ;
+
+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' ) ;
+
+ 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
+ {
+ var 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.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() ;
+ }
+ }
+*/
+}
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,206 @@
+/*
+ * 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: 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.SetLinkedFieldValue: Sets 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.SetLinkedFieldValue = function( value )
+{
+ if ( FCKConfig.FormatOutput )
+ FCK.LinkedField.value = FCKCodeFormatter.Format( value ) ;
+ else
+ FCK.LinkedField.value = 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 )
+{
+ text = text.replace( /&/g, "&" ) ;
+ text = text.replace( /"/g, """ ) ;
+ text = text.replace( //g, ">" ) ;
+ text = text.replace( /'/g, "'" ) ;
+
+ 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 )
+{
+ // Initializes the Coordinates object that will be returned by the function.
+ var c = { X:0, Y:0 } ;
+
+ // Loop throw the offset chain.
+ while ( el )
+ {
+ c.X += el.offsetLeft ;
+ c.Y += el.offsetTop ;
+
+ el = el.offsetParent ;
+ }
+
+ // Return the Coordinates object
+ return c ;
+}
+
+FCKTools.GetElementAscensor = function( element, ascensorTagName )
+{
+ var e = element.parentNode ;
+
+ while ( e )
+ {
+ if ( e.nodeName == ascensorTagName )
+ return e ;
+
+ e = e.parentNode ;
+ }
+}
+
+FCKTools.Pause = function( miliseconds )
+{
+ var oStart = new Date() ;
+
+ while (true)
+ {
+ var oNow = new Date() ;
+ if ( miliseconds < oNow - oStart )
+ return ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,85 @@
+/*
+ * 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: fcktools_gecko.js
+ * Utility functions. (Gecko version).
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+// 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 ) ;
+}
+
+// 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 ) ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,68 @@
+/*
+ * 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: 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) {}
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckundo_gecko.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckundo_gecko.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckundo_gecko.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,4 @@
+var FCKUndo = new Object() ;
+
+FCKUndo.SaveUndoStep = function()
+{}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckundo_ie.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckundo_ie.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckundo_ie.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,78 @@
+var FCKUndo = new Object() ;
+
+FCKUndo.SavedData = new Array() ;
+FCKUndo.CurrentIndex = -1 ;
+
+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.Undo = function()
+{
+ if ( FCKUndo.CurrentIndex > 0 )
+ {
+ // 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.CurrentIndex < ( FCKUndo.SavedData.length - 1 ) )
+ {
+ // Go a step forward.
+ FCKUndo._ApplyUndoLevel( ++FCKUndo.CurrentIndex ) ;
+
+ FCK.Events.FireEvent( "OnSelectionChange" ) ;
+ }
+}
+
+FCKUndo._ApplyUndoLevel = function(level)
+{
+ var oData = FCKUndo.SavedData[ level ] ;
+
+ // Update the editor contents with that step data.
+ FCK.EditorDocument.body.innerHTML = oData[0] ;
+
+ if ( oData[1] )
+ {
+ var oRange = FCK.EditorDocument.selection.createRange() ;
+ oRange.moveToBookmark( oData[1] ) ;
+ oRange.select() ;
+ }
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckurlparams.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckurlparams.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckurlparams.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,30 @@
+/*
+ * 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: 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 ( i = 0 ; i < aParams.length ; i++ )
+{
+ var aParam = aParams[i].split('=') ;
+ var sParamName = aParam[0] ;
+ var sParamValue = aParam[1] ;
+
+ FCKURLParams[ sParamName ] = sParamValue ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckxhtml.js,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js 11 Aug 2005 06:26:03 -0000 1.1
@@ -0,0 +1,307 @@
+/*
+ * 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: 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() ;
+
+ if ( FCKConfig.ForceSimpleAmpersand )
+ sXHTML = sXHTML.replace( /___FCKAmp___/g, '&' ) ;
+
+ 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 )
+{
+ if ( htmlNode.hasChildNodes() )
+ {
+ // Get all children nodes.
+ var oChildren = htmlNode.childNodes ;
+
+ for ( var i = 0 ; i < oChildren.length ; i++ )
+ this._AppendNode( xmlNode, oChildren[i] ) ;
+ }
+ else
+ {
+ 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 )
+{
+ switch ( htmlNode.nodeType )
+ {
+ // Element Node.
+ case 1 :
+ // Mozilla insert custom nodes in the DOM.
+ if ( FCKBrowserInfo.IsGecko && htmlNode.hasAttribute('_moz_editor_bogus_node') )
+ return ;
+
+ // Create the Element.
+ var sNodeName = htmlNode.nodeName ;
+
+ // Check if the node name is valid, otherwise ignore this tag.
+ if ( !FCKRegexLib.ElementName.test( sNodeName ) )
+ return ;
+
+ sNodeName = sNodeName.toLowerCase() ;
+
+ if ( FCKBrowserInfo.IsGecko && sNodeName == 'br' && htmlNode.hasAttribute('type') && htmlNode.getAttribute( 'type', 2 ) == '_moz' )
+ return ;
+
+ // 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 == FCKXHtml.CurrentJobNum )
+ return ;
+ else
+ htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ;
+
+ // 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 ( sNodeName.length == 0 || sNodeName.substr(0,1) == '/' )
+// break ;
+
+ var oNode = this.XML.createElement( sNodeName ) ;
+
+ // Add all attributes.
+ FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ;
+
+ // 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 :
+ xmlNode.appendChild( this.XML.createComment( htmlNode.nodeValue ) ) ;
+ break ;
+
+ // Unknown Node type.
+ default :
+ xmlNode.appendChild( this.XML.createComment( "Element not supported - Type: " + htmlNode.nodeType + " Name: " + htmlNode.nodeName ) ) ;
+ break ;
+ }
+}
+
+// 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 )
+{
+ // The "ALT" attribute is required in XHTML.
+ if ( ! node.attributes.getNamedItem( 'alt' ) )
+ FCKXHtml._AppendAttribute( node, 'alt', '' ) ;
+
+ 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
+
+
+
+
+
+