]>
git.scottworley.com Git - picsort/blob - picsorter.js
d3f50ccdf5701a68a6372bd3dc199860cb1bfdd1
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 say(message
) {
17 $("#message").text(message
).removeClass("fade");
18 setTimeout(function() { $("#message").addClass("fade"); }, 1);
21 function say_exposure() {
22 var e
= (exposure
/ 4) - 3.5;
23 say((e
>= 0 ? "+" : "") + e
);
26 function toggle_zoom() {
35 function move_to_nondeleted(direction
) {
37 input_index
+= direction
;
38 } while (files
[input_index
] in picsorter_deleted
);
42 function mark_deleted() {
43 picsorter_deleted
[files
[input_index
]] = 1;
44 localStorage
.picsorter_deleted
= JSON
.stringify(picsorter_deleted
);
48 function mark_not_deleted() {
49 delete picsorter_deleted
[files
[input_index
]];
50 localStorage
.picsorter_deleted
= JSON
.stringify(picsorter_deleted
);
58 Mousetrap
.bind('z', toggle_zoom
);
59 Mousetrap
.bind('Z', function() { $("#pic").toggleClass("fit_view"); });
60 Mousetrap
.bind('n', function() { move_to_nondeleted(1); setpic(); });
61 Mousetrap
.bind('p', function() { move_to_nondeleted(-1); setpic(); });
62 Mousetrap
.bind('N', function() { input_index
++; say(input_index
); setpic(); });
63 Mousetrap
.bind('P', function() { input_index
--; say(input_index
); setpic(); });
64 Mousetrap
.bind('b', function() { exposure
++; say_exposure(); setpic(); });
65 Mousetrap
.bind('d', function() { exposure
--; say_exposure(); setpic(); });
66 Mousetrap
.bind('x', mark_deleted
);
67 Mousetrap
.bind('X', mark_not_deleted
);