Compare commits

..

2 commits

Author SHA1 Message Date
rlx
d38f692558 Merge branch 'master' of code.0x2620.org:0x2620/openmedialibrary_reader 2019-01-24 13:37:21 +05:30
rlx
f855172c42 use oxjs 2019-01-24 13:37:06 +05:30

View file

@ -1,5 +1,9 @@
let txtjs = {} let txtjs = {}
Ox.load({UI: {loadCSS: false}}, function() {
// ...
})
txtjs.open = function(url) { txtjs.open = function(url) {
fetch(url).then(function(response) { fetch(url).then(function(response) {
return response.text() return response.text()
@ -211,7 +215,8 @@ txtjs.onMessage = function(action, data) {
txtjs.postMessage = function(action, data) { txtjs.postMessage = function(action, data) {
console.log('postMessage', action, data) console.log('postMessage', action, data)
parent.postMessage(JSON.stringify({action: action, data: data}), '*') //parent.postMessage(JSON.stringify({action: action, data: data}), '*')
Ox.$parent.postMessage(action.replace('Note', 'Annotation'), data)
} }
txtjs.removeNote = function() { txtjs.removeNote = function() {