Commit Graph

10210 Commits

Author SHA1 Message Date
Jonas Jenwald
ece24dfe61 Merge pull request #8302 from timvandermeij/es6-attachments-outline
Convert the attachments/outline view to ES6 syntax
2017-04-23 16:57:00 +02:00
Tim van der Meij
93520172f6
Convert the attachments/outline view to ES6 syntax 2017-04-23 16:06:15 +02:00
Tim van der Meij
0e8f020e2e Merge pull request #8323 from Snuffleupagus/importl10n-beta
Change the `importl10n` script to use the Beta channel, since Aurora is being removed
2017-04-22 19:50:05 +02:00
Jonas Jenwald
9e9676e54e Update l10n files 2017-04-22 16:29:37 +02:00
Jonas Jenwald
57cd52303a Change the importl10n script to use the Beta channel, since Aurora is being removed
Since the Aurora channel is being removed, and is no longer going to be receiving updates (with the possible exception of security bugs), we need to change the target for the `gulp importl10n` command.

For more information, please refer to:
 - https://groups.google.com/forum/#!topic/firefox-dev/q4Eb5nEcfSg
 - https://hacks.mozilla.org/2017/04/simplifying-firefox-release-channels/
 - https://mozilla.github.io/process-releases/draft/development_overview/
 - http://release.mozilla.org/firefox/release/2017/04/17/Dawn-Project-FAQ.html
2017-04-22 16:24:52 +02:00
Tim van der Meij
96cb599e93 Merge pull request #8322 from Snuffleupagus/rm-window-FirefoxCom
[Firefox addon] Remove the `window.FirefoxCom` hack from `web/viewer.js`, since it was made redunant by the `setExternalLocalizerServices` refactoring (PR 7202 follow-up)
2017-04-21 00:15:10 +02:00
Jonas Jenwald
c44fd3d6e2 Merge pull request #8321 from Snuffleupagus/issue-8263
Change `getPDFFileNameFromURL` to ignore `data:` URLs for performance reasons (issue 8263)
2017-04-20 19:46:29 +02:00
Jonas Jenwald
7bd8b97dba Change PDFAttachmentViewer to only open PDF attachments in the viewer, instead of downloading them, when PDFJS.disableCreateObjectURL = false
This prevents issues with the filename detection being skipped, when trying to download the opened PDF attachment, since `getPDFFileNameFromURL` ignores `data:` URLs for performance reasons.
2017-04-20 18:21:41 +02:00
Jonas Jenwald
84472b30ee Change getPDFFileNameFromURL to ignore data: URLs for performance reasons (issue 8263)
The patch also changes the `defaultFilename` to use the ES6 default parameter notation, and fixes the formatting of the JSDoc comment.

