From c5bfe69e2199d6dc92136d5e1ebcc9cdeb180bf5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 4 Jun 2014 18:42:57 +0200 Subject: Improved video support, all tinymce related resources moved to program/js/tinymce/roundcube dir --- program/js/editor.js | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'program/js/editor.js') diff --git a/program/js/editor.js b/program/js/editor.js index 6540bd56a..c5ceddd0f 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -40,7 +40,7 @@ function rcube_text_editor(config, id) selector: '#' + ($('#' + id).is('.mce_editor') ? id : 'fake-editor-id'), theme: 'modern', language: config.lang, - content_css: config.skin_path + '/editor_content.css?v2', + content_css: 'program/js/tinymce/roundcube/content.css?v1', menubar: false, statusbar: false, toolbar_items_size: 'small', @@ -84,7 +84,7 @@ function rcube_text_editor(config, id) accessibility_focus: false, file_browser_callback: function(name, url, type, win) { ref.file_browser_callback(name, url, type); }, // @todo: support more than image (types: file, image, media) - file_browser_callback_types: 'image' + file_browser_callback_types: 'image media' }); } @@ -582,9 +582,25 @@ function rcube_text_editor(config, id) return; } - if (file.mimetype.startsWith('image/')) { + var rx, img_src; + + switch (rcmail.env.file_browser_type) { + case 'image': + rx = /^image\//i; + break; + + case 'media': + rx = /^video\//i; + img_src = 'program/js/tinymce/roundcube/video.png'; + break; + + default: + return; + } + + if (rx.test(file.mimetype)) { var href = rcmail.env.comm_path+'&_id='+rcmail.env.compose_id+'&_action=display-attachment&_file='+file_id, - img = $('').attr({title: file.name, src: href + '&_thumbnail=1'}); + img = $('').attr({title: file.name, src: img_src ? img_src : href + '&_thumbnail=1'}); return $('
  • ').data('url', href) .append($('').append(img)) -- cgit v1.2.3