]>
git.scottworley.com Git - picsort/blob - picsorter.js
ae4c8377453caa1c1d80d6456b8d3d4de6dbd572
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
);
15 move_to_nondeleted(1);
19 $("#pic").attr("src", zoom
+ exposure
+ "/" + files
[input_index
]);
22 function say(message
) {
23 $("#message").text(message
).removeClass("fade");
24 setTimeout(function() { $("#message").addClass("fade"); }, 1);
27 function say_exposure() {
28 var e
= (exposure
/ 4) - 3.5;
29 say((e
>= 0 ? "+" : "") + e
);
32 function toggle_zoom() {
41 function move_to_nondeleted(direction
) {
43 input_index
+= direction
;
44 } while (picinfo
[files
[input_index
]].deleted
);
48 function mark_deleted() {
49 picinfo
[files
[input_index
]].deleted
= 1;
50 localStorage
.picsorter_picinfo
= JSON
.stringify(picinfo
);
54 function mark_not_deleted() {
55 delete picinfo
[files
[input_index
]].deleted
;
56 localStorage
.picsorter_picinfo
= JSON
.stringify(picinfo
);
64 Mousetrap
.bind('z', toggle_zoom
);
65 Mousetrap
.bind('Z', function() { $("#pic").toggleClass("fit_view"); });
66 Mousetrap
.bind('n', function() { move_to_nondeleted(1); setpic(); });
67 Mousetrap
.bind('p', function() { move_to_nondeleted(-1); setpic(); });
68 Mousetrap
.bind('N', function() { input_index
++; say(input_index
); setpic(); });
69 Mousetrap
.bind('P', function() { input_index
--; say(input_index
); setpic(); });
70 Mousetrap
.bind('b', function() { exposure
++; say_exposure(); setpic(); });
71 Mousetrap
.bind('d', function() { exposure
--; say_exposure(); setpic(); });
72 Mousetrap
.bind('x', mark_deleted
);
73 Mousetrap
.bind('X', mark_not_deleted
);