diff --git a/WebKit/scripts/helper/Core.js b/WebKit/scripts/helper/Core.js index b85d6b0..8e26c1e 100644 --- a/WebKit/scripts/helper/Core.js +++ b/WebKit/scripts/helper/Core.js @@ -533,7 +533,15 @@ function(jQuery, Paths, URI, HostApp, Cache) { post += blob_string; post += "\r\n--" + boundary + "--\r\n"; - Paths.postMultipart(url.toString(), callback, post, boundary); + var newCallback = function(resp) { + if (resp.status == 403) { + var err = JSON.parse(resp.responseText); + HostApp.alertTitleWithMessage(resp.statusText, err.error); + } + callback(resp); + } + + Paths.postMultipart(url.toString(), newCallback, post, boundary); } Core.prototype.remove = function(id, callback) { diff --git a/WebKit/scripts/helper/HostApp.js b/WebKit/scripts/helper/HostApp.js index 0d2ddcf..29358cf 100644 --- a/WebKit/scripts/helper/HostApp.js +++ b/WebKit/scripts/helper/HostApp.js @@ -46,6 +46,15 @@ define(function() { } } + HostApp.openAuthorizationURL = function(url) { + + if (OS_TYPE == "mac") { + controller.openURL_(url); + } else { + controller.openAuthorizationURL(url); + } + } + HostApp.loggedIn = function() { controller.loggedIn(); } @@ -103,9 +112,9 @@ define(function() { HostApp.alertTitleWithMessage = function(title, message) { if (OS_TYPE == "mac") { - controller.alertTitle_withMessage_(message); + controller.alertTitle_withMessage_(title, message); } else { - controller.alertTitleWithMessage(message); + controller.alertTitleWithMessage(title, message); } } diff --git a/WebKit/scripts/helper/Paths.js b/WebKit/scripts/helper/Paths.js index ae4dab1..3b7cf71 100644 --- a/WebKit/scripts/helper/Paths.js +++ b/WebKit/scripts/helper/Paths.js @@ -101,7 +101,7 @@ function(jQuery, HostApp, Hmac, Cache) { data: data, processData: false, error: function(xhr, ajaxOptions, thrownError) { - console.error("postMultipart " + xhr.statusText + " (" + url + "): '" + xhr.responseText + "'"); + console.error("postMultipart (" + xhr.status + ")" + xhr.statusText + " (" + url + "): '" + xhr.responseText + "'"); } }); }