From 3ac95d5a673db544d7ceeaa9e5fca766cb738120 Mon Sep 17 00:00:00 2001 From: alecpl Date: Mon, 28 Jul 2008 06:43:02 +0000 Subject: #1485230: allow only images (by filename extension) in tinyMCE's images selector --- program/js/editor_images.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'program/js') diff --git a/program/js/editor_images.js b/program/js/editor_images.js index 373b44e3d..36fc1ab59 100644 --- a/program/js/editor_images.js +++ b/program/js/editor_images.js @@ -15,6 +15,8 @@ if (rc_client.gui_objects.attachmentlist) fname = liElem.childNodes[j].nodeValue; } } - tinyMCEImageList.push([fname, rc_client.env.comm_path+'&_action=display-attachment&_file='+attachElems[i].id]); + + if (fname.match(/\.(bmp|gif|png|jpg|jpeg)$/)) + tinyMCEImageList.push([fname, rc_client.env.comm_path+'&_action=display-attachment&_file='+attachElems[i].id]); } }; -- cgit v1.2.3