I just realized that using the 'Insert image' browser to insert files other than images (e.g. zip, html, ...) results in <img src="/files/abc.zip" width="0" height="0" alt="abc.zip" />. Thats really ugly. However using the 'Insert link' browser works perfectly nice und generates <a href="/files/abc.zip">abc.zip (10 KB)</a>.

This is especially bad for unexperienced users. They dont understand the difference between 'Insert image or link'. There should at least be a filter which automatically switches to 'link mode' when a users tries to embed non-image files.

I could also help to add a select field to the browser (to switch mode between 'embed' and 'link') rather than providing two links which result in the same dialog. However non-image detection is needed either way.

Comments

ufku’s picture

try replacing line 22 in imce_set_inline.js with;
imceActiveType = imceActiveType=='link' ? 'link' : (w&&h ? 'image' : 'link');

i'll later provide a patch or directly commit this change to dev version.

profix898’s picture

Yes, this change works nicely. Thanks. Should be good to go ...

ufku’s picture

Status: Active » Fixed

committed to 5.x branch.

Anonymous’s picture

Status: Fixed » Closed (fixed)