diff options
author | anekos | 2012-06-13 16:11:13 +0900 |
---|---|---|
committer | anekos | 2012-06-13 20:04:28 +0900 |
commit | a5a7259a23509164e7ca3bf92deff6aa23209538 (patch) | |
tree | 7f21644c9c4bde632c1fbcf42c33a23a19d6ac86 | |
parent | 5561a2c419b14905b5ff984a9be2e0e7f76c3bc2 (diff) | |
download | vimperator-plugins-a5a7259a23509164e7ca3bf92deff6aa23209538.tar.bz2 |
Add some mappings (zh zw zz)
-rw-r--r-- | PDF.js.js | 44 |
1 files changed, 42 insertions, 2 deletions
@@ -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 - ); + ); // }}} })(); |