Index: lams_central/web/fckeditor/fckconfig.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/Attic/fckconfig.js,v diff -u -r1.4 -r1.5 --- lams_central/web/fckeditor/fckconfig.js 12 Dec 2005 05:18:56 -0000 1.4 +++ lams_central/web/fckeditor/fckconfig.js 5 Jan 2006 00:02:26 -0000 1.5 @@ -16,6 +16,8 @@ * * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) + * + * Version: 2.2 */ FCKConfig.CustomConfigurationsPath = '' ; @@ -29,12 +31,13 @@ FCKConfig.FullPage = false ; FCKConfig.Debug = false ; +FCKConfig.AllowQueryStringDebug = true ; FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ; FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ; -// FCKConfig.Plugins.Add( 'placeholder', 'en,it' ) ; +// FCKConfig.Plugins.Add( 'placeholder', 'de,en,fr,it,pl' ) ; FCKConfig.ProtectedSource.Add( //gi ) ; // \ No newline at end of file Index: lams_central/web/fckeditor/editor/fckeditor.html =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckeditor.html,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/fckeditor.html 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/fckeditor.html 5 Jan 2006 00:02:25 -0000 1.3 @@ -29,15 +29,15 @@ - Index: lams_central/web/fckeditor/editor/dialog/fck_checkbox.html =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_checkbox.html,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/dialog/fck_checkbox.html 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/dialog/fck_checkbox.html 5 Jan 2006 00:02:24 -0000 1.4 @@ -40,7 +40,7 @@ if ( oActiveEl && oActiveEl.tagName == 'INPUT' && oActiveEl.type == 'checkbox' ) { GetE('txtName').value = oActiveEl.name ; - GetE('txtValue').value = oActiveEl.value ; + GetE('txtValue').value = oEditor.FCKBrowserInfo.IsIE ? oActiveEl.value : GetAttribute( oActiveEl, 'value' ) ; GetE('txtSelected').checked = oActiveEl.checked ; } else @@ -58,14 +58,17 @@ oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ; } - oActiveEl.name = GetE('txtName').value ; - SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ; + if ( GetE('txtName').value.length > 0 ) + oActiveEl.name = GetE('txtName').value ; + + if ( oEditor.FCKBrowserInfo.IsIE ) + oActiveEl.value = GetE('txtValue').value ; + else + SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ; - if ( GetE('txtSelected').checked ) - { - SetAttribute( oActiveEl, 'checked', 'checked' ) ; - oActiveEl.checked = GetE('txtSelected').checked ; - } + var bIsChecked = GetE('txtSelected').checked ; + SetAttribute( oActiveEl, 'checked', bIsChecked ? 'checked' : null ) ; // For Firefox + oActiveEl.checked = bIsChecked ; return true ; } Index: lams_central/web/fckeditor/editor/dialog/fck_docprops.html =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_docprops.html,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/dialog/fck_docprops.html 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/dialog/fck_docprops.html 5 Jan 2006 00:02:24 -0000 1.3 @@ -148,6 +148,9 @@ window.onload = function () { + // Show/Hide the "Browse Server" button. + GetE('tdBrowse').style.display = oEditor.FCKConfig.ImageBrowser ? "" : "none"; + // First of all, translate the dialog box texts oEditor.FCKLanguageManager.TranslatePage( document ) ; @@ -372,26 +375,7 @@ function BrowseServerBack() { - var iLeft = (FCKConfig.ScreenWidth - FCKConfig.ImageBrowserWindowWidth) / 2 ; - var iTop = (FCKConfig.ScreenHeight - FCKConfig.ImageBrowserWindowHeight) / 2 ; - - var sOptions = "toolbar=no,status=no,resizable=yes,dependent=yes" ; - sOptions += ",width=" + FCKConfig.LinkBrowserWindowWidth ; - sOptions += ",height=" + FCKConfig.LinkBrowserWindowHeight ; - sOptions += ",left=" + iLeft ; - sOptions += ",top=" + iTop ; - - if ( oEditor.FCKBrowserInfo.IsIE ) - { - // The following change has been made otherwise IE will open the file - // browser on a different server session (on some cases): - // http://support.microsoft.com/default.aspx?scid=kb;en-us;831678 - // by Simone Chiaretta. - var oWindow = oEditor.window.open( FCKConfig.ImageBrowserURL, "FCKBrowseWindow", sOptions ) ; - oWindow.opener = window ; - } - else - window.open( FCKConfig.ImageBrowserURL, "FCKBrowseWindow", sOptions ) ; + OpenFileBrowser( FCKConfig.ImageBrowserURL, FCKConfig.ImageBrowserWindowWidth, FCKConfig.ImageBrowserWindowHeight ) ; } function SetUrl( url ) @@ -499,7 +483,7 @@
+ - + - + valign="bottom" onclick="FCKToolbarSet.Collapse();return false;"> +
Index: lams_central/web/fckeditor/editor/fckeditor.original.html =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/Attic/fckeditor.original.html,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/fckeditor.original.html 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/fckeditor.original.html 5 Jan 2006 00:02:25 -0000 1.3 @@ -46,15 +46,15 @@ - - - + + ----------------------------------------- Index: lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuseparator.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckcontextmenuseparator.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuseparator.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuseparator.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -30,9 +30,11 @@ var oCell = this._Row.insertCell(-1) ; oCell.className = 'CM_Icon' ; + var oDoc = targetTable.ownerDocument || targetTable.document ; + oCell = this._Row.insertCell(-1) ; oCell.className = 'CM_Label' ; - oCell.innerHTML = '
' ; + oCell.appendChild( oDoc.createElement( 'DIV' ) ).className = 'CM_Separator_Line' ; } FCKContextMenuSeparator.prototype.SetVisible = function( isVisible ) Index: lams_central/web/fckeditor/editor/_source/classes/fckpanel_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckpanel_gecko.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckpanel_gecko.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckpanel_gecko.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -19,51 +19,41 @@ var FCKPanel = function( parentWindow ) { + this.IsRTL = false ; + this.IsContextMenu = false ; + this._IsOpened = false ; + if ( parentWindow ) - this.Window = parentWindow ; + this._Window = parentWindow ; else { - this.Window = window ; + this._Window = window ; - while ( this.Window != window.top ) + while ( this._Window != window.top ) { // Try/Catch must be used to avoit an error when using a frameset // on a different domain: // "Permission denied to get property HTMLDocument.Body". try { - if ( this.Window.parent.document.body.tagName == 'FRAMESET' ) + if ( this._Window.parent.document.body.tagName == 'FRAMESET' ) break ; - } - catch (e) - { - break ; - } + } catch (e) { break ; } - this.Window = this.Window.parent ; + this._Window = this._Window.parent ; } } -} + + var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ; + oIFrame.frameBorder = '0'; + oIFrame.scrolling = 'no' ; + oIFrame.style.position = 'absolute'; + oIFrame.width = oIFrame.height = 0 ; + oIFrame.style.zIndex = FCKConfig.FloatingPanelsZIndex ; -FCKPanel.prototype.Create = function() -{ - this._IFrame = this.Window.document.createElement('iframe') ; - this._IFrame.src = 'about:blank' ; - this._IFrame.frameBorder = '0'; - this._IFrame.scrolling = 'no' ; - this._IFrame.style.left = '0px' ; - this._IFrame.style.top = '0px' ; - this._IFrame.width = 10 ; - this._IFrame.height = 10 ; - this._IFrame.style.position = 'absolute'; - this._IFrame.style.visibility = 'hidden' ; - - this._IFrame.IsFCKPanel = true ; - this._IFrame.Panel = this ; - - this.Window.document.body.appendChild( this._IFrame ) ; + this._Window.document.body.appendChild( oIFrame ) ; - this.Document = this._IFrame.contentWindow.document ; + this.Document = oIFrame.contentWindow.document ; // Initialize the IFRAME document body. this.Document.open() ; @@ -73,134 +63,111 @@ // Remove the default margins. this.Document.body.style.margin = this.Document.body.style.padding = '0px' ; - // Add the defined Style Sheet to the document. - if ( this.StyleSheet ) - FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ; + this._IFrame.contentWindow.onblur = this.Hide ; + + oIFrame.contentWindow.Panel = this ; - this.OuterDiv = this.Document.body.appendChild( this.Document.createElement('DIV') ) ; - this.OuterDiv.style.cssFloat = 'left' ; - - this.PanelDiv = this.OuterDiv.appendChild( this.Document.createElement('DIV') ) ; + // Create the main DIV that is used as the panel base. + this.PanelDiv = this.Document.body.appendChild( this.Document.createElement('DIV') ) ; this.PanelDiv.className = 'FCK_Panel' ; + + this.EnableContextMenu( false ) ; + this.SetDirection( FCKLang.Dir ) ; +} - this.Created = true ; +FCKPanel.prototype.EnableContextMenu = function( enabled ) +{ + this.Document.oncontextmenu = enabled ? null : FCKTools.CancelEvent ; } -FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, autoSize ) +FCKPanel.prototype.AppendStyleSheet = function( styleSheet ) { - if ( ! this.Created ) - this.Create() ; + FCKTools.AppendStyleSheet( this.Document, styleSheet ) ; +} - if ( width != null && autoSize && width < this.OuterDiv.offsetWidth ) - this.PanelDiv.style.width = width ; +FCKPanel.prototype.SetDirection = function( dir ) +{ + this.IsRTL = ( dir == 'rtl' ) ; + this.Document.dir = dir ; - if ( height != null && autoSize && height < this.PanelDiv.offsetHeight ) - this.PanelDiv.style.height = height + 'px' ; + // The "float" property must be set so Firefox calculates the size correcly. + this.PanelDiv.style.cssFloat = ( dir == 'rtl' ? 'right' : 'left' ) ; +} - var oPos = this.GetElementPosition( relElement ) ; +FCKPanel.prototype.Load = function() +{ + // This is a IE only need. +} - panelX += oPos.X ; - panelY += oPos.Y ; +FCKPanel.prototype.Show = function( x, y, relElement, width, height ) +{ + this.PanelDiv.style.width = width ? width + 'px' : '' ; + this.PanelDiv.style.height = height ? height + 'px' : '' ; - if ( panelX + this.OuterDiv.offsetWidth > this.Window.innerWidth ) - { - // The following line aligns the panel to the other side of the refElement. - // panelX = oPos.X - ( this.PanelDiv.offsetWidth - relElement.offsetWidth ) ; + if ( !width ) this._IFrame.width = 1 ; + if ( !height ) this._IFrame.height = 1 ; - panelX -= panelX + this.OuterDiv.offsetWidth - this.Window.innerWidth ; - } + var oPos = FCKTools.GetElementPosition( relElement, this._Window ) ; - // Set the context menu DIV in the specified location. - this._IFrame.style.left = panelX + 'px' ; - this._IFrame.style.top = panelY + 'px' ; + x += oPos.X ; + y += oPos.Y ; - // Watch the "OnClick" event for all windows to close the Context Menu. - function SetOnClickListener( targetWindow, targetFunction ) + if ( this.IsRTL ) { - // Try/Catch must be used to avoit an error when using a frameset - // on a different domain: - // "Permission denied to get property Window.frameElement". - try - { - if ( targetWindow == null || ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel ) ) - return ; - - targetWindow.document.addEventListener( 'click', targetFunction, false ) ; - } - catch (e) {} - - for ( var i = 0 ; i < targetWindow.frames.length ; i++ ) - SetOnClickListener( targetWindow.frames[i], targetFunction ) ; + if ( this.IsContextMenu ) + x = x - this.PanelDiv.offsetWidth + 1 ; + else if ( relElement ) + x = x + ( relElement.offsetWidth - this.PanelDiv.offsetWidth ) ; } - SetOnClickListener( window.top, FCKPanelEventHandlers.OnDocumentClick ) ; - - this._IFrame.width = this.OuterDiv.offsetWidth ; - this._IFrame.height = this.OuterDiv.offsetHeight ; - - // Show it. - this._IFrame.style.visibility = '' ; -} - -FCKPanel.prototype.GetElementPosition = function( el ) -{ - // Initializes the Coordinates object that will be returned by the function. - var c = { X:0, Y:0 } ; - - // Loop throw the offset chain. - while ( el ) + else { - c.X += el.offsetLeft ; - c.Y += el.offsetTop ; - - if ( el.offsetParent == null && el.ownerDocument.defaultView != this.Window ) - el = el.ownerDocument.defaultView.frameElement ; - else - el = el.offsetParent ; + if ( ( x + this.PanelDiv.offsetWidth ) > this._Window.document.body.clientWidth ) + x -= x + this.PanelDiv.offsetWidth - this._Window.document.body.clientWidth ; } + + if ( x < 0 ) + x = 0 ; - // Return the Coordinates object - return c ; + // Set the context menu DIV in the specified location. + this._IFrame.style.left = x + 'px' ; + this._IFrame.style.top = y + 'px' ; + + var iWidth = this.PanelDiv.offsetWidth ; + var iHeight = this.PanelDiv.offsetHeight ; + + this._IFrame.width = iWidth ; + this._IFrame.height = iHeight ; + + // Move the focus to the IFRAME so we catch the "onblur". + this._IFrame.contentWindow.focus() ; + + this._IsOpened = true ; } FCKPanel.prototype.Hide = function() { - // There is a bug on Firefox over Mac. It doesn't hide the Panel - // scrollbars, so we must force it. - this.PanelDiv.style.overflow = 'visible' ; + var oPanel = this.Panel ? this.Panel : this ; + + if ( !oPanel._IsOpened ) + return ; + + // It is better to set the sizes to 0, otherwise Firefox would have + // rendering problems. + oPanel._IFrame.width = oPanel._IFrame.height = 0 ; + + if ( oPanel._OnHide ) + oPanel._OnHide( oPanel ) ; - this._IFrame.style.visibility = 'hidden' ; -// this._IFrame.style.left = this._IFrame.style.top = '0px' ; + oPanel._IsOpened = false ; } -var FCKPanelEventHandlers = new Object() ; - -FCKPanelEventHandlers.OnDocumentClick = function( e ) +FCKPanel.prototype.CheckIsOpened = function() { - var oWindow = e.target.ownerDocument.defaultView ; + return this._IsOpened ; +} - if ( ! oWindow.IsFCKPanel ) - { - function RemoveOnClickListener( targetWindow ) - { - if ( targetWindow == null ) - return ; - - // Try/Catch must be used to avoit an error when using a frameset - // on a different domain: - // "Permission denied to get property Window.frameElement". - try - { - if ( targetWindow.frameElement && targetWindow.frameElement.IsFCKPanel ) - targetWindow.frameElement.Panel.Hide() ; - else - targetWindow.document.removeEventListener( 'click', FCKPanelEventHandlers.OnDocumentClick, false ) ; - } - catch (e) {} - - for ( var i = 0 ; i < targetWindow.frames.length ; i++ ) - RemoveOnClickListener( targetWindow.frames[i] ) ; - } - RemoveOnClickListener( window.top ) ; - } +FCKPanel.prototype.AttachToOnHideEvent = function( targetFunction ) +{ + this._OnHide = targetFunction ; } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/classes/fckpanel_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckpanel_ie.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckpanel_ie.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckpanel_ie.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -19,60 +19,109 @@ var FCKPanel = function( parentWindow ) { - this.Window = parentWindow ? parentWindow : window ; -} - -function FCKPanel_OnContextMenu() { return false ; } - -FCKPanel.prototype.Create = function() -{ - // Create the Popup that will hold the panel. - this._Popup = this.Window.createPopup() ; + this.IsRTL = false ; + this.IsContextMenu = false ; + this._IsOpened = false ; - this.Document = this._Popup.document ; + this._Window = parentWindow ? parentWindow : window ; - aCleanupDocs[ aCleanupDocs.length ] = this.Document ; - - this.Document.oncontextmenu = FCKPanel_OnContextMenu ; + // Create the Popup that will hold the panel. + this._Popup = this._Window.createPopup() ; + this.Document = this._Popup.document ; - if ( this.StyleSheet ) - FCKTools.AppendStyleSheet( this.Document, this.StyleSheet ) ; - + // Create the main DIV that is used as the panel base. this.PanelDiv = this.Document.body.appendChild( this.Document.createElement('DIV') ) ; this.PanelDiv.className = 'FCK_Panel' ; - - this.Created = true ; + + this.EnableContextMenu( false ) ; + this.SetDirection( FCKLang.Dir ) ; } -FCKPanel.prototype.Show = function( panelX, panelY, relElement, width, height, autoSize ) +FCKPanel.prototype.EnableContextMenu = function( enabled ) { - if ( ! this.Created ) - this._Create() ; - + this.Document.oncontextmenu = enabled ? null : FCKTools.CancelEvent ; +} + +FCKPanel.prototype.AppendStyleSheet = function( styleSheet ) +{ + FCKTools.AppendStyleSheet( this.Document, styleSheet ) ; +} + +FCKPanel.prototype.SetDirection = function( dir ) +{ + this.IsRTL = ( dir == 'rtl' ) ; + this.Document.dir = dir ; +} + +FCKPanel.prototype.Load = function( x, y, relElement ) +{ // The offsetWidth and offsetHeight properties are not available if the // element is not visible. So we must "show" the popup with no size to // be able to use that values in the second call. - this._Popup.show( panelX, panelY, 0, 0, relElement ) ; + this._Popup.show( x, y, 0, 0, relElement ) ; +} - if ( width == null || ( autoSize && width > this.PanelDiv.offsetWidth ) ) - var iWidth = this.PanelDiv.offsetWidth ; - else - var iWidth = width ; +FCKPanel.prototype.Show = function( x, y, relElement, width, height ) +{ + this.Load( x, y, relElement ) ; - if ( height == null || ( autoSize && height > this.PanelDiv.offsetHeight ) ) - var iHeight = this.PanelDiv.offsetHeight ; - else - var iHeight = height ; + // The following lines must be place after the above "show", otherwise it + // doesn't has the desired effect. + this.PanelDiv.style.width = width ? width + 'px' : '' ; + this.PanelDiv.style.height = height ? height + 'px' : '' ; - this.PanelDiv.style.height = iHeight ; + if ( this.IsRTL ) + { + if ( this.IsContextMenu ) + x = x - this.PanelDiv.offsetWidth + 1 ; + else if ( relElement ) + x = x + ( relElement.offsetWidth - this.PanelDiv.offsetWidth ) ; + } - // Second call: Show the Popup at the specified location. - this._Popup.show( panelX, panelY, iWidth, iHeight, relElement ) ; + // Second call: Show the Popup at the specified location, with the correct size. + this._Popup.show( x, y, this.PanelDiv.offsetWidth, this.PanelDiv.offsetHeight, relElement ) ; + + if ( this._OnHide ) + { + if ( FCKPanel_ActivePopupInfo.Timer ) + CheckPopupOnHide() ; + FCKPanel_ActivePopupInfo.Timer = window.setInterval( CheckPopupOnHide, 200 ) ; + FCKPanel_ActivePopupInfo.Panel = this ; + } + + this._IsOpened = true ; } FCKPanel.prototype.Hide = function() { - if ( this._Popup ) - this._Popup.hide() ; + this._Popup.hide() ; +} + +FCKPanel.prototype.CheckIsOpened = function() +{ + return this._Popup.isOpen ; +} + +FCKPanel.prototype.AttachToOnHideEvent = function( targetFunction ) +{ + this._OnHide = targetFunction ; +} + +var FCKPanel_ActivePopupInfo = new Object() ; + +function CheckPopupOnHide() +{ + var oPanel = FCKPanel_ActivePopupInfo.Panel ; + + if ( oPanel && !oPanel._Popup.isOpen ) + { + window.clearInterval( FCKPanel_ActivePopupInfo.Timer ) ; + + if ( oPanel._OnHide ) + oPanel._OnHide( oPanel ) ; + + FCKPanel_ActivePopupInfo.Timer = null ; + FCKPanel_ActivePopupInfo.Panel = null ; + } } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/classes/fckspecialcombo.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckspecialcombo.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckspecialcombo.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckspecialcombo.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -17,12 +17,12 @@ * Frederico Caldeira Knabben (fredck@fckeditor.net) */ -var FCKSpecialCombo = function( caption ) +var FCKSpecialCombo = function( caption, fieldWidth, panelWidth, panelMaxHeight, parentWindow ) { // Default properties values. - this.FieldWidth = 80 ; - this.PanelWidth = 130 ; - this.PanelMaxHeight = 150 ; + this.FieldWidth = fieldWidth || 100 ; + this.PanelWidth = panelWidth || 150 ; + this.PanelMaxHeight = panelMaxHeight || 150 ; this.Label = ' ' ; this.Caption = caption ; this.Tooltip = caption ; @@ -32,13 +32,21 @@ this.Items = new Object() ; - this._Panel = new FCKPanel() ; - this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ; - this._Panel.Create() ; - this._Panel.PanelDiv.className += ' SC_Panel' ; - this._Panel.PanelDiv.innerHTML = '
+ - + - + valign="bottom" onclick="FCKToolbarSet.Collapse();return false;"> +
Index: lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuitem.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckcontextmenuitem.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuitem.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckcontextmenuitem.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -61,11 +61,10 @@ var oCell = this._Row.insertCell(-1) ; oCell.className = 'CM_Icon' ; - if ( this.HasIcon ) oCell.innerHTML = '' ; + if ( this.HasIcon ) oCell.innerHTML = '' ; oCell = this._Row.insertCell(-1) ; oCell.className = 'CM_Label' ; - oCell.unselectable = 'on' ; oCell.noWrap = true ; oCell.innerHTML = this.Label ; } @@ -93,8 +92,8 @@ Sample output. -----------------------------------------
CutCut
' ; + this._Panel = new FCKPanel( parentWindow ) ; + this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ; + this._PanelBox = this._Panel.PanelDiv.appendChild( this._Panel.Document.createElement( 'DIV' ) ) ; + this._PanelBox.className = 'SC_Panel' ; + this._PanelBox.style.width = this.PanelWidth + 'px' ; + + this._PanelBox.innerHTML = '
' ; - this._ItemsHolderEl = this._Panel.PanelDiv.getElementsByTagName('TD')[0] ; + this._ItemsHolderEl = this._PanelBox.getElementsByTagName('TD')[0] ; + +// this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ; +// this._Panel.Create() ; +// this._Panel.PanelDiv.className += ' SC_Panel' ; +// this._Panel.PanelDiv.innerHTML = '
' ; +// this._ItemsHolderEl = this._Panel.PanelDiv.getElementsByTagName('TD')[0] ; } function FCKSpecialCombo_ItemOnMouseOver() @@ -93,13 +101,33 @@ } } -FCKSpecialCombo.prototype.DeselectAll = function() +FCKSpecialCombo.prototype.SelectItemByLabel = function( itemLabel, setLabel ) { + for ( var id in this.Items ) + { + var oDiv = this.Items[id] ; + + if ( oDiv.FCKItemLabel == itemLabel ) + { + oDiv.className = oDiv.originalClass = 'SC_ItemSelected' ; + oDiv.Selected = true ; + + if ( setLabel ) + this.SetLabel( itemLabel ) ; + } + } +} + +FCKSpecialCombo.prototype.DeselectAll = function( clearLabel ) +{ for ( var i in this.Items ) { this.Items[i].className = this.Items[i].originalClass = 'SC_Item' ; this.Items[i].Selected = false ; } + + if ( clearLabel ) + this.SetLabel( '' ) ; } FCKSpecialCombo.prototype.SetLabelById = function( id ) @@ -154,7 +182,6 @@ if ( this.Caption && this.Caption.length > 0 && bShowLabel ) { var oCaptionCell = this._OuterTable.rows[0].insertCell(-1) ; - oCaptionCell.unselectable = 'on' ; oCaptionCell.innerHTML = this.Caption ; oCaptionCell.className = 'SC_FieldCaption' ; } @@ -165,23 +192,23 @@ { oField.className = 'SC_Field' ; oField.style.width = this.FieldWidth + 'px' ; - oField.innerHTML = '
 
