Commit 59781d1c authored by Ivan Tyagov's avatar Ivan Tyagov

Typos.

parent 7e8c50e6
// SafeJS add ons
function makeid() { function makeid() {
var text = ""; var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
...@@ -10,6 +12,7 @@ function makeid() { ...@@ -10,6 +12,7 @@ function makeid() {
// when handling the response from the global environment back to the sandbox // when handling the response from the global environment back to the sandbox
var callbackRegistry = {}; var callbackRegistry = {};
// a global variable that holds current gadget, this is bad as it's shared
var selfGadget = {}; var selfGadget = {};
...@@ -21,7 +24,6 @@ function registerCallback(callback, id) { ...@@ -21,7 +24,6 @@ function registerCallback(callback, id) {
var communicate = function(id, selector, callback) { var communicate = function(id, selector, callback) {
var callId = makeid(); var callId = makeid();
registerCallback(callback, callId); registerCallback(callback, callId);
postMessage({ postMessage({
command: 'masterAndCommander', command: 'masterAndCommander',
data: { data: {
...@@ -46,7 +48,7 @@ var handleGadgetResponse = function(data) { ...@@ -46,7 +48,7 @@ var handleGadgetResponse = function(data) {
for(var i in data.selectors) { for(var i in data.selectors) {
selectors[data.selectors[i]] = selectorProxy(data.selectors[i]); selectors[data.selectors[i]] = selectorProxy(data.selectors[i]);
}; };
if(callback) { if(callback) {
callback(proxy); callback(proxy);
} }
...@@ -62,11 +64,10 @@ function selectorProxy(selector, id) { ...@@ -62,11 +64,10 @@ function selectorProxy(selector, id) {
}; };
// Async get gadget by id. out of renderjs for now. needs refactorings // Async get gadget by id. out of renderjs for now. needs refactorings
function asyncGetGadgetById(id, callback) { function asyncGetGadgetById(id, callback) {
var callId = makeid(); var callId = makeid();
registerCallback(callback, callId); registerCallback(callback, callId);
postMessage({ postMessage({
command: 'getGadgetById', command: 'getGadgetById',
data: { data: {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment