Added [P] hotkey for selecting first post on page

This commit is contained in:
Marcin Kurczewski 2013-11-16 22:02:18 +01:00
parent 04e9bad79e
commit 6582b395d2
2 changed files with 2 additions and 0 deletions

View file

@ -240,4 +240,5 @@ $(function()
Mousetrap.bind('s', function() { $('body,html').animate({scrollTop: '+=150px'}, 200); }); Mousetrap.bind('s', function() { $('body,html').animate({scrollTop: '+=150px'}, 200); });
Mousetrap.bind('a', function() { var url = $('.paginator:visible .prev:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); Mousetrap.bind('a', function() { var url = $('.paginator:visible .prev:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup');
Mousetrap.bind('d', function() { var url = $('.paginator:visible .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup'); Mousetrap.bind('d', function() { var url = $('.paginator:visible .next:not(.disabled) a').attr('href'); if (typeof url !== 'undefined') window.location.href = url; }, 'keyup');
Mousetrap.bind('p', function() { $('.post a').eq(0).focus(); return false; }, 'keyup');
}); });

View file

@ -11,6 +11,7 @@
<li>scroll up/down: <code>[W]</code><span class="comma">, </span><code>[S]</code></li> <li>scroll up/down: <code>[W]</code><span class="comma">, </span><code>[S]</code></li>
<li>go to newer/older post or page: <code>[A]</code><span class="comma">, </span><code>[D]</code></li> <li>go to newer/older post or page: <code>[A]</code><span class="comma">, </span><code>[D]</code></li>
<li>edit post: <code>[E]</code></li> <li>edit post: <code>[E]</code></li>
<li>focus first post in post list: <code>[P]</code></li>
</ul> </ul>
<h1>Search syntax</h1> <h1>Search syntax</h1>