From 978a22c5a514501ec4115772b8023d96fdcb77ad Mon Sep 17 00:00:00 2001 From: Pieter de Bie Date: Fri, 12 Sep 2008 22:17:31 +0200 Subject: [PATCH] Add 'v' as a shortcut to show large diffs --- PBCommitList.m | 2 +- html/commit.js | 2 +- html/keyboardNavigation.js | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/PBCommitList.m b/PBCommitList.m index cafe583..67d446d 100644 --- a/PBCommitList.m +++ b/PBCommitList.m @@ -22,7 +22,7 @@ else [webView scrollPageDown: self]; } - else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jk"]].location == 0) + else if ([character rangeOfCharacterFromSet:[NSCharacterSet characterSetWithCharactersInString:@"jkv"]].location == 0) [webController sendKey: character]; else [super keyDown: event]; diff --git a/html/commit.js b/html/commit.js index d333812..87de52d 100644 --- a/html/commit.js +++ b/html/commit.js @@ -72,7 +72,7 @@ var loadCommit = function() { if (commit.diff.length < 10000) { showDiffs(); } else { - $("details").innerHTML = "This is a large commit. Click here to show the diff."; + $("details").innerHTML = "This is a large commit. Click here or press 'v' to view."; } scroll(0, 0); diff --git a/html/keyboardNavigation.js b/html/keyboardNavigation.js index 6367e26..671be3d 100644 --- a/html/keyboardNavigation.js +++ b/html/keyboardNavigation.js @@ -10,7 +10,10 @@ var handleKeys = function(event) { return changeHunk(true); else if (event.keyCode == 75) return changeHunk(false); - + else if (event.keyCode == 86) {// 'v' + showDiffs(); + return false; + } return true; } @@ -19,6 +22,8 @@ var handleKeyFromCocoa = function(key) { changeHunk(true); else if (key == 'k') changeHunk(false); + else if (key == 'v') + showDiffs(); } var changeHunk = function(next) {