From d37c17497ccc9c61d7c6a288dd2ad2500c1ddd97 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Fri, 26 Dec 2014 03:22:50 -0800 Subject: [PATCH] Limit size of embedded images and videos. --- src/Linkification/Embedding.coffee | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Linkification/Embedding.coffee b/src/Linkification/Embedding.coffee index 86bc92e2f..ad07b6d20 100644 --- a/src/Linkification/Embedding.coffee +++ b/src/Linkification/Embedding.coffee @@ -189,7 +189,7 @@ Embedding = regExp: /\.(?:gif|png|jpg|jpeg|bmp)(?:\?|$)/i style: 'border: 0; width: auto; height: auto;' el: (a) -> - $.el 'div', <%= html('') %> + $.el 'div', <%= html('') %> , key: 'InstallGentoo' regExp: /^\w+:\/\/paste\.installgentoo\.com\/view\/(?:raw\/|download\/|embed\/)?(\w+)/ @@ -234,11 +234,11 @@ Embedding = return el.textContent = "ERROR: Not a valid filetype" unless embed switch embed.type when 'video/mp4', 'video/webm', 'video/ogv' - $.extend el, <%= html('') %> + $.extend el, <%= html('') %> for ext, i in ['mp4', 'webm'] el.firstChild.children[i].src = "https://mediacru.sh/#{a.dataset.uid}.#{ext}" when 'image/svg+xml', 'image/png', 'image/gif', 'image/jpeg' - $.extend el, <%= html('') %> + $.extend el, <%= html('') %> when 'audio/mpeg', 'audio/ogg' $.extend el, <%= html('') %> else @@ -348,7 +348,7 @@ Embedding = , key: 'Loopvid' regExp: /^\w+:\/\/(?:www\.)?loopvid.appspot.com\/((?:pf|kd|lv|mc|gd|gh|db|nn)\/[\w\-]+(,[\w\-]+)*|fc\/\w+\/\d+)/ - style: 'border: 0; width: auto; height: auto;' + style: 'border: 0; width: auto; height: auto; max-width: 80vw; max-height: 80vh;' el: (a) -> el = $.el 'video', controls: true @@ -393,7 +393,7 @@ Embedding = , key: 'video' regExp: /\.(?:ogv|webm|mp4)(?:\?|$)/i - style: 'border: 0; width: auto; height: auto;' + style: 'border: 0; width: auto; height: auto; max-width: 80vw; max-height: 80vh;' el: (a) -> $.el 'video', controls: true