Finally, since `getPDFFileNameFromURL` currently has no unit-tests, a few basic ones are added to avoid regressions.
2017-04-20 18:21:27 +02:00
Jonas Jenwald
d76f299b6b [Firefox addon] Remove the window.FirefoxCom hack from web/viewer.js, since it was made redundant by the setExternalLocalizerServices re-factoring (PR 7202 follow-up)
After PR 7202, there are no remaining references to `FirefoxCom` in the `/extensions/firefox/tools/l10n.js` file.
2017-04-20 17:23:30 +02:00
Jonas Jenwald
3888a993b1 Remove the URL checks in the createObjectURL utility function, since the URL polyfill have made them redundant
Also, this changes `createBlob` to throw when `Blob` isn't supported.
2017-04-20 10:16:06 +02:00
Tim van der Meij
2928578164 Merge pull request #8313 from Snuffleupagus/bug-1346616
[Firefox addon] Upstream changes from: Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales
2017-04-19 23:20:08 +02:00
Tim van der Meij
93f345483a Merge pull request #8315 from Snuffleupagus/rm-signchromium
Remove the `signchromium` target from `make.js`
2017-04-19 23:18:00 +02:00
Jonas Jenwald
a77130a0c2 Remove the signchromium target from make.js
According to the IRC discussion starting at http://logs.glob.uno/?c=mozilla%23pdfjs&s=18+Apr+2017&e=18+Apr+2017#c59676, and in particular http://logs.glob.uno/?c=mozilla%23pdfjs&s=18+Apr+2017&e=18+Apr+2017#c59682, this build target is unused and can thus be removed.
2017-04-19 23:13:16 +02:00
Jonas Jenwald
3b59169ffc [Firefox addon] Upstream changes from: Bug 1346616 - Migrate callsites that are retrieving requested locale from pref, to use LocaleService::GetRequestedLocales
With [bug 1346616](https://bugzilla.mozilla.org/show_bug.cgi?id=1346616) and [this commit](https://hg.mozilla.org/mozilla-central/rev/39a903b099a6#l7.2), it's apparently no longer recommended to check the `general.useragent.locale` pref directly, but instead the `Services.locale.getRequestedLocale()` function should be used.

In this case, it's at least really easy to feature detect this properly :-)
2017-04-18 23:34:48 +02:00
Jonas Jenwald
19321937da Merge pull request #8312 from yurydelendik/mv-dist-gulpfile
Moves dist and minifiedpost tragets from make.js.
2017-04-18 21:31:58 +02:00
Yury Delendik
bc20181a1e Merge pull request #8311 from Snuffleupagus/bug-1356569
[Firefox addon] Upstream changes from: Bug 1356569 - Remove optional trailing parameters (issue 8310)
2017-04-18 14:19:21 -05:00
Yury Delendik
1d30cea914 Moves dist and minifiedpost tragets from make.js. 2017-04-18 14:00:53 -05:00
Jonas Jenwald
cf87c9bba2 [Firefox addon] Upstream changes from: Bug 1356569 - Remove optional trailing parameters (issue 8310)
In https://bugzilla.mozilla.org/show_bug.cgi?id=1355216, the *third* parameter of `Services.obs.addObserver` was made optional.
However, omitting it in Firefox versions *without* that patch causes failures that completely prevents the addon from working (it won't even load).

As far as I can tell, there isn't *any* way to detect ahead of time if the third parameter can be safely omitted, hence we're forced to fallback to manually checking the version number :-(

*Note:* Since the `PdfJs.jsm` file is only used in the `MOZCENTRAL` build, we at least don't need to add any compatibility hacks there.
2017-04-18 20:51:17 +02:00
Vladimir Bloshchitsyn
319ea0f350 Allow use versions for pdf.js script (i.e. - pdf.js?2412313) 2017-04-18 15:07:09 +03:00
Yury Delendik
5ad3611cc4 Merge pull request #8300 from Snuffleupagus/GENERIC-DownloadManager-creation
Refactor the `DownloadManager` initialization in `GENERIC`/`CHROME` builds again (PR 8203 follow-up)
2017-04-17 07:34:13 -05:00
Yury Delendik
7812b3cfb2 Merge pull request #8299 from Snuffleupagus/domEvents-getGlobalEventBus-import
Import `getGlobalEventBus` correctly from `web/dom_events.js` in various `/web` files, to un-break e.g. the viewer components (PR 8203 follow-up)
2017-04-17 07:32:04 -05:00
Jonas Jenwald
594e8c05ef Refactor the DownloadManager initialization in GENERIC/CHROME builds again (PR 8203 follow-up)
In the first commit in PR 8203, I changed how the `DownloadManager` was included/initialized in `GENERIC`/`CHROME` builds.
The change was prompted by the fact that you cannot have conditional `import`s with ES6 modules, and I wanted to avoid bundling the general `DownloadManager` into the various Firefox specific build targets.

What I completely missed though, is that the new code meant that `download_manager.js` will now be pulling in the *entire* viewer (through `app.js`).
This is a *really* stupid mistake on my part, since it causes the `dist/build/pdf_viewer.js` used with the viewer components to now include basically the entire default viewer.

The simplest solution that I could come up with, is to add a `genericcom.js` file (similar to the `firefoxcom.js`/`chromecom.js` files) which will be responsible for importing/initializing the `DownloadManager`.
2017-04-17 13:34:30 +02:00
Jonas Jenwald
79e0745a12 Import getGlobalEventBus correctly from web/dom_events.js in various /web files, to un-break e.g. the viewer components (PR 8203 follow-up)
In PR 8203, I somehow managed to mess up the import of `getGlobalEventBus` in *all* files where it's present; my sincere apologies for this!
2017-04-17 00:54:29 +02:00
Tim van der Meij
bd0e4dc4e3 Merge pull request #8297 from timvandermeij/es6-find-bar
Convert the find bar to ES6 syntax
2017-04-16 23:46:25 +02:00
Jonas Jenwald
009d91d735 Merge pull request #8296 from timvandermeij/es6-document-properties
Convert the document properties to ES6 syntax
2017-04-16 23:17:47 +02:00
Tim van der Meij
6f6fb4dfd0
Convert the find bar to ES6 syntax 2017-04-16 23:12:11 +02:00
Tim van der Meij
6d7a0ff8f2
Convert the document properties to ES6 syntax 2017-04-16 16:42:57 +02:00
Tim van der Meij
228df572d2 Merge pull request #8294 from Snuffleupagus/es6-modules-src-display
Convert the files in the `/src/display` folder to ES6 modules
2017-04-16 16:24:34 +02:00
Tim van der Meij
3eb51f1272 Merge pull request #8295 from Snuffleupagus/web-createPromiseCapability
Use `createPromiseCapability` in `/web` files and avoid unnecessary `PDFPageView.setPdfPage` calls
2017-04-16 15:47:26 +02:00
Jonas Jenwald
10592a311a Merge pull request #8293 from timvandermeij/es6-password-prompt
Convert the password prompt to ES6 syntax
2017-04-16 15:38:24 +02:00
Tim van der Meij
dfd338a399
Remove the password prompt input type hack
The browsers have become smarter and made this hack no longer
functional. Since this is now enforced by practically all browsers,
there is nothing more we can do about this. It is up to the user to
serve the viewer over HTTPS or deal with the warning.

Note that this is in no way specific for PDF.js. Any site with password
inputs served over HTTP has this problem right now. This hack was
provided as a convenience for the users, but nothing more than that.
2017-04-16 15:17:23 +02:00
Tim van der Meij
e3796f6f41
Convert the password prompt to ES6 syntax 2017-04-16 15:17:23 +02:00
Jonas Jenwald
fce2cfddcf Check if pageView.pdfPage exists in PDFViewer._ensurePdfPageLoaded, to avoid potentially calling PDFPageView.setPdfPage multiple times for the same page
Since calling `PDFPageView.setPdfPage` will in turn call `PDFPageView.reset`, which cancels all rendering and completely resets the page, it's thus possible that we currently cause some unnecessary re-rendering during the initial loading phase of the viewer.

Depending on the order in which data arrives, it's possible (and in practice always seem to happen) that the `pdfPage` property of the *second* page has already been set during `PDFViewer.setDocument`, by the time that the request for the `pdfPage` is resolved in `PDFViewer._ensurePdfPageLoaded`.

Also, note how the `setPdfPage` call in `PDFViewer.setDocument` is already guarded by this kind of check.
2017-04-16 13:42:45 +02:00
Jonas Jenwald
b0a4f6de8f Use createPromiseCapability in /web files
In various viewer files, there's a number of cases where we basically duplicate the functionality of `createPromiseCapability` manually.
As far as I can tell, a couple of these cases have existed for a very long time, and notable even before the `createPromiseCapability` utility function existed.

Also, since we can write ES6 code now, the patch also replaces a couple of `bind` usages with arrow functions in code that's touched in the patch.
2017-04-16 12:45:24 +02:00
Jonas Jenwald
52e3de3c0a Convert the files in the /src/display folder to ES6 modules
Also disables ES2015 transpilation in development mode.
2017-04-16 12:19:10 +02:00
Tim van der Meij
c6e8ca863e Merge pull request #8291 from Snuffleupagus/pr-8157
Ensure that `PDFThumbnailView.draw` is able to handle `RenderingCancelledException` correctly (PR 8157 follow-up)
2017-04-15 20:17:03 +02:00
Jonas Jenwald
db6f2f3718 Ensure that PDFThumbnailView.draw is able to handle RenderingCancelledException correctly (PR 8157 follow-up)
In PR 8157, I embarrassingly enough forgot to change `pdf_thumbnail_view.js` to match the changes made to `pdf_page_view.js`.
2017-04-15 11:12:48 +02:00
Tim van der Meij
27c3c33eec Merge pull request #8288 from yurydelendik/mv-make-web
Moves 'web' target to the gulpfile.
2017-04-15 00:03:29 +02:00
Yury Delendik
f8b3b75e42 Merge pull request #8289 from timvandermeij/firefox-extension-cleanup
Firefox extension: remove unused preference cleanup from `bootstrap.js`
2017-04-14 17:00:59 -05:00
Yury Delendik
89df5ef033 Moves 'web' target to the gulpfile. 2017-04-14 16:57:53 -05:00
Tim van der Meij
e7a3ea29aa
Firefox extension: remove unused preference cleanup from bootstrap.js
The comment for the removal has been added three years ago, so we can
safely remove this now.
2017-04-14 23:49:01 +02:00
Jonas Jenwald
fd51a7cb8c Merge pull request #8287 from yurydelendik/babel-es2015-preset
Allow to convert (some of) ES6 code to ES5.
2017-04-14 21:47:45 +02:00
Yury Delendik
5855c0a8be Allow to convert (some of) ES6 code to ES5. 2017-04-14 14:39:25 -05:00
Jonas Jenwald
bc1f4dd9c8 Merge pull request #8285 from yurydelendik/webcjspath
Change amd to cjs path in ES6 modules
2017-04-14 18:35:39 +02:00
Yury Delendik
f6d4de9898 Merge pull request #8283 from yurydelendik/uint32arrayview
Moves Uint32ArrayView and hasCanvasTypedArrays into compatibility.js.
2017-04-14 10:39:21 -05:00
Yury Delendik
5feb2a253f Merge pull request #8286 from mozilla/package-version
Changing package.json version to 1.0.0
2017-04-14 10:37:26 -05:00
Yury Delendik
3b36a1709a Changing package.json version to 1.0.0
We are changing how we are structuring the src file -- it makes sense to create a "major" release.
2017-04-14 10:36:42 -05:00
Yury Delendik
8e681ce3e2 Change amd to cjs path in ES6 modules 2017-04-14 10:32:36 -05:00
Yury Delendik
30bee9fe0c Moves Uint32ArrayView and hasCanvasTypedArrays into compatibility.js. 2017-04-14 10:04:52 -05:00