Commit Graph

1764 Commits

Author SHA1 Message Date
Yury Delendik
185a1f45e7 Fixes AMD name in the web/pdf_viewer.js. 2016-05-16 12:01:29 -05:00
Yury Delendik
1c0433586e Merge pull request #7315 from McGiogen/bug-usestrict-compatibilityjs
Solving issue #7307, 'use strict' context in compatibility.js
2016-05-12 15:18:43 -05:00
Gioele Masini
1c96cb8862 Added context to compatibility.js to have 'use strict' directive in our context only 2016-05-12 10:04:51 +02:00
Yury Delendik
b261203018 Merge pull request #7317 from yurydelendik/move-defaultprefs
Moves DEFAULT_PREFENCES into JSON format.
2016-05-11 18:05:20 -05:00
Yury Delendik
df10513e10 Moves DEFAULT_PREFENCES into JSON format. 2016-05-11 17:58:17 -05:00
Tim van der Meij
f4ae277355 Convert the secondary toolbar to a class 2016-05-11 20:53:39 +02:00
Jonas Jenwald
69cf8c5fb3 Merge pull request #7289 from yurydelendik/double-pagechange
Disable pagechange event if page is not changing.
2016-05-10 16:38:55 +02:00
Jonas Jenwald
aa9ba43fa1 Merge pull request #7306 from yurydelendik/enable-debugger
Enables debugger only when needed.
2016-05-10 16:19:49 +02:00
Yury Delendik
a4c81c203b Enables debugger only when needed. 2016-05-09 18:18:43 -05:00
Rob Wu
fc658a718c Remove streamsPrivate usage
This was only ever useful for the Opera extension because the API
requires a whitelisted extension ID. Opera ditched PDF.js from their
extension gallery, so we don't need to keep this in the tree.
2016-05-09 22:49:47 +02:00
Jonas Jenwald
b13b78388b Prevent intermittent "Node was not found" errors when removing the zoomLayer in PDFPageView_draw
I've seen the above error occasionally when the scale is updated many times in quick succession, but I've not been able to pinpoint exactly why it happens.
Since the error isn't caught, this means that the `pageViewDrawCallback` function doesn't run to completion.

Unfortunately, given the very intermittent nature of the issue, I haven't got any good STR for reliably reproducing this issue. However, I hope that this patch can be accepted anyway, since it's simple and should help prevent unnecessary errors.
2016-05-08 16:03:17 +02:00
Rob Wu
057b4615ba Update grab_to_pan.js
See b81897bee4
2016-05-07 23:46:56 +02:00
Yury Delendik
9f68e3f1bc Disable pagechange event if page is not changing. 2016-05-04 11:06:07 -05:00
Yury Delendik
8adddf031c Merge pull request #7242 from Snuffleupagus/bug-1194700
[Bug 1194700] Ensure that the `customScaleOption` is hidden in e10s
2016-05-03 07:06:43 -05:00
Yury Delendik
32ce369d88 Fixes some static analysis warnings and recommendations
* Useless conditional
* Superfluous trailing arguments
* Useless assignment to local variable
* Misspelled identifier
* JSDoc tag for non-existent parameter
2016-05-02 17:34:58 -05:00
Yury Delendik
d20002b6b1 Merge pull request #7273 from Snuffleupagus/issue-7270
Prevent "Prefixed Fullscreen API is deprecated." warnings in the MOZCENTRAL version (issue 7270)
2016-04-29 10:37:11 -05:00
Jonas Jenwald
9dd6017901 Prevent "Prefixed Fullscreen API is deprecated." warnings in the MOZCENTRAL version (issue 7270)
We're already, since quite some time, using the standard Fullscreen API provided that it's available in the browser. The warning is only caused by the code that checks if the Fullscreen API is supported.

This patch uses a simple preprocessor tag to avoid the warning, since I'm assuming that in general, we want to try and remain backwards compatible with the prefixed versions of the Fullscreen API.

Fixes 7270.
2016-04-29 17:28:24 +02:00
Yury Delendik
4a2c76a34f Adds pre and post UI control change events. 2016-04-29 10:05:04 -05:00
Jonas Jenwald
4968ac7cea Merge pull request #7266 from yurydelendik/secondary
Removes circular dependency of secondary toolbar on app.js.
2016-04-29 11:18:59 +02:00
Yury Delendik
eb3d1ca003 Removes circular dependency of secondary toolbar on app.js. 2016-04-28 15:04:09 -05:00
Yury Delendik
5f883d763f Better components examples. 2016-04-28 13:30:03 -05:00
Jonas Jenwald
61a4c740d2 Merge pull request #7254 from yurydelendik/eventbus
Introducing EventBus for the viewer UI.
2016-04-28 15:19:49 +02:00
Yury Delendik
3e6e294fd4 Refactors PDFFindBar and FirefoxCom find events. 2016-04-28 07:11:40 -05:00
Yury Delendik
7fd3db9977 Adds EventBus. 2016-04-28 06:57:24 -05:00
Yury Delendik
5568a19ee3 Moves bundle target/task to gulpfile.js 2016-04-24 08:37:39 -05:00
Yury Delendik
3132941948 Removes app.js dependency on mozPrintCallback_polyfill.js. 2016-04-24 08:25:55 -05:00
Yury Delendik
3b21b51716 Refactors preferences and PDF opening related chromecom code. 2016-04-24 08:25:55 -05:00
Yury Delendik
148102b626 Refactors firefoxcom dependency on app and l10n. 2016-04-24 08:25:55 -05:00
Yury Delendik
81fc46e666 Refactors FindController dependencies. 2016-04-24 08:25:55 -05:00
Jonas Jenwald
9d7d95ead4 [Bug 1194700] Ensure that the customScaleOption is hidden in e10s
When Firefox is run in e10s mode, which will soon be the default, the PDF.js zoom dropdown menu doesn't look right. This is apparently because the `<select>` DOM element is rendered in the parent, and that all the necessary style information isn't sent up from the child. See the discussion in https://bugzilla.mozilla.org/show_bug.cgi?id=910022.

Besides this causing the PDF.js UI to *look* worse in e10s, notably it also means that the `customScaleOption` isn't hidden like it ought to be.
To work-around that, this patch utilizes the `hidden` attribute, since https://bugzilla.mozilla.org/show_bug.cgi?id=1242450 at least made that work in e10s.

Fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1194700.
2016-04-23 15:57:51 +02:00
Yury Delendik
b6c74f2056 Moves all document.getElementById lookups into viewer.js 2016-04-21 11:39:11 -05:00
Tim van der Meij
2b7137ba0a Convert the password prompt to a class
Furthermore we introduce two new methods named `setCallback` and
`setReason` so external code does not change the properties of the class
directly. Finally we update various names of properties and methods to
be more self-explanatory.
2016-04-21 14:06:10 +02:00
Tim van der Meij
b0aca31de8 Convert the hand tool to a class 2016-04-16 19:20:37 +02:00
Jonas Jenwald
7f90f5bfed Merge pull request #7206 from Snuffleupagus/viewer-expose-non-classes-on-PDFViewerApplication
Expose a few non-classes on `PDFViewerApplication`
2016-04-16 16:43:22 +02:00
Jonas Jenwald
9dfda2b908 Expose a few non-classes on PDFViewerApplication
With the recent PR 7172, which made the viewer modular, there's now a couple of modules that are no longer easily accessible (e.g. through the console).
This can make testing/debugging more difficult, and means that e.g. https://github.com/mozilla/pdf.js/wiki/Debugging-PDF.js#enabling no longer works in the generic viewer.

For now, as a simple solution, this patch just exposes those non-classes on `PDFViewerApplication` to ensure that they are available, and to avoid polluting the `window` scope.
2016-04-16 16:23:21 +02:00
Ankit Aggarwal
6ceda3f290 web/viewer.js: Persist the state of sidebar
Persist the state of content sidebar while browsing away from viewer and
initializing the same on returning back to the viewer. The state is saved
in persistent store preferences and used upon viewer initialization.

Fixes #6935
2016-04-16 10:17:42 +02:00
Jonas Jenwald
5657d082c7 Dispatch a sidebarviewchanged event in PDFSidebar when the view changes
We cannot piggy-back on the `updateviewarea` event in order to update the stored sidebar state, since there're a number of cases where opening/switching the sidebar view won't fire a `updateviewarea` event.
Note that `updateviewarea` only fires when the position changes in the *viewer*, which means that it won't fire if e.g. the viewer is narrow, such that the sidebar overlays the document transparently; or when switching views, without the document position also changing.

This patch also moves the handling of `forceOpen` parameter in `PDFSidebar_switchView`, to prevent triggering back-to-back rendering and dispatching of events.
2016-04-16 10:10:28 +02:00
Jonas Jenwald
c98f25145f Export the DefaultAnnotationLayerFactory to prevent the viewer components from breaking (PR 7172 followup) 2016-04-13 17:42:04 +02:00
Yury Delendik
50fe8e7c75 Removes PDFView global and pagerender event support. 2016-04-13 10:11:43 -05:00
Yury Delendik
4165cedc9f Replace pdfjsLib with module that represents pdf.js. 2016-04-13 10:11:34 -05:00
Yury Delendik
006e8fb59d Introduces UMD headers to the web/ folder. 2016-04-13 10:09:48 -05:00
Jonas Jenwald
514210814d Prevent the *entire* viewer from zooming, when quickly switching from scrolling to zooming using the mousewheel (PR 7097 followup)
This is a regression from PR 7097.

(Also, out of scope for this PR, but I think that a `setTimeout` value of `1000 ms` is too large. Switching from scrolling to zooming can fell sluggish, and give the impression that nothing happens.)
2016-04-07 21:04:52 +02:00
Brendan Dahl
f351eb23aa Merge pull request #7097 from prometheansacrifice/zoom-due-to-scroll-inertia
Prevents document zooming if still scrolling and meta keys pressed (Issue #7022)
2016-04-07 11:52:10 -07:00
Yury Delendik
1e3e14e6b2 Exposes all functional members via lib exports and use them in viewer. 2016-04-07 13:46:07 -05:00
Yury Delendik
1d12aed5ca Move all PDFJS.xxx settings into display/global. 2016-04-07 13:46:07 -05:00
Manas
6878d7c6d3 Disables zooming when the stream of events that don't have meta/ctrl
keys active at the outset, for 1000ms
2016-04-07 22:18:46 +05:30
Yury Delendik
313b418a20 Prepare viewer.js for async loading and module separation. 2016-04-01 10:29:44 -05:00
Yury Delendik
b371785fbb Rename web/viewer.js -> web/app.js 2016-04-01 10:27:16 -05:00
Tobias Schneider
708895ffba Let print canvas height scale proportionally 2016-03-21 14:21:07 -07:00
Tobias Schneider
aeabd0db20 Fix insertion of blank pages during printing due to non-matching page sizes 2016-03-21 14:21:07 -07:00