From 2d6621ee06572bdbab51c5a0a019f29a42891590 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Thu, 21 Feb 2013 14:52:41 +0000 Subject: [PATCH] embeds --- static/pdf.js/links.js | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/static/pdf.js/links.js b/static/pdf.js/links.js index 108269cd9..88944d90a 100644 --- a/static/pdf.js/links.js +++ b/static/pdf.js/links.js @@ -24,21 +24,23 @@ function getEmbedURL(id, videoURL) { + '&in=' + inPoint + '&out=' + outPoint + '&paused=false&showCloseButton=true'; } - function getVideoOverlay(page) { - return (editable || links[page]) ? { + var links = embeds.filter(function(embed) { + return embed.page == page && embed.type =='inline'; + }); + return (editable || links.length) ? { beginLayout: function() { this.counter = 0; - //console.log('lets beging'); }, endLayout: function() { - //console.log('lets end it here'); }, appendImage: function(image) { var id = ++this.counter, - hasVideo = links[page] && links[page][id], + video = links.filter(function(embed) { + return embed.id == id; + })[0], $interface, $playButton, $editButton; - if (editable || hasVideo) { + if (editable || video) { $interface = Ox.$('
') .addClass('interface') .css({ @@ -66,7 +68,7 @@ function getVideoOverlay(page) { if (editable) { $editButton.show(); } - if (hasVideo) { + if (video) { enableVideoUI(); } this.div.appendChild($interface[0]); @@ -78,7 +80,7 @@ function getVideoOverlay(page) { $iframe = Ox.$('