From 7a9c52ae56da365213ff7a10b1bd384d3d5a42e5 Mon Sep 17 00:00:00 2001 From: alec Date: Fri, 4 Nov 2011 15:12:31 +0000 Subject: - Don't use external js file for images listing in HTML editor git-svn-id: https://svn.roundcube.net/trunk@5391 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/js/editor.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'roundcubemail/program/js/editor.js') diff --git a/roundcubemail/program/js/editor.js b/roundcubemail/program/js/editor.js index 63186fb02..9ad50cea5 100644 --- a/roundcubemail/program/js/editor.js +++ b/roundcubemail/program/js/editor.js @@ -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 }; @@ -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; +}; -- cgit v1.2.3