|
|
|
@ -86,7 +86,21 @@ function openTrackingHistory(code) {
|
|
|
|
|
infocontext.history[i].date = timestampToDateTimeString(infocontext.history[i].date);
|
|
|
|
|
infocontext.history[i].status = trackingStatusToNiceString(infocontext.history[i].status, true);
|
|
|
|
|
}
|
|
|
|
|
// TODO: format timestamps as local time
|
|
|
|
|
|
|
|
|
|
// Keep last five tracking codes in history
|
|
|
|
|
var history = localStorage.getItem("trackingcodehistory");
|
|
|
|
|
if (history == null) {
|
|
|
|
|
history = [];
|
|
|
|
|
} else {
|
|
|
|
|
history = JSON.parse(history);
|
|
|
|
|
}
|
|
|
|
|
if (infocontext.code != "") {
|
|
|
|
|
history.push(infocontext.code);
|
|
|
|
|
}
|
|
|
|
|
while (history.length > 5) {
|
|
|
|
|
history.shift();
|
|
|
|
|
}
|
|
|
|
|
localStorage.setItem("trackingcodehistory", JSON.stringify(history));
|
|
|
|
|
|
|
|
|
|
if (refresh) {
|
|
|
|
|
router.navigate("/toolbox/track/info", {
|
|
|
|
@ -150,7 +164,7 @@ $("#trackbtn").click(function () {
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("input[name=trackingcode]").on('keypress', function (e) {
|
|
|
|
|
if (e.which == 13) {
|
|
|
|
|
if (event.key === "Enter") {
|
|
|
|
|
$("#trackbtn").click();
|
|
|
|
|
}
|
|
|
|
|
});
|