Page 1 of 1

FCKEditorX - 2 questions

Posted: Tue Jan 02, 2007 12:07 am
by dsolheid
Hi all !

First of all, Happy new Year  ;D

I have 2 questions about FCKEditorX.

1) This is possible, when the user add an image into a content, and click to the "browse server" button to show the "FCKEditor - Resources Browser" window, to remain the previous path used ... (to not have to browse each time to the dir Images/yyy/xxx/zzzz/ ...) ?

2) Is a simple way to have "thumbnail" into the "FCKEditor - Resources Browser" when browsing image, (and not have a simple list with file names... ?

Just to know if these features are planed, or to know if someone else has try to code it ..

Regards,

Didier.

Re: FCKEditorX - 2 questions

Posted: Tue Jan 02, 2007 9:21 pm
by dsolheid
I have coded a solution for the question 2) ...

here the source code (to have thumbnail gallery when user want to pick up an image inside the FCKEditor).

Regards ;)

Replace the "oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )" function located in \modules\FCKeditorX\FCKeditor\editor\filemanager\browser\default\frmresourceslist.html by the following code =>

Code: Select all

oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
{
	// Build the link to view the folder.
	var sLink = '<a href="#" onclick="OpenFile(\'' + fileUrl.replace( /'/g, '\\\'') + '\');return false;">' ;

	// Get the file icon.
	var sIcon = oIcons.GetIcon( fileName ) ;

    if ((sIcon=="jpg") || (sIcon=="gif"))
	return '<tr>' +
			'<td width="16" valign="middle">' +
				sLink + 
				'<img alt="" src="' + fileUrl.replace( /'/g, '\\\'') + '" width="80" height="60" border="0"></a>' +
			'</td><td valign="middle"> ' +
				sLink + 
				fileName + 
				'</a>' +
			'</td><td valign="middle" align="right" nowrap> ' +
				fileSize + 
				' KB' +
		'</td></tr>' ;
	else

	return '<tr>' +
			'<td width="16">' +
				sLink + 
				'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
			'</td><td> ' +
				sLink + 
				fileName + 
				'</a>' +
			'</td><td align="right" nowrap> ' +
				fileSize + 
				' KB' +
		'</td></tr>' ;
}