[freeside-commits] freeside/httemplate/elements/fckeditor/editor/dialog/fck_image fck_image.js, 1.1, 1.1.6.1 fck_image_preview.html, 1.1, 1.1.6.1

Mark Wells mark at wavetail.420.am
Tue Mar 16 01:34:53 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_image
In directory wavetail.420.am:/tmp/cvs-serv23603/editor/dialog/fck_image

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	fck_image.js fck_image_preview.html 
Log Message:
FCKeditor 2.6.6

Index: fck_image.js
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_image/fck_image.js,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_image.js	1 Aug 2007 22:25:17 -0000	1.1
+++ fck_image.js	16 Mar 2010 08:34:51 -0000	1.1.6.1
@@ -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 ==
  *
@@ -21,27 +21,29 @@
  * Scripts related to the Image dialog window (see fck_image.html).
  */
 
-var oEditor		= window.parent.InnerDialogLoaded() ;
+var dialog		= window.parent ;
+var oEditor		= dialog.InnerDialogLoaded() ;
 var FCK			= oEditor.FCK ;
 var FCKLang		= oEditor.FCKLang ;
 var FCKConfig	= oEditor.FCKConfig ;
 var FCKDebug	= oEditor.FCKDebug ;
+var FCKTools	= oEditor.FCKTools ;
 
 var bImageButton = ( document.location.search.length > 0 && document.location.search.substr(1) == 'ImageButton' ) ;
 
 //#### Dialog Tabs
 
 // Set the dialog tabs.
-window.parent.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ;
+dialog.AddTab( 'Info', FCKLang.DlgImgInfoTab ) ;
 
 if ( !bImageButton && !FCKConfig.ImageDlgHideLink )
-	window.parent.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ;
+	dialog.AddTab( 'Link', FCKLang.DlgImgLinkTab ) ;
 
 if ( FCKConfig.ImageUpload )
-	window.parent.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
+	dialog.AddTab( 'Upload', FCKLang.DlgLnkUpload ) ;
 
 if ( !FCKConfig.ImageDlgHideAdvanced )
-	window.parent.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
+	dialog.AddTab( 'Advanced', FCKLang.DlgAdvancedTag ) ;
 
 // Function called when a dialog tag is selected.
 function OnDialogTabChange( tabCode )
@@ -53,13 +55,13 @@
 }
 
 // Get the selected image (if available).
-var oImage = FCK.Selection.GetSelectedElement() ;
+var oImage = dialog.Selection.GetSelectedElement() ;
 
 if ( oImage && oImage.tagName != 'IMG' && !( oImage.tagName == 'INPUT' && oImage.type == 'image' ) )
 	oImage = null ;
 
 // Get the active link.
-var oLink = FCK.Selection.MoveToAncestorNode( 'A' ) ;
+var oLink = dialog.Selection.GetSelection().MoveToAncestorNode( 'A' ) ;
 
 var oImageOriginal ;
 
@@ -111,10 +113,12 @@
 	if ( FCKConfig.ImageUpload )
 		GetE('frmUpload').action = FCKConfig.ImageUploadURL ;
 
-	window.parent.SetAutoSize( true ) ;
+	dialog.SetAutoSize( true ) ;
 
 	// Activate the "OK" button.
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+
+	SelectField( 'txtUrl' ) ;
 }
 
 function LoadSelection()
