Improved keyboard shortcuts in post upload

This commit is contained in:
Marcin Kurczewski 2014-10-18 15:37:04 +02:00
parent 3f93aaa652
commit 1610659910
3 changed files with 11 additions and 3 deletions

1
TODO
View file

@ -2,7 +2,6 @@ This is transient file that lists functionalities to be implemented before
first major release. first major release.
- autocomplete: don't show items that are already used in tag list (unsure) - autocomplete: don't show items that are already used in tag list (unsure)
- posts/upload: better hotkeys for going to next post
- posts/upload: ability to paste many urls (unsure) - posts/upload: ability to paste many urls (unsure)
- posts/listing: add buttons for toggling safety - posts/listing: add buttons for toggling safety
- posts: fix empty edit snapshots when changing only thumbnail content - posts: fix empty edit snapshots when changing only thumbnail content

View file

@ -2,6 +2,14 @@ var App = App || {};
App.Keyboard = function(mousetrap) { App.Keyboard = function(mousetrap) {
var oldStopCallback = mousetrap.stopCallback;
mousetrap.stopCallback = function(e, element, combo, sequence) {
if (combo.indexOf('ctrl') !== -1) {
return false;
}
return oldStopCallback.apply(mousetrap, arguments);
}
function keyup(key, callback) { function keyup(key, callback) {
unbind(key); unbind(key);
mousetrap.bind(key, callback, 'keyup'); mousetrap.bind(key, callback, 'keyup');

View file

@ -54,8 +54,9 @@ App.Presenters.PostUploadPresenter = function(
$el.find('.url-handler button').click(urlHandlerButtonClicked); $el.find('.url-handler button').click(urlHandlerButtonClicked);
$el.find('thead th.checkbox').click(postTableSelectAllCheckboxClicked); $el.find('thead th.checkbox').click(postTableSelectAllCheckboxClicked);
keyboard.keyup('a', selectPrevPostTableRow); keyboard.keydown('ctrl+up', selectPrevPostTableRow);
keyboard.keyup('d', selectNextPostTableRow); keyboard.keydown('ctrl+down', selectNextPostTableRow);
keyboard.keyup('q', tagInput.focus);
$el.find('.remove').click(removeButtonClicked); $el.find('.remove').click(removeButtonClicked);
$el.find('.move-up').click(moveUpButtonClicked); $el.find('.move-up').click(moveUpButtonClicked);