Fix worker app

pull/1/head
yflory 7 years ago
parent b6e91c772e
commit 1c39e8b1bb

@ -32,6 +32,7 @@ define([
sFrameChan.onReady(waitFor());
}).nThen(function (/*waitFor*/) {
var $container = $('#cp-app-worker-container');
$('<a>', {href:'http://localhost:3000/worker/', target:'_blank'}).text('other').appendTo($container);
var $bar = $('.cp-toolbar-container');
var displayed = ['useradmin', 'newpad', 'limit', 'pageTitle'];

@ -29,16 +29,17 @@ require.config({
});
var i = 0;
var id = Math.floor(Math.random()*100000);
onconnect = function(e) {
console.log(e);
console.log(i);
var port = e.ports[0];
console.log('here');
require([
'/common/outer/async-store.js'
], function (Store) {
console.log(Store);
//require([
// '/common/outer/async-store.js'
//], function (Store) {
//console.log(Store);
console.log(self.Proxy);
var n = i;
port.postMessage({state: 'READY'});
@ -46,8 +47,9 @@ onconnect = function(e) {
console.log('worker received');
console.log(e.data);
port.postMessage('hello CryptPad'+n);
port.postMessage('This is '+id);
};
var data = {
/*var data = {
query: function (cmd, data, cb) {
console.log(cmd, data);
},
@ -64,7 +66,7 @@ onconnect = function(e) {
});
port.postMessage('Store is connected!');
port.postMessage('Your username is ' + ret.store.proxy['cryptpad.username']);
});
});*/
i++;
});
//});
};

Loading…
Cancel
Save