]> git.scottworley.com Git - picsort/blobdiff - picsorter.js
'n' and 'p' for next and previous input image
[picsort] / picsorter.js
index 9a1b1c11b678be42e1ba71fb85ec69ec6a9686d0..3fd9e2840f6d68d840ed002e274ee6f5567096e2 100644 (file)
@@ -1,9 +1,14 @@
 var exposure = 20;
+var input_index = 0;
 
-function setpic(pic) {
-  $("#pic")[0].src = exposure + "/" + pic;
+function setpic() {
+  $("#pic").attr("src", exposure + "/" + files[input_index]);
 }
 
 $(function() {
-  setpic(files[0]);
+  setpic();
 });
+
+Mousetrap.bind('z', function() { $("#pic").toggleClass("fit_view"); });
+Mousetrap.bind('n', function() { input_index ++; setpic(); });
+Mousetrap.bind('p', function() { input_index --; setpic(); });