update pdf.js to use new iframe/postMessage api

This commit is contained in:
j 2014-09-23 23:47:55 +02:00
parent ac2f1a550f
commit 2db57c3c69

View file

@ -448,8 +448,8 @@ pandora.ui.textPDF = function(text) {
src: url,
width: '100%'
})
.onMessage(function(event, data) {
if (event == 'edit') {
.bindMessage({
edit: function(data) {
pandora.ui.insertEmbedDialog(data.src, function(url) {
data.src = url;
var embed = text.embeds.filter(function(embed) {
@ -470,7 +470,8 @@ pandora.ui.textPDF = function(text) {
$iframe.postMessage('update', data);
});
}).open();
} else if (event == 'page') {
},
page: function(data) {
pandora.UI.set('texts.' + pandora.UI.encode(pandora.user.ui.text), {
'position': data.page
});