From ee87841ec2464a24cce9a0ed89dc1915c139679b Mon Sep 17 00:00:00 2001 From: chylex <info@chylex.com> Date: Fri, 15 Apr 2016 23:24:21 +0200 Subject: [PATCH] Open browser when clicking on a "gif" (actually mp4) --- Resources/code.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Resources/code.js b/Resources/code.js index 4175b3ba..107b39fb 100644 --- a/Resources/code.js +++ b/Resources/code.js @@ -230,4 +230,16 @@ onUrlOpened(); }; })(); + + // + // Block: Hook into mp4 video element clicking + // + $(document.body).delegate("video.js-media-gif","click",function(e){ + var src = $(this).attr("src"); + + if (src.endsWith(".mp4")){ + $TD.openBrowser(src); + e.preventDefault(); + } + }); })($,$TD);