From 934c79a7db094b4ba7178cae6fde081d9998801c Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 7 Jan 2014 13:59:51 +0000 Subject: [PATCH] make pdf.js usable without video embeds --- static/pdf.js/embeds.js | 8 +- static/pdf.js/index.html | 355 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 361 insertions(+), 2 deletions(-) create mode 100644 static/pdf.js/index.html diff --git a/static/pdf.js/embeds.js b/static/pdf.js/embeds.js index 7f29976f5..24b5c88b1 100644 --- a/static/pdf.js/embeds.js +++ b/static/pdf.js/embeds.js @@ -15,14 +15,18 @@ Ox.load(function() { PDFView.page = data.page; } } + if (event == 'pdf' && Ox.isUndefined(oxid)) { + PDFView.open(data.pdf); + } }); + Ox.$parent.postMessage('init', {}); }); function getVideoOverlay(page) { - var links = embeds.filter(function(embed) { + var links = (window.embeds || []).filter(function(embed) { return embed.page == page && embed.type =='inline'; }); - return (editable || links.length) ? { + return (window.editable || links.length) ? { beginLayout: function() { this.counter = 0; }, diff --git a/static/pdf.js/index.html b/static/pdf.js/index.html new file mode 100644 index 000000000..6e8abaf84 --- /dev/null +++ b/static/pdf.js/index.html @@ -0,0 +1,355 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ + +
+
+
+
+
+ +
+
+ +
+ + + + +
+
+
+
+ +
+ +
+ +
+ +
+ + + +
+
+ + + + + + + + + + Current View + + +
+ + +
+
+
+
+ +
+ +
+ + + +
+
+
+
+
+
+
+
+
+
+
+ + + + + + + + +
+
+
+ + +
+ + + +
+
+ + + + +