aboutsummaryrefslogtreecommitdiffstats
path: root/PDF.js.js
diff options
context:
space:
mode:
authoranekos2012-06-13 16:11:13 +0900
committeranekos2012-06-13 20:04:28 +0900
commita5a7259a23509164e7ca3bf92deff6aa23209538 (patch)
tree7f21644c9c4bde632c1fbcf42c33a23a19d6ac86 /PDF.js.js
parent5561a2c419b14905b5ff984a9be2e0e7f76c3bc2 (diff)
downloadvimperator-plugins-a5a7259a23509164e7ca3bf92deff6aa23209538.tar.bz2
Add some mappings (zh zw zz)
Diffstat (limited to 'PDF.js.js')
-rw-r--r--PDF.js.js44
1 files changed, 42 insertions, 2 deletions
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
- );
+ ); // }}}
})();