added error message if attachments are not allowed
This commit is contained in:
parent
e5704ddda7
commit
80728df815
3 changed files with 21 additions and 4 deletions
|
@ -533,7 +533,15 @@ function(jQuery, Paths, URI, HostApp, Cache) {
|
||||||
post += blob_string;
|
post += blob_string;
|
||||||
post += "\r\n--" + boundary + "--\r\n";
|
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) {
|
Core.prototype.remove = function(id, callback) {
|
||||||
|
|
|
@ -46,6 +46,15 @@ define(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HostApp.openAuthorizationURL = function(url) {
|
||||||
|
|
||||||
|
if (OS_TYPE == "mac") {
|
||||||
|
controller.openURL_(url);
|
||||||
|
} else {
|
||||||
|
controller.openAuthorizationURL(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HostApp.loggedIn = function() {
|
HostApp.loggedIn = function() {
|
||||||
controller.loggedIn();
|
controller.loggedIn();
|
||||||
}
|
}
|
||||||
|
@ -103,9 +112,9 @@ define(function() {
|
||||||
|
|
||||||
HostApp.alertTitleWithMessage = function(title, message) {
|
HostApp.alertTitleWithMessage = function(title, message) {
|
||||||
if (OS_TYPE == "mac") {
|
if (OS_TYPE == "mac") {
|
||||||
controller.alertTitle_withMessage_(message);
|
controller.alertTitle_withMessage_(title, message);
|
||||||
} else {
|
} else {
|
||||||
controller.alertTitleWithMessage(message);
|
controller.alertTitleWithMessage(title, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ function(jQuery, HostApp, Hmac, Cache) {
|
||||||
data: data,
|
data: data,
|
||||||
processData: false,
|
processData: false,
|
||||||
error: function(xhr, ajaxOptions, thrownError) {
|
error: function(xhr, ajaxOptions, thrownError) {
|
||||||
console.error("postMultipart " + xhr.statusText + " (" + url + "): '" + xhr.responseText + "'");
|
console.error("postMultipart (" + xhr.status + ")" + xhr.statusText + " (" + url + "): '" + xhr.responseText + "'");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue