]>
git.scottworley.com Git - picsort/blob - picsorter.js
1d42b018b2eafc9e981af3e9d2f4d5abb539d5ff
1 if (!("picsorter_deleted" in localStorage
)) {
2 localStorage
.picsorter_deleted
= JSON
.stringify({});
4 var picsorter_deleted
= JSON
.parse(localStorage
.picsorter_deleted
);
13 $("#pic").attr("src", zoom
+ exposure
+ "/" + files
[input_index
]);
16 function toggle_zoom() {
25 function move_to_nondeleted(direction
) {
27 input_index
+= direction
;
28 } while (files
[input_index
] in picsorter_deleted
);
31 function mark_deleted() {
32 picsorter_deleted
[files
[input_index
]] = 1;
33 localStorage
.picsorter_deleted
= JSON
.stringify(picsorter_deleted
);
36 function mark_not_deleted() {
37 delete picsorter_deleted
[files
[input_index
]];
38 localStorage
.picsorter_deleted
= JSON
.stringify(picsorter_deleted
);
45 Mousetrap
.bind('z', toggle_zoom
);
46 Mousetrap
.bind('Z', function() { $("#pic").toggleClass("fit_view"); });
47 Mousetrap
.bind('n', function() { move_to_nondeleted(1); setpic(); });
48 Mousetrap
.bind('p', function() { move_to_nondeleted(-1); setpic(); });
49 Mousetrap
.bind('N', function() { input_index
++; setpic(); });
50 Mousetrap
.bind('P', function() { input_index
--; setpic(); });
51 Mousetrap
.bind('b', function() { exposure
++; setpic(); });
52 Mousetrap
.bind('d', function() { exposure
--; setpic(); });
53 Mousetrap
.bind('x', mark_deleted
);
54 Mousetrap
.bind('X', mark_not_deleted
);