]*>.*?)(<\/P>)","gi") ; // Different because of a IE 5.0 error
-// html = html.replace( re, "
" ) ;
-
-// FCK.InsertHtml( html ) ;
-//}
-
FCK.Preview = function()
{
var iWidth = FCKConfig.ScreenWidth * 0.8 ;
@@ -135,9 +96,10 @@
sHTML =
FCKConfig.DocType +
'' +
- '
' + FCKLang.Preview + '' +
- '
' +
+ '' +
FCK.TempBaseTag +
+ '
' + FCKLang.Preview + '' +
+ FCK._GetEditorAreaStyleTags() +
'' +
FCK.GetXHTML() +
'' ;
@@ -147,36 +109,34 @@
oWindow.document.close();
}
-FCK.SwitchEditMode = function()
+FCK.SwitchEditMode = function( noUndo )
{
- // Check if the actual mode is WYSIWYG.
- var bWYSIWYG = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
+ var bIsWysiwyg = ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) ;
+ var sHtml ;
- // 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 ( bIsWysiwyg )
{
- if ( FCKBrowserInfo.IsIE )
+ if ( !noUndo && FCKBrowserInfo.IsIE )
FCKUndo.SaveUndoStep() ;
- // EnableXHTML and EnableSourceXHTML has been deprecated
-// document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
- document.getElementById('eSourceField').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
+ sHtml = FCK.GetXHTML( FCKConfig.FormatSource ) ;
}
else
- FCK.SetHTML( document.getElementById('eSourceField').value, true ) ;
+ sHtml = this.EditingArea.Textarea.value ;
- // Updates the actual mode status.
- FCK.EditMode = bWYSIWYG ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
-
- // Update the toolbar.
- FCKToolbarSet.RefreshModeState() ;
+ FCK.EditMode = bIsWysiwyg ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ;
+ FCK.SetHTML( sHtml ) ;
+
+ if ( FCKBrowserInfo.IsGecko )
+ window.onresize() ;
+
// Set the Focus.
FCK.Focus() ;
+
+ // Update the toolbar (Running it directly causes IE to fail).
+ FCKTools.RunFunction( FCK.ToolbarSet.RefreshModeState, FCK.ToolbarSet ) ;
}
FCK.CreateElement = function( tag )
@@ -187,17 +147,17 @@
FCK.InsertElementAndGetIt = function( e )
{
- e.setAttribute( '__FCKTempLabel', 1 ) ;
+ e.setAttribute( 'FCKTempLabel', 'true' ) ;
this.InsertElement( e ) ;
var aEls = FCK.EditorDocument.getElementsByTagName( e.tagName ) ;
for ( var i = 0 ; i < aEls.length ; i++ )
{
- if ( aEls[i].getAttribute( '__FCKTempLabel' ) )
+ if ( aEls[i].getAttribute( 'FCKTempLabel' ) )
{
- aEls[i].removeAttribute( '__FCKTempLabel' ) ;
+ aEls[i].removeAttribute( 'FCKTempLabel' ) ;
return aEls[i] ;
}
}
Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js (.../fck_2_gecko.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js (.../fck_2_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js (.../fck_2_ie.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js (.../fck_2_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -48,23 +48,25 @@
if ( FCKConfig.ForcePasteAsPlainText )
{
FCK.PasteAsPlainText() ;
- return false ;
+ return ;
}
- else if ( FCKConfig.AutoDetectPasteFromWord )
+
+ var sHTML = FCK.GetClipboardHTML() ;
+
+ if ( FCKConfig.AutoDetectPasteFromWord )
{
- var sHTML = FCK.GetClipboardHTML() ;
var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ;
if ( re.test( sHTML ) )
{
if ( confirm( FCKLang["PasteWordConfirm"] ) )
{
FCK.PasteFromWord() ;
- return false ;
+ return ;
}
}
}
- else
- return true ;
+
+ FCK.InsertHtml( sHTML ) ;
}
FCK.PasteAsPlainText = function()
Index: lams_central/web/fckeditor/editor/_source/internals/fck_contextmenu.js
===================================================================
diff -u
--- lams_central/web/fckeditor/editor/_source/internals/fck_contextmenu.js (revision 0)
+++ lams_central/web/fckeditor/editor/_source/internals/fck_contextmenu.js (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -0,0 +1,287 @@
+/*
+ * FCKeditor - The text editor for internet
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
+ *
+ * Licensed under the terms of the GNU Lesser General Public License:
+ * http://www.opensource.org/licenses/lgpl-license.php
+ *
+ * For further information visit:
+ * http://www.fckeditor.net/
+ *
+ * "Support Open Source software. What about a donation today?"
+ *
+ * File Name: fck_contextmenu.js
+ * Defines the FCK.ContextMenu object that is responsible for all
+ * Context Menu operations in the editing area.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+FCK.ContextMenu = new Object() ;
+FCK.ContextMenu.Listeners = new Array() ;
+
+FCK.ContextMenu.RegisterListener = function( listener )
+{
+ if ( listener )
+ this.Listeners.push( listener ) ;
+}
+
+function FCK_ContextMenu_Init()
+{
+ var oInnerContextMenu = FCK.ContextMenu._InnerContextMenu = new FCKContextMenu( FCKBrowserInfo.IsIE ? window : window.parent, FCK.EditorWindow, FCKLang.Dir ) ;
+ oInnerContextMenu.OnBeforeOpen = FCK_ContextMenu_OnBeforeOpen ;
+ oInnerContextMenu.OnItemClick = FCK_ContextMenu_OnItemClick ;
+
+ // Get the registering function.
+ var oMenu = FCK.ContextMenu ;
+
+ // Register all configured context menu listeners.
+ for ( var i = 0 ; i < FCKConfig.ContextMenu.length ; i++ )
+ oMenu.RegisterListener( FCK_ContextMenu_GetListener( FCKConfig.ContextMenu[i] ) ) ;
+}
+
+function FCK_ContextMenu_GetListener( listenerName )
+{
+ switch ( listenerName )
+ {
+ case 'Generic' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ menu.AddItem( 'Cut' , FCKLang.Cut , 7, FCKCommands.GetCommand( 'Cut' ).GetState() == FCK_TRISTATE_DISABLED ) ;
+ menu.AddItem( 'Copy' , FCKLang.Copy , 8, FCKCommands.GetCommand( 'Copy' ).GetState() == FCK_TRISTATE_DISABLED ) ;
+ menu.AddItem( 'Paste' , FCKLang.Paste , 9, FCKCommands.GetCommand( 'Paste' ).GetState() == FCK_TRISTATE_DISABLED ) ;
+ }} ;
+
+ case 'Table' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ var bIsTable = ( tagName == 'TABLE' ) ;
+ var bIsCell = ( !bIsTable && FCKSelection.HasAncestorNode( 'TABLE' ) ) ;
+
+ if ( bIsCell )
+ {
+ menu.AddSeparator() ;
+ var oItem = menu.AddItem( 'Cell' , FCKLang.CellCM ) ;
+ oItem.AddItem( 'TableInsertCell' , FCKLang.InsertCell, 58 ) ;
+ oItem.AddItem( 'TableDeleteCells' , FCKLang.DeleteCells, 59 ) ;
+ oItem.AddItem( 'TableMergeCells' , FCKLang.MergeCells, 60 ) ;
+ oItem.AddItem( 'TableSplitCell' , FCKLang.SplitCell, 61 ) ;
+ oItem.AddSeparator() ;
+ oItem.AddItem( 'TableCellProp' , FCKLang.CellProperties, 57 ) ;
+
+ menu.AddSeparator() ;
+ oItem = menu.AddItem( 'Row' , FCKLang.RowCM ) ;
+ oItem.AddItem( 'TableInsertRow' , FCKLang.InsertRow, 62 ) ;
+ oItem.AddItem( 'TableDeleteRows' , FCKLang.DeleteRows, 63 ) ;
+
+ menu.AddSeparator() ;
+ oItem = menu.AddItem( 'Column' , FCKLang.ColumnCM ) ;
+ oItem.AddItem( 'TableInsertColumn' , FCKLang.InsertColumn, 64 ) ;
+ oItem.AddItem( 'TableDeleteColumns' , FCKLang.DeleteColumns, 65 ) ;
+ }
+
+ if ( bIsTable || bIsCell )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'TableDelete' , FCKLang.TableDelete ) ;
+ menu.AddItem( 'TableProp' , FCKLang.TableProperties, 39 ) ;
+ }
+ }} ;
+
+ case 'Link' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( FCK.GetNamedCommandState( 'Unlink' ) != FCK_TRISTATE_DISABLED )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Link' , FCKLang.EditLink , 34 ) ;
+ menu.AddItem( 'Unlink' , FCKLang.RemoveLink , 35 ) ;
+ }
+ }} ;
+
+ case 'Image' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'IMG' && !tag.getAttribute( '_fckfakelement' ) )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Image', FCKLang.ImageProperties, 37 ) ;
+ }
+ }} ;
+
+ case 'Anchor' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'IMG' && tag.getAttribute( '_fckanchor' ) )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Anchor', FCKLang.AnchorProp, 36 ) ;
+ }
+ }} ;
+
+ case 'Flash' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'IMG' && tag.getAttribute( '_fckflash' ) )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Flash', FCKLang.FlashProperties, 38 ) ;
+ }
+ }} ;
+
+ case 'Form' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( FCKSelection.HasAncestorNode('FORM') )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Form', FCKLang.FormProp, 48 ) ;
+ }
+ }} ;
+
+ case 'Checkbox' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && tag.type == 'checkbox' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Checkbox', FCKLang.CheckboxProp, 49 ) ;
+ }
+ }} ;
+
+ case 'Radio' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && tag.type == 'radio' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Radio', FCKLang.RadioButtonProp, 50 ) ;
+ }
+ }} ;
+
+ case 'TextField' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && ( tag.type == 'text' || tag.type == 'password' ) )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'TextField', FCKLang.TextFieldProp, 51 ) ;
+ }
+ }} ;
+
+ case 'HiddenField' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && tag.type == 'hidden' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'HiddenField', FCKLang.HiddenFieldProp, 56 ) ;
+ }
+ }} ;
+
+ case 'ImageButton' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && tag.type == 'image' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'ImageButton', FCKLang.ImageButtonProp, 55 ) ;
+ }
+ }} ;
+
+ case 'Button' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'INPUT' && ( tag.type == 'button' || tag.type == 'submit' || tag.type == 'reset' ) )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Button', FCKLang.ButtonProp, 54 ) ;
+ }
+ }} ;
+
+ case 'Select' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'SELECT' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Select', FCKLang.SelectionFieldProp, 53 ) ;
+ }
+ }} ;
+
+ case 'Textarea' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( tagName == 'TEXTAREA' )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'Textarea', FCKLang.TextareaProp, 52 ) ;
+ }
+ }} ;
+
+ case 'BulletedList' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( FCKSelection.HasAncestorNode('UL') )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'BulletedList', FCKLang.BulletedListProp, 27 ) ;
+ }
+ }} ;
+
+ case 'NumberedList' :
+ return {
+ AddItems : function( menu, tag, tagName )
+ {
+ if ( FCKSelection.HasAncestorNode('OL') )
+ {
+ menu.AddSeparator() ;
+ menu.AddItem( 'NumberedList', FCKLang.NumberedListProp, 26 ) ;
+ }
+ }} ;
+ }
+}
+
+function FCK_ContextMenu_OnBeforeOpen()
+{
+ // Update the UI.
+ FCK.Events.FireEvent( "OnSelectionChange" ) ;
+
+ // Get the actual selected tag (if any).
+ var oTag, sTagName ;
+
+ if ( oTag = FCKSelection.GetSelectedElement() )
+ sTagName = oTag.tagName ;
+
+ // Cleanup the current menu items.
+ var oMenu = FCK.ContextMenu._InnerContextMenu ;
+ oMenu.RemoveAllItems() ;
+
+ // Loop through the listeners.
+ var aListeners = FCK.ContextMenu.Listeners ;
+ for ( var i = 0 ; i < aListeners.length ; i++ )
+ aListeners[i].AddItems( oMenu, oTag, sTagName ) ;
+}
+
+function FCK_ContextMenu_OnItemClick( item )
+{
+ FCK.Focus() ;
+ FCKCommands.GetCommand( item.Name ).Execute() ;
+}
\ No newline at end of file
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fck_last.js'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fck_onload.js'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/web/fckeditor/editor/_source/internals/fckbrowserinfo.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckbrowserinfo.js (.../fckbrowserinfo.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckbrowserinfo.js (.../fckbrowserinfo.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -11,22 +11,27 @@
* "Support Open Source software. What about a donation today?"
*
* File Name: fckbrowserinfo.js
- * Defines the FCKBrowserInfo object that hold some browser informations.
+ * Contains browser detection information.
*
* File Authors:
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
-var FCKBrowserInfo ;
+var s = navigator.userAgent.toLowerCase() ;
-if ( !( FCKBrowserInfo = NS.FCKBrowserInfo ) )
+var FCKBrowserInfo =
{
- FCKBrowserInfo = NS.FCKBrowserInfo = new Object() ;
+ IsIE : s.Contains('msie'),
+ IsIE7 : s.Contains('msie 7'),
+ IsGecko : s.Contains('gecko/'),
+ IsSafari : s.Contains('safari'),
+ IsOpera : s.Contains('opera')
+}
- var sAgent = navigator.userAgent.toLowerCase() ;
+FCKBrowserInfo.IsGeckoLike = FCKBrowserInfo.IsGecko || FCKBrowserInfo.IsSafari || FCKBrowserInfo.IsOpera ;
- FCKBrowserInfo.IsIE = ( sAgent.indexOf("msie") != -1 ) ;
- FCKBrowserInfo.IsGecko = !FCKBrowserInfo.IsIE ;
- FCKBrowserInfo.IsSafari = ( sAgent.indexOf("safari") != -1 ) ;
- FCKBrowserInfo.IsNetscape = ( sAgent.indexOf("netscape") != -1 ) ;
-}
+if ( FCKBrowserInfo.IsGecko )
+{
+ var sGeckoVersion = s.match( /gecko\/(\d+)/ )[1] ;
+ FCKBrowserInfo.IsGecko10 = sGeckoVersion < 20051111 ; // Actually "10" refers to versions before Firefox 1.5, where Gecko 20051111 has been released.
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js (.../fckcodeformatter.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js (.../fckcodeformatter.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -17,79 +17,80 @@
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
-var FCKCodeFormatter ;
+var FCKCodeFormatter = new Object() ;
-if ( !( FCKCodeFormatter = NS.FCKCodeFormatter ) )
+FCKCodeFormatter.Init = function()
{
- FCKCodeFormatter = NS.FCKCodeFormatter = new Object() ;
+ var oRegex = this.Regex = new Object() ;
- FCKCodeFormatter.Regex = new Object() ;
-
// Regex for line breaks.
- FCKCodeFormatter.Regex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
- FCKCodeFormatter.Regex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
+ oRegex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
+ oRegex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ;
- FCKCodeFormatter.Regex.NewLineTags = /\<(BR|HR)[^\>]\>/gi ;
+ oRegex.NewLineTags = /\<(BR|HR)[^\>]*\>/gi ;
- FCKCodeFormatter.Regex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ;
+ oRegex.MainTags = /\<\/?(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR)[^\>]*\>/gi ;
- FCKCodeFormatter.Regex.LineSplitter = /\s*\n+\s*/g ;
+ oRegex.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 ) ;
+ oRegex.IncreaseIndent = /^\<(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \/\>]/i ;
+ oRegex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i ;
+ oRegex.FormatIndentatorRemove = new RegExp( '^' + FCKConfig.FormatIndentator ) ;
- FCKCodeFormatter.Regex.ProtectedTags = /(
]*>)([\s\S]*?)(<\/PRE>)/gi ;
+ oRegex.ProtectedTags = /(]*>)([\s\S]*?)(<\/PRE>)/gi ;
+}
- FCKCodeFormatter._ProtectData = function( outer, opener, data, closer )
- {
- return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.addItem( data ) + closer ;
- }
+FCKCodeFormatter._ProtectData = function( outer, opener, data, closer )
+{
+ return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.AddItem( data ) + closer ;
+}
- FCKCodeFormatter.Format = function( html )
+FCKCodeFormatter.Format = function( html )
+{
+ if ( !this.Regex )
+ this.Init() ;
+
+ // Protected content that remain untouched during the
+ // process go in the following array.
+ FCKCodeFormatter.ProtectedData = new Array() ;
+
+ var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ;
+
+ // Line breaks.
+ sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ; ;
+ sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ;
+ sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ;
+ sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ;
+
+ // Indentation.
+ var sIndentation = '' ;
+
+ var asLines = sFormatted.split( this.Regex.LineSplitter ) ;
+ sFormatted = '' ;
+
+ for ( var i = 0 ; i < asLines.length ; i++ )
{
- // Protected content that remain untouched during the
- // process go in the following array.
- FCKCodeFormatter.ProtectedData = new Array() ;
+ var sLine = asLines[i] ;
- var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ;
-
- // Line breaks.
- sFormatted = sFormatted.replace( this.Regex.BlocksOpener, '\n$&' ) ; ;
- sFormatted = sFormatted.replace( this.Regex.BlocksCloser, '$&\n' ) ;
- sFormatted = sFormatted.replace( this.Regex.NewLineTags, '$&\n' ) ;
- sFormatted = sFormatted.replace( this.Regex.MainTags, '\n$&\n' ) ;
+ if ( sLine.length == 0 )
+ continue ;
- // 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, '' ) ;
+ 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 ;
- }
+ sFormatted += sIndentation + sLine + '\n' ;
- // Now we put back the protected data.
- for ( var i = 0 ; i < FCKCodeFormatter.ProtectedData.length ; i++ )
- {
- var oRegex = new RegExp( '___FCKpd___' + i ) ;
- sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[i] ) ;
- }
-
- return sFormatted.trim() ;
+ if ( this.Regex.IncreaseIndent.test( sLine ) )
+ sIndentation += FCKConfig.FormatIndentator ;
}
+
+ // Now we put back the protected data.
+ for ( var i = 0 ; i < FCKCodeFormatter.ProtectedData.length ; i++ )
+ {
+ var oRegex = new RegExp( '___FCKpd___' + i ) ;
+ sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[i].replace( /\$/g, '$$$$' ) ) ;
+ }
+
+ return sFormatted.trim() ;
}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckcommands.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckcommands.js (.../fckcommands.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckcommands.js (.../fckcommands.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -37,6 +37,7 @@
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 'Unlink' : oCommand = new FCKUnlinkCommand() ; 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 ;
@@ -49,7 +50,7 @@
case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 400 ) ; break ;
case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 320 ) ; break ;
case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ;
- case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 400, 250 ) ; break ;
+ case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 450, 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 ;
@@ -93,6 +94,7 @@
case 'ImageButton' : oCommand = new FCKDialogCommand( 'ImageButton', FCKLang.ImageButton , 'dialog/fck_image.html?ImageButton', 450, 400 ) ; break ;
case 'SpellCheck' : oCommand = new FCKSpellCheckCommand() ; break ;
+ case 'FitWindow' : oCommand = new FCKFitWindow() ; break ;
case 'Undo' : oCommand = new FCKUndoCommand() ; break ;
case 'Redo' : oCommand = new FCKRedoCommand() ; break ;
Index: lams_central/web/fckeditor/editor/_source/internals/fckconfig.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckconfig.js (.../fckconfig.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckconfig.js (.../fckconfig.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -19,12 +19,18 @@
var FCKConfig = FCK.Config = new Object() ;
+/*
+ For the next major version (probably 3.0) we should move all this stuff to
+ another dedicated object and leave FCKConfig as a holder object for settings only).
+*/
+
// Editor Base Path
if ( document.location.protocol == 'file:' )
{
FCKConfig.BasePath = unescape( document.location.pathname.substr(1) ) ;
FCKConfig.BasePath = FCKConfig.BasePath.replace( /\\/gi, '/' ) ;
FCKConfig.BasePath = 'file://' + FCKConfig.BasePath.substring(0,FCKConfig.BasePath.lastIndexOf('/')+1) ;
+ FCKConfig.FullBasePath = FCKConfig.BasePath ;
}
else
{
@@ -87,12 +93,31 @@
}
}
-FCKConfig.LoadPageConfig = function()
+function FCKConfig_LoadPageConfig()
{
- for ( var sKey in this.PageConfig )
- FCKConfig[ sKey ] = this.PageConfig[ sKey ] ;
+ var oPageConfig = FCKConfig.PageConfig ;
+ for ( var sKey in oPageConfig )
+ FCKConfig[ sKey ] = oPageConfig[ sKey ] ;
}
+function FCKConfig_PreProcess()
+{
+ var oConfig = FCKConfig ;
+
+ // Force debug mode if fckdebug=true in the QueryString (main page).
+ if ( oConfig.AllowQueryStringDebug && (/fckdebug=true/i).test( window.top.location.search ) )
+ oConfig.Debug = true ;
+
+ // Certifies that the "PluginsPath" configuration ends with a slash.
+ if ( !oConfig.PluginsPath.endsWith('/') )
+ oConfig.PluginsPath += '/' ;
+
+ // EditorAreaCSS accepts an array of paths or a single path (as string).
+ // In the last case, transform it in an array.
+ if ( typeof( oConfig.EditorAreaCSS ) == 'string' )
+ oConfig.EditorAreaCSS = [ oConfig.EditorAreaCSS ] ;
+}
+
// Define toolbar sets collection.
FCKConfig.ToolbarSets = new Object() ;
@@ -102,7 +127,7 @@
FCKConfig.Plugins.Add = function( name, langs, path )
{
- FCKConfig.Plugins.Items.addItem( [name, langs, path] ) ;
+ FCKConfig.Plugins.Items.AddItem( [name, langs, path] ) ;
}
// FCKConfig.ProtectedSource: object that holds a collection of Regular
@@ -113,7 +138,7 @@
FCKConfig.ProtectedSource.Add = function( regexPattern )
{
- this.RegexEntries.addItem( regexPattern ) ;
+ this.RegexEntries.AddItem( regexPattern ) ;
}
FCKConfig.ProtectedSource.Protect = function( html )
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_gecko.js'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu_ie.js'.
Fisheye: No comparison available. Pass `N' to diff?
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fckcoreextensions.js'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/web/fckeditor/editor/_source/internals/fckdebug.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckdebug.js (.../fckdebug.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckdebug.js (.../fckdebug.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -19,58 +19,59 @@
var FCKDebug = new Object() ;
-if ( FCKConfig.Debug )
+FCKDebug.Output = function( message, color, noParse )
{
- FCKDebug.Output = function( message, color, noParse )
- {
- if ( ! FCKConfig.Debug ) return ;
-
- if ( !noParse && message != null && isNaN( message ) )
- message = message.replace(/' ;
- if ( anyObject != null )
+ for (var prop in anyObject)
{
- message = 'Properties of: ' + anyObject + '' ;
-
- for (var prop in anyObject)
+ try
{
var sVal = anyObject[ prop ] ? anyObject[ prop ] + '' : '[null]' ;
- try
+ message += '' + prop + ' : ' + sVal.replace(/' ;
+ }
+ catch (e)
+ {
+ try
{
- message += '' + prop + ' : ' + sVal.replace(/' ;
- }
+ message += '' + prop + ' : [' + typeof( anyObject[ prop ] ) + ']
' ;
+ }
catch (e)
{
- message += '' + prop + ' : [' + typeof( anyObject[ prop ] ) + ']
' ;
+ message += '' + prop + ' : [-error-]
' ;
}
}
+ }
- message += '
' ;
- } else
- message = 'OutputObject : Object is "null".' ;
-
- FCKDebug.Output( message, color, true ) ;
- }
-}
-else
-{
- FCKDebug.Output = function() {}
- FCKDebug.OutputObject = function() {}
+ message += '
' ;
+ } else
+ message = 'OutputObject : Object is "null".' ;
+
+ FCKDebug.Output( message, color, true ) ;
}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckdialog.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckdialog.js (.../fckdialog.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckdialog.js (.../fckdialog.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
Index: lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js (.../fckdialog_gecko.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js (.../fckdialog_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -32,11 +32,14 @@
if ( !parentWindow )
parentWindow = window ;
+ FCKFocusManager.Lock() ;
+
var oWindow = parentWindow.open( '', 'FCKeditorDialog_' + dialogName, sOption, true ) ;
if ( !oWindow )
{
alert( FCKLang.DialogBlocked ) ;
+ FCKFocusManager.Unlock() ;
return ;
}
Index: lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js (.../fckdialog_ie.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js (.../fckdialog_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -22,9 +22,12 @@
if ( !parentWindow )
parentWindow = window ;
- this.IsOpened = true ;
+ FCKFocusManager.Lock() ;
- parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
+ var oReturn = parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ;
- this.IsOpened = false ;
+ if ( !oReturn )
+ alert( FCKLang.DialogBlocked ) ;
+
+ FCKFocusManager.Unlock() ;
}
Index: lams_central/web/fckeditor/editor/_source/internals/fckdocumentprocessor.js
===================================================================
diff -u
--- lams_central/web/fckeditor/editor/_source/internals/fckdocumentprocessor.js (revision 0)
+++ lams_central/web/fckeditor/editor/_source/internals/fckdocumentprocessor.js (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -0,0 +1,230 @@
+/*
+ * FCKeditor - The text editor for internet
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
+ *
+ * Licensed under the terms of the GNU Lesser General Public License:
+ * http://www.opensource.org/licenses/lgpl-license.php
+ *
+ * For further information visit:
+ * http://www.fckeditor.net/
+ *
+ * "Support Open Source software. What about a donation today?"
+ *
+ * File Name: fckdocumentprocessor.js
+ * Advanced document processors.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+
+var FCKDocumentProcessor = new Object() ;
+FCKDocumentProcessor._Items = new Array() ;
+
+FCKDocumentProcessor.AppendNew = function()
+{
+ var oNewItem = new Object() ;
+ this._Items.AddItem( oNewItem ) ;
+ return oNewItem ;
+}
+
+FCKDocumentProcessor.Process = function( document )
+{
+ var oProcessor, i = 0 ;
+ while( ( oProcessor = this._Items[i++] ) )
+ oProcessor.ProcessDocument( document ) ;
+}
+
+var FCKDocumentProcessor_CreateFakeImage = function( fakeClass, realElement )
+{
+ var oImg = FCK.EditorDocument.createElement( 'IMG' ) ;
+ oImg.className = fakeClass ;
+ oImg.src = FCKConfig.FullBasePath + 'images/spacer.gif' ;
+ oImg.setAttribute( '_fckfakelement', 'true', 0 ) ;
+ oImg.setAttribute( '_fckrealelement', FCKTempBin.AddElement( realElement ), 0 ) ;
+ return oImg ;
+}
+
+// Link Anchors
+var FCKAnchorsProcessor = FCKDocumentProcessor.AppendNew() ;
+FCKAnchorsProcessor.ProcessDocument = function( document )
+{
+ var aLinks = document.getElementsByTagName( 'A' ) ;
+
+ var oLink ;
+ var i = aLinks.length - 1 ;
+ while ( i >= 0 && ( oLink = aLinks[i--] ) )
+ {
+ // If it is anchor.
+ if ( oLink.name.length > 0 && ( !oLink.getAttribute('href') || oLink.getAttribute('href').length == 0 ) )
+ {
+ var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Anchor', oLink.cloneNode(true) ) ;
+ oImg.setAttribute( '_fckanchor', 'true', 0 ) ;
+
+ oLink.parentNode.insertBefore( oImg, oLink ) ;
+ oLink.parentNode.removeChild( oLink ) ;
+ }
+ }
+}
+
+// Page Breaks
+var FCKPageBreaksProcessor = FCKDocumentProcessor.AppendNew() ;
+FCKPageBreaksProcessor.ProcessDocument = function( document )
+{
+ var aDIVs = document.getElementsByTagName( 'DIV' ) ;
+
+ var eDIV ;
+ var i = aDIVs.length - 1 ;
+ while ( i >= 0 && ( eDIV = aDIVs[i--] ) )
+ {
+ if ( eDIV.style.pageBreakAfter == 'always' && eDIV.childNodes.length == 1 && eDIV.childNodes[0].style && eDIV.childNodes[0].style.display == 'none' )
+ {
+ var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', eDIV.cloneNode(true) ) ;
+
+ eDIV.parentNode.insertBefore( oFakeImage, eDIV ) ;
+ eDIV.parentNode.removeChild( eDIV ) ;
+ }
+ }
+/*
+ var aCenters = document.getElementsByTagName( 'CENTER' ) ;
+
+ var oCenter ;
+ var i = aCenters.length - 1 ;
+ while ( i >= 0 && ( oCenter = aCenters[i--] ) )
+ {
+ if ( oCenter.style.pageBreakAfter == 'always' && oCenter.innerHTML.trim().length == 0 )
+ {
+ var oFakeImage = FCKDocumentProcessor_CreateFakeImage( 'FCK__PageBreak', oCenter.cloneNode(true) ) ;
+
+ oCenter.parentNode.insertBefore( oFakeImage, oCenter ) ;
+ oCenter.parentNode.removeChild( oCenter ) ;
+ }
+ }
+*/
+}
+
+// Flash Embeds.
+var FCKFlashProcessor = FCKDocumentProcessor.AppendNew() ;
+FCKFlashProcessor.ProcessDocument = function( document )
+{
+ /*
+ Sample code:
+ This is some sample text. You are using FCKeditor.
+ */
+
+ var aEmbeds = document.getElementsByTagName( 'EMBED' ) ;
+
+ var oEmbed ;
+ var i = aEmbeds.length - 1 ;
+ while ( i >= 0 && ( oEmbed = aEmbeds[i--] ) )
+ {
+ if ( oEmbed.src.endsWith( '.swf', true ) )
+ {
+ var oCloned = oEmbed.cloneNode( true ) ;
+
+ // On IE, some properties are not getting clonned properly, so we
+ // must fix it. Thanks to Alfonso Martinez.
+ if ( FCKBrowserInfo.IsIE )
+ {
+ var oAtt ;
+ if ( oAtt = oEmbed.getAttribute( 'scale' ) ) oCloned.setAttribute( 'scale', oAtt ) ;
+ if ( oAtt = oEmbed.getAttribute( 'play' ) ) oCloned.setAttribute( 'play', oAtt ) ;
+ if ( oAtt = oEmbed.getAttribute( 'loop' ) ) oCloned.setAttribute( 'loop', oAtt ) ;
+ if ( oAtt = oEmbed.getAttribute( 'menu' ) ) oCloned.setAttribute( 'menu', oAtt ) ;
+ if ( oAtt = oEmbed.getAttribute( 'wmode' ) ) oCloned.setAttribute( 'wmode', oAtt ) ;
+ if ( oAtt = oEmbed.getAttribute( 'quality' ) ) oCloned.setAttribute( 'quality', oAtt ) ;
+ }
+
+ var oImg = FCKDocumentProcessor_CreateFakeImage( 'FCK__Flash', oCloned ) ;
+ oImg.setAttribute( '_fckflash', 'true', 0 ) ;
+
+ FCKFlashProcessor.RefreshView( oImg, oEmbed ) ;
+
+ oEmbed.parentNode.insertBefore( oImg, oEmbed ) ;
+ oEmbed.parentNode.removeChild( oEmbed ) ;
+
+// oEmbed.setAttribute( '_fcktemp', 'true', 0) ;
+// oEmbed.style.display = 'none' ;
+// oEmbed.hidden = true ;
+ }
+ }
+}
+
+FCKFlashProcessor.RefreshView = function( placholderImage, originalEmbed )
+{
+ if ( originalEmbed.width > 0 )
+ placholderImage.style.width = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.width ) ;
+
+ if ( originalEmbed.height > 0 )
+ placholderImage.style.height = FCKTools.ConvertHtmlSizeToStyle( originalEmbed.height ) ;
+}
+
+FCK.GetRealElement = function( fakeElement )
+{
+ var e = FCKTempBin.Elements[ fakeElement.getAttribute('_fckrealelement') ] ;
+
+ if ( fakeElement.getAttribute('_fckflash') )
+ {
+ if ( fakeElement.style.width.length > 0 )
+ e.width = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.width ) ;
+
+ if ( fakeElement.style.height.length > 0 )
+ e.height = FCKTools.ConvertStyleSizeToHtml( fakeElement.style.height ) ;
+ }
+
+ return e ;
+}
+
+// START iCM MODIFICATIONS
+/*
+var FCKTablesProcessor = FCKDocumentProcessor.AppendNew() ;
+FCKTablesProcessor.ProcessDocument = function( document )
+{
+ FCKTablesProcessor.CheckTablesNesting( document ) ;
+}
+
+// Ensure that tables are not incorrectly nested within P, H1, H2, etc tags
+FCKTablesProcessor.CheckTablesNesting = function( document )
+{
+ var aTables = document.getElementsByTagName( "TABLE" ) ;
+ var oParentNode ;
+
+ for ( var i=0; i]+)/gi ;
+
+FCKRegexLib.Html4DocType = /HTML 4\.0 Transitional/i ;
\ No newline at end of file
Fisheye: Tag e31d1853222ec105bcc6293bcc9ab9799dfc685b refers to a dead (removed) revision in file `lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js'.
Fisheye: No comparison available. Pass `N' to diff?
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckselection.js (.../fckselection.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection.js (.../fckselection.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -17,6 +17,4 @@
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
-var FCKSelection = new Object() ;
-
-FCK.Selection = FCKSelection ;
+var FCKSelection = FCK.Selection = new Object() ;
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js (.../fckselection_gecko.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js (.../fckselection_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -33,7 +33,7 @@
if ( oSel && oSel.rangeCount == 1 )
{
var oRange = oSel.getRangeAt(0) ;
- if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 )
+ if ( oRange.startContainer == oRange.endContainer && (oRange.endOffset - oRange.startOffset) == 1 && oRange.startContainer.nodeType != Node.TEXT_NODE )
this._Type = 'Control' ;
}
// }
@@ -72,7 +72,7 @@
FCKSelection.SelectNode = function( element )
{
- FCK.Focus() ;
+// FCK.Focus() ;
var oRange = FCK.EditorDocument.createRange() ;
oRange.selectNode( element ) ;
Index: lams_central/web/fckeditor/editor/_source/internals/fckselection_ie.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckselection_ie.js (.../fckselection_ie.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckselection_ie.js (.../fckselection_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -53,17 +53,32 @@
{
FCK.Focus() ;
FCK.EditorDocument.selection.empty() ;
- var oRange = FCK.EditorDocument.selection.createRange() ;
- oRange.moveToElementText( node ) ;
+
+ try
+ {
+ // Try to select the node as a control.
+ var oRange = FCK.EditorDocument.body.createControlRange() ;
+ oRange.addElement( node ) ;
+ }
+ catch(e)
+ {
+ // If failed, select it as a text range.
+ 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() ;
+ if ( this.GetType() == 'Text' )
+ {
+ var oRange = FCK.EditorDocument.selection.createRange() ;
+ oRange.collapse( toStart == null || toStart === true ) ;
+ oRange.select() ;
+ }
}
// The "nodeTagName" parameter must be Upper Case.
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js (.../fcktablehandler.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js (.../fcktablehandler.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -103,7 +103,7 @@
oCell = oRow.cells[iIndex-1].cloneNode(false) ;
if ( FCKBrowserInfo.IsGecko )
- oCell.innerHTML = FCKBrowserInfo.IsGecko ? GECKO_BOGUS : '' ;
+ oCell.innerHTML = GECKO_BOGUS ;
// Get the cell that is placed in the new cell place.
var oBaseCell = oRow.cells[iIndex] ;
@@ -218,21 +218,40 @@
var iColSpan = isNaN( aCells[0].colSpan ) ? 1 : aCells[0].colSpan ;
var sHtml = '' ;
+ var oCellsContents = FCK.EditorDocument.createDocumentFragment() ;
- for ( var i = aCells.length - 1 ; i > 0 ; i-- )
+ for ( var i = aCells.length - 1 ; i >= 0 ; i-- )
{
- iColSpan += isNaN( aCells[i].colSpan ) ? 1 : aCells[i].colSpan ;
+ var eCell = aCells[i] ;
- // Append the HTML of each cell.
- sHtml = aCells[i].innerHTML + sHtml ;
+ // Move its contents to the document fragment.
+ for ( var c = eCell.childNodes.length - 1 ; c >= 0 ; c-- )
+ {
+ var eChild = eCell.removeChild( eCell.childNodes[c] ) ;
+
+ if ( ( eChild.hasAttribute && eChild.hasAttribute('_moz_editor_bogus_node') ) || ( eChild.getAttribute && eChild.getAttribute( 'type', 2 ) == '_moz' ) )
+ continue ;
+
+ oCellsContents.insertBefore( eChild, oCellsContents.firstChild ) ;
+ }
- // Delete the cell.
- FCKTableHandler.DeleteCell( aCells[i] ) ;
+ if ( i > 0 )
+ {
+ // Accumulate the colspan of the cell.
+ iColSpan += isNaN( eCell.colSpan ) ? 1 : eCell.colSpan ;
+
+ // Delete the cell.
+ FCKTableHandler.DeleteCell( eCell ) ;
+ }
}
// Set the innerHTML of the remaining cell (the first one).
aCells[0].colSpan = iColSpan ;
- aCells[0].innerHTML += sHtml ;
+
+ if ( FCKBrowserInfo.IsGecko && oCellsContents.childNodes.length == 0 )
+ aCells[0].innerHTML = GECKO_BOGUS ;
+ else
+ aCells[0].appendChild( oCellsContents ) ;
}
FCKTableHandler.SplitCell = function()
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_gecko.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_gecko.js (.../fcktablehandler_gecko.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_gecko.js (.../fcktablehandler_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -26,7 +26,7 @@
// If the selection is a text.
if ( oSelection.rangeCount == 1 && oSelection.anchorNode.nodeType == 3 )
{
- var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD' ) ;
+ var oParent = FCKTools.GetElementAscensor( oSelection.anchorNode, 'TD,TH' ) ;
if ( oParent )
{
@@ -38,9 +38,14 @@
for ( var i = 0 ; i < oSelection.rangeCount ; i++ )
{
var oRange = oSelection.getRangeAt(i) ;
- var oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
+ var oCell ;
- if ( oCell.tagName == 'TD' )
+ if ( oRange.startContainer.tagName.Equals( 'TD', 'TH' ) )
+ oCell = oRange.startContainer ;
+ else
+ oCell = oRange.startContainer.childNodes[ oRange.startOffset ] ;
+
+ if ( oCell.tagName.Equals( 'TD', 'TH' ) )
aCells[aCells.length] = oCell ;
}
Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js (.../fcktablehandler_ie.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js (.../fcktablehandler_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -25,7 +25,7 @@
// var oParent = oRange.parentElement() ;
var oParent = FCKSelection.GetParentElement() ;
- if ( oParent && oParent.tagName == "TD" )
+ if ( oParent && oParent.tagName.Equals( 'TD', 'TH' ) )
aCells[0] = oParent ;
else
{
Index: lams_central/web/fckeditor/editor/_source/internals/fcktoolbaritems.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktoolbaritems.js (.../fcktoolbaritems.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktoolbaritems.js (.../fcktoolbaritems.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -34,77 +34,78 @@
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 'Source' : oItem = new FCKToolbarButton( 'Source' , FCKLang.Source, null, FCK_TOOLBARITEM_ICONTEXT, true, true, 1 ) ; break ;
+ case 'DocProps' : oItem = new FCKToolbarButton( 'DocProps' , FCKLang.DocProps, null, null, null, null, 2 ) ; break ;
+ case 'Save' : oItem = new FCKToolbarButton( 'Save' , FCKLang.Save, null, null, true, null, 3 ) ; break ;
+ case 'NewPage' : oItem = new FCKToolbarButton( 'NewPage' , FCKLang.NewPage, null, null, true, null, 4 ) ; break ;
+ case 'Preview' : oItem = new FCKToolbarButton( 'Preview' , FCKLang.Preview, null, null, true, null, 5 ) ; break ;
+ case 'Templates' : oItem = new FCKToolbarButton( 'Templates' , FCKLang.Templates, null, null, null, null, 6 ) ; break ;
+ case 'About' : oItem = new FCKToolbarButton( 'About' , FCKLang.About, null, null, true, null, 47 ) ; 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 'Cut' : oItem = new FCKToolbarButton( 'Cut' , FCKLang.Cut, null, null, false, true, 7 ) ; break ;
+ case 'Copy' : oItem = new FCKToolbarButton( 'Copy' , FCKLang.Copy, null, null, false, true, 8 ) ; break ;
+ case 'Paste' : oItem = new FCKToolbarButton( 'Paste' , FCKLang.Paste, null, null, false, true, 9 ) ; break ;
+ case 'PasteText' : oItem = new FCKToolbarButton( 'PasteText' , FCKLang.PasteText, null, null, false, true, 10 ) ; break ;
+ case 'PasteWord' : oItem = new FCKToolbarButton( 'PasteWord' , FCKLang.PasteWord, null, null, false, true, 11 ) ; break ;
+ case 'Print' : oItem = new FCKToolbarButton( 'Print' , FCKLang.Print, null, null, false, true, 12 ) ; break ;
+ case 'SpellCheck' : oItem = new FCKToolbarButton( 'SpellCheck', FCKLang.SpellCheck, null, null, null, null, 13 ) ; break ;
+ case 'Undo' : oItem = new FCKToolbarButton( 'Undo' , FCKLang.Undo, null, null, false, true, 14 ) ; break ;
+ case 'Redo' : oItem = new FCKToolbarButton( 'Redo' , FCKLang.Redo, null, null, false, true, 15 ) ; break ;
+ case 'SelectAll' : oItem = new FCKToolbarButton( 'SelectAll' , FCKLang.SelectAll, null, null, null, null, 18 ) ; break ;
+ case 'RemoveFormat' : oItem = new FCKToolbarButton( 'RemoveFormat', FCKLang.RemoveFormat, null, null, false, true, 19 ) ; break ;
+ case 'FitWindow' : oItem = new FCKToolbarButton( 'FitWindow' , FCKLang.FitWindow, null, null, true, true, 66 ) ; 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 'Bold' : oItem = new FCKToolbarButton( 'Bold' , FCKLang.Bold, null, null, false, true, 20 ) ; break ;
+ case 'Italic' : oItem = new FCKToolbarButton( 'Italic' , FCKLang.Italic, null, null, false, true, 21 ) ; break ;
+ case 'Underline' : oItem = new FCKToolbarButton( 'Underline' , FCKLang.Underline, null, null, false, true, 22 ) ; break ;
+ case 'StrikeThrough' : oItem = new FCKToolbarButton( 'StrikeThrough' , FCKLang.StrikeThrough, null, null, false, true, 23 ) ; break ;
+ case 'Subscript' : oItem = new FCKToolbarButton( 'Subscript' , FCKLang.Subscript, null, null, false, true, 24 ) ; break ;
+ case 'Superscript' : oItem = new FCKToolbarButton( 'Superscript' , FCKLang.Superscript, null, null, false, true, 25 ) ; 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 'OrderedList' : oItem = new FCKToolbarButton( 'InsertOrderedList' , FCKLang.NumberedListLbl, FCKLang.NumberedList, null, false, true, 26 ) ; break ;
+ case 'UnorderedList' : oItem = new FCKToolbarButton( 'InsertUnorderedList' , FCKLang.BulletedListLbl, FCKLang.BulletedList, null, false, true, 27 ) ; break ;
+ case 'Outdent' : oItem = new FCKToolbarButton( 'Outdent' , FCKLang.DecreaseIndent, null, null, false, true, 28 ) ; break ;
+ case 'Indent' : oItem = new FCKToolbarButton( 'Indent' , FCKLang.IncreaseIndent, null, null, false, true, 29 ) ; 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 'Link' : oItem = new FCKToolbarButton( 'Link' , FCKLang.InsertLinkLbl, FCKLang.InsertLink, null, false, true, 34 ) ; break ;
+ case 'Unlink' : oItem = new FCKToolbarButton( 'Unlink' , FCKLang.RemoveLink, null, null, false, true, 35 ) ; break ;
+ case 'Anchor' : oItem = new FCKToolbarButton( 'Anchor' , FCKLang.Anchor, null, null, null, null, 36 ) ; break ;
- case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage ) ; break ;
- case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash ) ; break ;
- case 'Table' : oItem = new FCKToolbarButton( 'Table' , FCKLang.InsertTableLbl, FCKLang.InsertTable ) ; break ;
- case 'SpecialChar' : oItem = new FCKToolbarButton( 'SpecialChar' , FCKLang.InsertSpecialCharLbl, FCKLang.InsertSpecialChar ) ; break ;
- case 'Smiley' : oItem = new FCKToolbarButton( 'Smiley' , FCKLang.InsertSmileyLbl, FCKLang.InsertSmiley ) ; break ;
- case 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak ) ; break ;
- case 'UniversalKey' : oItem = new FCKToolbarButton( 'UniversalKey' , FCKLang.UniversalKeyboard ) ; break ;
+ case 'Image' : oItem = new FCKToolbarButton( 'Image' , FCKLang.InsertImageLbl, FCKLang.InsertImage, null, false, true, 37 ) ; break ;
+ case 'Flash' : oItem = new FCKToolbarButton( 'Flash' , FCKLang.InsertFlashLbl, FCKLang.InsertFlash, null, false, true, 38 ) ; break ;
+ case 'Table' : oItem = new FCKToolbarButton( 'Table' , FCKLang.InsertTableLbl, FCKLang.InsertTable, null, false, true, 39 ) ; break ;
+ case 'SpecialChar' : oItem = new FCKToolbarButton( 'SpecialChar' , FCKLang.InsertSpecialCharLbl, FCKLang.InsertSpecialChar, null, false, true, 42 ) ; break ;
+ case 'Smiley' : oItem = new FCKToolbarButton( 'Smiley' , FCKLang.InsertSmileyLbl, FCKLang.InsertSmiley, null, false, true, 41 ) ; break ;
+ case 'PageBreak' : oItem = new FCKToolbarButton( 'PageBreak' , FCKLang.PageBreakLbl, FCKLang.PageBreak, null, false, true, 43 ) ; break ;
+ case 'UniversalKey' : oItem = new FCKToolbarButton( 'UniversalKey' , FCKLang.UniversalKeyboard , null, null, false, true, 44) ; break ;
- case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true ) ; break ;
+ case 'Rule' : oItem = new FCKToolbarButton( 'InsertHorizontalRule', FCKLang.InsertLineLbl, FCKLang.InsertLine, null, false, true, 40 ) ; 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 'JustifyLeft' : oItem = new FCKToolbarButton( 'JustifyLeft' , FCKLang.LeftJustify, null, null, false, true, 30 ) ; break ;
+ case 'JustifyCenter' : oItem = new FCKToolbarButton( 'JustifyCenter' , FCKLang.CenterJustify, null, null, false, true, 31 ) ; break ;
+ case 'JustifyRight' : oItem = new FCKToolbarButton( 'JustifyRight' , FCKLang.RightJustify, null, null, false, true, 32 ) ; break ;
+ case 'JustifyFull' : oItem = new FCKToolbarButton( 'JustifyFull' , FCKLang.BlockJustify, null, null, false, true, 33 ) ; 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 'TextColor' : oItem = new FCKToolbarPanelButton( 'TextColor', FCKLang.TextColor, null, null, 45 ) ; break ;
+ case 'BGColor' : oItem = new FCKToolbarPanelButton( 'BGColor' , FCKLang.BGColor, null, null, 46 ) ; break ;
- case 'Find' : oItem = new FCKToolbarButton( 'Find' , FCKLang.Find ) ; break ;
- case 'Replace' : oItem = new FCKToolbarButton( 'Replace' , FCKLang.Replace ) ; break ;
+ case 'Find' : oItem = new FCKToolbarButton( 'Find' , FCKLang.Find, null, null, null, null, 16 ) ; break ;
+ case 'Replace' : oItem = new FCKToolbarButton( 'Replace' , FCKLang.Replace, null, null, null, null, 17 ) ; 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 ;
+ case 'Form' : oItem = new FCKToolbarButton( 'Form' , FCKLang.Form, null, null, null, null, 48 ) ; break ;
+ case 'Checkbox' : oItem = new FCKToolbarButton( 'Checkbox' , FCKLang.Checkbox, null, null, null, null, 49 ) ; break ;
+ case 'Radio' : oItem = new FCKToolbarButton( 'Radio' , FCKLang.RadioButton, null, null, null, null, 50 ) ; break ;
+ case 'TextField' : oItem = new FCKToolbarButton( 'TextField' , FCKLang.TextField, null, null, null, null, 51 ) ; break ;
+ case 'Textarea' : oItem = new FCKToolbarButton( 'Textarea' , FCKLang.Textarea, null, null, null, null, 52 ) ; break ;
+ case 'HiddenField' : oItem = new FCKToolbarButton( 'HiddenField' , FCKLang.HiddenField, null, null, null, null, 56 ) ; break ;
+ case 'Button' : oItem = new FCKToolbarButton( 'Button' , FCKLang.Button, null, null, null, null, 54 ) ; break ;
+ case 'Select' : oItem = new FCKToolbarButton( 'Select' , FCKLang.SelectionField, null, null, null, null, 53 ) ; break ;
+ case 'ImageButton' : oItem = new FCKToolbarButton( 'ImageButton' , FCKLang.ImageButton, null, null, null, null, 55 ) ; break ;
default:
alert( FCKLang.UnknownToolbarItem.replace( /%1/g, itemName ) ) ;
Index: lams_central/web/fckeditor/editor/_source/internals/fcktoolbarset.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktoolbarset.js (.../fcktoolbarset.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktoolbarset.js (.../fcktoolbarset.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -18,62 +18,211 @@
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
-var FCKToolbarSet = FCK.ToolbarSet = new Object() ;
+function FCKToolbarSet_Create( overhideLocation )
+{
+ var oToolbarSet ;
+
+ var sLocation = overhideLocation || FCKConfig.ToolbarLocation ;
+ switch ( sLocation )
+ {
+ case 'In' :
+ document.getElementById( 'xToolbarRow' ).style.display = '' ;
+ oToolbarSet = new FCKToolbarSet( document ) ;
+ break ;
+
+// case 'OutTop' :
+ // Not supported.
+
+ default :
+ FCK.Events.AttachEvent( 'OnBlur', FCK_OnBlur ) ;
+ FCK.Events.AttachEvent( 'OnFocus', FCK_OnFocus ) ;
-document.getElementById( 'ExpandHandle' ).title = FCKLang.ToolbarExpand ;
-document.getElementById( 'CollapseHandle' ).title = FCKLang.ToolbarCollapse ;
+ var eToolbarTarget ;
+
+ // Out:[TargetWindow]([TargetId])
+ var oOutMatch = sLocation.match( /^Out:(.+)\((\w+)\)$/ ) ;
+ if ( oOutMatch )
+ {
+ eToolbarTarget = eval( 'parent.' + oOutMatch[1] ).document.getElementById( oOutMatch[2] ) ;
+ }
+ else
+ {
+ // Out:[TargetId]
+ oOutMatch = sLocation.match( /^Out:(\w+)$/ ) ;
+ if ( oOutMatch )
+ eToolbarTarget = parent.document.getElementById( oOutMatch[1] ) ;
+ }
+
+ if ( !eToolbarTarget )
+ {
+ alert( 'Invalid value for "ToolbarLocation"' ) ;
+ return this._Init( 'In' ) ;
+ }
+
+ // If it is a shared toolbar, it may be already available in the target element.
+ if ( oToolbarSet = eToolbarTarget.__FCKToolbarSet )
+ break ;
-FCKToolbarSet.Toolbars = new Array() ;
+ // Create the IFRAME that will hold the toolbar inside the target element.
+ var eToolbarIFrame = FCKTools.GetElementDocument( eToolbarTarget ).createElement( 'iframe' ) ;
+ eToolbarIFrame.frameBorder = 0 ;
+ eToolbarIFrame.width = '100%' ;
+ eToolbarIFrame.height = '10' ;
+ eToolbarTarget.appendChild( eToolbarIFrame ) ;
+ eToolbarIFrame.unselectable = 'on' ;
+
+ // Write the basic HTML for the toolbar (copy from the editor main page).
+ var eTargetDocument = eToolbarIFrame.contentWindow.document ;
+ eTargetDocument.open() ;
+ eTargetDocument.write( '' + document.getElementById( 'xToolbarSpace' ).innerHTML + '' ) ;
+ eTargetDocument.close() ;
+
+ eTargetDocument.oncontextmenu = FCKTools.CancelEvent ;
-// Array of toolbat items that are active only on WYSIWYG mode.
-FCKToolbarSet.ItemsWysiwygOnly = new Array() ;
+ // Load external resources (must be done here, otherwise Firefox will not
+ // have the document DOM ready to be used right away.
+ FCKTools.AppendStyleSheet( eTargetDocument, FCKConfig.SkinPath + 'fck_editor.css' ) ;
+
+ oToolbarSet = eToolbarTarget.__FCKToolbarSet = new FCKToolbarSet( eTargetDocument ) ;
+ oToolbarSet._IFrame = eToolbarIFrame ;
-// Array of toolbar items that are sensitive to the cursor position.
-FCKToolbarSet.ItemsContextSensitive = new Array() ;
+ if ( FCK.IECleanup )
+ FCK.IECleanup.AddItem( eToolbarTarget, FCKToolbarSet_Target_Cleanup ) ;
+ }
+
+ oToolbarSet.CurrentInstance = FCK ;
-FCKToolbarSet.Expand = function()
+ FCK.AttachToOnSelectionChange( oToolbarSet.RefreshItemsState ) ;
+
+ return oToolbarSet ;
+}
+
+function FCK_OnBlur( editorInstance )
{
- document.getElementById( 'Collapsed' ).style.display = 'none' ;
- document.getElementById( 'Expanded' ).style.display = '' ;
+ var eToolbarSet = editorInstance.ToolbarSet ;
- 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 ) ;
- }
+ if ( eToolbarSet.CurrentInstance == editorInstance )
+ eToolbarSet.Disable() ;
}
-FCKToolbarSet.Collapse = function()
+function FCK_OnFocus( editorInstance )
{
- document.getElementById( 'Collapsed' ).style.display = '' ;
- document.getElementById( 'Expanded' ).style.display = 'none' ;
+ var oToolbarset = editorInstance.ToolbarSet ;
+ var oInstance = editorInstance || FCK ;
- 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 ) ;
- }
+ // Unregister the toolbar window from the current instance.
+ oToolbarset.CurrentInstance.FocusManager.RemoveWindow( oToolbarset._IFrame.contentWindow ) ;
+
+ // Set the new current instance.
+ oToolbarset.CurrentInstance = oInstance ;
+
+ // Register the toolbar window in the current instance.
+ oInstance.FocusManager.AddWindow( oToolbarset._IFrame.contentWindow, true ) ;
+
+ oToolbarset.Enable() ;
}
-FCKToolbarSet.Restart = function()
+function FCKToolbarSet_Cleanup()
{
+ this._TargetElement = null ;
+ this._IFrame = null ;
+}
+
+function FCKToolbarSet_Target_Cleanup()
+{
+ this.__FCKToolbarSet = null ;
+}
+
+var FCKToolbarSet = function( targetDocument )
+{
+ this._Document = targetDocument ;
+
+ // Get the element that will hold the elements structure.
+ this._TargetElement = targetDocument.getElementById( 'xToolbar' ) ;
+
+ // Setup the expand and collapse handlers.
+ var eExpandHandle = targetDocument.getElementById( 'xExpandHandle' ) ;
+ var eCollapseHandle = targetDocument.getElementById( 'xCollapseHandle' ) ;
+
+ eExpandHandle.title = FCKLang.ToolbarExpand ;
+ eExpandHandle.onclick = FCKToolbarSet_Expand_OnClick ;
+
+ eCollapseHandle.title = FCKLang.ToolbarCollapse ;
+ eCollapseHandle.onclick = FCKToolbarSet_Collapse_OnClick ;
+
+ // Set the toolbar state at startup.
if ( !FCKConfig.ToolbarCanCollapse || FCKConfig.ToolbarStartExpanded )
this.Expand() ;
else
this.Collapse() ;
+
+ // Enable/disable the collapse handler
+ eCollapseHandle.style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
+
+ if ( FCKConfig.ToolbarCanCollapse )
+ eCollapseHandle.style.display = '' ;
+ else
+ targetDocument.getElementById( 'xTBLeftBorder' ).style.display = '' ;
+
+ // Set the default properties.
+ this.Toolbars = new Array() ;
+ this.IsLoaded = false ;
+
+ if ( FCK.IECleanup )
+ FCK.IECleanup.AddItem( this, FCKToolbarSet_Cleanup ) ;
+}
+
+function FCKToolbarSet_Expand_OnClick()
+{
+ FCK.ToolbarSet.Expand() ;
+}
+
+function FCKToolbarSet_Collapse_OnClick()
+{
+ FCK.ToolbarSet.Collapse() ;
+}
+
+FCKToolbarSet.prototype.Expand = function()
+{
+ this._ChangeVisibility( false ) ;
+}
+
+FCKToolbarSet.prototype.Collapse = function()
+{
+ this._ChangeVisibility( true ) ;
+}
+
+FCKToolbarSet.prototype._ChangeVisibility = function( collapse )
+{
+ this._Document.getElementById( 'xCollapsed' ).style.display = collapse ? '' : 'none' ;
+ this._Document.getElementById( 'xExpanded' ).style.display = collapse ? 'none' : '' ;
- document.getElementById( 'CollapseHandle' ).style.display = FCKConfig.ToolbarCanCollapse ? '' : 'none' ;
+ if ( FCKBrowserInfo.IsGecko )
+ {
+ // I had to use "setTimeout" because Gecko was not responding in a right
+ // way when calling window.onresize() directly.
+ FCKTools.RunFunction( window.onresize ) ;
+ }
}
-FCKToolbarSet.Load = function( toolbarSetName )
+FCKToolbarSet.prototype.Load = function( toolbarSetName )
{
- this.DOMElement = document.getElementById( 'eToolbar' ) ;
+ this.Name = toolbarSetName ;
+
+ this.Items = new Array() ;
+ // Reset the array of toolbat items that are active only on WYSIWYG mode.
+ this.ItemsWysiwygOnly = new Array() ;
+
+ // Reset the array of toolbar items that are sensitive to the cursor position.
+ this.ItemsContextSensitive = new Array() ;
+
+ // Cleanup the target element.
+ this._TargetElement.innerHTML = '' ;
+
var ToolbarSet = FCKConfig.ToolbarSets[toolbarSetName] ;
- if (! ToolbarSet)
+ if ( !ToolbarSet )
{
alert( FCKLang.UnknownToolbarSet.replace( /%1/g, toolbarSetName ) ) ;
return ;
@@ -109,58 +258,95 @@
{
oToolbar.AddItem( oItem ) ;
+ this.Items.push( oItem ) ;
+
if ( !oItem.SourceView )
- this.ItemsWysiwygOnly[this.ItemsWysiwygOnly.length] = oItem ;
+ this.ItemsWysiwygOnly.push( oItem ) ;
if ( oItem.ContextSensitive )
- this.ItemsContextSensitive[this.ItemsContextSensitive.length] = oItem ;
+ this.ItemsContextSensitive.push( oItem ) ;
}
}
}
- oToolbar.AddTerminator() ;
+ // oToolbar.AddTerminator() ;
}
+
+ oToolbar.Create( this._TargetElement ) ;
this.Toolbars[ this.Toolbars.length ] = oToolbar ;
}
+
+ FCKTools.DisableSelection( this._Document.getElementById( 'xCollapseHandle' ).parentNode ) ;
+
+ if ( FCK.Status != FCK_STATUS_COMPLETE )
+ FCK.Events.AttachEvent( 'OnStatusChange', this.RefreshModeState ) ;
+ else
+ this.RefreshModeState() ;
+
+ this.IsLoaded = true ;
+ this.IsEnabled = true ;
+
+ FCKTools.RunFunction( this.OnLoad ) ;
}
-FCKToolbarSet.RefreshModeState = function()
+FCKToolbarSet.prototype.Enable = function()
{
+ if ( this.IsEnabled )
+ return ;
+
+ this.IsEnabled = true ;
+
+ var aItems = this.Items ;
+ for ( var i = 0 ; i < aItems.length ; i++ )
+ aItems[i].RefreshState() ;
+}
+
+FCKToolbarSet.prototype.Disable = function()
+{
+ if ( !this.IsEnabled )
+ return ;
+
+ this.IsEnabled = false ;
+
+ var aItems = this.Items ;
+ for ( var i = 0 ; i < aItems.length ; i++ )
+ aItems[i].Disable() ;
+}
+
+FCKToolbarSet.prototype.RefreshModeState = function( editorInstance )
+{
+ if ( FCK.Status != FCK_STATUS_COMPLETE )
+ return ;
+
+ var oToolbarSet = editorInstance ? editorInstance.ToolbarSet : this ;
+ var aItems = oToolbarSet.ItemsWysiwygOnly ;
+
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() ;
+ for ( var i = 0 ; i < aItems.length ; i++ )
+ aItems[i].Enable() ;
// Refresh the buttons state.
- FCKToolbarSet.RefreshItemsState() ;
+ oToolbarSet.RefreshItemsState( editorInstance ) ;
}
else
{
// Refresh the buttons state.
- FCKToolbarSet.RefreshItemsState() ;
+ oToolbarSet.RefreshItemsState( editorInstance ) ;
// Disable all buttons that are available on WYSIWYG mode only.
- for ( var i = 0 ; i < FCKToolbarSet.ItemsWysiwygOnly.length ; i++ )
- FCKToolbarSet.ItemsWysiwygOnly[i].Disable() ;
+ for ( var i = 0 ; i < aItems.length ; i++ )
+ aItems[i].Disable() ;
}
}
-FCKToolbarSet.RefreshItemsState = function()
+FCKToolbarSet.prototype.RefreshItemsState = function( editorInstance )
{
-
- 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() ;
- }
- }
-*/
+
+ var aItems = ( editorInstance ? editorInstance.ToolbarSet : this ).ItemsContextSensitive ;
+
+ for ( var i = 0 ; i < aItems.length ; i++ )
+ aItems[i].RefreshState() ;
}
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktools.js (.../fcktools.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools.js (.../fcktools.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -19,20 +19,21 @@
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.
+/**
+ * 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 refers
+ * to the instance name when getting the posted data.
+ */
FCKTools.GetLinkedFieldValue = function()
{
return FCK.LinkedField.value ;
}
-//**
-// FCKTools.AttachToLinkedFieldFormSubmit: attaches a function call to the
-// submit event of the linked field form. This function us generally used to
-// update the linked field value before submitting the form.
+/**
+ * Attachs 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
@@ -45,7 +46,7 @@
if ( FCKBrowserInfo.IsIE )
oForm.attachEvent( "onsubmit", functionPointer ) ;
else
- oForm.addEventListener( 'submit', functionPointer, true ) ;
+ oForm.addEventListener( 'submit', functionPointer, false ) ;
//**
// Attaches the functionPointer call to the submit method
@@ -85,87 +86,33 @@
this.originalSubmit() ;
}
-//**
-// FCKTools.AddSelectOption: Adds a option to a SELECT element.
-FCKTools.AddSelectOption = function( targetDocument, selectElement, optionText, optionValue )
+// Get the window object where the element is placed in.
+FCKTools.GetElementWindow = function( element )
{
- var oOption = targetDocument.createElement("OPTION") ;
-
- oOption.text = optionText ;
- oOption.value = optionValue ;
-
- selectElement.options.add(oOption) ;
-
- return oOption ;
+ return this.GetDocumentWindow( this.GetElementDocument( element ) ) ;
}
-/*
-FCKTools.RemoveAllSelectOptions = function( selectElement )
-{
- for ( var i = selectElement.options.length - 1 ; i >= 0 ; i-- )
- {
- selectElement.options.remove(i) ;
- }
-}
-FCKTools.SelectNoCase = function( selectElement, value, defaultValue )
+FCKTools.GetDocumentWindow = function( doc )
{
- var sNoCaseValue = value.toString().toLowerCase() ;
+ // With Safari, there is not way to retrieve the window from the document, so we must fix it.
+ if ( FCKBrowserInfo.IsSafari && !doc.parentWindow )
+ this.FixDocumentParentWindow( window.top ) ;
- 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 ) ;
+ return doc.parentWindow || doc.defaultView ;
}
-*/
-FCKTools.HTMLEncode = function( text )
-{
- if ( !text )
- return '' ;
- 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, relativeWindow )
{
-// Initializes the Coordinates object that will be returned by the function.
+ // Initializes the Coordinates object that will be returned by the function.
var c = { X:0, Y:0 } ;
var oWindow = relativeWindow || window ;
// Loop throw the offset chain.
while ( el )
{
- c.X += el.offsetLeft ;
- c.Y += el.offsetTop ;
+ c.X += el.offsetLeft - el.scrollLeft ;
+ c.Y += el.offsetTop - el.scrollTop ;
if ( el.offsetParent == null )
{
@@ -174,7 +121,11 @@
if ( oOwnerWindow != oWindow )
el = oOwnerWindow.frameElement ;
else
+ {
+ c.X += el.scrollLeft ;
+ c.Y += el.scrollTop ;
break ;
+ }
}
else
el = el.offsetParent ;
@@ -184,145 +135,125 @@
return c ;
}
-// START iCM MODIFICATIONS
-// Amended to accept a list of one or more ascensor tag names
-// Amended to check the element itself before working back up through the parent hierarchy
-FCKTools.GetElementAscensor = function( element, ascensorTagNames )
+/*
+ This is a Safari specific function that fix the reference to the parent
+ window from the document object.
+*/
+FCKTools.FixDocumentParentWindow = function( targetWindow )
{
-// var e = element.parentNode ;
- var e = element ;
- var lstTags = "," + ascensorTagNames.toUpperCase() + "," ;
+ targetWindow.document.parentWindow = targetWindow ;
+
+ for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
+ FCKTools.FixDocumentParentWindow( targetWindow.frames[i] ) ;
+}
- while ( e )
- {
- if ( lstTags.indexOf( "," + e.nodeName.toUpperCase() + "," ) != -1 )
- return e ;
+FCKTools.GetParentWindow = function( document )
+{
+ return document.contentWindow ? document.contentWindow : document.parentWindow ;
+}
- e = e.parentNode ;
- }
- return null ;
+FCKTools.HTMLEncode = function( text )
+{
+ if ( !text )
+ return '' ;
+
+ text = text.replace( /&/g, '&' ) ;
+ text = text.replace( //g, '>' ) ;
+
+ return text ;
}
-// END iCM MODIFICATIONS
-FCKTools.Pause = function( miliseconds )
+/**
+ * Adds an option to a SELECT element.
+ */
+FCKTools.AddSelectOption = function( selectElement, optionText, optionValue )
{
- var oStart = new Date() ;
+ var oOption = FCKTools.GetElementDocument( selectElement ).createElement( "OPTION" ) ;
- while (true)
- {
- var oNow = new Date() ;
- if ( miliseconds < oNow - oStart )
- return ;
- }
+ oOption.text = optionText ;
+ oOption.value = optionValue ;
+
+ selectElement.options.add(oOption) ;
+
+ return oOption ;
}
-FCKTools.ConvertStyleSizeToHtml = function( size )
+FCKTools.RunFunction = function( func, thisObject, paramsArray, timerWindow )
{
- return size.endsWith( '%' ) ? size : parseInt( size ) ;
+ if ( func )
+ this.SetTimeout( func, 0, thisObject, paramsArray, timerWindow ) ;
}
-FCKTools.ConvertHtmlSizeToStyle = function( size )
+FCKTools.SetTimeout = function( func, milliseconds, thisObject, paramsArray, timerWindow )
{
- return size.endsWith( '%' ) ? size : ( size + 'px' ) ;
+ return ( timerWindow || window ).setTimeout(
+ function()
+ {
+ if ( paramsArray )
+ func.apply( thisObject, [].concat( paramsArray ) ) ;
+ else
+ func.apply( thisObject ) ;
+ },
+ milliseconds ) ;
}
-// Get the window object where the element is placed in.
-FCKTools.GetElementWindow = function( element )
+FCKTools.SetInterval = function( func, milliseconds, thisObject, paramsArray, timerWindow )
{
- var oDocument = element.ownerDocument || element.document ;
-
- // With Safari, there is not way to retrieve the window from the document, so we must fix it.
- if ( FCKBrowserInfo.IsSafari && !oDocument.parentWindow )
- FCKTools._FixDocumentParentWindow( window.top ) ;
-
- return oDocument.parentWindow || oDocument.defaultView ;
+ return ( timerWindow || window ).setInterval(
+ function()
+ {
+ func.apply( thisObject, paramsArray || [] ) ;
+ },
+ milliseconds ) ;
}
-/*
- This is a Safari specific function that fix the reference to the parent
- window from the document object.
-*/
-FCKTools._FixDocumentParentWindow = function( targetWindow )
+FCKTools.ConvertStyleSizeToHtml = function( size )
{
- targetWindow.document.parentWindow = targetWindow ;
-
- for ( var i = 0 ; i < targetWindow.frames.length ; i++ )
- FCKTools._FixDocumentParentWindow( targetWindow.frames[i] ) ;
+ return size.endsWith( '%' ) ? size : parseInt( size ) ;
}
-FCKTools.CancelEvent = function( e )
+FCKTools.ConvertHtmlSizeToStyle = function( size )
{
- return false ;
+ return size.endsWith( '%' ) ? size : ( size + 'px' ) ;
}
// START iCM MODIFICATIONS
-/*
-// Transfers the supplied attributes to the supplied node
-FCKTools.SetElementAttributes = function( oElement, oAttributes )
+// Amended to accept a list of one or more ascensor tag names
+// Amended to check the element itself before working back up through the parent hierarchy
+FCKTools.GetElementAscensor = function( element, ascensorTagNames )
{
- for ( var i = 0; i < oAttributes.length; i++ )
+// var e = element.parentNode ;
+ var e = element ;
+ var lstTags = "," + ascensorTagNames.toUpperCase() + "," ;
+
+ while ( e )
{
- if ( oAttributes[i].specified ) // Needed for IE which always returns all attributes whether set or not
- oElement.setAttribute( oAttributes[i].nodeName, oAttributes[i].nodeValue, 0 ) ;
+ if ( lstTags.indexOf( "," + e.nodeName.toUpperCase() + "," ) != -1 )
+ return e ;
+
+ e = e.parentNode ;
}
+ return null ;
}
+// END iCM MODIFICATIONS
-// Get immediate block node (P, H1, for example) for the supplied node - the supplied node may itself be a block node in which
-// case it will be returned. If no block node found, returns null.
-FCKTools.GetParentBlockNode = function( oNode )
+FCKTools.CreateEventListener = function( func, params )
{
- if ( oNode.nodeName.toUpperCase() == "BODY" )
- return null ;
- else if ( oNode.nodeType == 1 && FCKRegexLib.BlockElements.test(oNode.tagName) )
- return oNode ;
- else
- return FCKTools.GetParentBlockNode( oNode.parentNode ) ;
-}
-
-// Run through any children of the supplied node. If there are none, or they only comprise
-// empty text nodes and BR nodes, then the node is effectively empty.
-// Sometimes (on Gecko) a seemingly empty node is coming back with several children that are solely
-// empty text nodes and BRs e.g. the first item in an OL list, for example, when
-// UseBROnCarriageReturn is set to false.
-// Seems to be due to the use of the
(GECKO_BOGUS) as fillers both
-// in fck_gecko_1.js when html is empty and in ENTER key handler ? If normal BR tags are
-// used instead this doesn't seem to happen....
-FCKTools.NodeIsEmpty = function( oNode )
-{
- var oSibling = oNode.childNodes[0] ;
- while ( oSibling )
+ var f = function()
{
- if ( ( oSibling.nodeType != 1 && oSibling.nodeType != 3 ) || ( oSibling.nodeType == 1 && oSibling.nodeName.toUpperCase() != "BR" ) || ( oSibling.nodeType == 3 && oSibling.nodeValue && oSibling.nodeValue.trim() != '' ) )
- return false ;
+ var aAllParams = [] ;
- oSibling = oSibling.nextSibling ;
- }
+ for ( var i = 0 ; i < arguments.length ; i++ )
+ aAllParams.push( arguments[i] ) ;
- return true ;
-}
+ func.apply( this, aAllParams.concat( params ) ) ;
+ }
-// Returns a document fragment that contains a copy of the specified range of nodes
-FCKTools.GetDocumentFragment = function( oParentNode, oFromNode, oToNode, bIncludeFromNode, bIncludeToNode, bClone )
-{
- if ( typeof bIncludeFromNode == "undefined" ) bIncludeFromNode = true ;
- if ( typeof bIncludeToNode == "undefined" ) bIncludeToNode = true ;
- if ( typeof bClone == "undefined" ) bClone = true ;
-
- var oFragment = FCK.EditorDocument.createDocumentFragment() ;
-
- var oNode = oFromNode ;
- while ( oNode && oNode != oToNode )
- {
- if ( oNode != oFromNode || bIncludeFromNode )
- oFragment.appendChild( bClone ? oNode.cloneNode( true ) : oNode ) ;
-
- oNode = oNode.nextSibling ;
- }
-
- if ( oNode && (oFromNode != oToNode && bIncludeToNode) )
- oFragment.appendChild( bClone ? oNode.cloneNode( true ) : oNode ) ; // Include To Node
-
- return oFragment ;
+ return f ;
}
-*/
-// END iCM MODIFICATIONS
+
+FCKTools.GetElementDocument = function ( element )
+{
+ return element.ownerDocument || element.document ;
+}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js (.../fcktools_gecko.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js (.../fcktools_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -18,8 +18,22 @@
*/
// Constant for the Gecko Bogus Node.
-var GECKO_BOGUS = '
' ;
+var GECKO_BOGUS = FCKBrowserInfo.IsGecko ? '
' : '' ;
+FCKTools.CancelEvent = function( e )
+{
+ if ( e )
+ e.preventDefault() ;
+}
+
+FCKTools.DisableSelection = function( element )
+{
+ if ( FCKBrowserInfo.IsGecko )
+ element.style.MozUserSelect = 'none' ; // Gecko only.
+ else
+ element.style.userSelect = 'none' ; // CSS3 (not supported yet).
+}
+
// Appends a CSS file to a document.
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrl )
{
@@ -91,12 +105,84 @@
return null ;
}
-FCKTools.DisableSelection = function( element )
+FCKTools.GetScrollPosition = function( relativeWindow )
{
- element.style.MozUserSelect = 'none' ; // Gecko only.
- // element.style.userSelect = 'none' ; // CSS3 (not supported yet).
+ return { X : relativeWindow.pageXOffset, Y : relativeWindow.pageYOffset } ;
}
+FCKTools.AddEventListener = function( sourceObject, eventName, listener )
+{
+ sourceObject.addEventListener( eventName, listener, false ) ;
+}
+
+FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
+{
+ sourceObject.removeEventListener( eventName, listener, false ) ;
+}
+
+// Listeners attached with this function cannot be detached.
+FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
+{
+ sourceObject.addEventListener(
+ eventName,
+ function( e )
+ {
+ listener.apply( sourceObject, [ e ].concat( paramsArray || [] ) ) ;
+ },
+ false
+ ) ;
+}
+
+// Returns and object with the "Width" and "Height" properties.
+FCKTools.GetViewPaneSize = function( win )
+{
+ return { Width : win.innerWidth, Height : win.innerHeight } ;
+}
+
+FCKTools.SaveStyles = function( element )
+{
+ var oSavedStyles = new Object() ;
+
+ if ( element.className.length > 0 )
+ {
+ oSavedStyles.Class = element.className ;
+ element.className = '' ;
+ }
+
+ var sInlineStyle = element.getAttribute( 'style' ) ;
+
+ if ( sInlineStyle && sInlineStyle.length > 0 )
+ {
+ oSavedStyles.Inline = sInlineStyle ;
+ element.setAttribute( 'style', '', 0 ) ; // 0 : Case Insensitive
+ }
+
+ return oSavedStyles ;
+}
+
+FCKTools.RestoreStyles = function( element, savedStyles )
+{
+ element.className = savedStyles.Class || '' ;
+
+ if ( savedStyles.Inline )
+ element.setAttribute( 'style', savedStyles.Inline, 0 ) ; // 0 : Case Insensitive
+ else
+ element.removeAttribute( 'style', 0 ) ;
+}
+
+FCKTools.RegisterDollarFunction = function( targetWindow )
+{
+ targetWindow.$ = function( id )
+ {
+ return this.document.getElementById( id ) ;
+ } ;
+}
+
+FCKTools.AppendElement = function( target, elementName )
+{
+ return target.appendChild( target.ownerDocument.createElement( elementName ) ) ;
+}
+
// START iCM Modifications
/*
// Starting at the specified node, find the first inline node of the sequence
Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js (.../fcktools_ie.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js (.../fcktools_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -17,10 +17,15 @@
* Frederico Caldeira Knabben (fredck@fckeditor.net)
*/
+FCKTools.CancelEvent = function( e )
+{
+ return false ;
+}
+
// Appends a CSS file to a document.
FCKTools.AppendStyleSheet = function( documentElement, cssFileUrl )
{
- return documentElement.createStyleSheet( cssFileUrl ) ;
+ return documentElement.createStyleSheet( cssFileUrl ).owningElement ;
}
// Removes all attributes and values from the element.
@@ -95,4 +100,103 @@
e.unselectable = 'on' ;
}
}
+}
+
+FCKTools.GetScrollPosition = function( relativeWindow )
+{
+ var oDoc = relativeWindow.document ;
+
+ // Try with the doc element.
+ var oPos = { X : oDoc.documentElement.scrollLeft, Y : oDoc.documentElement.scrollTop } ;
+
+ if ( oPos.X > 0 || oPos.Y > 0 )
+ return oPos ;
+
+ // If no scroll, try with the body.
+ return { X : oDoc.body.scrollLeft, Y : oDoc.body.scrollTop } ;
+}
+
+FCKTools.AddEventListener = function( sourceObject, eventName, listener )
+{
+ sourceObject.attachEvent( 'on' + eventName, listener ) ;
+}
+
+FCKTools.RemoveEventListener = function( sourceObject, eventName, listener )
+{
+ sourceObject.detachEvent( 'on' + eventName, listener ) ;
+}
+
+// Listeners attached with this function cannot be detached.
+FCKTools.AddEventListenerEx = function( sourceObject, eventName, listener, paramsArray )
+{
+ // Ok... this is a closures party, but is the only way to make it clean of memory leaks.
+ var o = new Object() ;
+ o.Source = sourceObject ;
+ o.Params = paramsArray || [] ; // Memory leak if we have DOM objects here.
+ o.Listener = function( ev )
+ {
+ return listener.apply( o.Source, [ ev ].concat( o.Params ) ) ;
+ }
+
+ if ( FCK.IECleanup )
+ FCK.IECleanup.AddItem( null, function() { o.Source = null ; o.Params = null ; } ) ;
+
+ sourceObject.attachEvent( 'on' + eventName, o.Listener ) ;
+
+ sourceObject = null ; // Memory leak cleaner (because of the above closure).
+ paramsArray = null ; // Memory leak cleaner (because of the above closure).
+}
+
+// Returns and object with the "Width" and "Height" properties.
+FCKTools.GetViewPaneSize = function( win )
+{
+ var oSizeSource ;
+
+ var oDoc = win.document.documentElement ;
+ if ( oDoc && oDoc.clientWidth ) // IE6 Strict Mode
+ oSizeSource = oDoc ;
+ else
+ oSizeSource = top.document.body ; // Other IEs
+
+ if ( oSizeSource )
+ return { Width : oSizeSource.clientWidth, Height : oSizeSource.clientHeight } ;
+ else
+ return { Width : 0, Height : 0 } ;
+}
+
+FCKTools.SaveStyles = function( element )
+{
+ var oSavedStyles = new Object() ;
+
+ if ( element.className.length > 0 )
+ {
+ oSavedStyles.Class = element.className ;
+ element.className = '' ;
+ }
+
+ var sInlineStyle = element.style.cssText ;
+
+ if ( sInlineStyle.length > 0 )
+ {
+ oSavedStyles.Inline = sInlineStyle ;
+ element.style.cssText = '' ;
+ }
+
+ return oSavedStyles ;
+}
+
+FCKTools.RestoreStyles = function( element, savedStyles )
+{
+ element.className = savedStyles.Class || '' ;
+ element.style.cssText = savedStyles.Inline || '' ;
+}
+
+FCKTools.RegisterDollarFunction = function( targetWindow )
+{
+ targetWindow.$ = targetWindow.document.getElementById ;
+}
+
+FCKTools.AppendElement = function( target, elementName )
+{
+ return target.appendChild( this.GetElementDocument( target ).createElement( elementName ) ) ;
}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckundo_gecko.js
===================================================================
diff -u -rec7cf4ccd30c2f44920a59691c6055f714e5e36c -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckundo_gecko.js (.../fckundo_gecko.js) (revision ec7cf4ccd30c2f44920a59691c6055f714e5e36c)
+++ lams_central/web/fckeditor/editor/_source/internals/fckundo_gecko.js (.../fckundo_gecko.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,4 +1,23 @@
-var FCKUndo = new Object() ;
+/*
+ * FCKeditor - The text editor for internet
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
+ *
+ * Licensed under the terms of the GNU Lesser General Public License:
+ * http://www.opensource.org/licenses/lgpl-license.php
+ *
+ * For further information visit:
+ * http://www.fckeditor.net/
+ *
+ * "Support Open Source software. What about a donation today?"
+ *
+ * File Name: fckundo_gecko.js
+ * Fake implementation to ignore calls on Gecko.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+var FCKUndo = new Object() ;
+
FCKUndo.SaveUndoStep = function()
{}
\ No newline at end of file
Index: lams_central/web/fckeditor/editor/_source/internals/fckundo_ie.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckundo_ie.js (.../fckundo_ie.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckundo_ie.js (.../fckundo_ie.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,12 +1,34 @@
-var FCKUndo = new Object() ;
+/*
+ * FCKeditor - The text editor for internet
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
+ *
+ * Licensed under the terms of the GNU Lesser General Public License:
+ * http://www.opensource.org/licenses/lgpl-license.php
+ *
+ * For further information visit:
+ * http://www.fckeditor.net/
+ *
+ * "Support Open Source software. What about a donation today?"
+ *
+ * File Name: fckundo_ie.js
+ * IE specific implementation for the Undo/Redo system.
+ *
+ * File Authors:
+ * Frederico Caldeira Knabben (fredck@fckeditor.net)
+ */
+var FCKUndo = new Object() ;
+
FCKUndo.SavedData = new Array() ;
FCKUndo.CurrentIndex = -1 ;
FCKUndo.TypesCount = FCKUndo.MaxTypes = 25 ;
FCKUndo.Typing = false ;
FCKUndo.SaveUndoStep = function()
{
+ if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
+ return ;
+
// Shrink the array to the current level.
FCKUndo.SavedData = FCKUndo.SavedData.slice( 0, FCKUndo.CurrentIndex + 1 ) ;
Index: lams_central/web/fckeditor/editor/_source/internals/fckurlparams.js
===================================================================
diff -u -r55b56043d9d88eeb96bb4f8680fe9d2b0491dc12 -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckurlparams.js (.../fckurlparams.js) (revision 55b56043d9d88eeb96bb4f8680fe9d2b0491dc12)
+++ lams_central/web/fckeditor/editor/_source/internals/fckurlparams.js (.../fckurlparams.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js
===================================================================
diff -u -r877c31055fbefba3e65d509cdee913a6e762a67d -re31d1853222ec105bcc6293bcc9ab9799dfc685b
--- lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js (.../fckxhtml.js) (revision 877c31055fbefba3e65d509cdee913a6e762a67d)
+++ lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js (.../fckxhtml.js) (revision e31d1853222ec105bcc6293bcc9ab9799dfc685b)
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for internet
- * Copyright (C) 2003-2005 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2006 Frederico Caldeira Knabben
*
* Licensed under the terms of the GNU Lesser General Public License:
* http://www.opensource.org/licenses/lgpl-license.php
@@ -23,6 +23,10 @@
FCKXHtml.GetXHTML = function( node, includeNode, format )
{
+ FCKXHtmlEntities.Initialize() ;
+
+ this._CreateNode = FCKConfig.ForceStrongEm ? FCKXHtml_CreateNode_StrongEm : FCKXHtml_CreateNode_Normal ;
+
// Special blocks are blocks of content that remain untouched during the
// process. It is used for SCRIPTs and STYLEs.
FCKXHtml.SpecialBlocks = new Array() ;
@@ -125,14 +129,19 @@
{
// Element Node.
case 1 :
+
+ // Here we found an element that is not the real element, but a
+ // fake one (like the Flash placeholder image), so we must get the real one.
if ( htmlNode.getAttribute('_fckfakelement') )
return FCKXHtml._AppendNode( xmlNode, FCK.GetRealElement( htmlNode ) ) ;
// Mozilla insert custom nodes in the DOM.
if ( FCKBrowserInfo.IsGecko && htmlNode.hasAttribute('_moz_editor_bogus_node') )
return false ;
- if ( htmlNode.getAttribute('_fckdelete') )
+ // This is for elements that are instrumental to FCKeditor and
+ // must be removed from the final HTML.
+ if ( htmlNode.getAttribute('_fcktemp') )
return false ;
// Get the element name.
@@ -170,7 +179,7 @@
if ( oTagProcessor )
{
- oNode = oTagProcessor( oNode, htmlNode ) ;
+ oNode = oTagProcessor( oNode, htmlNode, xmlNode ) ;
if ( !oNode ) break ;
}
else
@@ -199,34 +208,29 @@
return true ;
}
-if ( FCKConfig.ForceStrongEm )
+function FCKXHtml_CreateNode_StrongEm( nodeName )
{
- FCKXHtml._CreateNode = function( nodeName )
+ switch ( nodeName )
{
- switch ( nodeName )
- {
- case 'b' :
- nodeName = 'strong' ;
- break ;
- case 'i' :
- nodeName = 'em' ;
- break ;
- }
- return this.XML.createElement( nodeName ) ;
+ case 'b' :
+ nodeName = 'strong' ;
+ break ;
+ case 'i' :
+ nodeName = 'em' ;
+ break ;
}
+ return this.XML.createElement( nodeName ) ;
}
-else
+
+function FCKXHtml_CreateNode_Normal( nodeName )
{
- FCKXHtml._CreateNode = function( nodeName )
- {
- return this.XML.createElement( nodeName ) ;
- }
+ return this.XML.createElement( nodeName ) ;
}
// Append an item to the SpecialBlocks array and returns the tag to be used.
FCKXHtml._AppendSpecialItem = function( item )
{
- return '___FCKsi___' + FCKXHtml.SpecialBlocks.addItem( item ) ;
+ return '___FCKsi___' + FCKXHtml.SpecialBlocks.AddItem( item ) ;
}
//if ( FCKConfig.ProcessHTMLEntities )
@@ -304,11 +308,6 @@
FCKXHtml.TagProcessors['style'] = function( node, htmlNode )
{
- // The "_fcktemp" attribute is used to mark the ';FCK._BehaviorsStyle=C;};return FCK._BehaviorsStyle;};function Doc_OnMouseUp(){if (FCK.EditorWindow.event.srcElement.tagName=='HTML'){FCK.Focus();FCK.EditorWindow.event.cancelBubble=true;FCK.EditorWindow.event.returnValue=false;}};function Doc_OnPaste(){if (FCK.Status==FCK_STATUS_COMPLETE) FCK.Events.FireEvent("OnPaste");return false;};function Doc_OnKeyDown(){var e=FCK.EditorWindow.event;switch (e.keyCode){case 13:if (FCKConfig.UseBROnCarriageReturn&&!(e.ctrlKey||e.altKey||e.shiftKey)){Doc_OnKeyDownUndo();if (FCK.EditorDocument.queryCommandState('InsertOrderedList')||FCK.EditorDocument.queryCommandState('InsertUnorderedList')) return true;FCK.InsertHtml('
');var oRange=FCK.EditorDocument.selection.createRange();oRange.moveStart('character',-1);oRange.select();FCK.EditorDocument.selection.clear();return false;};break;case 8:if (FCKSelection.GetType()=='Control'){FCKSelection.Delete();return false;};break;case 9:if (FCKConfig.TabSpaces>0&&!(e.ctrlKey||e.altKey||e.shiftKey)){Doc_OnKeyDownUndo();FCK.InsertHtml(window.FCKTabHTML);return false;};break;case 90:if (e.ctrlKey&&!(e.altKey||e.shiftKey)){FCKUndo.Undo();return false;};break;case 89:if (e.ctrlKey&&!(e.altKey||e.shiftKey)){FCKUndo.Redo();return false;};break;};if (!(e.keyCode>=16&&e.keyCode<=18)) Doc_OnKeyDownUndo();return true;};function Doc_OnKeyDownUndo(){if (!FCKUndo.Typing){FCKUndo.SaveUndoStep();FCKUndo.Typing=true;FCK.Events.FireEvent("OnSelectionChange");};FCKUndo.TypesCount++;if (FCKUndo.TypesCount>FCKUndo.MaxTypes){FCKUndo.TypesCount=0;FCKUndo.SaveUndoStep();}};function Doc_OnDblClick(){FCK.OnDoubleClick(FCK.EditorWindow.event.srcElement);FCK.EditorWindow.event.cancelBubble=true;};function Doc_OnSelectionChange(){FCK.Events.FireEvent("OnSelectionChange");};FCK.InitializeBehaviors=function(A){this.EditorDocument.attachEvent('onmouseup',Doc_OnMouseUp);this.EditorDocument.body.attachEvent('onpaste',Doc_OnPaste);FCK.ContextMenu._InnerContextMenu.AttachToElement(FCK.EditorDocument.body);if (FCKConfig.TabSpaces>0){window.FCKTabHTML='';for (i=0;i
'+A;B.getElementById('__fakeFCKRemove__').removeNode(true);};var FCK_PreloadImages_Count=0;var FCK_PreloadImages_Images=new Array();function FCK_PreloadImages(){var aImages=FCKConfig.PreloadImages||[];if (typeof(aImages)=='string') aImages=aImages.split(';');aImages.push(FCKConfig.SkinPath+'fck_strip.gif');FCK_PreloadImages_Count=aImages.length;var aImageElements=new Array();for (var i=0;i