Selecting image does not fire onchange event in TinyMCE image browser window

prond - May 31, 2007 - 14:56
Project:IMCE
Version:HEAD
Component:Code
Category:bug report
Priority:normal
Assigned:prond
Status:closed
Description

When choosing an image the preview in TinyMCE image browser window does not change.

Adding following code fixes that bug:

try {
      imceVar['targetField'].fireEvent('onchange');
  }
  catch (evt) {
      var newEvt = document.createEvent("Events");
          newEvt.initEvent('change',false,true);
          imceVar['targetField'].dispatchEvent(newEvt);
  }

It should be placed in imce_browse.js just after following lines in imceFinitor() function body:

imceVar['targetField'].value = path;

AttachmentSize
imce_browse.js_.txt5.61 KB

#1

DawnLight - June 16, 2007 - 16:53

This happens for me in 5.x-1.0. I don't know PHP or JavaScript.

I thought it may be because some hebrew translation found its way into the javascript. I got that idea from seeing that while I point at an image in the file manager, FireFox's status bar shows me "javascript: imceFinitor('/drupal/files/images/avatar.jpg', 85, 85, '2.69 ק". notice the last letter is hebrew. Its probably a part of the hebrew translation for "KB", which is "ק"ב".

I don't even know where the translation comes from. Is it the browser doing it?

#2

levavie - August 23, 2007 - 11:11
Title:Slecting image does not fire onchange event in TinyMCE image browser window» Selecting image does not fire onchange event in TinyMCE image browser window

Search for the string and replace it with a string without quotes. Go to admin/settings/locale/string/search. I changed the translation to קילובייט, instead of ק"ב, and now it inserts the filename into the dialog. This is an immediate solution.

I will notify Yuval, who is responsible for the Hebrew translation, about the problem. This will hopefully go into the next translation.

Thanks alot for the lead to the solution.

Amnon
-
Professional: Drupal Israel | Drupal Development & Consulting | בניית אתרים
Personal: Hitech Dolphin: Regain Simple Joy :)

#3

levavie - August 23, 2007 - 12:06
Status:reviewed & tested by the community» needs work

Please make validation on the 'KB' and only allow plain text on it.
This will premanently solve the issue for other languages as well.

#4

yhager - December 4, 2007 - 08:16

@levavie, @DawnLight - I am not sure this is the same issue as originally reported. I opened another issue for the hebrew translation there and provided a patch. Please test it.

#5

ufku - September 25, 2009 - 13:11
Status:needs work» closed
 
 

Drupal is a registered trademark of Dries Buytaert.