This will also store other data, like name and exposure level.
-if (!("picsorter_deleted" in localStorage)) {
- localStorage.picsorter_deleted = JSON.stringify({});
+var picinfo = {};
+if ("picsorter_picinfo" in localStorage) {
+ picinfo = JSON.parse(localStorage.picsorter_picinfo);
-var picsorter_deleted = JSON.parse(localStorage.picsorter_deleted);
+$.each(files, function(i, f) {
+ if (!(f in picinfo)) {
+ picinfo[f] = {};
+ }
+});
+localStorage.picsorter_picinfo = JSON.stringify(picinfo);
var exposure = 20;
var zoom = "sm/";
var exposure = 20;
var zoom = "sm/";
function move_to_nondeleted(direction) {
do {
input_index += direction;
function move_to_nondeleted(direction) {
do {
input_index += direction;
- } while (files[input_index] in picsorter_deleted);
+ } while (picinfo[files[input_index]].deleted);
say(input_index);
}
function mark_deleted() {
say(input_index);
}
function mark_deleted() {
- picsorter_deleted[files[input_index]] = 1;
- localStorage.picsorter_deleted = JSON.stringify(picsorter_deleted);
+ picinfo[files[input_index]].deleted = 1;
+ localStorage.picsorter_picinfo = JSON.stringify(picinfo);
say("Deleted");
}
function mark_not_deleted() {
say("Deleted");
}
function mark_not_deleted() {
- delete picsorter_deleted[files[input_index]];
- localStorage.picsorter_deleted = JSON.stringify(picsorter_deleted);
+ delete picinfo[files[input_index]].deleted;
+ localStorage.picsorter_picinfo = JSON.stringify(picinfo);