summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-04 15:12:31 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-11-04 15:12:31 +0000
commit7a9c52ae56da365213ff7a10b1bd384d3d5a42e5 (patch)
treed32096a63b626fd9a77d8fc196d6a5b5c8a8c9c8 /roundcubemail/program
parent1e4c231c0eabecf8723186dcea9a18692e7413e0 (diff)
- 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
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/js/editor.js17
-rw-r--r--roundcubemail/program/js/editor_images.js12
2 files changed, 16 insertions, 13 deletions
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;
+};
diff --git a/roundcubemail/program/js/editor_images.js b/roundcubemail/program/js/editor_images.js
deleted file mode 100644
index 28e6bec38..000000000
--- a/roundcubemail/program/js/editor_images.js
+++ /dev/null
@@ -1,12 +0,0 @@
-
-var rc_client = tinyMCEPopup.getParam("rc_client");
-if (rc_client.env.attachments)
-{
- var tinyMCEImageList = new Array();
- for (var id in rc_client.env.attachments)
- {
- var att = rc_client.env.attachments[id];
- if (att.complete && att.mimetype.indexOf('image/') == 0)
- tinyMCEImageList.push([att.name, rc_client.env.comm_path+'&_action=display-attachment&_file='+id+'&_id='+rc_client.env.compose_id]);
- }
-};