aboutsummaryrefslogtreecommitdiffstats
path: root/PDF.js.js
diff options
context:
space:
mode:
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
- );
+ ); // }}}
})();