' ; + oField.innerHTML = '
 
' ; this._LabelEl = oField.getElementsByTagName('label')[0] ; this._LabelEl.innerHTML = this.Label ; } else { oField.className = 'TB_Button_Off' ; - //oField.innerHTML = '' + this.Caption + '
 
' ; - oField.innerHTML = '
 
' ; + //oField.innerHTML = '' + this.Caption + '
 
' ; + oField.innerHTML = '
 
' ; // Gets the correct CSS class to use for the specified style (param). - oField.innerHTML ='' + + oField.innerHTML ='
' + '' + - //'' + - '' + - '' + + //'' + + '' + + '' + '' + '
' + this.Caption + '' + this.Caption + '
' ; } @@ -194,6 +221,8 @@ oField.onmouseover = FCKSpecialCombo_OnMouseOver ; oField.onmouseout = FCKSpecialCombo_OnMouseOut ; oField.onclick = FCKSpecialCombo_OnClick ; + + FCKTools.DisableSelection( this._Panel.Document.body ) ; } function FCKSpecialCombo_OnMouseOver() @@ -235,30 +264,39 @@ { // For Mozilla we must stop the event propagation to avoid it hiding // the panel because of a click outside of it. - if ( e ) - { - e.stopPropagation() ; - FCKPanelEventHandlers.OnDocumentClick( e ) ; - } +// if ( e ) +// { +// e.stopPropagation() ; +// FCKPanelEventHandlers.OnDocumentClick( e ) ; +// } + + var oSpecialCombo = this.SpecialCombo ; - if ( this.SpecialCombo.Enabled ) + if ( oSpecialCombo.Enabled ) { - var oPanel = this.SpecialCombo._Panel ; + var oPanel = oSpecialCombo._Panel ; + var oPanelBox = oSpecialCombo._PanelBox ; + var oItemsHolder = oSpecialCombo._ItemsHolderEl ; + var iMaxHeight = oSpecialCombo.PanelMaxHeight ; - if ( typeof( this.SpecialCombo.OnBeforeClick ) == 'function' ) - this.SpecialCombo.OnBeforeClick( this.SpecialCombo ) ; + if ( oSpecialCombo.OnBeforeClick ) + oSpecialCombo.OnBeforeClick( oSpecialCombo ) ; - if ( this.SpecialCombo._ItemsHolderEl.offsetHeight > this.SpecialCombo.PanelMaxHeight ) - oPanel.PanelDiv.style.height = this.SpecialCombo.PanelMaxHeight + 'px' ; + // This is a tricky thing. We must call the "Load" function, otherwise + // it will not be possible to retrieve "oItemsHolder.offsetHeight". + oPanel.Load( 0, this.offsetHeight, this ) ; + + if ( oItemsHolder.offsetHeight > iMaxHeight ) + oPanelBox.style.height = iMaxHeight + 'px' ; else - oPanel.PanelDiv.style.height = this.SpecialCombo._ItemsHolderEl.offsetHeight + 'px' ; + oPanelBox.style.height = oItemsHolder.offsetHeight + 'px' ; - oPanel.PanelDiv.style.width = this.SpecialCombo.PanelWidth + 'px' ; +// oPanel.PanelDiv.style.width = oSpecialCombo.PanelWidth + 'px' ; if ( FCKBrowserInfo.IsGecko ) - oPanel.PanelDiv.style.overflow = '-moz-scrollbars-vertical' ; + oPanelBox.style.overflow = '-moz-scrollbars-vertical' ; - oPanel.Show( 0, this.offsetHeight, this, null, this.SpecialCombo.PanelMaxHeight, true ) ; + oPanel.Show( 0, this.offsetHeight, this ) ; } return false ; Index: lams_central/web/fckeditor/editor/_source/classes/fckstyledef_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fckstyledef_ie.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fckstyledef_ie.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fckstyledef_ie.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -50,10 +50,19 @@ { for ( var a in this.Attributes ) { - if ( a.toLowerCase() == 'style' ) - targetElement.style.cssText = this.Attributes[a] ; - else - targetElement.setAttribute( a, this.Attributes[a], 0 ) ; + switch ( a.toLowerCase() ) + { + case 'style' : + targetElement.style.cssText = this.Attributes[a] ; + break ; + + case 'class' : + targetElement.setAttribute( 'className', this.Attributes[a], 0 ) ; + break ; + + default : + targetElement.setAttribute( a, this.Attributes[a], 0 ) ; + } } } @@ -65,10 +74,7 @@ this._RemoveDuplicates( oChild ) ; if ( this.IsEqual( oChild ) ) - { - oChild.insertAdjacentHTML( 'beforeBegin', oChild.innerHTML ) ; - oChild.parentElement.removeChild( oChild ) ; - } + FCKTools.RemoveOuterTags( oChild ) ; } } Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbar.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbar.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbar.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbar.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -36,7 +36,7 @@ var oCell = this.DOMRow.insertCell(-1) ; oCell.className = 'TB_Start' ; - oCell.innerHTML = '' ; + oCell.innerHTML = '' ; FCKToolbarSet.DOMElement.appendChild( e ) ; } @@ -50,13 +50,12 @@ FCKToolbar.prototype.AddSeparator = function() { var oCell = this.DOMRow.insertCell(-1) ; - oCell.unselectable = 'on' ; - oCell.innerHTML = '' ; + oCell.innerHTML = '' ; } FCKToolbar.prototype.AddTerminator = function() { var oCell = this.DOMRow.insertCell(-1) ; oCell.className = 'TB_End' ; - oCell.innerHTML = '' ; + oCell.innerHTML = '' ; } Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbutton.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarbutton.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbutton.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarbutton.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -37,14 +37,14 @@ this.DOMDiv.FCKToolbarButton = this ; var sHtml = - '' + + '
' + '' ; if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT ) - sHtml += '' ; + sHtml += '' ; if ( this.Style != FCK_TOOLBARITEM_ONLYICON ) - sHtml += '' ; + sHtml += '' ; sHtml += '' + @@ -61,7 +61,7 @@ FCKToolbarButton.prototype.RefreshState = function() { /* - TODO: Delete this commend block on stable version. + TODO: Delete this comment block on stable version. // Gets the actual state. // var eState ; Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarfontformatcombo.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontformatcombo.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -24,6 +24,8 @@ this.Tooltip = tooltip ? tooltip : this.Label ; this.Style = style ? style : FCK_TOOLBARITEM_ICONTEXT ; + this.NormalLabel = 'Normal' ; + this.PanelWidth = 190 ; } @@ -57,8 +59,40 @@ for ( var i = 0 ; i < aTags.length ; i++ ) { - if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko ) - continue ; - this._Combo.AddItem( aTags[i], '<' + aTags[i] + '>' + oNames[aTags[i]] + '', oNames[aTags[i]] ) ; + // Support for DIV in Firefox has been reintroduced on version 2.2. +// if ( aTags[i] == 'div' && FCKBrowserInfo.IsGecko ) +// continue ; + + var sTag = aTags[i] ; + var sLabel = oNames[sTag] ; + + if ( sTag == 'p' ) + this.NormalLabel = sLabel ; + + this._Combo.AddItem( sTag, '
<' + sTag + '>' + sLabel + '
', sLabel ) ; } +} + +if ( FCKBrowserInfo.IsIE ) +{ + FCKToolbarFontFormatCombo.prototype.RefreshActiveItems = function( combo, value ) + { +// FCKDebug.Output( 'FCKToolbarFontFormatCombo Value: ' + value ) ; + + // IE returns normal for DIV and P, so to avoid confusion, we will not show it if normal. + if ( value == this.NormalLabel ) + { + if ( combo.Label != ' ' ) + combo.DeselectAll(true) ; + } + else + { + if ( this._LastValue == value ) + return ; + + combo.SelectItemByLabel( value, true ) ; + } + + this._LastValue = value ; + } } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarfontscombo.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarfontscombo.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -38,5 +38,5 @@ var aFonts = FCKConfig.FontNames.split(';') ; for ( var i = 0 ; i < aFonts.length ; i++ ) - this._Combo.AddItem( aFonts[i], '' + aFonts[i] + '' ) ; + this._Combo.AddItem( aFonts[i], '' + aFonts[i] + '' ) ; } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarpanelbutton.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarpanelbutton.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -25,17 +25,18 @@ this.Tooltip = tooltip ? tooltip : ( label ? label : commandName) ; this.Style = style ? style : FCK_TOOLBARITEM_ONLYICON ; this.State = FCK_UNKNOWN ; + this.IconPath = FCKConfig.SkinPath + 'toolbar/' + commandName.toLowerCase() + '.gif' ; } FCKToolbarPanelButton.prototype.Click = function(e) { // For Mozilla we must stop the event propagation to avoid it hiding // the panel because of a click outside of it. - if ( e ) - { - e.stopPropagation() ; - FCKPanelEventHandlers.OnDocumentClick( e ) ; - } +// if ( e ) +// { +// e.stopPropagation() ; +// FCKPanelEventHandlers.OnDocumentClick( e ) ; +// } if ( this.State != FCK_TRISTATE_DISABLED ) { @@ -54,17 +55,17 @@ this.DOMDiv.FCKToolbarButton = this ; var sHtml = - '
' + this.Label + '' + this.Label + '
' + + '
' + '' ; if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT ) - sHtml += '' ; - + sHtml += '' ; + if ( this.Style != FCK_TOOLBARITEM_ONLYICON ) - sHtml += '' ; + sHtml += '' ; sHtml += - '' + + '' + '' + '
' + this.Label + '' + this.Label + '
' ; Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarspecialcombo.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarspecialcombo.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -37,10 +37,13 @@ FCKToolbarSpecialCombo.prototype.CreateInstance = function( parentToolbar ) { - this._Combo = new FCKSpecialCombo( this.GetLabel() ) ; + this._Combo = new FCKSpecialCombo( this.GetLabel(), this.FieldWidth, this.PanelWidth, this.PanelMaxHeight ) ; + + /* this._Combo.FieldWidth = this.FieldWidth != null ? this.FieldWidth : 100 ; this._Combo.PanelWidth = this.PanelWidth != null ? this.PanelWidth : 150 ; this._Combo.PanelMaxHeight = this.PanelMaxHeight != null ? this.PanelMaxHeight : 150 ; + */ //this._Combo.Command.Name = this.Command.Name; // this._Combo.Label = this.Label ; @@ -81,7 +84,14 @@ if ( this.RefreshActiveItems ) this.RefreshActiveItems( this._Combo, sValue ) ; else + { + if ( this._LastValue == sValue ) + return ; + + this._LastValue = sValue ; + FCKToolbarSpecialCombo_RefreshActiveItems( this._Combo, sValue ) ; + } } else eState = FCK_TRISTATE_DISABLED ; Index: lams_central/web/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/classes/Attic/fcktoolbarstylecombo.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/classes/fcktoolbarstylecombo.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -37,6 +37,8 @@ { // Add the Editor Area CSS to the Styles panel so the style classes are previewed correctly. FCKTools.AppendStyleSheet( targetSpecialCombo._Panel.Document, FCKConfig.EditorAreaCSS ) ; + + targetSpecialCombo._Panel.Document.body.className += ' ForceBaseFont' ; // For some reason Gecko is blocking inside the "RefreshVisibleItems" function. if ( ! FCKBrowserInfo.IsGecko ) Index: lams_central/web/fckeditor/editor/_source/commandclasses/fck_othercommands.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fck_othercommands.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/commandclasses/fck_othercommands.js 12 Dec 2005 05:18:53 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/commandclasses/fck_othercommands.js 5 Jan 2006 00:02:24 -0000 1.4 @@ -115,6 +115,8 @@ { if ( formatName == null || formatName == '' ) FCK.ExecuteNamedCommand( 'FormatBlock', '

