]>
git.scottworley.com Git - picsort/blob - picsorter.js
808855bcbb83477dc76d0e7bf93b40f1dd5eeecd
2 if ("picsorter_picinfo" in localStorage
) {
3 picinfo
= JSON
.parse(localStorage
.picsorter_picinfo
);
5 $.each(files
, function(i
, f
) {
10 localStorage
.picsorter_picinfo
= JSON
.stringify(picinfo
);
18 $("#pic").attr("src", zoom
+ exposure
+ "/" + files
[input_index
]);
21 function say(message
) {
22 $("#message").text(message
).removeClass("fade");
23 setTimeout(function() { $("#message").addClass("fade"); }, 1);
26 function toggle_zoom() {
35 function move_to_nondeleted(direction
) {
37 input_index
+= direction
;
38 } while (picinfo
[files
[input_index
]].deleted
);
43 function mark_deleted() {
44 picinfo
[files
[input_index
]].deleted
= 1;
45 localStorage
.picsorter_picinfo
= JSON
.stringify(picinfo
);
49 function mark_not_deleted() {
50 delete picinfo
[files
[input_index
]].deleted
;
51 localStorage
.picsorter_picinfo
= JSON
.stringify(picinfo
);
55 function change_exposure(amount
) {
58 var display_exposure
= (exposure
/ 4) - 3.5;
59 say((display_exposure
>= 0 ? "+" : "") + display_exposure
);
63 move_to_nondeleted(1);
66 Mousetrap
.bind('z', toggle_zoom
);
67 Mousetrap
.bind('Z', function() { $("#pic").toggleClass("fit_view"); });
68 Mousetrap
.bind('n', function() { move_to_nondeleted(1); });
69 Mousetrap
.bind('p', function() { move_to_nondeleted(-1); });
70 Mousetrap
.bind('N', function() { input_index
++; say(input_index
); setpic(); });
71 Mousetrap
.bind('P', function() { input_index
--; say(input_index
); setpic(); });
72 Mousetrap
.bind('b', function() { change_exposure(1); });
73 Mousetrap
.bind('d', function() { change_exposure(-1); });
74 Mousetrap
.bind('x', mark_deleted
);
75 Mousetrap
.bind('X', mark_not_deleted
);