summaryrefslogtreecommitdiff
path: root/cloud.js
diff options
context:
space:
mode:
authorjmoenig <jens@moenig.org>2013-04-02 14:01:42 +0200
committerjmoenig <jens@moenig.org>2013-04-02 14:01:42 +0200
commit84fd877fa483d986a9651b7d5555455cce978cae (patch)
treebb36ebf2d24033add6d7da83b012cb3f9fcd1f6e /cloud.js
parentf05104ee6765ba25b503323a172c5a6365c32466 (diff)
downloadsnap-84fd877fa483d986a9651b7d5555455cce978cae.tar.gz
snap-84fd877fa483d986a9651b7d5555455cce978cae.zip
Project Sharing / Unsharing Support (frontend)
Support for publishing and un-publishing projects in the cloud (not yet live in the current production version of the cloud backend)
Diffstat (limited to 'cloud.js')
-rw-r--r--cloud.js28
1 files changed, 23 insertions, 5 deletions
diff --git a/cloud.js b/cloud.js
index ebe17d7..86964b6 100644
--- a/cloud.js
+++ b/cloud.js
@@ -29,7 +29,7 @@
/*global modules, IDE_Morph, SnapSerializer, hex_sha512, alert, nop*/
-modules.cloud = '2013-March-22';
+modules.cloud = '2013-April-02';
// Global stuff
@@ -82,6 +82,10 @@ Cloud.prototype.signup = function (
+ email,
true
);
+ request.setRequestHeader(
+ "Content-Type",
+ "application/x-www-form-urlencoded"
+ );
request.withCredentials = true;
request.onreadystatechange = function () {
if (request.readyState === 4) {
@@ -127,6 +131,10 @@ Cloud.prototype.connect = function (
(this.hasProtocol() ? '' : 'http://') + this.url,
true
);
+ request.setRequestHeader(
+ "Content-Type",
+ "application/x-www-form-urlencoded"
+ );
request.withCredentials = true;
request.onreadystatechange = function () {
if (request.readyState === 4) {
@@ -318,7 +326,10 @@ Cloud.prototype.callURL = function (url, callBack, errorCall) {
try {
request.open('GET', url, true);
request.withCredentials = true;
- request.setRequestHeader('Content-Type', 'text/plain');
+ request.setRequestHeader(
+ "Content-Type",
+ "application/x-www-form-urlencoded"
+ );
request.setRequestHeader('MioCracker', this.session);
request.onreadystatechange = function () {
if (request.readyState === 4) {
@@ -355,11 +366,15 @@ Cloud.prototype.callService = function (
postDict;
if (!this.session) {
- errorCall.call('You are not connected', 'Cloud');
+ errorCall.call(null, 'You are not connected', 'Cloud');
return;
}
if (!service) {
- errorCall.call('service ' + serviceName + ' is not available', 'API');
+ errorCall.call(
+ null,
+ 'service ' + serviceName + ' is not available',
+ 'API'
+ );
return;
}
if (args && args.length > 0) {
@@ -371,7 +386,10 @@ Cloud.prototype.callService = function (
try {
request.open(service.method, service.url, true);
request.withCredentials = true;
- request.setRequestHeader('Content-Type', 'text/plain');
+ request.setRequestHeader(
+ "Content-Type",
+ "application/x-www-form-urlencoded"
+ );
request.setRequestHeader('MioCracker', this.session);
request.onreadystatechange = function () {
if (request.readyState === 4) {