diff --git a/pandora/text/templates/pdf/viewer.html b/pandora/text/templates/pdf/viewer.html
index edb5b496..9150cb35 100644
--- a/pandora/text/templates/pdf/viewer.html
+++ b/pandora/text/templates/pdf/viewer.html
@@ -24,8 +24,7 @@ limitations under the License.
-
-
+
diff --git a/static/pdf.js/embeds.js b/static/pdf.js/embeds.js
index 95a6b52a..eb44cf16 100644
--- a/static/pdf.js/embeds.js
+++ b/static/pdf.js/embeds.js
@@ -1,27 +1,30 @@
-Ox.load(function() {
+Ox.load({
+ 'UI': {
+ loadCSS: false
+ }
+}, function() {
var currentPage = PDFView.page;
window.addEventListener('pagechange', function (evt) {
var page = evt.pageNumber;
if (page && page != currentPage) {
currentPage = page;
- Ox.$parent.postMessage('page', {
+ Ox.parent.postMessage('page', {
page: Math.round(page)
});
}
});
- Ox.$parent.onMessage(function(event, data, oxid) {
- if (event == 'page' && Ox.isUndefined(oxid)) {
+ Ox.parent.bindMessage({
+ page: function(data) {
if (data.page != PDFView.page) {
PDFView.page = data.page;
}
- }
- if (event == 'pdf' && Ox.isUndefined(oxid)) {
+ },
+ pdf: function(data) {
if (PDFView.url != data.pdf) {
PDFView.open(data.pdf);
}
}
});
- Ox.$parent.postMessage('init', {});
});
function getVideoOverlay(page) {
@@ -72,15 +75,10 @@ function getVideoOverlay(page) {
enableVideoUI();
}
this.div.appendChild($interface[0]);
- Ox.Message.bind(function(event, data, oxid) {
- if (event == 'update') {
- if(Ox.isUndefined(oxid)
- && video
- && data.id == video.id
- && data.page == video.page) {
- video.src = data.src;
- video.src !== '' ? enableVideoUI() : disableVideoUI();
- }
+ Ox.parent.bindMessage('update', function(data) {
+ if (video && data.id == video.id && data.page == video.page) {
+ video.src = data.src;
+ video.src !== '' ? enableVideoUI() : disableVideoUI();
}
});
}
@@ -88,7 +86,7 @@ function getVideoOverlay(page) {
e.preventDefault();
e.stopPropagation();
var videoId = 'video' + page + id + Ox.uid(),
- $iframe = Ox.$('