forked from cory/tildefriends
Some plumbing for local storage for apps.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3864 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
a1d244567a
commit
42fcfee042
@ -418,6 +418,10 @@ function receive(message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log('error', message);
|
console.log('error', message);
|
||||||
|
} else if (message && message.action == "localStorageSet") {
|
||||||
|
window.localStorage.setItem('app:' + message.key, message.value);
|
||||||
|
} else if (message && message.action == "localStorageGet") {
|
||||||
|
send({message: 'localStorage', key: message.key, value: window.localStorage.getItem('app:' + message.key)});
|
||||||
} else if (message && message.action == "print") {
|
} else if (message && message.action == "print") {
|
||||||
console.log('app>', ...message.args);
|
console.log('app>', ...message.args);
|
||||||
} else if (message && message.action == "stats") {
|
} else if (message && message.action == "stats") {
|
||||||
@ -673,6 +677,8 @@ function connectSocket(path) {
|
|||||||
['setDocument', 'content'],
|
['setDocument', 'content'],
|
||||||
['postMessage', 'message'],
|
['postMessage', 'message'],
|
||||||
['error', 'error'],
|
['error', 'error'],
|
||||||
|
['localStorageSet', 'key', 'value'],
|
||||||
|
['localStorageGet', 'key'],
|
||||||
],
|
],
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ async function getProcessBlob(blobId, key, options) {
|
|||||||
}
|
}
|
||||||
process.eventHandlers[eventName].push(handler);
|
process.eventHandlers[eventName].push(handler);
|
||||||
},
|
},
|
||||||
'unregister': function(eventHandle, handler) {
|
'unregister': function(eventName, handler) {
|
||||||
if (process.eventHandlers[eventName]) {
|
if (process.eventHandlers[eventName]) {
|
||||||
let index = process.eventHandlers[eventName].indexOf(handler);
|
let index = process.eventHandlers[eventName].indexOf(handler);
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
|
Loading…
Reference in New Issue
Block a user