From c3102561f4181a61f10277ca358616a39141fd36 Mon Sep 17 00:00:00 2001 From: JC Brand Date: Wed, 18 Dec 2019 14:18:37 +0100 Subject: [PATCH] updates #1795: Only download metadata for video files --- spec/messages.js | 6 ++---- src/templates/video.html | 3 +-- src/utils/html.js | 6 +----- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/spec/messages.js b/spec/messages.js index 1c4a242aa..af7fd59d5 100644 --- a/spec/messages.js +++ b/spec/messages.js @@ -1973,8 +1973,7 @@ let media = view.el.querySelector('.chat-msg .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download video file "video.mp4"'); + ''); // If the and contents is the same, don't duplicate. stanza = u.toStanza(` @@ -1991,8 +1990,7 @@ media = view.el.querySelector('.chat-msg:last-child .chat-msg__media'); expect(media.innerHTML.replace(/(\r\n|\n|\r)/gm, "")).toEqual( ''+ - ''+ - 'Download video file "video.mp4"'); + ''); done(); })); diff --git a/src/templates/video.html b/src/templates/video.html index 696acf519..ca1c33a14 100644 --- a/src/templates/video.html +++ b/src/templates/video.html @@ -1,2 +1 @@ - -{{{o.label_download}}} + diff --git a/src/utils/html.js b/src/utils/html.js index 5cb3cdba6..b8ecc79cd 100644 --- a/src/utils/html.js +++ b/src/utils/html.js @@ -223,11 +223,7 @@ u.renderImageURLs = function (_converse, el) { u.renderMovieURL = function (_converse, url) { const uri = new URI(url); if (u.isVideoURL(uri)) { - const { __ } = _converse; - return tpl_video({ - 'url': url, - 'label_download': __('Download video file "%1$s"', decodeURI(uri.filename())) - }) + return tpl_video({url}); } return url; };