I can currently get fckeditor to actually put in the img src equal to a .thumb_filename.jpg. So a thumbnail will show instead of the full image in the editor. However, I can not figure out how to automatically create an <a href> tag around that img tag to link back to the full image. Which file do i need to modify to change the default <img src=> generation?
Sat, 12/03/2005 - 20:03
#1

RE: Link from thumbnail
var sLnkUrl = GetE('txtLnkUrl').value.trim() ;
if ( sLnkUrl.length == 0 )
{
if ( oLink )
FCK.ExecuteNamedCommand( 'Unlink' ) ;
}
else
{
if ( oLink ) // Modifying an existent link.
oLink.href = sLnkUrl ;
else // Creating a new link.
{
if ( !bHasImage )
oEditor.FCKSelection.SelectNode( oImage ) ;
oLink = oEditor.FCK.CreateLink( sLnkUrl ) ;
if ( !bHasImage )
{
oEditor.FCKSelection.SelectNode( oLink ) ;
oEditor.FCKSelection.Collapse( false ) ;
}
}
SetAttribute( oLink, 'target', GetE('cmbLnkTarget').value ) ;
}
RE: Link from thumbnail
function Ok()
{
if ( GetE('txtUrl').value.length == 0 )
{
window.parent.SetSelectedTab( 'Info' ) ;
GetE('txtUrl').focus() ;
alert( oEditor.FCKLang.DlgImgAlertUrl ) ;
return false ;
}
if ( oImage && bImageButton && oImage.tagName == 'IMG' )
{
if ( confirm( 'Do you want to transform the selected image on a image button?' ) )
oImage = null ;
}
else if ( oImage && !bImageButton && oImage.tagName == 'INPUT' )
{
if ( confirm( 'Do you want to transform the selected image button on a simple image?' ) )
oImage = null ;
}
if ( !oImage )
{
if ( bImageButton )
{
oImage = FCK.EditorDocument.createElement( 'INPUT' ) ;
oImage.type = 'image' ;
oImage = FCK.InsertElementAndGetIt( oImage ) ;
}
else
oImage = FCK.CreateElement( 'IMG' ) ;
}
return true ;
}
RE: Link from thumbnail
http://cvs.sourceforge.net/viewcvs.py/f ... &view=auto
RE: Link from thumbnail
I can upload images fine - I am trying to have it automatically link when a .thumb_image is selected. When I click on browse server to insert an image, and I choose a .thumb_filename.jpg to have it automatically link to filename.jpg.
RE: Link from thumbnail
Basically it gets the image link, strips out the filename, appends the .thumb_ to it and resizes as oppose to keeping the original dimensions.
Inside fck_image.html I added a checkbox for the behavior - incase you dont want to always use the thumbnail.
<input name="chkThumb" type="checkbox" id="chkThumb" value="checkbox" checked>
function UpdateImage( e, skipId )
{
e.src = GetE('txtUrl').value;
asdf = e.src.split("/");
filename = e.src.split("/")[e.src.split("/").length - 1];
asdf.pop();
if (chkThumb.checked) {
thumbname = (asdf.join("/") + '/.thumb_' + filename);
e.src = thumbname;
SetAttribute( e, "width" , '150' ) ;
SetAttribute( e, "height", '150' ) ;
} else {
SetAttribute( e, "width" , GetE('txtWidth').value ) ;
SetAttribute( e, "height", GetE('txtHeight').value ) ;
}
SetAttribute( e, "alt" , GetE('txtAlt').value ) ;
SetAttribute( e, "vspace", GetE('txtVSpace').value ) ;
SetAttribute( e, "hspace", GetE('txtHSpace').value ) ;
SetAttribute( e, "border", GetE('txtBorder').value ) ;
SetAttribute( e, "align" , GetE('cmbAlign').value ) ;