Ticket #409: FCKEditor_2.3_ThumbNail.txt

File FCKEditor_2.3_ThumbNail.txt, 2.6 KB (added by Alfonso Martínez de Lizarrondo, 17 years ago)
Line 
1Right got version 2.3 to work with an extra feature to show the full size image if you want it:
2
3Edit the file: editor/filemanager/browser/default/frmresourceslist.html 
4
5First off paste the following code at the top, just within the
6<script type="text/javascript"> 
7 
8###START PASTE###
9function h2oDisplayNormal(h2oObj,h2oID) {
10var h2oImgStart='<img src="';
11var h2oImgEnd='" border="0" />';
12var h2oMyOutput=document.getElementById("h2o_"+h2oID);
13h2oMyOutput.style.display="block";
14h2oMyOutput.innerHTML=h2oImgStart+h2oObj+h2oImgEnd;
15}
16function h2oDisplayNone(h2oObj) {
17var h2oMyOutput=document.getElementById("h2o_"+h2oObj);
18h2oMyOutput.style.display="none";
19h2oMyOutput.innerHTML=""; 
20}
21### END PASTE ###
22 
23Then locate this line:
24 
25oListManager.GetFileRowHtml = function( fileName, fileUrl, fileSize )
26 
27Comment out:
28
29/*return '<tr>' +
30'<td width="16">' +
31sLink + 
32'<img alt="" src="images/icons/' + sIcon + '.gif" width="16" height="16" border="0"></a>' +
33'</td><td>&nbsp;' +
34sLink + 
35fileName + 
36'</a>' +
37'</td><td align="right" nowrap>&nbsp;' +
38fileSize + 
39' KB' +
40'</td></tr>' ;*/
41 
42Then paste the following:
43/*==================================================
44Modification to display thumb nails 
45Modifed date: 20/07/2006
46Modified by: http://www.h2odevelopments.co.uk
47==================================================*/
48var imgH="52";
49var imgW="52";
50var h2oOutput="";
51h2oOutput='<tr><td width="16">'+sLink+'<img alt="'+sIcon+'" src="images/icons/'+sIcon+'.gif" width="16" height="16" border="0"/></a></td>';
52h2oOutput+='<td nowarp colspan="2">&nbsp;'+sLink;
53if(sIcon=="gif" || sIcon=="jpg" || sIcon=="png") {
54 
55h2oOutput+='&nbsp;' + sLink + '<img src="'+fileUrl+'" alt="'+fileName+'" height="'+imgH+'" width="'+imgW+'" border="0"';
56 
57//=== Start of remove if you don't want to display full image on rollover
58var h2oFunc='h2oDisplayNormal(this.src,&#39;'+fileName+'&#39;)';
59h2oOutput+=' onmouseover="'+h2oFunc+'"';
60h2oOutput+=' onmouseout="h2oDisplayNone(&#39;'+fileName+'&#39;)"';
61//=== End of remove if you don't want to display full image on rollover
62 
63h2oOutput+=' /></a> ('+fileName+')';
64h2oOutput+='<div id="h2o_'+fileName+'" style="display: none; border: 1px solid #ccc;padding: 2px;"></div>';
65 
66} else {
67h2oOutput+= '&nbsp;' + sLink + fileName + '</a>';
68}
69h2oOutput+='</td><td align="right" nowrap>&nbsp;' +fileSize+' KB</td></tr>';
70return h2oOutput;
71/*==================================================
72End of modifications
73==================================================*/
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy