Base for Drive in sandboxed iframe

This commit is contained in:
yflory
2017-09-21 17:56:24 +02:00
parent a1c124f1be
commit 456370b1aa
22 changed files with 5060 additions and 19 deletions

View File

@@ -42,6 +42,25 @@ var afterLoaded = function (req) {
updated: updated,
cache: data.cache
};
data.localStore = data.localStore || {};
var lsUpdated = {};
window.cryptpadStore = {
get: function (k, cb) {
setTimeout(function () { cb(data.localStore[k]); });
},
getAll: function (cb) {
setTimeout(function () {
cb(JSON.parse(JSON.stringify(data.localStore)));
});
},
put: function (k, v, cb) {
cb = cb || function () { };
lsUpdated[k] = v;
setTimeout(function () { data.localStore[k] = v; cb(); });
},
updated: lsUpdated,
store: data.localStore
};
window.cryptpadLanguage = data.language;
require(['/common/sframe-boot2.js'], function () { });
};