From a5a7259a23509164e7ca3bf92deff6aa23209538 Mon Sep 17 00:00:00 2001 From: anekos Date: Wed, 13 Jun 2012 16:11:13 +0900 Subject: Add some mappings (zh zw zz) --- PDF.js.js | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'PDF.js.js') diff --git a/PDF.js.js b/PDF.js.js index 92c7eea..58b4671 100644 --- a/PDF.js.js +++ b/PDF.js.js @@ -59,6 +59,8 @@ let INFO = let scrollCount = 1; + // Functions {{{ + function getScrollHeight (count) { let base = content.innerHeight / 10; if (count > 0) @@ -99,6 +101,10 @@ let INFO = return res; } + // }}} + + // Mappings {{{ + addMap( ['j'], 'Scroll Down', @@ -142,7 +148,41 @@ let INFO = } ); - commands.addUserCommand( + addMap( + ['zh'], + 'Fit to page.', + function (count) { + liberator.execute('pdfjs zoom page-fit'); + } + ); + + addMap( + ['zw'], + 'Fit to page to width.', + function (count) { + liberator.execute('pdfjs zoom page-width'); + } + ); + + addMap( + ['za'], + 'Fit to page to width.', + function (count) { + liberator.execute('pdfjs zoom auto'); + } + ); + + addMap( + ['zz'], + 'Fit to page to width.', + function (count) { + commandline.open('', 'pdfjs zoom ', modes.EX); + } + ); + + // }}} + + commands.addUserCommand( // {{{ ['pdfjs'], 'PDF.js', function () void 'Meow is best', @@ -205,7 +245,7 @@ let INFO = ] }, true - ); + ); // }}} })(); -- cgit v1.2.3