' ) ; + else if ( formatName == 'div' && FCKBrowserInfo.IsGecko ) + FCK.ExecuteNamedCommand( 'FormatBlock', 'div' ) ; else FCK.ExecuteNamedCommand( 'FormatBlock', '<' + formatName + '>' ) ; } @@ -262,10 +264,16 @@ FCKPageBreakCommand.prototype.Execute = function() { - var oCenter = FCK.EditorDocument.createElement( 'CENTER' ) ; - oCenter.style.pageBreakAfter = 'always' ; +// var e = FCK.EditorDocument.createElement( 'CENTER' ) ; +// e.style.pageBreakAfter = 'always' ; + + // Tidy was removing the empty CENTER tags, so the following solution has + // been found. It also validates correctly as XHTML 1.0 Strict. + var e = FCK.EditorDocument.createElement( 'DIV' ) ; + e.style.pageBreakAfter = 'always' ; + e.innerHTML = ' ' ; - var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', oCenter ) ; + var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', e ) ; oFakeImage = FCK.InsertElement( oFakeImage ) ; } Index: lams_central/web/fckeditor/editor/_source/commandclasses/fcktablecommand.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fcktablecommand.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/commandclasses/fcktablecommand.js 12 Dec 2005 05:18:53 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/commandclasses/fcktablecommand.js 5 Jan 2006 00:02:24 -0000 1.4 @@ -53,6 +53,9 @@ case 'TableSplitCell' : FCKTableHandler.SplitCell() ; break ; + case 'TableDelete' : + FCKTableHandler.DeleteTable() ; + break ; default : alert( FCKLang.UnknownCommand.replace( /%1/g, this.Name ) ) ; } Index: lams_central/web/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/commandclasses/Attic/fcktextcolorcommand.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/commandclasses/fcktextcolorcommand.js 5 Jan 2006 00:02:24 -0000 1.3 @@ -31,11 +31,14 @@ */ this._Panel = new FCKPanel() ; - this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ; - this._Panel.Create() ; + this._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ; +// this._Panel.StyleSheet = FCKConfig.SkinPath + 'fck_contextmenu.css' ; +// this._Panel.Create() ; this._CreatePanelBody( this._Panel.Document, this._Panel.PanelDiv ) ; + FCKTools.DisableSelection( this._Panel.Document.body ) ; + // END ### } @@ -123,6 +126,7 @@ // Create the Table that will hold all colors. var oTable = targetDiv.appendChild( targetDocument.createElement( "TABLE" ) ) ; + oTable.className = 'ForceBaseFont' ; // Firefox 1.5 Bug. oTable.style.tableLayout = 'fixed' ; oTable.cellPadding = 0 ; oTable.cellSpacing = 0 ; @@ -138,7 +142,7 @@ '\ \ \ - \ + \ \
' + FCKLang.ColorAutomatic + '' + FCKLang.ColorAutomatic + '
' ; Index: lams_central/web/fckeditor/editor/_source/globals/fckeditorapi.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/globals/Attic/fckeditorapi.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/globals/fckeditorapi.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/globals/fckeditorapi.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -32,7 +32,7 @@ FCKeditorAPI.__Instances = new Object() ; // Set the current version. - FCKeditorAPI.Version = '2.1.1' ; + FCKeditorAPI.Version = '2.2' ; // Function used to get a instance of an existing editor present in the // page. Index: lams_central/web/fckeditor/editor/_source/internals/fck.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -25,20 +25,31 @@ FCK.Status = FCK_STATUS_NOTLOADED ; FCK.EditMode = FCK_EDITMODE_WYSIWYG ; -// There is a bug on IE... getElementById returns any META tag that has the -// name set to the ID you are looking for. So the best way in to get the array -// by names and look for the correct one. -// As ASP.Net generates a ID that is different from the Name, we must also -// look for the field based on the ID. - -var aElements = window.parent.document.getElementsByName( FCK.Name ) ; -aElements[ aElements.length ] = window.parent.document.getElementById( FCK.Name ) ; -var i = 0; -while ( ( FCK.LinkedField = aElements[i++] ) ) +FCK.LoadLinkedFile = function() { - if ( FCK.LinkedField.tagName == 'INPUT' || FCK.LinkedField.tagName == 'TEXTAREA' ) - break ; + // There is a bug on IE... getElementById returns any META tag that has the + // name set to the ID you are looking for. So the best way in to get the array + // by names and look for the correct one. + // As ASP.Net generates a ID that is different from the Name, we must also + // look for the field based on the ID (the first one is the ID). + + var oDocument = window.parent.document ; + + var eLinkedField = oDocument.getElementById( FCK.Name ) ; + var colElementsByName = oDocument.getElementsByName( FCK.Name ) ; + + var i = 0; + while ( eLinkedField || i == 0 ) + { + if ( eLinkedField && ( eLinkedField.tagName == 'INPUT' || eLinkedField.tagName == 'TEXTAREA' ) ) + { + FCK.LinkedField = eLinkedField ; + break ; + } + eLinkedField = colElementsByName[i++] ; + } } +FCK.LoadLinkedFile() ; var FCKTempBin = new Object() ; FCKTempBin.Elements = new Array() ; Index: lams_central/web/fckeditor/editor/_source/internals/fck_1.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_1.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_1.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_1.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -18,6 +18,8 @@ * Frederico Caldeira Knabben (fredck@fckeditor.net) */ +var FCK_StartupValue ; + FCK.Events = new FCKEvents( FCK ) ; FCK.Toolbar = null ; @@ -38,6 +40,9 @@ // Set the editor's startup contents this.SetHTML( FCKTools.GetLinkedFieldValue() ) ; + + // Save the startup value for the "IsDirty()" check. + this.ResetIsDirty() ; // Attach the editor to the form onsubmit event FCKTools.AttachToLinkedFieldFormSubmit( this.UpdateLinkedField ) ; @@ -50,16 +55,24 @@ function Window_OnFocus() { FCK.Focus() ; + FCK.Events.FireEvent( "OnFocus" ) ; } +function Window_OnBlur() +{ + if ( !FCKDialog.IsOpened ) + return FCK.Events.FireEvent( "OnBlur" ) ; +} + FCK.SetStatus = function( newStatus ) { this.Status = newStatus ; if ( newStatus == FCK_STATUS_ACTIVE ) { // Force the focus in the window to go to the editor. - window.onfocus = window.document.body.onfocus = Window_OnFocus ; + window.frameElement.onfocus = window.document.body.onfocus = Window_OnFocus ; + window.frameElement.onblur = Window_OnBlur ; // Force the focus in the editor. if ( FCKConfig.StartupFocus ) @@ -108,7 +121,7 @@ FCKScriptLoader.AddScript( '_source/classes/fckcontextmenuseparator.js' ) ; FCKScriptLoader.AddScript( '_source/classes/fckcontextmenugroup.js' ) ; FCKScriptLoader.AddScript( '_source/internals/fckcontextmenu.js' ) ; - FCKScriptLoader.AddScript( '_source/internals/fckcontextmenu_' + sBrowserSuffix + '.js' ) ; +// FCKScriptLoader.AddScript( '_source/internals/fckcontextmenu_' + sBrowserSuffix + '.js' ) ; FCKScriptLoader.AddScript( '_source/classes/fckplugin.js' ) ; FCKScriptLoader.AddScript( '_source/internals/fckplugins.js' ) ; FCKScriptLoader.AddScript( '_source/internals/fck_last.js' ) ; @@ -127,8 +140,11 @@ this.Events.FireEvent( 'OnStatusChange', newStatus ) ; } +// Deprecated : returns the same value as GetXHTML. FCK.GetHTML = function( format ) { + FCK.GetXHTML( format ) ; +/* var sHTML ; if ( FCK.EditMode == FCK_EDITMODE_WYSIWYG ) @@ -149,6 +165,7 @@ return FCKCodeFormatter.Format( sHTML ) ; else return sHTML ; +*/ } FCK.GetXHTML = function( format ) @@ -158,10 +175,6 @@ if ( bSource ) this.SwitchEditMode() ; - // TODO: Wait stable version and remove the following commented lines. -// if ( FCKBrowserInfo.IsIE ) -// FCK.CheckRelativeLinks() ; - var sXHTML ; if ( FCKConfig.FullPage ) @@ -191,10 +204,11 @@ FCK.UpdateLinkedField = function() { - if ( FCKConfig.EnableXHTML ) + // EnableXHTML has been deprecated +// if ( FCKConfig.EnableXHTML ) FCK.LinkedField.value = FCK.GetXHTML( FCKConfig.FormatOutput ) ; - else - FCK.LinkedField.value = FCK.GetHTML( FCKConfig.FormatOutput ) ; +// else +// FCK.LinkedField.value = FCK.GetHTML( FCKConfig.FormatOutput ) ; FCK.Events.FireEvent( 'OnAfterLinkedFieldUpdate' ) ; } @@ -232,6 +246,32 @@ this.Events.FireEvent( 'OnAfterSetHTML' ) ; } +// Saves URLs on links and images on special attributes, so they don't change when +// moving around. +FCK.ProtectUrls = function( html ) +{ + // href + html = html.replace( FCKRegexLib.ProtectUrlsAApo , '$1$2$3$2 _fcksavedurl=$2$3$2' ) ; + html = html.replace( FCKRegexLib.ProtectUrlsANoApo , '$1$2 _fcksavedurl="$2"' ) ; + + // src + html = html.replace( FCKRegexLib.ProtectUrlsImgApo , '$1$2$3$2 _fcksavedurl=$2$3$2' ) ; + html = html.replace( FCKRegexLib.ProtectUrlsImgNoApo, '$1$2 _fcksavedurl="$2"' ) ; + + return html ; +} + +FCK.IsDirty = function() +{ + return ( FCK_StartupValue != FCK.EditorDocument.body.innerHTML ) ; +} + +FCK.ResetIsDirty = function() +{ + if ( FCK.EditorDocument.body ) + FCK_StartupValue = FCK.EditorDocument.body.innerHTML ; +} + // Advanced document processors. var FCKDocumentProcessors = new Array() ; @@ -274,6 +314,21 @@ var FCKPageBreaksProcessor = new Object() ; FCKPageBreaksProcessor.ProcessDocument = function( document ) { + var aDIVs = document.getElementsByTagName( 'DIV' ) ; + + var eDIV ; + var i = aDIVs.length - 1 ; + while ( i >= 0 && ( eDIV = aDIVs[i--] ) ) + { + if ( eDIV.style.pageBreakAfter == 'always' && eDIV.childNodes.length == 1 && eDIV.childNodes[0].style && eDIV.childNodes[0].style.display == 'none' ) + { + var oFakeImage = FCKDocumentProcessors_CreateFakeImage( 'FCK__PageBreak', eDIV.cloneNode(true) ) ; + + eDIV.parentNode.insertBefore( oFakeImage, eDIV ) ; + eDIV.parentNode.removeChild( eDIV ) ; + } + } +/* var aCenters = document.getElementsByTagName( 'CENTER' ) ; var oCenter ; @@ -288,6 +343,7 @@ oCenter.parentNode.removeChild( oCenter ) ; } } +*/ } FCKDocumentProcessors.addItem( FCKPageBreaksProcessor ) ; @@ -309,7 +365,19 @@ { if ( oEmbed.src.endsWith( '.swf', true ) ) { - var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__Flash', oEmbed.cloneNode(true) ) ; + var oCloned = oEmbed.cloneNode( true ) ; + + // On IE, some properties are not getting clonned properly, so we + // must fix it. Thanks to Alfonso Martinez. + if ( FCKBrowserInfo.IsIE ) + { + oCloned.setAttribute( 'scale', oEmbed.getAttribute( 'scale' ) ); + oCloned.setAttribute( 'play', oEmbed.getAttribute( 'play' ) ); + oCloned.setAttribute( 'loop', oEmbed.getAttribute( 'loop' ) ); + oCloned.setAttribute( 'menu', oEmbed.getAttribute( 'menu' ) ); + } + + var oImg = FCKDocumentProcessors_CreateFakeImage( 'FCK__Flash', oCloned ) ; oImg.setAttribute( '_fckflash', 'true', 0 ) ; FCKFlashProcessor.RefreshView( oImg, oEmbed ) ; Index: lams_central/web/fckeditor/editor/_source/internals/fck_1_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_1_gecko.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_1_gecko.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_1_gecko.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -23,6 +23,18 @@ FCK.InitializeBehaviors = function() { + /* + window.document.onblur = function(e) + { + return FCK.Events.FireEvent( "OnBlur" ) ; + } + + window.document.onfocus = function() + { + return FCK.Events.FireEvent( "OnFocus" ) ; + } + */ + // Enable table borders visibility. if ( FCKConfig.ShowBorders ) { @@ -41,7 +53,6 @@ // Handle pasting operations. var oOnKeyDown = function( e ) { - // FCKDebug.Output( 'Which Key: ' + e.which ) ; // START iCM Modifications /* @@ -53,18 +64,18 @@ } // Amend backspace handling so correctly removes empty block elements i.e. those block elements containing nothing or // just the bogus BR node - if ( e.which == 8 && !e.shiftKey && !e.ctrlKey && !e.altKey && !FCKConfig.UserBROnCarriageReturn && !FCK.Events.FireEvent( "OnBackSpace" ) ) + if ( e.which == 8 && !e.shiftKey && !e.ctrlKey && !e.altKey && !FCKConfig.UseBROnCarriageReturn && !FCK.Events.FireEvent( "OnBackSpace" ) ) { e.preventDefault() ; e.stopPropagation() ; } */ // END iCM Modifications + var bPrevent ; + if ( e.ctrlKey && !e.shiftKey && !e.altKey ) { - var bPrevent = false ; - switch ( e.which ) { case 66 : // B @@ -84,13 +95,15 @@ bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ; break ; } - - if ( bPrevent ) - { - e.preventDefault() ; - e.stopPropagation() ; - } } + else if ( e.shiftKey && !e.ctrlKey && !e.altKey && e.keyCode == 45 ) // SHIFT + + bPrevent = ( FCK.Status != FCK_STATUS_COMPLETE || !FCK.Events.FireEvent( "OnPaste" ) ) ; + + if ( bPrevent ) + { + e.preventDefault() ; + e.stopPropagation() ; + } } this.EditorDocument.addEventListener( 'keypress', oOnKeyDown, true ) ; @@ -126,6 +139,9 @@ { this.document.body.innerHTML = this._FCK_HTML ; this._FCK_HTML = null ; + + if ( !FCK_StartupValue ) + FCK.ResetIsDirty() ; } } this.EditorWindow.addEventListener( 'load', this._OnLoad, true ) ; @@ -151,6 +167,18 @@ // Tell Gecko to use or not the tag for the bold, italic and underline. FCK.EditorDocument.execCommand( 'useCSS', false, !FCKConfig.GeckoUseSPAN ) ; + + // Analysing Firefox 1.5 source code, it seams that there is support for a + // "insertBrOnReturn" command. Applying it gives no error, but it doesn't + // gives the same behavior that you have with IE. It works only if you are + // already inside a paragraph and it doesn't render correctly in the first enter. + // FCK.EditorDocument.execCommand( 'insertBrOnReturn', false, false ) ; + + // Tell Gecko (Firefox 1.5+) to enable or not live resizing of objects (by Alfonso Martinez) + FCK.EditorDocument.execCommand( 'enableObjectResizing', false, !FCKConfig.DisableImageHandles ) ; + + // Disable the standard table editing features of Firefox. + FCK.EditorDocument.execCommand( 'enableInlineTableEditing', false, !FCKConfig.DisableTableHandles ) ; } catch (e) {} } @@ -165,8 +193,39 @@ catch(e) {} } +// @Packager.Compactor.Remove.Start +if ( FCKBrowserInfo.IsSafari ) +{ FCK.SetHTML = function( html, forceWYSIWYG ) { + if( window.console ) window.console.log( 'FCK.SetHTML()' ) ; // @Packager.Compactor.RemoveLine + + sHtml = + FCKConfig.DocType + + '' + + '' + + '' + + '' ; + +// sHtml += FCK.TempBaseTag ; + sHtml += '' + html + '' ; + + this.EditorDocument.open() ; + this.EditorDocument.write( sHtml ) ; + this.EditorDocument.close() ; + +// this.InitializeBehaviors() ; + +// FCK.MakeEditable() ; + FCK.EditorDocument.designMode = 'on' ; + FCK.OnAfterSetHTML() ; +} +} +else +{ +// @Packager.Compactor.Remove.End +FCK.SetHTML = function( html, forceWYSIWYG ) +{ // Firefox can't handle correctly the editing of the STRONG and EM tags. // We must replace them with B and I. html = html.replace( FCKRegexLib.StrongOpener, ' 0 && !(e.ctrlKey || e.altKey || e.shiftKey) ) { @@ -205,6 +214,7 @@ if ( forceWYSIWYG || FCK.EditMode == FCK_EDITMODE_WYSIWYG ) { html = FCKConfig.ProtectedSource.Protect( html ) ; + html = FCK.ProtectUrls( html ) ; var sHtml ; @@ -238,7 +248,8 @@ sHtml += '' + html + '' ; } - this.EditorDocument.open( '', '_self', '', true ) ; +// this.EditorDocument.open( '', '_self', '', true ) ; // This one opens popups in IE 5.5 - BUG 1204220 (I was not able to reproduce the problem). + this.EditorDocument.open( '', 'replace' ) ; this.EditorDocument.write( sHtml ) ; this.EditorDocument.close() ; @@ -253,6 +264,9 @@ FCK.InsertHtml = function( html ) { + html = FCKConfig.ProtectedSource.Protect( html ) ; + html = FCK.ProtectUrls( html ) ; + FCK.Focus() ; FCKUndo.SaveUndoStep() ; @@ -264,7 +278,7 @@ if ( oSel.type.toLowerCase() != "none" ) oSel.clear() ; - // Inset the HTML. + // Insert the HTML. oSel.createRange().pasteHTML( html ) ; } Index: lams_central/web/fckeditor/editor/_source/internals/fck_2.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_2.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_2.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -22,11 +22,11 @@ // wich named commands must be handled separately. FCK.RedirectNamedCommands = new Object() ; -FCK.ExecuteNamedCommand = function( commandName, commandParameter ) +FCK.ExecuteNamedCommand = function( commandName, commandParameter, noRedirect ) { FCKUndo.SaveUndoStep() ; - if ( FCK.RedirectNamedCommands[ commandName ] != null ) + if ( !noRedirect && FCK.RedirectNamedCommands[ commandName ] != null ) FCK.ExecuteRedirectedNamedCommand( commandName, commandParameter ) ; else { @@ -161,10 +161,13 @@ { if ( FCKBrowserInfo.IsIE ) FCKUndo.SaveUndoStep() ; - document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ; + + // EnableXHTML and EnableSourceXHTML has been deprecated +// document.getElementById('eSourceField').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ; + document.getElementById('eSourceField').value = FCK.GetXHTML( FCKConfig.FormatSource ) ; } else - FCK.SetHTML( FCK.GetHTML(), true ) ; + FCK.SetHTML( document.getElementById('eSourceField').value, true ) ; // Updates the actual mode status. FCK.EditMode = bWYSIWYG ? FCK_EDITMODE_SOURCE : FCK_EDITMODE_WYSIWYG ; Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2_gecko.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_2_gecko.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -58,16 +58,16 @@ FCK.EditorWindow.print() ; break ; case 'Paste' : - try { if ( FCK.Paste() ) FCK.ExecuteNamedCommand( 'Paste' ) ; } - catch (e) { alert( FCKLang.PasteErrorPaste ) ; } + try { if ( FCK.Paste() ) FCK.ExecuteNamedCommand( 'Paste', null, true ) ; } + catch (e) { alert(FCKLang.PasteErrorPaste) ; } break ; case 'Cut' : - try { FCK.ExecuteNamedCommand( 'Cut' ) ; } - catch (e) { alert( FCKLang.PasteErrorCut ) ; } + try { FCK.ExecuteNamedCommand( 'Cut', null, true ) ; } + catch (e) { alert(FCKLang.PasteErrorCut) ; } break ; case 'Copy' : - try { FCK.ExecuteNamedCommand( 'Copy' ) ; } - catch (e) { alert( FCKLang.PasteErrorCopy ) ; } + try { FCK.ExecuteNamedCommand( 'Copy', null, true ) ; } + catch (e) { alert(FCKLang.PasteErrorCopy) ; } break ; // START iCM MODIFICATIONS @@ -138,19 +138,15 @@ // selected content if any. FCK.InsertHtml = function( html ) { + html = FCKConfig.ProtectedSource.Protect( html ) ; + html = FCK.ProtectUrls( html ) ; + // Delete the actual selection. var oSel = FCKSelection.Delete() ; -// var oContainer = oSel.getRangeAt(0).startContainer ; -// var iOffSet = oSel.getRangeAt(0).startOffset ; - // Get the first available range. var oRange = oSel.getRangeAt(0) ; -// var oRange = this.EditorDocument.createRange() ; -// oRange.setStart( oContainer, iOffSet ) ; -// oRange.setEnd( oContainer, iOffSet ) ; - // Create a fragment with the input HTML. var oFragment = oRange.createContextualFragment( html ) ; @@ -161,13 +157,9 @@ oRange.insertNode(oFragment) ; // Set the cursor after the inserted fragment. - oRange.setEndAfter( oLastNode ) ; - oRange.setStartAfter( oLastNode ) ; + FCKSelection.SelectNode( oLastNode ) ; + FCKSelection.Collapse( false ) ; - oSel.removeAllRanges() ; - oSel = FCK.EditorWindow.getSelection() ; - oSel.addRange( oRange ) ; - this.Focus() ; } @@ -183,8 +175,8 @@ oRange.insertNode( element ) ; // Set the cursor after the inserted fragment. - oRange.setEndAfter( element ) ; - oRange.setStartAfter( element ) ; + FCKSelection.SelectNode( element ) ; + FCKSelection.Collapse( false ) ; this.Focus() ; } Index: lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_2_ie.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_2_ie.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -53,7 +53,7 @@ else if ( FCKConfig.AutoDetectPasteFromWord ) { var sHTML = FCK.GetClipboardHTML() ; - var re = /<\w[^>]* class="?MsoNormal"?/gi ; + var re = /<\w[^>]*(( class="?MsoNormal"?)|(="mso-))/gi ; if ( re.test( sHTML ) ) { if ( confirm( FCKLang["PasteWordConfirm"] ) ) Index: lams_central/web/fckeditor/editor/_source/internals/fck_last.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_last.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fck_last.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fck_last.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -24,7 +24,7 @@ window.document.dir = FCKLang.Dir ; // Activate pasting operations. -if ( FCKConfig.ForcePasteAsPlainText ) +if ( FCKConfig.ForcePasteAsPlainText || FCKConfig.AutoDetectPasteFromWord ) FCK.Events.AttachEvent( "OnPaste", FCK.Paste ) ; // START iCM Modifications @@ -58,6 +58,8 @@ FCK.AttachToOnSelectionChange( FCKToolbarSet.RefreshItemsState ) ; //FCK.AttachToOnSelectionChange( FCKSelection._Reset ) ; + FCKTools.DisableSelection( document.body ) ; + FCK.SetStatus( FCK_STATUS_COMPLETE ) ; // Call the special "FCKeditor_OnComplete" function that should be present in Index: lams_central/web/fckeditor/editor/_source/internals/fck_onload.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fck_onload.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fck_onload.js 12 Dec 2005 05:18:53 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fck_onload.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -153,6 +153,9 @@ function LoadPageConfig() { FCKConfig.LoadPageConfig() ; + + if ( FCKConfig.AllowQueryStringDebug && (/fckdebug=true/i).test( window.top.location.search ) ) + FCKConfig.Debug = true ; // Load the styles for the configured skin. LoadStyles() ; Index: lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcodeformatter.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckcodeformatter.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -26,8 +26,8 @@ FCKCodeFormatter.Regex = new Object() ; // Regex for line breaks. - FCKCodeFormatter.Regex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|AREA|OPTION)[^\>]*\>/gi ; - FCKCodeFormatter.Regex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|AREA|OPTION)[^\>]*\>/gi ; + FCKCodeFormatter.Regex.BlocksOpener = /\<(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ; + FCKCodeFormatter.Regex.BlocksCloser = /\<\/(P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TITLE|META|LINK|BASE|SCRIPT|LINK|TD|TH|AREA|OPTION)[^\>]*\>/gi ; FCKCodeFormatter.Regex.NewLineTags = /\<(BR|HR)[^\>]\>/gi ; @@ -40,10 +40,23 @@ FCKCodeFormatter.Regex.DecreaseIndent = /^\<\/(HTML|HEAD|BODY|FORM|TABLE|TBODY|THEAD|TR|UL|OL)[ \>]/i ; FCKCodeFormatter.Regex.FormatIndentatorRemove = new RegExp( FCKConfig.FormatIndentator ) ; + FCKCodeFormatter.Regex.ProtectedTags = /(]*>)([\s\S]*?)(<\/PRE>)/gi ; + + FCKCodeFormatter._ProtectData = function( outer, opener, data, closer ) + { + return opener + '___FCKpd___' + FCKCodeFormatter.ProtectedData.addItem( data ) + closer ; + } + FCKCodeFormatter.Format = function( html ) { + // Protected content that remain untouched during the + // process go in the following array. + FCKCodeFormatter.ProtectedData = new Array() ; + + var sFormatted = html.replace( this.Regex.ProtectedTags, FCKCodeFormatter._ProtectData ) ; + // Line breaks. - var sFormatted = html.replace( this.Regex.BlocksOpener, '\n$&' ) ; ; + 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' ) ; @@ -69,6 +82,13 @@ if ( this.Regex.IncreaseIndent.test( sLine ) ) sIndentation += FCKConfig.FormatIndentator ; } + + // Now we put back the protected data. + for ( var i = 0 ; i < FCKCodeFormatter.ProtectedData.length ; i++ ) + { + var oRegex = new RegExp( '___FCKpd___' + i ) ; + sFormatted = sFormatted.replace( oRegex, FCKCodeFormatter.ProtectedData[i] ) ; + } return sFormatted.trim() ; } Index: lams_central/web/fckeditor/editor/_source/internals/fckcommands.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcommands.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckcommands.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckcommands.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -47,7 +47,7 @@ case 'Image' : oCommand = new FCKDialogCommand( 'Image' , FCKLang.DlgImgTitle , 'dialog/fck_image.html' , 450, 400 ) ; break ; case 'Flash' : oCommand = new FCKDialogCommand( 'Flash' , FCKLang.DlgFlashTitle , 'dialog/fck_flash.html' , 450, 400 ) ; break ; - case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 300 ) ; break ; + case 'SpecialChar' : oCommand = new FCKDialogCommand( 'SpecialChar', FCKLang.DlgSpecialCharTitle , 'dialog/fck_specialchar.html' , 400, 320 ) ; break ; case 'Smiley' : oCommand = new FCKDialogCommand( 'Smiley' , FCKLang.DlgSmileyTitle , 'dialog/fck_smiley.html' , FCKConfig.SmileyWindowWidth, FCKConfig.SmileyWindowHeight ) ; break ; case 'Table' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html' , 400, 250 ) ; break ; case 'TableProp' : oCommand = new FCKDialogCommand( 'Table' , FCKLang.DlgTableTitle , 'dialog/fck_table.html?Parent', 400, 250 ) ; break ; @@ -80,6 +80,7 @@ case 'TableDeleteCells' : oCommand = new FCKTableCommand('TableDeleteCells') ; break ; case 'TableMergeCells' : oCommand = new FCKTableCommand('TableMergeCells') ; break ; case 'TableSplitCell' : oCommand = new FCKTableCommand('TableSplitCell') ; break ; + case 'TableDelete' : oCommand = new FCKTableCommand('TableDelete') ; break ; case 'Form' : oCommand = new FCKDialogCommand( 'Form' , FCKLang.Form , 'dialog/fck_form.html' , 380, 230 ) ; break ; case 'Checkbox' : oCommand = new FCKDialogCommand( 'Checkbox' , FCKLang.Checkbox , 'dialog/fck_checkbox.html' , 380, 230 ) ; break ; Index: lams_central/web/fckeditor/editor/_source/internals/fckconfig.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckconfig.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckconfig.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckconfig.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -22,7 +22,7 @@ // Editor Base Path if ( document.location.protocol == 'file:' ) { - FCKConfig.BasePath = document.location.pathname.substr(1) ; + 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) ; } Index: lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckcontextmenu.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckcontextmenu.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -20,25 +20,55 @@ var FCKContextMenu = new Object() ; +FCKContextMenu._Panel = new FCKPanel( FCKBrowserInfo.IsIE ? window : window.parent ) ; +FCKContextMenu._Panel.PanelDiv.className = 'CM_ContextMenu' ; +FCKContextMenu._Panel.AppendStyleSheet( FCKConfig.SkinPath + 'fck_contextmenu.css' ) ; +FCKContextMenu._Panel.IsContextMenu = true ; + +FCKContextMenu._Document = FCKContextMenu._Panel.Document ; + // This property is internally used to indicate that the context menu has been created. FCKContextMenu._IsLoaded = false ; +FCKContextMenu.Show = function( x, y ) +{ + if ( !this._IsLoaded ) + this.Reload() ; + + this.RefreshState() ; + + // If not IE, x and y are relative to the editing area, so we must "fix" it. + if ( !FCKBrowserInfo.IsIE ) + { + var oCoordsA = FCKTools.GetElementPosition( FCK.EditorWindow.frameElement, this._Panel._Window ) ; + x += oCoordsA.X ; + y += oCoordsA.Y ; + } + + this._Panel.Show( x, y ) ; +} + +FCKContextMenu.Hide = function() +{ + this._Panel.Hide() ; +} + // This method creates the context menu inside a DIV tag. Take a look at the end of this file for a sample output. FCKContextMenu.Reload = function() { // Create the Main DIV that holds the Context Menu. - this._Div = this._Document.createElement( 'DIV' ) ; - this._Div.className = 'CM_ContextMenu' ; - this._Div.style.position = 'absolute' ; - this._Div.style.visibility = 'hidden' ; - this._Document.body.appendChild( this._Div ); +// this._Div = this._Document.createElement( 'DIV' ) ; +// this._Div.className = 'CM_ContextMenu' ; +// this._Div.style.position = 'absolute' ; +// this._Div.style.visibility = 'hidden' ; +// this._Document.body.appendChild( this._Div ); // Create the main table for the menu items. var oTable = this._Document.createElement( 'TABLE' ) ; oTable.cellSpacing = 0 ; oTable.cellPadding = 0 ; - oTable.border = 0 ; - this._Div.appendChild( oTable ) ; + this._Panel.PanelDiv.appendChild( oTable ) ; +// this._Div.appendChild( oTable ) ; // Load all configured groups. this.Groups = new Object() ; @@ -50,6 +80,8 @@ this.Groups[ sGroup ].CreateTableRows( oTable ) ; } + FCKTools.DisableSelection( this._Panel.Document.body ) ; + this._IsLoaded = true ; } @@ -93,13 +125,22 @@ oGroup.Add( new FCKContextMenuItem( this, 'TableMergeCells' , FCKLang.MergeCells, true ) ) ; oGroup.Add( new FCKContextMenuItem( this, 'TableSplitCell' , FCKLang.SplitCell, true ) ) ; oGroup.Add( new FCKContextMenuSeparator() ) ; + oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ; + oGroup.Add( new FCKContextMenuSeparator() ) ; oGroup.Add( new FCKContextMenuItem( this, 'TableCellProp' , FCKLang.CellProperties, true ) ) ; oGroup.Add( new FCKContextMenuItem( this, 'TableProp' , FCKLang.TableProperties, true ) ) ; break ; case 'Table' : - return new FCKContextMenuGroup( true, this, 'Table', FCKLang.TableProperties, true ) ; + oGroup = new FCKContextMenuGroup() ; + + oGroup.Add( new FCKContextMenuSeparator() ) ; + oGroup.Add( new FCKContextMenuItem( this, 'TableDelete' , FCKLang.TableDelete, false ) ) ; + oGroup.Add( new FCKContextMenuSeparator() ) ; + oGroup.Add( new FCKContextMenuItem( this, 'Table' , FCKLang.TableProperties, true ) ) ; + + break ; case 'Image' : return new FCKContextMenuGroup( true, this, 'Image', FCKLang.ImageProperties, true ) ; @@ -196,8 +237,8 @@

