-
+
-
+
-
+ 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 @@
-
+
-
+
-
+ 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.
-----------------------------------------
-
- Cut
+
+ Cut
-----------------------------------------
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 = '' ;
+ 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 += '' + this.Label + ' ' ;
+ sHtml += '' + this.Label + ' ' ;
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]] + '' + 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 + '' + sTag + '>
', 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 =
- '' +
+ '' +
'' ;
if ( this.Style != FCK_TOOLBARITEM_ONLYTEXT )
- sHtml += ' ' ;
-
+ sHtml += ' ' ;
+
if ( this.Style != FCK_TOOLBARITEM_ONLYICON )
- sHtml += '' + this.Label + ' ' ;
+ sHtml += '' + this.Label + ' ' ;
sHtml +=
- ' ' +
+ ' ' +
' ' +
'
' ;
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/dialog/fck_image.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_image.html,v
diff -u -r1.3 -r1.4
--- lams_central/web/fckeditor/editor/dialog/fck_image.html 12 Dec 2005 05:18:54 -0000 1.3
+++ lams_central/web/fckeditor/editor/dialog/fck_image.html 5 Jan 2006 00:02:24 -0000 1.4
@@ -122,24 +122,7 @@
-
-
Magnus
- es, domine, et laudabilis valde: magna virtus tua, et sapientiae tuae non est
- numerus. et laudare te vult homo, aliqua portio creaturae tuae, et homo
- circumferens mortalitem suam, circumferens testimonium peccati sui et
- testimonium, quia superbis resistis: et tamen laudare te vult homo, aliqua
- portio creaturae tuae.tu excitas, ut laudare te delectet, quia fecisti nos ad
- te et inquietum est cor nostrum, donec requiescat in te. da mihi, domine, scire
- et intellegere, utrum sit prius invocare te an laudare te, et scire te prius
- sit an invocare te. sed quis te invocat nesciens te? aliud enim pro alio potest
- invocare nesciens. an potius invocaris, ut sciaris? quomodo autem invocabunt,
- in quem non crediderunt? aut quomodo credent sine praedicante? et laudabunt
- dominum qui requirunt eum. quaerentes enim inveniunt eum et invenientes
- laudabunt eum. quaeram te, domine, invocans te, et invocem te credens in te:
- praedicatus enim es nobis. invocat te, domine, fides mea, quam dedisti mihi,
- quam inspirasti mihi per humanitatem filii tui, per ministerium praedicatoris
- tui.
-
+
Index: lams_central/web/fckeditor/editor/dialog/fck_paste.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_paste.html,v
diff -u -r1.3 -r1.4
--- lams_central/web/fckeditor/editor/dialog/fck_paste.html 12 Dec 2005 05:18:54 -0000 1.3
+++ lams_central/web/fckeditor/editor/dialog/fck_paste.html 5 Jan 2006 00:02:24 -0000 1.4
@@ -31,8 +31,6 @@
// First of all, translate the dialog box texts
oEditor.FCKLanguageManager.TranslatePage(document) ;
- window.parent.SetOkButton( true ) ;
-
if ( window.parent.dialogArguments.CustomValue == 'Word' )
{
var oFrame = document.getElementById('frmData')
@@ -48,6 +46,9 @@
document.getElementById('txtData').style.display = '' ;
document.getElementById('oWordCommands').style.display = 'none' ;
}
+
+ window.parent.SetOkButton( true ) ;
+ window.parent.SetAutoSize( true ) ;
}
function Ok()
Index: lams_central/web/fckeditor/editor/dialog/fck_radiobutton.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_radiobutton.html,v
diff -u -r1.3 -r1.4
--- lams_central/web/fckeditor/editor/dialog/fck_radiobutton.html 12 Dec 2005 05:18:54 -0000 1.3
+++ lams_central/web/fckeditor/editor/dialog/fck_radiobutton.html 5 Jan 2006 00:02:24 -0000 1.4
@@ -40,7 +40,7 @@
if ( oActiveEl && oActiveEl.tagName.toUpperCase() == 'INPUT' && oActiveEl.type == 'radio' )
{
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_smiley.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_smiley.html,v
diff -u -r1.2 -r1.3
--- lams_central/web/fckeditor/editor/dialog/fck_smiley.html 12 Dec 2005 05:18:54 -0000 1.2
+++ lams_central/web/fckeditor/editor/dialog/fck_smiley.html 5 Jan 2006 00:02:24 -0000 1.3
@@ -39,6 +39,7 @@
{
var oImg = oEditor.FCK.CreateElement( 'IMG' ) ;
oImg.src = url ;
+ oImg.setAttribute( '_fcksavedurl', url ) ;
window.parent.Cancel() ;
}
Index: lams_central/web/fckeditor/editor/dialog/fck_source.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_source.html,v
diff -u -r1.2 -r1.3
--- lams_central/web/fckeditor/editor/dialog/fck_source.html 12 Dec 2005 05:18:54 -0000 1.2
+++ lams_central/web/fckeditor/editor/dialog/fck_source.html 5 Jan 2006 00:02:24 -0000 1.3
@@ -31,7 +31,9 @@
window.onload = function()
{
- document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
+ // EnableXHTML and EnableSourceXHTML has been deprecated
+// document.getElementById('txtSource').value = ( FCKConfig.EnableXHTML && FCKConfig.EnableSourceXHTML ? FCK.GetXHTML( FCKConfig.FormatSource ) : FCK.GetHTML( FCKConfig.FormatSource ) ) ;
+ document.getElementById('txtSource').value = FCK.GetXHTML( FCKConfig.FormatSource ) ;
// Activate the "OK" button.
window.parent.SetOkButton( true ) ;
Index: lams_central/web/fckeditor/editor/dialog/fck_specialchar.html
===================================================================
RCS file: /usr/local/cvsroot/lams_central/web/fckeditor/editor/dialog/Attic/fck_specialchar.html,v
diff -u -r1.3 -r1.4
--- lams_central/web/fckeditor/editor/dialog/fck_specialchar.html 12 Dec 2005 05:18:54 -0000 1.3
+++ lams_central/web/fckeditor/editor/dialog/fck_specialchar.html 5 Jan 2006 00:02:24 -0000 1.4
@@ -22,8 +22,11 @@
+
+
+