@@ -197,7 +201,7 @@
 {
 	if ( GetE('txtUrl').value.length == 0 )
 	{
-		window.parent.SetSelectedTab( 'Info' ) ;
+		dialog.SetSelectedTab( 'Info' ) ;
 		GetE('txtUrl').focus() ;
 
 		alert( FCKLang.DlgImgAlertUrl ) ;
@@ -218,19 +222,18 @@
 			oImage = null ;
 	}
 
+	oEditor.FCKUndo.SaveUndoStep() ;
 	if ( !bHasImage )
 	{
 		if ( bImageButton )
 		{
-			oImage = FCK.EditorDocument.createElement( 'INPUT' ) ;
+			oImage = FCK.EditorDocument.createElement( 'input' ) ;
 			oImage.type = 'image' ;
-			oImage = FCK.InsertElementAndGetIt( oImage ) ;
+			oImage = FCK.InsertElement( oImage ) ;
 		}
 		else
-			oImage = FCK.CreateElement( 'IMG' ) ;
+			oImage = FCK.InsertElement( 'img' ) ;
 	}
-	else
-		oEditor.FCKUndo.SaveUndoStep() ;
 
 	UpdateImage( oImage ) ;
 
@@ -354,7 +357,7 @@
 // Fired when the width or height input texts change
 function OnSizeChanged( dimension, value )
 {
-	// Verifies if the aspect ration has to be mantained
+	// Verifies if the aspect ration has to be maintained
 	if ( oImageOriginal && bLockRatio )
 	{
 		var e = dimension == 'Width' ? GetE('txtHeight') : GetE('txtWidth') ;
@@ -381,6 +384,11 @@
 function ResetSizes()
 {
 	if ( ! oImageOriginal ) return ;
+	if ( oEditor.FCKBrowserInfo.IsGecko && !oImageOriginal.complete )
+	{
+		setTimeout( ResetSizes, 50 ) ;
+		return ;
+	}
 
 	GetE('txtWidth').value  = oImageOriginal.width ;
 	GetE('txtHeight').value = oImageOriginal.height ;
@@ -434,11 +442,15 @@
 		UpdateOriginal( true ) ;
 	}
 
-	window.parent.SetSelectedTab( 'Info' ) ;
+	dialog.SetSelectedTab( 'Info' ) ;
 }
 
 function OnUploadCompleted( errorNumber, fileUrl, fileName, customMsg )
 {
+	// Remove animation
+	window.parent.Throbber.Hide() ;
+	GetE( 'divUpload' ).style.display  = '' ;
+
 	switch ( errorNumber )
 	{
 		case 0 :	// No errors
@@ -459,6 +471,9 @@
 		case 203 :
 			alert( "Security error. You probably don't have enough permissions to upload. Please check your server." ) ;
 			return ;
+		case 500 :
+			alert( 'The connector is disabled' ) ;
+			break ;
 		default :
 			alert( 'Error on file upload. Error number: ' + errorNumber ) ;
 			return ;
@@ -489,5 +504,9 @@
 		return false ;
 	}
 
+	// Show animation
+	window.parent.Throbber.Show( 100 ) ;
+	GetE( 'divUpload' ).style.display  = 'none' ;
+
 	return true ;
 }
\ No newline at end of file

Index: fck_image_preview.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_image/fck_image_preview.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_image_preview.html	1 Aug 2007 22:25:17 -0000	1.1
+++ fck_image_preview.html	16 Mar 2010 08:34:51 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * 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 ==
  *
@@ -28,11 +28,15 @@
 	<title></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta name="robots" content="noindex, nofollow" />
-	<link href="../common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+	<script src="../common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-// Sets the Skin CSS
-document.write( '<link href="' + window.parent.FCKConfig.SkinPath + 'fck_dialog.css" type="text/css" rel="stylesheet">' ) ;
+var FCKTools	= window.parent.FCKTools ;
+var FCKConfig	= window.parent.FCKConfig ;
+
+// Set the preview CSS
+document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaCSS ) ) ;
+document.write( FCKTools.GetStyleHtml( FCKConfig.EditorAreaStyles ) ) ;
 
 if ( window.parent.FCKConfig.BaseHref.length > 0 )
 	document.write( '<base href="' + window.parent.FCKConfig.BaseHref + '">' ) ;
@@ -46,21 +50,23 @@
 
 	</script>
 </head>
-<body style="color: #000000; background-color: #ffffff">
+<body>
+	<div>
 	<a id="lnkPreview" onclick="return false;" style="cursor: default">
-		<img id="imgPreview" onload="window.parent.UpdateOriginal();" style="display: none" /></a>Lorem
-	ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas feugiat consequat diam.
-	Maecenas metus. Vivamus diam purus, cursus a, commodo non, facilisis vitae, nulla.
-	Aenean dictum lacinia tortor. Nunc iaculis, nibh non iaculis aliquam, orci felis
-	euismod neque, sed ornare massa mauris sed velit. Nulla pretium mi et risus. Fusce
-	mi pede, tempor id, cursus ac, ullamcorper nec, enim. Sed tortor. Curabitur molestie.
-	Duis velit augue, condimentum at, ultrices a, luctus ut, orci. Donec pellentesque
-	egestas eros. Integer cursus, augue in cursus faucibus, eros pede bibendum sem,
-	in tempus tellus justo quis ligula. Etiam eget tortor. Vestibulum rutrum, est ut
-	placerat elementum, lectus nisl aliquam velit, tempor aliquam eros nunc nonummy
-	metus. In eros metus, gravida a, gravida sed, lobortis id, turpis. Ut ultrices,
-	ipsum at venenatis fringilla, sem nulla lacinia tellus, eget aliquet turpis mauris
-	non enim. Nam turpis. Suspendisse lacinia. Curabitur ac tortor ut ipsum egestas
-	elementum. Nunc imperdiet gravida mauris.
+			<img id="imgPreview" onload="window.parent.UpdateOriginal();"
+				style="display: none" alt="" /></a>Lorem ipsum dolor sit amet, consectetuer adipiscing
+		elit. Maecenas feugiat consequat diam. Maecenas metus. Vivamus diam purus, cursus
+		a, commodo non, facilisis vitae, nulla. Aenean dictum lacinia tortor. Nunc iaculis,
+		nibh non iaculis aliquam, orci felis euismod neque, sed ornare massa mauris sed
+		velit. Nulla pretium mi et risus. Fusce mi pede, tempor id, cursus ac, ullamcorper
+		nec, enim. Sed tortor. Curabitur molestie. Duis velit augue, condimentum at, ultrices
+		a, luctus ut, orci. Donec pellentesque egestas eros. Integer cursus, augue in cursus
+		faucibus, eros pede bibendum sem, in tempus tellus justo quis ligula. Etiam eget
+		tortor. Vestibulum rutrum, est ut placerat elementum, lectus nisl aliquam velit,
+		tempor aliquam eros nunc nonummy metus. In eros metus, gravida a, gravida sed, lobortis
+		id, turpis. Ut ultrices, ipsum at venenatis fringilla, sem nulla lacinia tellus,
+		eget aliquet turpis mauris non enim. Nam turpis. Suspendisse lacinia. Curabitur
+		ac tortor ut ipsum egestas elementum. Nunc imperdiet gravida mauris.
+	</div>
 </body>
 </html>



More information about the freeside-commits mailing list