From f541b776ea706bcc9c2edc938a2425aa33db5639 Mon Sep 17 00:00:00 2001 From: jmoenig Date: Tue, 17 Sep 2013 10:37:17 +0200 Subject: fixed #119, #149 accessing a shared projects requires lowercasing the username - this is now automatically taken care of --- cloud.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'cloud.js') diff --git a/cloud.js b/cloud.js index 243fad5..480c4f9 100644 --- a/cloud.js +++ b/cloud.js @@ -29,7 +29,7 @@ /*global modules, IDE_Morph, SnapSerializer, hex_sha512, alert, nop*/ -modules.cloud = '2013-May-10'; +modules.cloud = '2013-September-17'; // Global stuff @@ -579,6 +579,18 @@ Cloud.prototype.parseResponse = function (src) { return ans; }; +Cloud.prototype.parseDict = function (src) { + var dict = {}; + if (!src) {return dict; } + src.split("&").forEach(function (entry) { + var pair = entry.split("="), + key = decodeURIComponent(pair[0]), + val = decodeURIComponent(pair[1]); + dict[key] = val; + }); + return dict; +}; + Cloud.prototype.encodeDict = function (dict) { var str = '', pair, @@ -589,7 +601,7 @@ Cloud.prototype.encodeDict = function (dict) { pair = encodeURIComponent(key) + '=' + encodeURIComponent(dict[key]); - if (pair.length > 0) { + if (str.length > 0) { str += '&'; } str += pair; -- cgit v1.3.1