- - + + Index: lams_central/web/fckeditor/editor/_source/internals/fckdebug.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckdebug.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckdebug.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckdebug.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -21,19 +21,56 @@ if ( FCKConfig.Debug ) { - FCKDebug.Output = function( message, color ) + FCKDebug.Output = function( message, color, noParse ) { if ( ! FCKConfig.Debug ) return ; - if ( message != null && isNaN( message ) ) + if ( !noParse && message != null && isNaN( message ) ) message = message.replace(/
' ; + + for (var prop in anyObject) + { + var sVal = anyObject[ prop ] ? anyObject[ prop ] + '' : '[null]' ; + try + { + message += '' + prop + ' : ' + sVal.replace(/' ; + } + catch (e) + { + message += '' + prop + ' : [' + typeof( anyObject[ prop ] ) + ']
' ; + } + } + + message += '
' ; + } else + message = 'OutputObject : Object is "null".' ; + + FCKDebug.Output( message, color, true ) ; + } } else - FCKDebug.Output = function() {} +{ + FCKDebug.Output = function() {} + FCKDebug.OutputObject = function() {} +} \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckdialog_gecko.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckdialog_gecko.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -33,6 +33,13 @@ parentWindow = window ; var oWindow = parentWindow.open( '', 'FCKeditorDialog_' + dialogName, sOption, true ) ; + + if ( !oWindow ) + { + alert( FCKLang.DialogBlocked ) ; + return ; + } + oWindow.moveTo( iLeft, iTop ) ; oWindow.resizeTo( dialogWidth, dialogHeight ) ; oWindow.focus() ; Index: lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckdialog_ie.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckdialog_ie.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -22,5 +22,9 @@ if ( !parentWindow ) parentWindow = window ; + this.IsOpened = true ; + parentWindow.showModalDialog( pageUrl, dialogInfo, "dialogWidth:" + dialogWidth + "px;dialogHeight:" + dialogHeight + "px;help:no;scroll:no;status:no") ; + + this.IsOpened = false ; } Index: lams_central/web/fckeditor/editor/_source/internals/fckregexlib.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckregexlib.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckregexlib.js 12 Dec 2005 05:18:53 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckregexlib.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -23,7 +23,7 @@ FCKRegexLib.AposEntity = /'/gi ; // Used by the Styles combo to identify styles that can't be applied to text. -FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|INPUT|SELECT|TEXTAREA|HR|OBJECT)$/i ; +FCKRegexLib.ObjectElements = /^(?:IMG|TABLE|TR|TD|TH|INPUT|SELECT|TEXTAREA|HR|OBJECT|A|UL|OL|LI)$/i ; // START iCM MODIFICATIONS // Added TABLE and CAPTION to the block elements for ENTER key handling @@ -32,7 +32,7 @@ FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TABLE|CAPTION)$/i ; */ // END iCM MODIFICATIONS -FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD)$/i ; +FCKRegexLib.BlockElements = /^(?:P|DIV|H1|H2|H3|H4|H5|H6|ADDRESS|PRE|OL|UL|LI|TD|TH)$/i ; // Elements marked as empty "Empty" in the XHTML DTD. FCKRegexLib.EmptyElements = /^(?:BASE|META|LINK|HR|BR|PARAM|IMG|AREA|INPUT)$/i ; @@ -56,7 +56,7 @@ FCKRegexLib.TableBorderClass = /\s*FCK__ShowTableBorders\s*/ ; // Validate element names. -FCKRegexLib.ElementName = /^[A-Za-z_:][\w.-:]*$/ ; +FCKRegexLib.ElementName = /^[A-Za-z_:][\w.\-:]*$/ ; // Used in conjuction with the FCKConfig.ForceSimpleAmpersand configuration option. FCKRegexLib.ForceSimpleAmpersand = /___FCKAmp___/g ; @@ -90,3 +90,9 @@ FCKRegexLib.EmCloser = /<\/EM>/gi ; FCKRegexLib.GeckoEntitiesMarker = /#\?-\:/g ; + +FCKRegexLib.ProtectUrlsAApo = /(]+)/gi ; + +FCKRegexLib.ProtectUrlsImgApo = /(]+)/gi ; Index: lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckscriptloader.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckscriptloader.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -65,92 +65,55 @@ } } -if ( FCKBrowserInfo.IsSafari ) +FCKScriptLoader.LoadFile = function( filePath ) { - FCKScriptLoader.LoadFile = function( filePath ) + //window.status = ( 'Loading ' + filePath + '...' ) ; + + // Dynamically load the file (it can be a CSS or a JS) + var e ; + + // If it is a CSS + if ( filePath.lastIndexOf( '.css' ) > 0 ) { - if ( filePath.lastIndexOf( '.css' ) > 0 ) - { - this.CheckQueue() ; - return ; - } - - var oXmlRequest = new XMLHttpRequest() ; - - // Load the script synchronously. - oXmlRequest.open( "GET", filePath, false ) ; - oXmlRequest.send( null ) ; - - // Evaluate the script. - if ( oXmlRequest.status == 200 ) - { - try - { - eval( oXmlRequest.responseText ) ; - } - catch ( e ) - { - alert( 'Error parsing ' + filePath + ': ' + e.message ) ; - } - } - else - alert( 'Error loading ' + filePath ) ; - - this.CheckQueue() ; + e = document.createElement( 'LINK' ) ; + e.rel = 'stylesheet' ; + e.type = 'text/css' ; } -} -else -{ - FCKScriptLoader.LoadFile = function( filePath ) + // It it is a JS + else { - //window.status = ( 'Loading ' + filePath + '...' ) ; - - // Dynamically load the file (it can be a CSS or a JS) - var e ; - - // If is a CSS - if ( filePath.lastIndexOf( '.css' ) > 0 ) - { - e = document.createElement( 'LINK' ) ; - e.rel = 'stylesheet' ; - e.type = 'text/css' ; - } - // It is a JS - else - { - e = document.createElement( "script" ) ; - e.type = "text/javascript" ; - } - - // Add the new object to the HEAD. - document.getElementsByTagName("head")[0].appendChild( e ) ; - - // Start downloading it. - if ( e.tagName == 'LINK' ) - { - // IE must wait for the file to be downloaded. - if ( FCKBrowserInfo.IsIE ) - e.onload = FCKScriptLoader_OnLoad ; - // Gecko doens't fire any event when the CSS is loaded, so we - // can't wait for it. - else - FCKScriptLoader.CheckQueue() ; - - e.href = filePath ; - } - else - { - // Gecko fires the "onload" event and IE fires "onreadystatechange" - e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ; - e.src = filePath ; - } + e = document.createElement( "script" ) ; + e.type = "text/javascript" ; } + + // Add the new object to the HEAD. + document.getElementsByTagName("head")[0].appendChild( e ) ; - function FCKScriptLoader_OnLoad() + // Start downloading it. + if ( e.tagName == 'LINK' ) { - // Gecko doesn't have a "readyState" property - if ( this.tagName == 'LINK' || !this.readyState || this.readyState == 'loaded' ) - // Load the next script available in the queue + // IE must wait for the file to be downloaded. + if ( FCKBrowserInfo.IsIE ) + e.onload = FCKScriptLoader_OnLoad ; + // Gecko doens't fire any event when the CSS is loaded, so we + // can't wait for it. + else FCKScriptLoader.CheckQueue() ; + + e.href = filePath ; } + else + { + // Gecko fires the "onload" event and IE fires "onreadystatechange" + e.onload = e.onreadystatechange = FCKScriptLoader_OnLoad ; + e.src = filePath ; + } +} + +function FCKScriptLoader_OnLoad() +{ + // Gecko doesn't have a "readyState" property + if ( this.tagName == 'LINK' || !this.readyState || this.readyState == 'loaded' ) + // Load the next script available in the queue + FCKScriptLoader.CheckQueue() ; } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckselection_gecko.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js 12 Dec 2005 05:18:53 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckselection_gecko.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -26,7 +26,10 @@ this._Type = 'Text' ; // Check if the actual selection is a Control (IMG, TABLE, HR, etc...). - var oSel = FCK.EditorWindow.getSelection() ; + var oSel ; + try { oSel = FCK.EditorWindow.getSelection() ; } + catch (e) {} + if ( oSel && oSel.rangeCount == 1 ) { var oRange = oSel.getRangeAt(0) ; @@ -51,7 +54,7 @@ FCKSelection.GetParentElement = function() { if ( this.GetType() == 'Control' ) - return FCKSelection.GetSelectedElement().parentElement ; + return FCKSelection.GetSelectedElement().parentNode ; else { var oSel = FCK.EditorWindow.getSelection() ; @@ -139,6 +142,7 @@ return oSel ; } + // START iCM MODIFICATIONS /* // Move the cursor position (the selection point) to a specific offset within a specific node Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktablehandler.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -62,10 +62,16 @@ // If no table has been passed as a parameer, // then get the table where the selection is placed in. if ( !table ) - table = FCKSelection.MoveToAncestorNode("TABLE") ; + { + var table = FCKSelection.GetSelectedElement() ; + if ( !table || table.tagName != 'TABLE' ) + table = FCKSelection.MoveToAncestorNode("TABLE") ; + } if ( !table ) return ; // Delete the table. + FCKSelection.SelectNode( table ) ; + FCKSelection.Collapse(); table.parentNode.removeChild( table ) ; } @@ -113,7 +119,8 @@ FCKTableHandler.DeleteColumns = function() { // Get the cell where the selection is placed in. - var oCell = FCKSelection.MoveToAncestorNode("TD") ; + var oCell = FCKSelection.MoveToAncestorNode('TD') || FCKSelection.MoveToAncestorNode('TH') ; + if ( !oCell ) return ; // Get the cell's table. @@ -156,7 +163,7 @@ // oNewCell.innerHTML = " " ; // If it is the last cell in the row. - if ( oCell.cellIndex == oCell.parentNode.cells.lenght - 1 ) + if ( oCell.cellIndex == oCell.parentNode.cells.length - 1 ) { // Add the new cell at the end of the row. oCell.parentNode.appendChild( oNewCell ) ; @@ -354,4 +361,4 @@ else aCells[i].innerHTML = '' ; } -} \ No newline at end of file +} Index: lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktablehandler_ie.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fcktablehandler_ie.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -22,7 +22,8 @@ var aCells = new Array() ; var oRange = FCK.EditorDocument.selection.createRange() ; - var oParent = oRange.parentElement() ; +// var oParent = oRange.parentElement() ; + var oParent = FCKSelection.GetParentElement() ; if ( oParent && oParent.tagName == "TD" ) aCells[0] = oParent ; Index: lams_central/web/fckeditor/editor/_source/internals/fcktools.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fcktools.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fcktools.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -98,7 +98,7 @@ return oOption ; } - +/* FCKTools.RemoveAllSelectOptions = function( selectElement ) { for ( var i = selectElement.options.length - 1 ; i >= 0 ; i-- ) @@ -122,7 +122,7 @@ if ( defaultValue != null ) FCKTools.SelectNoCase( selectElement, defaultValue ) ; } - +*/ FCKTools.HTMLEncode = function( text ) { if ( !text ) @@ -136,7 +136,7 @@ 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. @@ -153,21 +153,33 @@ else return new Array() ; } } - -FCKTools.GetElementPosition = function( el ) +*/ +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 ; - - el = el.offsetParent ; + + if ( el.offsetParent == null ) + { + var oOwnerWindow = FCKTools.GetElementWindow( el ) ; + + if ( oOwnerWindow != oWindow ) + el = oOwnerWindow.frameElement ; + else + break ; + } + else + el = el.offsetParent ; } - + // Return the Coordinates object return c ; } @@ -213,6 +225,36 @@ { return size.endsWith( '%' ) ? size : ( size + 'px' ) ; } + +// Get the window object where the element is placed in. +FCKTools.GetElementWindow = function( element ) +{ + var oDocument = element.ownerDocument || element.document ; + + // With Safari, there is not way to retrieve the window from the document, so we must fix it. + if ( FCKBrowserInfo.IsSafari && !oDocument.parentWindow ) + FCKTools._FixDocumentParentWindow( window.top ) ; + + return oDocument.parentWindow || oDocument.defaultView ; +} + +/* + This is a Safari specific function that fix the reference to the parent + window from the document object. +*/ +FCKTools._FixDocumentParentWindow = function( targetWindow ) +{ + targetWindow.document.parentWindow = targetWindow ; + + for ( var i = 0 ; i < targetWindow.frames.length ; i++ ) + FCKTools._FixDocumentParentWindow( targetWindow.frames[i] ) ; +} + +FCKTools.CancelEvent = function( e ) +{ + return false ; +} + // START iCM MODIFICATIONS /* // Transfers the supplied attributes to the supplied node Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools_gecko.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fcktools_gecko.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -90,6 +90,13 @@ } return null ; } + +FCKTools.DisableSelection = function( element ) +{ + element.style.MozUserSelect = 'none' ; // Gecko only. + // element.style.userSelect = 'none' ; // CSS3 (not supported yet). +} + // START iCM Modifications /* // Starting at the specified node, find the first inline node of the sequence Index: lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fcktools_ie.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fcktools_ie.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -74,4 +74,25 @@ alert( FCKLang.NoActiveX ) ; FCKLang.NoActiveX = null ; } +} + +FCKTools.DisableSelection = function( element ) +{ + element.unselectable = 'on' ; + + var e, i = 0 ; + while ( e = element.all[ i++ ] ) + { + switch ( e.tagName ) + { + case 'IFRAME' : + case 'TEXTAREA' : + case 'INPUT' : + case 'SELECT' : + /* Ignore the above tags */ + break ; + default : + e.unselectable = 'on' ; + } + } } \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckxhtml.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js 12 Dec 2005 05:18:53 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckxhtml.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -91,16 +91,14 @@ { var iCount = 0 ; - if ( htmlNode.hasChildNodes() ) + var oNode = htmlNode.firstChild ; + + while ( oNode ) { - // Get all children nodes. - var oChildren = htmlNode.childNodes ; + if ( this._AppendNode( xmlNode, oNode ) ) + iCount++ ; - for ( var i = 0 ; i < oChildren.length ; i++ ) - { - if ( this._AppendNode( xmlNode, oChildren[i] ) ) - iCount++ ; - } + oNode = oNode.nextSibling ; } if ( iCount == 0 ) @@ -120,6 +118,9 @@ FCKXHtml._AppendNode = function( xmlNode, htmlNode ) { + if ( !htmlNode ) + return ; + switch ( htmlNode.nodeType ) { // Element Node. @@ -134,10 +135,16 @@ if ( htmlNode.getAttribute('_fckdelete') ) return false ; - // Create the Element. + // Get the element name. var sNodeName = htmlNode.nodeName ; + + //Add namespace: + if ( FCKBrowserInfo.IsIE && htmlNode.scopeName && htmlNode.scopeName != 'HTML' ) + sNodeName = htmlNode.scopeName + ':' + sNodeName ; // Check if the node name is valid, otherwise ignore this tag. + // If the nodeName starts with a slash, it is a orphan closing tag. + // On some strange cases, the nodeName is empty, even if the node exists. if ( !FCKRegexLib.ElementName.test( sNodeName ) ) return false ; @@ -150,18 +157,13 @@ // So here, the "mark" is checked... if the element is Ok, then mark it. if ( htmlNode._fckxhtmljob && htmlNode._fckxhtmljob == FCKXHtml.CurrentJobNum ) return false ; - else - htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ; - // If the nodeName starts with a slash, it is a orphan closing tag. - // On some strange cases, the nodeName is empty, even if the node exists. -// if ( sNodeName.length == 0 || sNodeName.substr(0,1) == '/' ) -// break ; - var oNode = this._CreateNode( sNodeName ) ; // Add all attributes. FCKXHtml._AppendAttributes( xmlNode, htmlNode, oNode, sNodeName ) ; + + htmlNode._fckxhtmljob = FCKXHtml.CurrentJobNum ; // Tag specific processing. var oTagProcessor = FCKXHtml.TagProcessors[ sNodeName ] ; @@ -265,15 +267,30 @@ // An object that hold tag specific operations. FCKXHtml.TagProcessors = new Object() ; -FCKXHtml.TagProcessors['img'] = function( node ) +FCKXHtml.TagProcessors['img'] = function( node, htmlNode ) { // The "ALT" attribute is required in XHTML. if ( ! node.attributes.getNamedItem( 'alt' ) ) FCKXHtml._AppendAttribute( node, 'alt', '' ) ; + var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ; + if ( sSavedUrl && sSavedUrl.length > 0 ) + FCKXHtml._AppendAttribute( node, 'src', sSavedUrl ) ; + return node ; } +FCKXHtml.TagProcessors['a'] = function( node, htmlNode ) +{ + var sSavedUrl = htmlNode.getAttribute( '_fcksavedurl' ) ; + if ( sSavedUrl && sSavedUrl.length > 0 ) + FCKXHtml._AppendAttribute( node, 'href', sSavedUrl ) ; + + FCKXHtml._AppendChildNodes( node, htmlNode, false ) ; + + return node ; +} + FCKXHtml.TagProcessors['script'] = function( node, htmlNode ) { // The "TYPE" attribute is required in XHTML. Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtml_gecko.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckxhtml_gecko.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckxhtml_gecko.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckxhtml_gecko.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -49,8 +49,8 @@ var sAttName = oAttribute.nodeName.toLowerCase() ; var sAttValue ; - // The "_fckxhtmljob" attribute is used to mark the already processed elements. - if ( sAttName == '_fckxhtmljob' ) + // Ignore any attribute starting with "_fck". + if ( sAttName.startsWith( '_fck' ) ) continue ; // There is a bug in Mozilla that returns '_moz_xxx' attributes as specified. else if ( sAttName.indexOf( '_moz' ) == 0 ) Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtml_ie.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckxhtml_ie.js,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/_source/internals/fckxhtml_ie.js 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/_source/internals/fckxhtml_ie.js 5 Jan 2006 00:02:25 -0000 1.4 @@ -41,8 +41,8 @@ var sAttName = oAttribute.nodeName.toLowerCase() ; var sAttValue ; - // The "_fckxhtmljob" attribute is used to mark the already processed elements. - if ( sAttName == '_fckxhtmljob' ) + // Ignore any attribute starting with "_fck". + if ( sAttName.startsWith( '_fck' ) ) continue ; // The following must be done because of a bug on IE regarding the style // attribute. It returns "null" for the nodeValue. @@ -123,9 +123,13 @@ return node ; } -// There is a BUG in IE regarding the ABBR tag. +// There is a BUG in IE regarding the ABBR tag (it has no support for it). FCKXHtml.TagProcessors['abbr'] = function( node, htmlNode ) { + // TODO: The XHTML processor duplicates the ABBR contents because of this + // code. We should find some way to move to the node after the /ABBR in the + // _AppendChildNodes loop. + var oNextNode = htmlNode.nextSibling ; while ( true ) @@ -174,7 +178,7 @@ FCKXHtml.TagProcessors['form'] = function( node, htmlNode ) { - if ( htmlNode.acceptCharset.length > 0 && htmlNode.acceptCharset != 'UNKNOWN' ) + if ( htmlNode.acceptCharset && htmlNode.acceptCharset.length > 0 && htmlNode.acceptCharset != 'UNKNOWN' ) FCKXHtml._AppendAttribute( node, 'accept-charset', htmlNode.acceptCharset ) ; if ( htmlNode.name ) @@ -194,4 +198,15 @@ FCKXHtml._AppendChildNodes( node, htmlNode ) ; return node ; -} \ No newline at end of file +} + +// On very rare cases, IE is loosing the "align" attribute for DIV. (right align and apply bulleted list) +FCKXHtml.TagProcessors['div'] = function( node, htmlNode ) +{ + if ( htmlNode.align.length > 0 ) + FCKXHtml._AppendAttribute( node, 'align', htmlNode.align ) ; + + FCKXHtml._AppendChildNodes( node, htmlNode ) ; + + return node ; +} \ No newline at end of file Index: lams_central/web/fckeditor/editor/_source/internals/fckxhtmlentities.js =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/_source/internals/Attic/fckxhtmlentities.js,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/_source/internals/fckxhtmlentities.js 12 Dec 2005 05:18:54 -0000 1.2 +++ lams_central/web/fckeditor/editor/_source/internals/fckxhtmlentities.js 5 Jan 2006 00:02:25 -0000 1.3 @@ -311,8 +311,8 @@ } // Create and Compile the Regex used to separate the entities from the text. - FCKXHtmlEntities.EntitiesRegex = new RegExp('','') ; - FCKXHtmlEntities.EntitiesRegex.compile( '[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+', 'g' ) ; + FCKXHtmlEntities.EntitiesRegex = new RegExp('[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+','g') ; +// FCKXHtmlEntities.EntitiesRegex.compile( '[' + FCKXHtmlEntities.Chars + ']|[^' + FCKXHtmlEntities.Chars + ']+', 'g' ) ; } else { Index: lams_central/web/fckeditor/editor/css/fck_internal.css =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/css/Attic/fck_internal.css,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/css/fck_internal.css 12 Dec 2005 05:18:56 -0000 1.3 +++ lams_central/web/fckeditor/editor/css/fck_internal.css 5 Jan 2006 00:02:25 -0000 1.4 @@ -17,15 +17,15 @@ * Frederico Caldeira Knabben (fredck@fckeditor.net) */ -TABLE.FCK__ShowTableBorders, TABLE.FCK__ShowTableBorders TD +TABLE.FCK__ShowTableBorders, TABLE.FCK__ShowTableBorders TD, TABLE.FCK__ShowTableBorders TH { - border: #d3d3d3 1px solid ; + border: #d3d3d3 1px solid; } FORM { border: 1px dotted #FF0000; - padding: 2px ; + padding: 2px; } .FCK__Flash @@ -34,17 +34,17 @@ background-position: center center; background-image: url(images/fck_flashlogo.gif); background-repeat: no-repeat; - width: 80px ; - height: 80px ; + width: 80px; + height: 80px; } .FCK__Anchor { background-position: center center; background-image: url(images/fck_anchor.gif); background-repeat: no-repeat; - width: 16px ; - height: 15px ; + width: 16px; + height: 15px; } .FCK__PageBreak @@ -58,7 +58,23 @@ width: 100%; border-top: #999999 1px dotted; border-bottom: #999999 1px dotted; - border-right:0px; - border-left:0px; + border-right: 0px; + border-left: 0px; height: 5px; -} \ No newline at end of file +} + +input[type="hidden"] +{ + display: inline; + width:20px; + height:20px; + border:1px dotted #FF0000 ; + background-image: url(behaviors/hiddenfield.gif); + background-repeat: no-repeat; +} + +input[type="hidden"]:after +{ + padding-left: 20px; + content: "" ; +} Index: lams_central/web/fckeditor/editor/css/fck_showtableborders_gecko.css =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/css/Attic/fck_showtableborders_gecko.css,v diff -u -r1.2 -r1.3 --- lams_central/web/fckeditor/editor/css/fck_showtableborders_gecko.css 12 Dec 2005 05:18:56 -0000 1.2 +++ lams_central/web/fckeditor/editor/css/fck_showtableborders_gecko.css 5 Jan 2006 00:02:25 -0000 1.3 @@ -16,8 +16,16 @@ * File Authors: * Frederico Caldeira Knabben (fredck@fckeditor.net) */ - -TABLE[border="0"], TABLE[border="0"] TD +TABLE[border="0"], +TABLE[border="0"] > TR > TD, TABLE[border="0"] > TR > TH, +TABLE[border="0"] > TBODY > TR > TD, TABLE[border="0"] > TBODY > TR > TH, +TABLE[border="0"] > THEAD > TR > TD, TABLE[border="0"] > THEAD > TR > TH, +TABLE[border="0"] > TFOOT > TR > TD, TABLE[border="0"] > TFOOT > TR > TH, +TABLE:not([border]), +TABLE:not([border]) > TR > TD, TABLE:not([border]) > TR > TH, +TABLE:not([border]) > TBODY > TR > TD, TABLE:not([border]) > TBODY > TR > TH, +TABLE:not([border]) > THEAD > TR > TD, TABLE:not([border]) > THEAD > TR > TH, +TABLE:not([border]) > TFOOT > TR > TD, TABLE:not([border]) > TFOOT > TR > TH { - border: #d3d3d3 1px solid + border: #d3d3d3 1px dotted ; } Index: lams_central/web/fckeditor/editor/dialog/fck_about.html =================================================================== RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_about.html,v diff -u -r1.3 -r1.4 --- lams_central/web/fckeditor/editor/dialog/fck_about.html 12 Dec 2005 05:18:54 -0000 1.3 +++ lams_central/web/fckeditor/editor/dialog/fck_about.html 5 Jan 2006 00:02:24 -0000 1.4 @@ -72,7 +72,7 @@ + 2.2
CutCut
version
- 2.1.1
- +