From d8ba874e8b253a32e5af10e8c2fbfc32bd41b646 Mon Sep 17 00:00:00 2001 From: Olivier Audard Date: Fri, 23 Aug 2013 10:16:25 +0200 Subject: [PATCH] fixed Dailymotion embed behaviour when URL field is empty --- index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 26497fe..2a7d554 100644 --- a/index.html +++ b/index.html @@ -118,9 +118,9 @@ function createDailymotionEmbed(){ var dailymotionURL = $("#dailymotion-url").val(); var dailymotionID = (m =dailymotionURL.match(new RegExp("\/video\/([^_?#]+).*?"))) ? m[1] : void 0; - var dailymotionEmbed = "<iframe src='http://www.dailymotion.com/embed/video/" + dailymotionID + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; - var dailymotionpreview = ""; - + var dailymotionEmbed = "<iframe src='http://www.dailymotion.com/embed/" + (dailymotionID ? 'video/'+dailymotionID : '') + "' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>"; + var dailymotionpreview = ""; + $("#dailymotionembedCode").html( embedLabel + ""); $("#dailymotionpreview").html( previewLabel + previewPrefix + dailymotionpreview + previewSuffix ); }