Created
January 23, 2016 17:15
-
-
Save descilla/806abf85152521eab243 to your computer and use it in GitHub Desktop.
enable iframe for statistics
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/proportions.js b/lib/proportions.js | |
old mode 100644 | |
new mode 100755 | |
index fdad203..a4cd95a | |
--- a/lib/proportions.js | |
+++ b/lib/proportions.js | |
@@ -33,6 +33,15 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode" ], | |
content = document.createElement("img") | |
content.src = o.thumbnail | |
} | |
+ else if (o.iframe) | |
+ if (o.iframe.url) { | |
+ content = document.createElement("iframe") | |
+ content.src = o.iframe.url | |
+ if (o.iframe.width && o.iframe.height) { | |
+ content.style.width = o.iframe.width | |
+ content.style.height = o.iframe.height | |
+ } | |
+ } | |
if (o.caption) { | |
caption = o.caption | |
@@ -47,12 +56,21 @@ define(["chroma-js", "virtual-dom", "numeral-intl", "filters/genericnode" ], | |
var link = document.createElement("a") | |
link.target = "_blank" | |
link.href = o.href | |
- link.appendChild(content) | |
- if (caption && o.thumbnail) | |
- link.title = caption | |
+ if (!o.iframe) { | |
+ link.appendChild(content) | |
- p.appendChild(link) | |
+ if (caption && o.thumbnail) | |
+ link.title = caption | |
+ | |
+ p.appendChild(link) | |
+ } else { | |
+ if (caption){ | |
+ link.appendChild(document.createTextNode(caption)) | |
+ p.appendChild(link) | |
+ } | |
+ p.appendChild(content) | |
+ } | |
} else | |
p.appendChild(content) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment