From 01b91756b0e838144176351d2b0484d5ee3ef88e Mon Sep 17 00:00:00 2001 From: Rob Garrison Date: Sun, 11 Oct 2015 13:32:55 -0500 Subject: Include non-keypad keys for font-resize. Fixes #8 --- src/bookmarklet/iframe.html | 6 +++--- src/chrome/popup.html | 6 +++--- src/printliminator.js | 18 ++++++++++++------ 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/bookmarklet/iframe.html b/src/bookmarklet/iframe.html index 1e3be6c..23e298f 100644 --- a/src/bookmarklet/iframe.html +++ b/src/bookmarklet/iframe.html @@ -29,9 +29,9 @@ Find previous box inside same wrapper EnterRemove the highlighted box BackspaceUndo last action - Numpad +Increase font-size by 1 - NumPad -Decrease font-size by 1 - NumPad *Reset font-size + Numpad + or + Increase font-size by 1 + NumPad - or -Decrease font-size by 1 + NumPad * or *Reset font-size Alt + Remove everything but highlighted box diff --git a/src/chrome/popup.html b/src/chrome/popup.html index 896ba5b..bc23855 100644 --- a/src/chrome/popup.html +++ b/src/chrome/popup.html @@ -108,15 +108,15 @@ n - + + + + - - + - - - * + * * diff --git a/src/printliminator.js b/src/printliminator.js index db7cfba..4a45338 100644 --- a/src/printliminator.js +++ b/src/printliminator.js @@ -85,9 +85,12 @@ var pl = window.thePrintliminator = { prevSib : 37, // left arrow hide : 13, // enter undo : 8, // backspace - fontUp : 107, // Numpad + - fontDown : 109, // Numpad - - fontReset : 106, // Numpad * + fontUp1 : 107, // Numpad + + fontUp2 : 187, // = (unshifted +) + fontDown1 : 109, // Numpad - + fontDown2 : 189, // - + fontReset1: 106, // Numpad * + fontReset2: 56, // 8 (unshifted *) print : 44, // PrtScn (keyup only) abort : 27, // Esc @@ -351,21 +354,24 @@ var pl = window.thePrintliminator = { suffix = n.match( /[a-z]+/i )[0]; switch ( event.which ) { - case pl.keys.fontUp : // Numpad + = Increase font size + case pl.keys.fontUp1 : // Numpad + = Increase font size + case pl.keys.fontUp2 : // = (unshifted +) body.style.fontSize = ( parseFloat( n ) + 1 ) + suffix; // @if MODE='EXT' pl.showMessage( msg.fontUp + body.style.fontSize ); // @endif break; - case pl.keys.fontDown : // Numpad - = Decrease font size + case pl.keys.fontDown1 : // Numpad - = Decrease font size + case pl.keys.fontDown2 : // - body.style.fontSize = ( parseFloat( n ) - 1 ) + suffix; // @if MODE='EXT' pl.showMessage( msg.fontDown + body.style.fontSize ); // @endif break; - case pl.keys.fontReset : // Numpad * = reset font-size + case pl.keys.fontReset1 : // Numpad * = reset font-size + case pl.keys.fontReset2 : // 8 (unshifted *) body.style.fontSize = ''; // @if MODE='EXT' pl.showMessage( msg.fontReset ); -- cgit v1.2.3