Marked as 0.2.9

This commit is contained in:
Wu Cheng-Han
2015-06-01 18:04:25 +08:00
parent 4e64583a0b
commit f7f8c901f4
33 changed files with 2972 additions and 242 deletions

View File

@@ -47,7 +47,7 @@ function saveHistoryToStorage(notehistory) {
if (store.enabled)
store.set('notehistory', JSON.stringify(notehistory));
else
saveHistoryToCookie(notehistory);
saveHistoryToStorage(notehistory);
}
function saveHistoryToCookie(notehistory) {
@@ -146,11 +146,14 @@ function writeHistoryToServer(view) {
} catch (err) {
var notehistory = [];
}
if(!notehistory)
notehistory = [];
var newnotehistory = generateHistory(view, notehistory);
saveHistoryToServer(newnotehistory);
})
.fail(function () {
writeHistoryToCookie(view);
writeHistoryToStorage(view);
});
}
@@ -160,7 +163,9 @@ function writeHistoryToCookie(view) {
} catch (err) {
var notehistory = [];
}
if(!notehistory)
notehistory = [];
var newnotehistory = generateHistory(view, notehistory);
saveHistoryToCookie(newnotehistory);
}
@@ -174,6 +179,9 @@ function writeHistoryToStorage(view) {
var notehistory = data;
} else
var notehistory = [];
if(!notehistory)
notehistory = [];
var newnotehistory = generateHistory(view, notehistory);
saveHistoryToStorage(newnotehistory);
} else {
@@ -241,7 +249,7 @@ function getServerHistory(callback) {
}
})
.fail(function () {
getCookieHistory(callback);
getStorageHistory(callback);
});
}
@@ -282,7 +290,7 @@ function parseServerToHistory(list, callback) {
}
})
.fail(function () {
parseCookieToHistory(list, callback);
parseStorageToHistory(list, callback);
});
}