Hi there!
In FCKeditor 1.6 I customized the image dialog.
For the output I included real rezising based on predefined values for the image-width via a dropdown from the dialog-window and also the img-tag was surrounded with an <a> tag and placed into a formatted div container.
See the code below (from V. 1.6)!
fck_image.html
In V. 2.03 it seems that the img-tag is produced by FCK.CreateElement( 'IMG' ), which doesn't allow me to make my customizations.
Does anybody have an idea how to solve my problem?
Regards
Gerhard
In FCKeditor 1.6 I customized the image dialog.
For the output I included real rezising based on predefined values for the image-width via a dropdown from the dialog-window and also the img-tag was surrounded with an <a> tag and placed into a formatted div container.
See the code below (from V. 1.6)!
fck_image.html
<html> <head> ... ... // Get the IMG tag. function getImageHtml() { var Ausgabew,Ausgabeh ; if ( imageOriginal.height > imageOriginal.width ) Ausgabew = Math.round( imageOriginal.width * ( 500 / imageOriginal.height )) + 30; Ausgabeh = 650; if ( imageOriginal.height < imageOriginal.width ) Ausgabew = 530; //Ausgabeh = Math.round(( imageOriginal.height * 500 ) / imageOriginal.width ); Ausgabeh = Math.round(( imageOriginal.width * 500 ) / imageOriginal.height ) + 70; if ( imageOriginal.height == imageOriginal.width ) Ausgabew = 530; Ausgabeh = 650; var sHTML ; if ( bImageButton ) sHTML = '<INPUT type="image"' ; else sHTML = '<DIV ALIGN=LEFT CLASS=bild-'+ cmbAlign[cmbAlign.selectedIndex].value + txtWidth.value +'><A href="javascript:void(0);" onClick="MM_openBrWindow(\'/bild_gross.php?bild='+ txtURL.value +'&bildu='+ txtAlt.value +'&x=\',\'x\',\'width='+ Ausgabew +',height='+ Ausgabeh +'\')"><IMG' ; sHTML = sHTML + attr("src", '/skripte/thumb/phpThumb.php?src='+ txtURL.value +'&w='+ txtWidth.value) + attr("alt", txtAlt.value) + ((txtWidth.value) ? attr("width" , txtWidth.value) : "") + ((txtHeight.value) ? attr("height", txtHeight.value) : "") + ((txtVSpace.value) ? attr("vspace", txtVSpace.value) : "") + ((txtHSpace.value) ? attr("hspace", txtHSpace.value) : "") + ((txtBorder.value) ? attr("border", txtBorder.value) : attr("border",0)) + '/></A><BR/>'+ txtAlt.value +'</DIV>' ; return sHTML ; } ... ... </head> </head> <body bottommargin="5" leftmargin="5" topmargin="5" rightmargin="5" onload="setDefaults()"> <table cellspacing="1" cellpadding="1" border="0" width="100%" class="dlg" height="100%" ID="Table1"> ... ... <tr height="100%"> <td> <table cellspacing="0" cellpadding="0" width="100%" border="0" height="100%" ID="Table6"> <tr> <td valign="top" nowrap> <table cellspacing="0" cellpadding="0" border="0" width="72" ID="Table7"> <tr> <td colspan="2" style="padding-bottom:8px;"><span fckLang="DlgImgAlign">Align</span><br/> <select id="cmbAlign" onchange="updatePreview();" style="width: 100%" NAME="cmbAlign"> <option value="" selected></option> <option fckLang="DlgImgAlignLeft" value="left">Left</option> <option fckLang="DlgImgAlignRight" value="right">Right</option> </select></td> </tr> <tr> <td><span fckLang="DlgImgWidth">Width</span> </td> <td> <select size="1" id="txtWidth" onchange="sizeChanged('Width');" NAME="txtWidth"> <option value="200">200</option> <option value="175">175</option> <option value="150">150</option> </select></td> </tr> <tr> <td><span fckLang="DlgImgHeight">Height</span> </td> <td> <input type="text" size="3" id="txtHeight" NAME="txtHeight"></td> </tr> </table> ... ... </table> </body> </html>
In V. 2.03 it seems that the img-tag is produced by FCK.CreateElement( 'IMG' ), which doesn't allow me to make my customizations.
Does anybody have an idea how to solve my problem?
Regards
Gerhard
Re: custom image dialog