From e284a28aba64f1e84364388062108a170bff37ba Mon Sep 17 00:00:00 2001 From: Nick Sergeant Date: Wed, 15 Feb 2012 00:49:55 -0500 Subject: [PATCH] Crazy keyboard stuff. --- snipt/media/cache/snipt.css | 2 +- snipt/media/cache/snipt.js | 15 ++++++++++++++ snipt/media/css/style.scss | 2 +- snipt/media/js/src/modules/site.js | 15 ++++++++++++++ .../snipts/templates/snipts/tags-public.html | 1 - snipt/templates/base.html | 20 +++++++++++++++++++ 6 files changed, 52 insertions(+), 3 deletions(-) diff --git a/snipt/media/cache/snipt.css b/snipt/media/cache/snipt.css index 18fa054..77fd77a 100644 --- a/snipt/media/cache/snipt.css +++ b/snipt/media/cache/snipt.css @@ -1182,7 +1182,7 @@ div.modal .modal-header h4 { margin-top: 1px; } div#keyboard-shortcuts { - max-height: 501px; } + max-height: 590px; } div#keyboard-shortcuts table { margin-bottom: 0; } diff --git a/snipt/media/cache/snipt.js b/snipt/media/cache/snipt.js index 906d287..ef9d4fb 100644 --- a/snipt/media/cache/snipt.js +++ b/snipt/media/cache/snipt.js @@ -988,6 +988,21 @@ jQuery(function($) { $document.bind('keydown', 'h', function(e) { $el.trigger('showKeyboardShortcuts'); }); + $document.bind('keydown', 'Shift+h', function(e) { + window.location = '/'; + }); + $document.bind('keydown', 't', function(e) { + window.open('', '_blank'); + }); + $document.bind('keydown', 'r', function(e) { + location.reload(true); + }); + $document.bind('keydown', 'Ctrl+h', function(e) { + history.go(-1); + }); + $document.bind('keydown', 'Ctrl+l', function(e) { + history.go(1); + }); $('input').bind('keydown', 'esc', function(e) { e.preventDefault(); this.blur(); diff --git a/snipt/media/css/style.scss b/snipt/media/css/style.scss index f3bd436..9570573 100644 --- a/snipt/media/css/style.scss +++ b/snipt/media/css/style.scss @@ -808,7 +808,7 @@ div.modal { } } div#keyboard-shortcuts { - max-height: 501px; + max-height: 590px; table { margin-bottom: 0; diff --git a/snipt/media/js/src/modules/site.js b/snipt/media/js/src/modules/site.js index 7525852..9f37408 100644 --- a/snipt/media/js/src/modules/site.js +++ b/snipt/media/js/src/modules/site.js @@ -61,6 +61,21 @@ $document.bind('keydown', 'h', function(e) { $el.trigger('showKeyboardShortcuts'); }); + $document.bind('keydown', 'Shift+h', function(e) { + window.location = '/'; + }); + $document.bind('keydown', 't', function(e) { + window.open('', '_blank'); + }); + $document.bind('keydown', 'r', function(e) { + location.reload(true); + }); + $document.bind('keydown', 'Ctrl+h', function(e) { + history.go(-1); + }); + $document.bind('keydown', 'Ctrl+l', function(e) { + history.go(1); + }); $('input').bind('keydown', 'esc', function(e) { e.preventDefault(); this.blur(); diff --git a/snipt/snipts/templates/snipts/tags-public.html b/snipt/snipts/templates/snipts/tags-public.html index fce8f4f..f825b9f 100644 --- a/snipt/snipts/templates/snipts/tags-public.html +++ b/snipt/snipts/templates/snipts/tags-public.html @@ -7,5 +7,4 @@ {% endfor %} - View all » diff --git a/snipt/templates/base.html b/snipt/templates/base.html index 00c60c4..7e8ee21 100644 --- a/snipt/templates/base.html +++ b/snipt/templates/base.html @@ -164,6 +164,26 @@ G Scroll to bottom of page + + <ctrl-h> + Back + + + <ctrl-l> + Forward + + + H + Go home + + + t + Open new window/tab + + + r + Refresh page + n Next page