Improve save notifications for TiddlySpot

This commit is contained in:
Jermolene
2013-11-26 12:50:40 +00:00
parent d96f85ac83
commit 42fce1929c
4 changed files with 13 additions and 4 deletions
+6 -2
View File
@@ -21,7 +21,7 @@ var UploadSaver = function(wiki) {
this.wiki = wiki;
};
UploadSaver.prototype.save = function(text) {
UploadSaver.prototype.save = function(text,callback) {
// Get the various parameters we need
var backupDir = ".",
username = this.wiki.getTextReference("$:/UploadName"),
@@ -56,7 +56,11 @@ UploadSaver.prototype.save = function(text) {
http.setRequestHeader("Content-Type","multipart/form-data; ;charset=UTF-8; boundary=" + boundary);
http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
window.alert(http.responseText);
if(http.responseText.trim() === "0 - Fileindex.html") {
callback(null);
} else {
callback(http.responseText);
}
}
};
http.send(data);