From: Scott Worley Date: Wed, 5 Mar 2014 07:18:04 +0000 (-0800) Subject: 'i' to show Info (number, name) for current pic X-Git-Url: http://git.scottworley.com/picsort/commitdiff_plain/52c0fe1e6ae207a7520aa731d5c3d21f5dde2a0c 'i' to show Info (number, name) for current pic --- diff --git a/picsorter.js b/picsorter.js index 084831c..9229442 100644 --- a/picsorter.js +++ b/picsorter.js @@ -54,6 +54,9 @@ function say(message) { $("#message").text(message).removeClass("fade"); setTimeout(function() { $("#message").addClass("fade"); }, 1); } +function announce() { + say(input_index + " " + (picinfo[files[input_index]].name || "")); +} function toggle_zoom() { if (zoom) { @@ -83,7 +86,7 @@ function move_by_filter(direction, filter) { } } input_index = new_index; - say(input_index + " " + (picinfo[files[input_index]].name || "")); + announce(); setpic(); } function move(direction) { @@ -193,6 +196,7 @@ Mousetrap.bind(['d', 'j'], function() { change_exposure(-1); }); Mousetrap.bind('x', mark_deleted); Mousetrap.bind('X', mark_not_deleted); Mousetrap.bind('r', rotate); +Mousetrap.bind('i', announce); Mousetrap.bind('f', function() { say(files[input_index]); }); Mousetrap.bind('c', function() { $("#name").show().focus(); return false; }); Mousetrap.bind('C', function() { if (last_name) { set_name(last_name); } });