Jonas Jenwald
085e7a7a74
Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072)
...
By making use of modern CSS features, in this case [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables ), implementing sidebar resizing is actually quite simple. Not only will the amount of added code be fairly small, but it should also be easy to maintain since there's no need for complicated JavaScript hacks in order to update the CSS. Another benefit is that the JavaScript code doesn't need to make detailed assumptions about the exact structure of the HTML/CSS code.
Obviously this will not work in older browsers, such as IE, that lack support for CSS variables. In those cases sidebar resizing is simply disabled (via feature detection), and the resizing DOM element hidden, and the behaviour is thus *identical* to the current (fixed-width) sidebar.
However, considering the simplicity of the implementation, I really don't see why limiting this feature to "modern" browsers is a problem.
Finally, note that a few edge-cases meant that the patch is a bit larger than what the basic functionality would dictate. Among those is first of all proper RTL support, and secondly (automatic) resizing of the sidebar when the width of the *entire* viewer changes. Another, pre-existing, issue fixed here is the incomplete interface of `NullL10n`.
*Please note:* This patch has been successfully tested in both LTR and RTL viewer locales, in recent versions of Firefox and Chrome.
Fixes 2072.
2017-11-06 15:58:24 +01:00
Jonas Jenwald
d70263ced8
Enable the no-var
ESLint rule in the /web
folder
...
https://eslint.org/docs/rules/no-var
Please note that two files were excluded:
1. `web/debugger.js`, since there's code in other files that currently depend on the global availability of code in `web/debugger.js`. Furthermore, since that file isn't used in production, doing a ES6 conversion probably isn't a priority.
2. `web/grab_to_pan.js`, since that file could be considered to be "external" code. We have made smaller changes to that file over the years, however doing a full ES6 `class` conversion might be a step too far!?
2017-11-05 16:53:47 +01:00
Jonas Jenwald
ad0c1fb2c0
Use ES6 notation, and replace var
with let
, in web/pdf_viewer.component.js
and web/pdfjs.js
2017-11-05 16:53:47 +01:00
Tim van der Meij
2b70e68eba
Merge pull request #9104 from Snuffleupagus/es6-chromecom
...
ES6-ify the code in `web/chromecom.js`
2017-11-05 15:09:03 +01:00
Jonas Jenwald
730928a402
ES6-ify the code in web/chromecom.js
...
These changes consists mainly of replacing `var` with `let`.
2017-11-05 13:26:06 +01:00
Tim van der Meij
f87c16bcc4
Merge pull request #8993 from Snuffleupagus/sidebar-constant-position
...
Layout the sidebar in the same vertical position regardless of the viewer width (issue 4052, bug 850591)
2017-11-04 16:53:11 +01:00
Jonas Jenwald
99b62fe3d4
Merge pull request #9098 from xiemaisi/fix-lgtm-alerts
...
Fix issues found by lgtm
2017-11-04 13:03:19 +01:00
Max Schaefer
3ae37d1b06
Remove a few useless assignments.
2017-11-03 11:36:48 +00:00
Max Schaefer
bc8f673522
Remove spurious arguments to NullStream
constructor.
2017-11-03 10:14:32 +00:00
Max Schaefer
3ab1a9922a
Rearrange a few declarations so that they precede their uses.
2017-11-03 10:14:32 +00:00
Tim van der Meij
6521d2fd94
Merge pull request #9094 from Snuffleupagus/rm-TypedArray-polyfills
...
[api-major] Remove the TypedArray polyfills
2017-11-02 22:15:44 +01:00
Tim van der Meij
97f1152d1e
Merge pull request #9093 from Snuffleupagus/rm-web-compatibility
...
[api-major] Stop bundling, and also remove, the `web/compatibility.js` file in pdfjs-dist
2017-11-01 22:48:34 +01:00
Jonas Jenwald
2dbd3f2603
[api-major] Remove the TypedArray polyfills
2017-11-01 10:31:28 +01:00
Jonas Jenwald
f0c98a7ab0
[api-major] Stop bundling, and also remove, the web/compatibility.js
file in pdfjs-dist
...
As suggested in PR 8102.
2017-10-31 22:32:43 +01:00
Brendan Dahl
b46443f0c1
Merge pull request #9077 from yurydelendik/v2
...
Version 2.0 merge
2017-10-31 14:24:20 -07:00
Tim van der Meij
7d0fce7317
Merge pull request #9088 from Snuffleupagus/issue-9084
...
For non-embedded fonts, map softhyphen (0x00AD) to regular hyphen (0x002D) (issue 9084)
2017-10-31 21:19:17 +01:00
Jonas Jenwald
83e8398ff2
For non-embedded fonts, map softhyphen (0x00AD) to regular hyphen (0x002D) (issue 9084)
...
In the PDF file, the `ToUnicode` data first maps the hyphen correctly, and then *overwrites* it to point to the softhyphen instead. That one cannot be rendered in browsers, and an empty space thus appear instead.
Fixes 9084.
2017-10-31 13:26:04 +01:00
Jonas Jenwald
92fcfce685
Merge pull request #9082 from brendandahl/issue7562
...
Overwrite glyphs contour count if it's less than -1.
2017-10-30 20:44:01 +01:00
Yury Delendik
85f544f55a
Moves OperatorList and QueueOptimizer into separate file.
2017-10-30 13:29:58 -05:00
Brendan Dahl
17037b5e51
Overwrite glyphs contour count if it's less than -1.
...
The test pdf has a contour count of -70, but OTS doesn't
like values less than -1.
Fixes issue #7562 .
2017-10-30 09:16:51 -07:00
Yury Delendik
7fbc9dbdc3
Version 2.0
2017-10-30 08:18:25 -05:00
Jonas Jenwald
4e66c69d30
Update l10n files
2017-10-30 11:46:54 +01:00
Tim van der Meij
1294247d1b
Merge pull request #9078 from Snuffleupagus/eslint-lines-between-class-members
...
Update ESLint and enable the `lines-between-class-members` rule
2017-10-29 13:19:55 +01:00
Jonas Jenwald
8f9d548874
Update ESLint and enable the lines-between-class-members
rule
...
This rule will help aid readability in `class`es, please see https://eslint.org/docs/rules/lines-between-class-members .
2017-10-29 11:41:13 +01:00
Yury Delendik
b4e25fb2e8
Merge remote-tracking branch 'mozilla/version-2.0' into v2
2017-10-27 14:01:45 -05:00
Yury Delendik
985c700bd5
Merge pull request #9076 from yurydelendik/v1.10.88
...
Release 1.10.88
2017-10-27 12:26:51 -05:00
Yury Delendik
da0c9360fa
Release 1.10.88
2017-10-27 10:32:55 -05:00
Tim van der Meij
c62a19388a
Merge pull request #9072 from Snuffleupagus/more-stringToBytes
...
Use `stringToBytes` in more places
2017-10-26 23:20:53 +02:00
Jonas Jenwald
5e627810e4
Use stringToBytes
in more places
...
Rather than having (basically) verbatim copies of `stringToBytes` in a few places, we can simply use the helper function directly instead.
2017-10-26 11:01:13 +02:00
Jonas Jenwald
ad74f6e741
Merge pull request #9046 from Snuffleupagus/ccitt-jbig2-stream-refactor
...
Extract the actual decoding in `CCITTFaxStream` into a new `CCITTFaxDecoder` "class", which the new `CCITTFaxStream` depends on
2017-10-24 18:14:01 +02:00
Jonas Jenwald
e94a0fd4e7
Extract the actual decoding in CCITTFaxStream
into a new CCITTFaxDecoder
"class", which the new CCITTFaxStream
depends on
2017-10-24 16:03:08 +02:00
Jonas Jenwald
bb35095083
Move CCITTFaxStream
and Jbig2Stream
, from src/core/stream.js
, to separate files
2017-10-24 12:00:40 +02:00
Jonas Jenwald
d71a576b30
Merge pull request #9045 from brendandahl/sani-name
...
Sanitize name index in compile phase of CFF.
2017-10-24 11:48:03 +02:00
Brendan Dahl
6b12612a52
Sanitize name index in compile phase of CFF.
...
Fixes #8960
2017-10-23 17:13:49 -07:00
Yury Delendik
af0a8a64c0
Release 1.9 as stable.
2017-10-23 15:34:00 -05:00
Yury Delendik
725a2eb1e7
Merge pull request #8986 from yurydelendik/version-1.10
...
Version 1.10
2017-10-23 15:29:54 -05:00
Yury Delendik
bab420e7ec
Merge pull request #9061 from yurydelendik/eccn
...
Adds ECCN response statement
2017-10-23 13:40:14 -05:00
Yury Delendik
a7f0522821
Adds ECCN response statement
2017-10-23 13:31:36 -05:00
Jonas Jenwald
3ac4baff36
Update l10n files
2017-10-23 09:54:39 +02:00
Tim van der Meij
f6bebabbcb
Merge pull request #9057 from Snuffleupagus/es6-print-code
...
Use `let`/`const` instead of `var` in the printing code
2017-10-22 21:00:34 +02:00
Tim van der Meij
ef4a13534d
Merge pull request #9058 from Snuffleupagus/web-more-let
...
Replace a few occurences of `var` with `let` in already ES6 converted web/ files
2017-10-22 20:58:41 +02:00
Jonas Jenwald
b0f524e65c
Replace a few occurences of var
with let
in already ES6 converted web/ files
2017-10-22 16:23:38 +02:00
Jonas Jenwald
d14cb5eb27
Use let
/const
instead of var
in the printing code
2017-10-22 16:13:14 +02:00
Tim van der Meij
a0ec980e63
Merge pull request #9055 from Snuffleupagus/core-js-Number
...
Replace `Number` polyfills with the ones from core-js
2017-10-21 16:15:11 +02:00
Tim van der Meij
32aff7889a
Merge pull request #9054 from Snuffleupagus/core-js-Promise
...
Replace our `Promise` polyfill with the one from core-js
2017-10-21 16:14:16 +02:00
Tim van der Meij
a1d61a7502
Merge pull request #9052 from Snuffleupagus/issue-template-extension
...
Attempt to clarify the meaning of "extension" in the ISSUE_TEMPLATE
2017-10-21 14:24:44 +02:00
Jonas Jenwald
dbbb763eaf
Replace Number
polyfills with the ones from core-js
...
Since we're already using core-js elsewhere in `compatibility.js`, we can reduce the amount of code we need to maintain ourselves.
https://github.com/zloirock/core-js#ecmascript-6-number
2017-10-21 12:58:53 +02:00
Jonas Jenwald
8684aa0ee5
Replace our Promise
polyfill with the one from core-js
...
Since we're already using core-js elsewhere in `compatibility.js`, we can reduce the amount of code we need to maintain ourselves.
https://github.com/zloirock/core-js#ecmascript-6-promise
2017-10-21 12:51:14 +02:00
Jonas Jenwald
40466a85e0
Attempt to clarify the meaning of "extension" in the ISSUE_TEMPLATE
...
Based on a number of opened issues, it seems that the "Is an extension" field might be causing some confusion as to its meaning. Without providing too much detail, I'm still thinking that we could attempt to clarify that it's referring to either of the *browser* extensions.
2017-10-21 11:32:03 +02:00
Tim van der Meij
10fd590c09
Merge pull request #9032 from Snuffleupagus/nativeImageDecoderSupport-2.0
...
Simplify the check, and remove the warning, for the `nativeImageDecoderSupport` API parameter
2017-10-20 21:30:47 +02:00