[freeside-commits] freeside/httemplate/elements/fckeditor/editor/plugins/autogrow fckplugin.js, 1.1, 1.2
Mark Wells
mark at wavetail.420.am
Tue Mar 16 00:49:36 PDT 2010
- Previous message: [freeside-commits] freeside/httemplate/elements/fckeditor/editor/js fckadobeair.js, NONE, 1.1 fckeditorcode_gecko.js, 1.1, 1.2 fckeditorcode_ie.js, 1.1, 1.2
- Next message: [freeside-commits] freeside/httemplate/elements/fckeditor/editor/lang _translationstatus.txt, 1.1, 1.2 af.js, 1.1, 1.2 ar.js, 1.1, 1.2 bg.js, 1.1, 1.2 bn.js, 1.1, 1.2 bs.js, 1.1, 1.2 ca.js, 1.1, 1.2 cs.js, 1.1, 1.2 da.js, 1.1, 1.2 de.js, 1.1, 1.2 el.js, 1.1, 1.2 en-au.js, 1.1, 1.2 en-ca.js, 1.1, 1.2 en-uk.js, 1.1, 1.2 en.js, 1.1, 1.2 eo.js, 1.1, 1.2 es.js, 1.1, 1.2 et.js, 1.1, 1.2 eu.js, 1.1, 1.2 fa.js, 1.1, 1.2 fi.js, 1.1, 1.2 fo.js, 1.1, 1.2 fr-ca.js, NONE, 1.1 fr.js, 1.1, 1.2 gl.js, 1.1, 1.2 gu.js, NONE, 1.1 he.js, 1.1, 1.2 hi.js, 1.1, 1.2 hr.js, 1.1, 1.2 hu.js, 1.1, 1.2 is.js, NONE, 1.1 it.js, 1.1, 1.2 ja.js, 1.1, 1.2 km.js, 1.1, 1.2 ko.js, 1.1, 1.2 lt.js, 1.1, 1.2 lv.js, 1.1, 1.2 mn.js, 1.1, 1.2 ms.js, 1.1, 1.2 nb.js, 1.1, 1.2 nl.js, 1.1, 1.2 no.js, 1.1, 1.2 pl.js, 1.1, 1.2 pt-br.js, 1.1, 1.2 pt.js, 1.1, 1.2 ro.js, 1.1, 1.2 ru.js, 1.1, 1.2 sk.js, 1.1, 1.2 sl.js, 1.1, 1.2 sr-latn.js, 1.1, 1.2 sr.js, 1.1, 1.2 sv.js, 1.1, 1.2 th.js, 1.1, 1.2 tr.js, 1.1, 1.2 uk.js, 1.1, 1.2 vi.js, 1.1, 1.2 zh-cn.js, 1.1, 1.2 zh.js, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/plugins/autogrow
In directory wavetail.420.am:/tmp/cvs-serv19732/fckeditor/editor/plugins/autogrow
Modified Files:
fckplugin.js
Log Message:
FCKeditor 2.6.6
Index: fckplugin.js
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/plugins/autogrow/fckplugin.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -d -r1.1 -r1.2
--- fckplugin.js 1 Aug 2007 22:26:34 -0000 1.1
+++ fckplugin.js 16 Mar 2010 07:49:33 -0000 1.2
@@ -1,6 +1,6 @@
/*
* FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
*
* == BEGIN LICENSE ==
*
@@ -22,71 +22,90 @@
* height (FCKConfig.AutoGrowMax), based on its contents.
*/
-var FCKAutoGrow_Min = window.frameElement.offsetHeight ;
+var FCKAutoGrow = {
+ MIN_HEIGHT : window.frameElement.offsetHeight,
-function FCKAutoGrow_Check()
+ Check : function()
{
- var oInnerDoc = FCK.EditorDocument ;
+ var delta = FCKAutoGrow.GetHeightDelta() ;
+ if ( delta != 0 )
+ {
+ var newHeight = window.frameElement.offsetHeight + delta ;
- var iFrameHeight, iInnerHeight ;
+ newHeight = FCKAutoGrow.GetEffectiveHeight( newHeight ) ;
- if ( FCKBrowserInfo.IsIE )
+ if ( newHeight != window.frameElement.height )
{
- iFrameHeight = FCK.EditorWindow.frameElement.offsetHeight ;
- iInnerHeight = oInnerDoc.body.scrollHeight ;
+ window.frameElement.style.height = newHeight + "px" ;
+
+ // Gecko browsers use an onresize handler to update the innermost
+ // IFRAME's height. If the document is modified before the onresize
+ // is triggered, the plugin will miscalculate the new height. Thus,
+ // forcibly trigger onresize. #1336
+ if ( typeof window.onresize == 'function' )
+ {
+ window.onresize() ;
+ }
}
+ }
+ },
+
+ CheckEditorStatus : function( sender, status )
+ {
+ if ( status == FCK_STATUS_COMPLETE )
+ FCKAutoGrow.Check() ;
+ },
+
+ GetEffectiveHeight : function( height )
+ {
+ if ( height < FCKAutoGrow.MIN_HEIGHT )
+ height = FCKAutoGrow.MIN_HEIGHT;
else
{
- iFrameHeight = FCK.EditorWindow.innerHeight ;
- iInnerHeight = oInnerDoc.body.offsetHeight ;
+ var max = FCKConfig.AutoGrowMax;
+ if ( max && max > 0 && height > max )
+ height = max;
}
- var iDiff = iInnerHeight - iFrameHeight ;
+ return height;
+ },
- if ( iDiff != 0 )
+ GetHeightDelta : function()
{
- var iMainFrameSize = window.frameElement.offsetHeight ;
+ var oInnerDoc = FCK.EditorDocument ;
- if ( iDiff > 0 && iMainFrameSize < FCKConfig.AutoGrowMax )
- {
- iMainFrameSize += iDiff ;
- if ( iMainFrameSize > FCKConfig.AutoGrowMax )
- iMainFrameSize = FCKConfig.AutoGrowMax ;
- }
- else if ( iDiff < 0 && iMainFrameSize > FCKAutoGrow_Min )
+ var iFrameHeight ;
+ var iInnerHeight ;
+
+ if ( FCKBrowserInfo.IsIE )
{
- iMainFrameSize += iDiff ;
- if ( iMainFrameSize < FCKAutoGrow_Min )
- iMainFrameSize = FCKAutoGrow_Min ;
+ iFrameHeight = FCK.EditorWindow.frameElement.offsetHeight ;
+ iInnerHeight = oInnerDoc.body.scrollHeight ;
}
else
- return ;
-
- window.frameElement.height = iMainFrameSize ;
- }
+ {
+ iFrameHeight = FCK.EditorWindow.innerHeight ;
+ iInnerHeight = oInnerDoc.body.offsetHeight +
+ ( parseInt( FCKDomTools.GetCurrentElementStyle( oInnerDoc.body, 'margin-top' ), 10 ) || 0 ) +
+ ( parseInt( FCKDomTools.GetCurrentElementStyle( oInnerDoc.body, 'margin-bottom' ), 10 ) || 0 ) ;
}
-FCK.AttachToOnSelectionChange( FCKAutoGrow_Check ) ;
+ return iInnerHeight - iFrameHeight ;
+ },
-function FCKAutoGrow_SetListeners()
+ SetListeners : function()
{
if ( FCK.EditMode != FCK_EDITMODE_WYSIWYG )
return ;
- FCK.EditorWindow.attachEvent( 'onscroll', FCKAutoGrow_Check ) ;
- FCK.EditorDocument.attachEvent( 'onkeyup', FCKAutoGrow_Check ) ;
+ FCK.EditorWindow.attachEvent( 'onscroll', FCKAutoGrow.Check ) ;
+ FCK.EditorDocument.attachEvent( 'onkeyup', FCKAutoGrow.Check ) ;
}
+};
-if ( FCKBrowserInfo.IsIE )
-{
-// FCKAutoGrow_SetListeners() ;
- FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAutoGrow_SetListeners ) ;
-}
+FCK.AttachToOnSelectionChange( FCKAutoGrow.Check ) ;
-function FCKAutoGrow_CheckEditorStatus( sender, status )
-{
- if ( status == FCK_STATUS_COMPLETE )
- FCKAutoGrow_Check() ;
-}
+if ( FCKBrowserInfo.IsIE )
+ FCK.Events.AttachEvent( 'OnAfterSetHTML', FCKAutoGrow.SetListeners ) ;
-FCK.Events.AttachEvent( 'OnStatusChange', FCKAutoGrow_CheckEditorStatus ) ;
\ No newline at end of file
+FCK.Events.AttachEvent( 'OnStatusChange', FCKAutoGrow.CheckEditorStatus ) ;
- Previous message: [freeside-commits] freeside/httemplate/elements/fckeditor/editor/js fckadobeair.js, NONE, 1.1 fckeditorcode_gecko.js, 1.1, 1.2 fckeditorcode_ie.js, 1.1, 1.2
- Next message: [freeside-commits] freeside/httemplate/elements/fckeditor/editor/lang _translationstatus.txt, 1.1, 1.2 af.js, 1.1, 1.2 ar.js, 1.1, 1.2 bg.js, 1.1, 1.2 bn.js, 1.1, 1.2 bs.js, 1.1, 1.2 ca.js, 1.1, 1.2 cs.js, 1.1, 1.2 da.js, 1.1, 1.2 de.js, 1.1, 1.2 el.js, 1.1, 1.2 en-au.js, 1.1, 1.2 en-ca.js, 1.1, 1.2 en-uk.js, 1.1, 1.2 en.js, 1.1, 1.2 eo.js, 1.1, 1.2 es.js, 1.1, 1.2 et.js, 1.1, 1.2 eu.js, 1.1, 1.2 fa.js, 1.1, 1.2 fi.js, 1.1, 1.2 fo.js, 1.1, 1.2 fr-ca.js, NONE, 1.1 fr.js, 1.1, 1.2 gl.js, 1.1, 1.2 gu.js, NONE, 1.1 he.js, 1.1, 1.2 hi.js, 1.1, 1.2 hr.js, 1.1, 1.2 hu.js, 1.1, 1.2 is.js, NONE, 1.1 it.js, 1.1, 1.2 ja.js, 1.1, 1.2 km.js, 1.1, 1.2 ko.js, 1.1, 1.2 lt.js, 1.1, 1.2 lv.js, 1.1, 1.2 mn.js, 1.1, 1.2 ms.js, 1.1, 1.2 nb.js, 1.1, 1.2 nl.js, 1.1, 1.2 no.js, 1.1, 1.2 pl.js, 1.1, 1.2 pt-br.js, 1.1, 1.2 pt.js, 1.1, 1.2 ro.js, 1.1, 1.2 ru.js, 1.1, 1.2 sk.js, 1.1, 1.2 sl.js, 1.1, 1.2 sr-latn.js, 1.1, 1.2 sr.js, 1.1, 1.2 sv.js, 1.1, 1.2 th.js, 1.1, 1.2 tr.js, 1.1, 1.2 uk.js, 1.1, 1.2 vi.js, 1.1, 1.2 zh-cn.js, 1.1, 1.2 zh.js, 1.1, 1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list