Skip to content

Commit

Permalink
- Don't use external js file for images listing in HTML editor
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed Nov 4, 2011
1 parent 77153b2 commit 8f142e3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
17 changes: 16 additions & 1 deletion program/js/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function rcmail_editor_init(config)
remove_script_host: false,
gecko_spellcheck: true,
convert_urls: false, // #1486944
external_image_list_url: 'program/js/editor_images.js',
external_image_list: window.rcmail_editor_images,
rc_client: rcmail
};

Expand Down Expand Up @@ -129,3 +129,18 @@ function rcmail_toggle_editor(select, textAreaId, flagElement)
select.checked = true;
}
}

// editor callbeck for images listing
function rcmail_editor_images()
{
var i, files = rcmail.env.attachments, list = [];

for (i in files) {
att = files[i];
if (att.complete && att.mimetype.indexOf('image/') == 0) {
list.push([att.name, rcmail.env.comm_path+'&_action=display-attachment&_file='+i+'&_id='+rcmail.env.compose_id]);
}
}

return list;
};
12 changes: 0 additions & 12 deletions program/js/editor_images.js

This file was deleted.

0 comments on commit 8f142e3

Please sign in to comment.