Tim van der Meij
d7aa95d6b1
Merge pull request #5857 from Rob--W/print-page-size
...
Set page size via @page + size
2015-05-14 16:52:40 +02:00
Tim van der Meij
39d5031832
Merge pull request #5989 from Snuffleupagus/updateviewarea-location
...
Add the |location| to the |updateviewarea| UI event
2015-05-14 13:14:34 +02:00
Yury Delendik
00f3756d02
Merge pull request #5867 from Snuffleupagus/pdfViewer-pages-private
...
Change |pages| to be a "private" property of |PDFViewer|
2015-05-11 12:33:59 -05:00
Jonas Jenwald
ba0eb7fdc6
Add the |location| to the |updateviewarea| UI event
...
*This patch addresses an issue I stumbled upon while working on rewriting the history implementation.*
Currently the `updateviewarea` UI event doesn't include the `location`, and in the event handler in viewer.js we instead reach into `PDFViewer` to retrieve it. Not only does this seem conceptually wrong, it also makes the `updateviewarea` event less useful in general since it's currently only possible to access the `location` if you have a reference to the `PDFViewer`.
To me, this simply appears to be an oversight in the implementation, hence this patch which adds `location` to the `updateviewarea` event. It also changes `location` to be a "private" property of `PDFViewer`.
2015-05-08 12:15:50 +02:00
David Flanagan
ae740768b0
Bug 1152841 - make pdf.js viewer app handle open requests from file viewers
2015-05-05 01:04:45 +02:00
Tim van der Meij
12be47c57c
Merge pull request #5598 from CodingFabian/chrome39-range-disable
...
Disable Range Support for Chrome 39+40 (#5512 )
2015-04-30 22:31:50 +02:00
Fabian Lange
1d4758dadf
Disable Range Support for Chrome 39+40 ( #5512 )
...
Disabling Range Support for Chrome 39 and 40, due to regression in
Chromium. https://crbug.com/442318
2015-04-29 23:25:58 +02:00
Tim van der Meij
6f3024f366
Merge pull request #5977 from Snuffleupagus/pr-5966-followup
...
Prevent Firefox from warning about |unreachable code after return statement|
2015-04-29 21:28:47 +02:00
Tim van der Meij
6159da0598
Merge pull request #5828 from Rob--W/mozCurrentTransform-fix
...
Fix flaw in mozCurrentTransform polyfill
2015-04-29 19:27:02 +02:00
Jonas Jenwald
66b12974c9
Prevent Firefox from warning about |unreachable code after return statement|
...
*This is a follow-up to PR 5966.*
Now that https://bugzilla.mozilla.org/show_bug.cgi?id=1151931 has landed, we're unfortunately in a situation where Firefox warns about `unreachable code after return statement` multiple times when using the PDF.js code in `node make server` mode.
I'm really sorry about the churn in this code!
However I don't think it's a good idea to let Firefox continue to printing these warnings in the console, since it increases the risk of missing actual errors.
2015-04-29 19:26:05 +02:00
Tim van der Meij
080ab204d6
Merge pull request #5953 from Snuffleupagus/issue-3498
...
Remove no longer needed hacks that enable spacebar scrolling in Firefox (issue 3498)
2015-04-27 19:10:49 +02:00
Tim van der Meij
c91f736db7
Merge pull request #5966 from Snuffleupagus/lint-viewer-preprocesser-code
...
Enable linting of Firefox specific code in viewer.js
2015-04-27 18:59:55 +02:00
Tim van der Meij
6abf3d6ba3
Simplify document properties field logic
...
This patch:
- Simplifies the way fields are passed to the document properties overlay
- Simplifies the way fields are filled internally in the document properties overlay
- Avoids passing a document properties reference to the secondary toolbar
2015-04-27 15:25:40 +02:00
Jonas Jenwald
91ce16bc1d
Enable linting of Firefox specific code in viewer.js
...
- This patch uncomments a large portion of the Firefox specific code in viewer.js, by using a preprocessor "trick", to enable linting. Doing this actually uncovered some issues, e.g. variables defined multiple times.
- This patch also fixes a spelling error, `adobe pdfwritter` -> `abobe pdfwriter`, in the `KNOWN_GENERATORS` list used when reporting telemetry data in Firefox.
*Please note:* there's still some Firefox specific code that is commented out, but it's usually just one (or two) lines of code. Hence the risk that errors creep in should be much lower, compared to entire code-blocks.
2015-04-26 19:52:09 +02:00
Tim van der Meij
1a5de56675
Group public/private methods and add comments
...
This patch:
- Puts public methods at the top of the file
- Puts private methods below the public methods and marks them with an underscore
- Adds JSDoc comments to the class
- Adds setDocumentAndUrl to avoid having to handle that in `viewer.js`
2015-04-26 15:50:28 +02:00
Tim van der Meij
7cf440c560
Refactor PDFDocumentProperties to be more class-like
2015-04-24 20:47:38 +02:00
Tim van der Meij
ca8f842d87
Rename DocumentProperties to PDFDocumentProperties
2015-04-24 20:35:11 +02:00
Jonas Jenwald
b1c4b85d4f
Change |pages| to be a "private" property of |PDFViewer|
...
As suggested by yurydelendik: http://logs.glob.uno/?c=mozilla%23pdfjs&s=30+Sep+2014&e=30+Sep+2014&h=4150#c26119 , this patch renames `pages` -> `_pages` to indicate that it's a "private" property.
Accessing pages from outside `PDFViewer` should instead be done by using `getPageView`.
2015-04-21 22:40:11 +02:00
Jonas Jenwald
10f134bcc2
Remove no longer needed hacks that enable spacebar scrolling in Firefox (issue 3498)
...
Now that [bug 915962](https://bugzilla.mozilla.org/show_bug.cgi?id=915962 ) has landed, we no longer need any hacks to enable <kbd>spacebar</kbd> scrolling in Firefox.
Fixes 3498.
2015-04-21 22:26:50 +02:00
Jonas Jenwald
601bd4a930
Preface all "fullscreen" CSS rules with a |pdfPresentationMode| class, and add it to the |viewerContainer| while Presentation Mode is active
2015-04-21 16:28:50 +02:00
Jonas Jenwald
4211df63eb
Refactor PDFPresentationMode to be more class-like
2015-04-21 16:28:50 +02:00
Jonas Jenwald
4edee12e92
Re-ordering the PDFPresentationMode code so that the "public" functions are placed towards the top of the file
2015-04-21 16:28:49 +02:00
Jonas Jenwald
d5089f42fa
Initial refactoring of the PDFPresentationMode code
...
Noteworthy changes:
- Adds JSDoc comments to PDFPresentationMode.
- Removes a couple of, no longer necessary, helper functions.
2015-04-21 16:28:49 +02:00
Jonas Jenwald
f15d5c8cfe
Rename the presentation_mode.js file and adjust the function names
...
Also moves the |fullscreenchange| event listeners into PDFPresentationMode.
2015-04-21 16:28:48 +02:00
Jonas Jenwald
e7fd5b4d4d
Refactor the options passed to |PresentationMode.initialize| and clean-up some code in viewer.js and presentation_mode.js
...
This patch:
- Passes in a reference to the current PDFThumbnailViewer, which is used to ensure that the current thumbnail becomes visible when exiting PresentationMode.
- Changes the way that the event listeners for the contextmenu items are defined, to avoid passing in a reference to the SecondaryToolbar.
- Ensures that |supportsFullscreen| always returns a boolean.
Currently `supportsFullscreen` will, when the browser supports the fullscreen API, return e.g. `function mozRequestFullScreen()` instead of `true`.
- Simplifies the |click| handler code when PresentationMode is active.
This code has been obsolete ever since PR 2919 landed.
- Removes hack used to workaround a bug in WebKit browsers, which caused |mousemove| events to be fired when the cursor changed.
This was fixed close to a year ago, see http://code.google.com/p/chromium/issues/detail?id=103041 .
2015-04-21 16:27:41 +02:00
Jonas Jenwald
95b2ec124b
Move the PresentationMode-specific scrollWheel code from PDFViewerApplication
2015-04-21 16:08:37 +02:00
Jonas Jenwald
2dc1af8028
Break dependencies between PresentationMode and other code, and add PresentationMode related utility methods to PDFViewer
...
This patch:
- Adds a couple of utility methods to `PDFViewer` to enable checking `presentationModeState` without cumbersome comparisons.
- Disentangles `PresentationMode` from `PDFHistory` and `HandTool`, by adding event listeners for `presentationmodechanged` to both of them.
- Adds a utility function to `PDFViewerApplication` for requesting PresentationMode.
- Prevents initialization of `PresentationMode` if the browser does not support the fullscreen API.
2015-04-21 16:02:32 +02:00
arai
5c4e3c31b8
Bug 1156287 - Do not extract unreachable code after return
2015-04-21 00:22:45 +09:00
Tim van der Meij
e4e9a2adea
Merge pull request #5926 from browtayl/1018932
...
prevent viewer from zooming on cmd+mousewheel (bug 1018932)
2015-04-13 20:57:23 +02:00
Jonas Jenwald
bc0d55bf43
Remove commented out code from viewer.html
...
The line that this patch removes has been commented out since 2012 (!), see commit c8a6a9ba00
.
Also, since the patch is trivial, I'm fixing the formatting of a comment to stop [GitHub from marking it with a red color](https://github.com/mozilla/pdf.js/blob/master/web/viewer.html#L394 ) (and IE from complaining).
2015-04-13 12:44:05 +02:00
Taylor Brown
34d3b96b52
prevent viewer from zooming on cmd+mousewheel
2015-04-10 15:08:32 -07:00
Jonas Jenwald
48242abe72
[B2G] Stub the |DownloadManager| to avoid error
...
After the refactoring in PR 5678, the B2G viewer now prints the following in the console:
```
ReferenceError: DownloadManager is not defined
```
This will obviously not matter once the B2G viewer is replaced with the new components-based one. But until that happens, I think it makes sense to just stub the class to suppress the error.
2015-04-04 21:26:33 +02:00
Tim van der Meij
01f1761a8b
Merge pull request #5881 from mbbaig/master
...
Added the data-page-number dom attribute to the page rendered in the browser
2015-04-01 20:57:07 +02:00
Jonas Jenwald
e5c4819601
Small refactoring of the code that calls |PDFViewerApplication.setInitialView|
...
This is a minor cleanup, to avoid an unnecessary `Promise.all` and to simplify catching |ViewHistory| errors.
2015-03-31 20:35:00 +02:00
Jonas Jenwald
6091e7bd6b
Move the code that resets the history state when the |showPreviousViewOnLoad| preference is set to |false|
...
Since this code is *only* necessary if/when the history is actually enabled, this patch refactors it to actually reflect that.
2015-03-31 18:12:15 +02:00
Jonas Jenwald
03497eabd5
Move fetching of the |defaultZoomValue| preference value to |PDFViewerApplication.initialize|
...
For consistency, this preference should be placed amongst the others. The current position is purely for "historical" reasons, since it was one of the first preferences that was added to the code.
2015-03-31 15:33:21 +02:00
Jonas Jenwald
3974adcc22
Remove reference to GNUpdf from comment in |DocumentProperties.parseDate|
...
Since the link is no longer valid, we should remove it from the comment.
(Using the Internet Archive, it seems that the contents of that page was basically identical to the PDF specification.)
2015-03-28 11:53:20 +01:00
Mohamed Baig
6d8adb31ad
Added the data-page-number dom attribute to the page rendered in the browser
...
Added data-page-id attribute to page container divs
Updated the attribute with a better label
2015-03-27 18:23:39 -04:00
Rob Wu
d34e6ddd60
Set page size via @page + size
...
In Blink-based browsers, there is a mismatch between document size and
paper size. Even if exactly the same values and unit are used, it is
possible that the printed results takes more pages than expected.
To solve the issue, the page size is set via @page size, and the canvas
and ancestor nodes are assigned a width+height of 100% (=relative to the
page). This change resolves bugs such as blank pages and split pages.
2015-03-23 11:19:48 +01:00
Jonas Jenwald
94cc731616
Add custom |outlineloaded| and |attachmentsloaded| events to the viewer (bug 1112947)
2015-03-21 17:49:34 +01:00
Tim van der Meij
2d11266a52
Merge pull request #5866 from Snuffleupagus/scalechange-evt-pageActualOption
...
Add |pageActualOption| to the list of predefined zoom options in the |scalechange| event handler in viewer.js
2015-03-20 22:26:07 +01:00
Jonas Jenwald
36400ae48d
Add |pageActualOption| to the list of predefined zoom options in the |scalechange| event handler in viewer.js
...
This patch also rearrange the order of the references to the DOM elements of the predefined zoom values, in viewer.js, to correspond with the element order in the current viewer UI. (The previous ordering is a leftover from the previous viewer UI.)
2015-03-20 22:09:34 +01:00
Jonas Jenwald
4a3b0d9c64
Add a |PDFViewer| option to remove the border shadow around pages (issue 5559)
2015-03-16 12:28:28 +01:00
Jonas Jenwald
65a5543efe
Disable PresentationMode for certain problematic configurations
...
Instead of trying to hack around various browser defects, let's just disable PresentationMode in the affected browsers. This patch:
- Disables PresentationMode in IE11+ when the viewer is embedded; fixes 4711.
2015-03-13 22:09:36 +01:00
Tim van der Meij
230d8c40e4
Make presentation mode work again in Safari
2015-03-13 21:41:14 +01:00
Tim van der Meij
ac5d1fbb2d
Merge pull request #5785 from Snuffleupagus/bug-1138993
...
Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox
2015-03-12 21:16:29 +01:00
Rob Wu
6eb9e6a6a4
Fix flaw in mozCurrentTransform polyfill
...
Set transformation matrix in (polyfilled) mozPrintCallback when a scale
is applied. Removed _scaleX and _scaleY in favor of _transformMatrix to
emphasize that the caller MUST ensure that the state of the matrix is
correct before `addContextCurrentTransform` is called.
2015-03-11 20:55:26 +01:00
Yury Delendik
da258f8972
Merge pull request #5692 from Rob--W/webl10n-fix
...
[l10n] Treat language as case-insensitive
2015-03-09 23:24:57 -05:00
Yury Delendik
c2dc665332
Merge pull request #5582 from Snuffleupagus/setHash-Fit-values
...
Fix handling of "Fit" zoom values in setHash (issue 5581)
2015-03-09 23:20:23 -05:00
Yury Delendik
f4dbd69e06
Merge pull request #5595 from fkaelberer/useBinarySearchToFindVisibleElements
...
Use binary search in getVisibleElements()
2015-03-09 23:11:50 -05:00
Jonas Jenwald
f0d538d7cf
Revert PR 5510, except in WebKit browsers, for breaking print preview in Firefox
...
See https://bugzilla.mozilla.org/show_bug.cgi?id=1138993 .
2015-03-07 00:16:55 +01:00
speedplane
80d85b5fe7
Embedded PDF viewers should not be changing their parent page's title.
2015-03-05 22:36:08 -05:00
Jonas Jenwald
43e6de7e38
Merge pull request #5680 from Rob--W/forget-showPreviousViewOnLoad
...
Reset state upon load if showPreviousViewOnLoad
2015-03-02 21:49:34 +01:00
Rob Wu
6a16d7dd44
Reset state upon load if showPreviousViewOnLoad
...
And moved showPreviousViewOnLoad up to PDFViewerApplication.initialize
2015-03-02 21:35:44 +01:00
fkaelberer
a78bb6b946
Use binary search in getVisibleElements()
2015-03-01 17:41:20 +01:00
Tim van der Meij
a033b4bf3d
Merge pull request #5769 from dumyan/findcontroller-nbsp
...
nbsp normalization
2015-02-28 14:50:25 +01:00
Jonas Jenwald
00ee6bd6b6
Merge pull request #5693 from collinanderson/whitespace
...
cleaned whitespace
2015-02-28 10:09:21 +01:00
Damjan Velickovski
29290f3277
added nbsp normalization
2015-02-28 02:57:08 +01:00
Yury Delendik
ce122591b9
Merge pull request #5586 from fkaelberer/updateThumbnailClassesOnlyWhenVisible
...
Update thumbnails only when they are visible (to improve scrolling through large documents)
2015-02-27 06:56:32 -06:00
Yury Delendik
6ead5c4731
Merge pull request #5711 from Snuffleupagus/deprecate-el-property
...
Remove the |el| property in PDFPageView and PDFThumbnailView
2015-02-27 06:39:00 -06:00
Yury Delendik
a0a94344d7
Merge pull request #5721 from Snuffleupagus/move-findController-resolveFirstPage
...
Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
2015-02-27 06:33:15 -06:00
Jonas Jenwald
eed67ea8bb
Remove the |el| property in PDFPageView and PDFThumbnailView
2015-02-27 00:26:02 +01:00
Jonas Jenwald
a495ab0d13
Fix regression that prevents resetting the zoom level to "Automatic" when using the |Ctrl + 0| keys
2015-02-19 17:37:02 +01:00
Collin Anderson
54e984c763
cleaned whitespace
2015-02-17 11:07:37 -05:00
Jonas Jenwald
8131440f9e
Move the call to |PDFFindController.resolveFirstPage| into PDFViewer
...
From reading IRC scrollback, it became clear that having to manually call `PDFFindController.resolveFirstPage` in order for the find functionality to work isn't particulary good. Hence this PR, which moves that code into `PDFViewer.setDocument` to make life easier for third-party implementations.
2015-02-11 14:22:24 +01:00
Rob Wu
ac5a8bcdda
[l10n] Treat language as case-insensitive
...
See "Case-insensitive language comparisons per RFC 4646"
https://github.com/fabi1cazenave/webL10n/pull/51
Removed the "patch" in compatibility.js and fixed the bug in webL10n,
because the logic belongs to webL10n instead of PDF.js.
The immediate motivation for this patch is that Chrome 40 converts
navigator.language to lower case: https://crbug.com/454331
2015-02-02 22:02:18 +01:00
Jonas Jenwald
d53fa1884b
Simplify a couple of preprocessor tags in viewer.js
2015-01-31 22:45:20 +01:00
Jonas Jenwald
bb16475070
Use the |shadow| function from src/shared/util.js in viewer.js
2015-01-31 22:43:30 +01:00
Tim van der Meij
b72395d5ce
Determine filename only once and reduce code for _bindLink
2015-01-28 20:53:03 +01:00
Tim van der Meij
818b7fc306
Add JSDoc comments to PDFAttachmentView
2015-01-28 20:53:02 +01:00
Tim van der Meij
4c6ca1c78f
Remove DownloadManager dependency
...
We can pass it in using the options object. Note that that this also avoids creating a DownloadManager object for each separate link (instead, having only one is enough).
2015-01-28 20:53:01 +01:00
Tim van der Meij
733882ac25
Refactor PDFAttachmentView to be more class-like and to separate functionality into methods
2015-01-28 20:53:00 +01:00
Tim van der Meij
609e2a30e9
Rename DocumentAttachmentsView to PDFAttachmentView
2015-01-28 20:52:59 +01:00
Tim van der Meij
2c19d99a2e
Rename document_attachments_view.js to pdf_attachment_view.js
2015-01-28 20:52:22 +01:00
Tim van der Meij
f4dbc99483
Add JSDoc comments to PDFOutlineView
2015-01-27 23:04:48 +01:00
Tim van der Meij
ea1d37eb0d
Refactor PDFAttachmentView to be more class-like and to separate functionality into methods
2015-01-27 22:51:39 +01:00
Tim van der Meij
b17da309ed
Rename DocumentOutlineView to PDFOutlineView
2015-01-27 22:40:12 +01:00
Tim van der Meij
3eeb571425
Rename document_outline_view.js to pdf_outline_view.js
2015-01-27 22:38:45 +01:00
fkaelberer
d3022e1e70
Update thumbnail images only when sidebar is visible
2015-01-27 21:13:34 +01:00
fkaelberer
047d61ed1f
Update thumbnail style only when sidebar is visible
2015-01-27 21:08:36 +01:00
Tim van der Meij
a544aed2b0
Merge pull request #5673 from Snuffleupagus/thumbnail-refactor
...
Refactor the thumbnail code
2015-01-26 21:33:32 +01:00
Jonas Jenwald
777d69b52e
Remove dead code from PDFThumbnailView
2015-01-26 20:52:46 +01:00
Jonas Jenwald
b7041f81f4
Enable cancelling of thumbnail drawing
...
This is useful if thumbnails are being rendered when the document is rotated, since it let us abort the current rendering.
2015-01-26 20:52:45 +01:00
Jonas Jenwald
878aa76c15
Refactor PDFThumbnailView to look more similar to PDFPageView
...
This includes an optimization to zero the height and width of existing thumbnail canvases, when they are removed and recreated during rotation of the document. (Credit goes to nnethercote, who initially found this in PR 4920.)
2015-01-26 20:52:45 +01:00
Jonas Jenwald
7f8f404536
Rename ThumbnailView to PDFThumbnailView and refactor it to be more class-like
2015-01-26 20:52:44 +01:00
Jonas Jenwald
4294fb18d8
Merge pull request #5675 from timvandermeij/cleanup-gitignore
...
Remove obselete file from .gitignore
2015-01-26 16:52:10 +01:00
Jonas Jenwald
9a8d1ce4fc
Merge pull request #5672 from timvandermeij/remove-b2g-header
...
Remove unused viewer-snippet-b2g-activity-header.html
2015-01-26 16:47:58 +01:00
Tim van der Meij
2524c4dee7
Remove obselete file from .gitignore
2015-01-26 16:44:45 +01:00
Tim van der Meij
5db9ebea19
Merge pull request #5674 from Snuffleupagus/avoid-double-childNodes-in-PDFPageView_reset
...
Avoid getting |childNodes| twice in PDFPageView_reset, by using the variable instead
2015-01-26 16:39:31 +01:00
Jonas Jenwald
8471bb3206
Avoid getting |childNodes| twice in PDFPageView_reset, by using the variable instead
2015-01-26 12:22:09 +01:00
Tim van der Meij
c278d65dfd
Remove unused viewer-snippet-b2g-activity-header.html
2015-01-25 20:55:20 +01:00
Tim van der Meij
f89d1ca2e7
Remove unused index.html.template
2015-01-25 20:44:21 +01:00
Jonas Jenwald
64ba38008f
Rename the thumbnail_view.js file
2015-01-25 17:21:53 +01:00
Jonas Jenwald
dfa993d13d
Fix function names in PDFThumbnailViewer
...
Also updates a couple of the JSDoc comments.
2015-01-25 17:21:29 +01:00
Jonas Jenwald
c55dcf19a0
Move PDFThumbnailViewer to its own file
2015-01-24 15:41:18 +01:00
Tim van der Meij
dd7fd0b665
Merge pull request #5588 from Snuffleupagus/remove-pageView-anchor
...
Remove unused anchor links placed before every page
2015-01-23 22:38:09 +01:00
Tim van der Meij
997c2b9d94
Merge pull request #5596 from fkaelberer/fixBordersAroundThumbnails
...
Fix border sizes around thumbnails
2015-01-23 21:29:49 +01:00
Tim van der Meij
6f36df79a1
Merge pull request #5610 from fkaelberer/betterThumbnailScaling
...
Better thumbnail image scaling
2015-01-23 20:45:37 +01:00
Jonas Jenwald
385b07c2ab
Merge pull request #5660 from timvandermeij/thumbnails-setimage
...
Fill temporary canvases with a white background too
2015-01-22 20:20:27 +01:00
Tim van der Meij
879f3d2c5a
Fill temporary canvases with a white background too
2015-01-19 22:01:55 +01:00
Jonas Jenwald
c149d4d75e
Fix thumbnail rendering regression, when using |draw|, for PDF files with blend modes (issue 5637)
2015-01-19 21:55:59 +01:00
Jonas Jenwald
af6170ffd0
Attempt to display the File size quicker in the Document Properties dialog (PR 5554 followup)
2015-01-13 09:38:34 +01:00
Jonas Jenwald
c466a9e034
Fix thumbnail scaling regression for files with different page sizes (issue 5637)
2015-01-13 01:03:54 +01:00
Jonas Jenwald
8d0c442004
Merge pull request #5632 from yurydelendik/b2g-start
...
Fixes B2G file open sequence.
2015-01-09 18:00:39 +01:00
Yury Delendik
d52289d8fd
Fixes B2G file open sequence.
2015-01-09 07:46:34 -06:00
Brendan Dahl
6ceb652abb
Merge pull request #5554 from yurydelendik/apiref
...
Refactors getDocument and adds PDFDataRangeTransport.
2015-01-08 14:24:38 -08:00
Jonas Jenwald
95dd9ee185
Move the |pagerendered| event to pdf_page_view.js
...
Also deprecates the |pagerender| event, except for GENERIC builds.
2015-01-06 21:44:22 +01:00
Jonas Jenwald
3f061cef86
Add a |textlayerrendered| event
2015-01-06 17:57:32 +01:00
Yury Delendik
3a61edfcae
Refactors getDocument and adds PDFDataRangeTransport.
2015-01-05 21:45:01 -06:00
Jonas Jenwald
42a00394b0
Remove unused anchor links placed before every page
...
In old versions of the viewer, anchor links were used to be able to scroll a page into view. Since we for quite some time have had a `scrollIntoView` function which handles this, the anchor links are no longer necessary and I believe that they can be removed. Doing so will reduce the total number of DOM elements in the viewer.
For most documents this patch will probably not make much of a difference performance wise, but for very long (1000+ pages) documents this could help performance especially on lower powered hardware.
2015-01-05 20:42:56 +01:00
Brendan Dahl
e93cf5ca97
Merge pull request #5552 from yurydelendik/pdfpageview
...
Creates/refactors PDFPageView class
2015-01-05 11:26:36 -08:00
fkaelberer
32c32c18e3
Better thumbnail image scaling
2015-01-02 15:40:30 +01:00
fkaelberer
1d31018c7d
Make thumbnail CSS size independent of data-loaded tag
2014-12-30 15:07:20 +01:00
fkaelberer
2bb981a835
Ensure constant 7px thumbnail border width
2014-12-30 15:07:20 +01:00
Jonas Jenwald
86edb8687d
Fix the placement of arrows in the zoom box
...
Now that [bug 649849](https://bugzilla.mozilla.org/show_bug.cgi?id=649849 ) has been fixed, adding support for `-moz-appearance: none`, the arrow is now too close to the text in the zoom box. This is currently only an issue in Nightly, but assuming the patch doesn't get backed out, this will soon affect all versions of Firefox.
The only simple solution I could find seems to be removing `*-appearance: none` rules from the CSS. I haven't been able to find any easier solutions that still looks the same with/without bug 649849.
2014-12-30 11:37:21 +01:00
Jonas Jenwald
5aad040735
Fix handling of "Fit" zoom values in setHash (issue 5581)
2014-12-27 12:54:29 +01:00
Tim van der Meij
c67ad28673
Remove unused annotation highlight div
...
This is now done using CSS. For annotation-heavy documents this change makes the DOM much lighter.
2014-12-21 17:38:22 +01:00
Yury Delendik
513a3d8c91
Replaces text selection example
2014-12-20 23:41:34 -06:00
Yury Delendik
2565e627a3
Refactors draw method in PDFPageView; makes optional some PDFPageViewOptions options
2014-12-20 23:41:34 -06:00
Yury Delendik
2ac7ac4678
Removes lastScrollSource and isViewerInPresentationMode from TextLayerBuilderOptions
2014-12-20 11:14:13 -06:00
Yury Delendik
b930228788
Refactors Cache into PDFPageViewBuffer
2014-12-19 16:54:32 -06:00
Yury Delendik
22c62685b0
Removes Stats dependency from PDFPageView.
2014-12-19 13:07:28 -06:00
Yury Delendik
9f384bbb41
Creates AnnotationsLayerBuilder.
2014-12-19 13:07:28 -06:00
Yury Delendik
fe4ac86781
Removes PDFPageSource
2014-12-19 09:55:11 -06:00
Yury Delendik
7663942ee5
Creates IPDFTextLayerFactory interface
2014-12-17 15:21:54 -06:00
Yury Delendik
f68678086d
Simple restructuring PageView into PDFPageView
2014-12-17 15:21:54 -06:00
Yury Delendik
863d583ae1
Renames page_view.js file.
2014-12-17 10:32:07 -06:00
dustyrockpyle
7a0e764ffd
Added page break hints in viewer css.
2014-11-26 11:56:00 -05:00
Tim van der Meij
dc5961d969
Merge pull request #5465 from Snuffleupagus/findbar-notFound-color
...
[GENERIC viewer] Fix the background color of the findInput when the search term is not found
2014-11-18 20:07:31 +01:00
Jonas Jenwald
6078901962
Prevent a "TypeError: pdfViewer is null" when the viewer loads (PR 5413 followup)
...
Currently if you manage to e.g. open the console (with <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>K</kbd>) before the viewer is initialized, the following will be printed in the console: `TypeError: pdfViewer is null`.
This doesn't cause any actual errors, but nevertheless it seems like something we should avoid.
Followup to PR 5413.
2014-11-15 12:17:10 +01:00
Yury Delendik
bb91aa5e38
Merge pull request #5478 from Snuffleupagus/bug-1018882
...
Prevent text selection in Presentation Mode (bug 1018882)
2014-11-11 09:15:50 -06:00
Yury Delendik
e294c8883a
Merge pull request #5203 from Snuffleupagus/disableAutoFetch-loadingBar
...
Fix loadingBar hiding when disableAutoFetch is enabled (issue 3590)
2014-11-11 09:05:16 -06:00
Yury Delendik
3b9a78d3d8
Merge pull request #5416 from Snuffleupagus/percent-sign-l10n
...
Allow localization of the placement of percent signs in the zoom box
2014-11-11 08:30:07 -06:00
Jonas Jenwald
ce62b9387d
Remove any active text selection when entering Presentation Mode
2014-11-07 12:53:21 +01:00
Jonas Jenwald
86309faf3c
Prevent text selection in Presentation Mode (bug 1018882)
2014-11-07 12:02:48 +01:00
Jonas Jenwald
fbca0e1ab0
[GENERIC viewer] Fix the background color of the findInput when the search term is not found
...
When a search term isn't found, the background color of the findInput is supposed to change (to red). This is currently not working as intended, because the CSS rule is not being applied correctly. (It seems that this broke in PR 2208.)
This patch also changes the background color to match the one used in the native Firefox findbar, since the old color seemed a bit too pink.
2014-11-01 20:26:44 +01:00
Jonas Jenwald
4ed3074011
Fix regression that prevents downloading of font files in the debugger
...
This is a regression from PR 5366.
2014-10-28 19:56:55 +01:00
Jonas Jenwald
2505c8613b
Allow localization of the placement of percent signs in the zoom box
2014-10-21 21:41:06 +02:00
Jonas Jenwald
a1f4bff4f3
Disable zooming in Presentation Mode
2014-10-15 22:25:31 +02:00
Jonas Jenwald
670b842e09
Fix "Automatic Zoom" for landscape documents with very wide pages (issue 5398)
2014-10-12 02:25:35 +02:00
Brendan Dahl
c8d729ff39
Merge pull request #5325 from fzembow/findcontrollerfix
...
Update findbar to wrap on initial search
2014-10-08 11:05:07 -07:00
Tim van der Meij
b215af30d3
Require destinations when they are needed and do not fetch all of them in advance
2014-10-06 22:26:18 +02:00
Jonas Jenwald
ecbb39f983
Fix loadingBar hiding when disableAutoFetch is enabled (issue 3590)
2014-10-05 23:16:36 +02:00
Jonas Jenwald
cfeb4c1019
Small refactoring of the loadingBar hiding code
2014-10-05 23:15:10 +02:00
Fil Zembowicz
dcb931dbe0
Use existing page count in nextMatch
2014-10-02 08:57:01 -04:00
Fil Zembowicz
4275481e08
Fix how matches are found in search
...
Instead of keeping track of where the search starts, just
keep track of the number of pages and make sure we don't
visit pages more than once.
2014-10-01 19:57:57 -04:00
Jonas Jenwald
5f83739190
Fix |cleanup| regression in the viewer
2014-10-02 00:24:01 +02:00
Jonas Jenwald
a429e88c3b
Fix inconsistencies in the preference names used by PDFViewerApplication
...
Since `preferenceSidebarViewOnLoad` is an enumeration value, it seems better to initialize it with the default one instead of a boolean.
`preferencesPdfBugEnabled` uses a superfluous "s", which is a typo I made when I introduced it.
2014-10-01 12:30:11 +02:00
Yury Delendik
29eb147d42
Merge pull request #4150 from Snuffleupagus/issue-3990
...
Add a page loading indicator to the page number input
2014-09-30 18:06:39 -05:00
Yury Delendik
193b55dba0
Fixes printing regression a10fde1
2014-09-30 18:01:30 -05:00
Jonas Jenwald
902b72ba50
Add updated loading-small.png (and corresponding Retina) asset
2014-10-01 00:13:45 +02:00
Jonas Jenwald
b9ef80e167
Add a page loading indicator to the page number input
2014-10-01 00:13:44 +02:00
Yury Delendik
1858fbfe82
Merge pull request #5366 from Rob--W/use-font-loader-api
...
Use font loader api
2014-09-30 16:35:41 -05:00
Yury Delendik
5e0b2d383f
Fixes enabling pdfBug
2014-09-30 15:19:39 -05:00
Rob Wu
d0845df971
Use Font Loading API if available
...
http://dev.w3.org/csswg/css-font-loading/
2014-09-30 22:18:53 +02:00
Yury Delendik
5740b96020
Introduces 'pagesinit' event.
2014-09-30 12:41:53 -05:00
Yury Delendik
b16a406f3a
Packages PDFViewer as a UI component.
2014-09-30 12:41:53 -05:00
Jonas Jenwald
a10fde165c
Merge pull request #5362 from yurydelendik/css-import
...
Use CSS import to separate pdfviewer styles
2014-09-30 17:55:13 +02:00
Yury Delendik
70a0935737
Move text_layer_builder and pdf_viewer styles out
2014-09-30 10:48:29 -05:00
Yury Delendik
374b94381d
Moves scrollPageIntoView to the PDFViewer.
2014-09-30 07:13:46 -05:00
Jonas Jenwald
b06e65e5d6
Followup fix for entering/exiting Presentation mode
...
Even after PR 5359, switching to/from Presentation mode is still sluggish and I'm still seeing `too much recursion` printed in the console.
I've managed to track down the issue to line https://github.com/mozilla/pdf.js/blob/master/web/page_view.js#L371 . It appears that for this particular case, we actually *need* to set `noScroll = true` when calling the `_setScale` function. (Note that it only applies to *this* line, and not to Presentation mode in general.)
Given the amount of refactoring done to the viewer, I'm not sure what the best way to fix this would be. However I'm submitting this patch as an easy workaround for now, but we should probably refactor this to avoid calling a "private" method directly.
2014-09-30 13:02:53 +02:00
Yury Delendik
504d2c19e0
Fixes typo/regression of #5295 for presentation mode
2014-09-29 20:17:26 -05:00
Brendan Dahl
1145eb8c09
Merge pull request #5295 from yurydelendik/pdfviewer
...
Refactoring to move page display code into separate class
2014-09-29 15:23:35 -07:00
Yury Delendik
44779f14b0
Renames and refactors PDFView to PDFViewerApplication.
2014-09-28 10:39:56 -05:00
Yury Delendik
a89bba35b2
Adds types definitions (jsdoc) for the PDFViewer code.
2014-09-28 10:39:56 -05:00
Yury Delendik
3773972dce
Marks some private methods in PDFViewer and PDFThumbnailViewer
...
Conflicts:
web/pdf_viewer.js
2014-09-28 10:39:56 -05:00
Brendan Dahl
9c56c6f9f6
Merge pull request #5263 from yurydelendik/stream
...
Implement streaming using moz-chunk-arraybuffer
2014-09-25 16:40:28 -07:00
Yury Delendik
e0bb2f76d2
Merge pull request #5335 from Snuffleupagus/pdfBug-text-highlight
...
Fix text highlighting in the Font Inspector in the debugger
2014-09-24 07:14:03 -05:00
Jonas Jenwald
7af46b433d
Fix a regression preventing page change in the Stepper in the debugger
...
This is a regression from ddd3c8fc2f
, which prevents changing pages in the Stepper.
(Apart from fixing the bug, for the sake of consistency, I also removed one instance of `parseInt`.)
2014-09-24 10:38:27 +02:00
Jonas Jenwald
9c3ea3c40b
Fix text highlighting in the Font Inspector in the debugger
...
After PR #5282 , the text highlighting in the Font Inspector is very hard to see against a white background. That seems to be an oversight from the mentioned PR, hence this patch fixes that.
2014-09-24 00:18:35 +02:00
Brendan Dahl
a2e8a5ee7f
Merge pull request #5282 from CodingFabian/nicer-overlapping-text-selection
...
TextLayer selection coloring improvement for overlap.
2014-09-23 14:15:47 -07:00
Yury Delendik
a1eca2084d
Moves constants to avoid dependency on PDFView
2014-09-21 12:47:26 -05:00
Yury Delendik
f1851c6393
Removes any usage of PDFView in the PageView
2014-09-21 12:47:26 -05:00
Yury Delendik
fbd7eedce8
Removes PresentationMode dependency from PDFViewer
2014-09-21 12:47:26 -05:00
Yury Delendik
a06a974f78
Moves rendering queue logic from PDFView
2014-09-21 12:47:26 -05:00
Yury Delendik
7642c39734
Moves pdfDocument.getPage/getTextContent requests out of PDFView
2014-09-21 12:47:26 -05:00
Yury Delendik
7af8748151
Moves viewer code into PDFViewer and some code from PageView.
2014-09-21 12:47:07 -05:00
Yury Delendik
3bce14761a
Moves thumbs logic into PDFThumbnailViewer.
2014-09-20 08:19:04 -05:00
Yury Delendik
bfefadb87c
Moves watchScroll and getVisibleElements from PDFView
2014-09-20 08:19:04 -05:00
Yury Delendik
12ec2a000b
Merge pull request #5318 from mitar/patch-2
...
textLayer is not used anymore in render context
2014-09-20 08:17:35 -05:00
Yury Delendik
c3f191a27c
Implement streaming using moz-chunk-arraybuffer
2014-09-19 19:05:25 -05:00
Yury Delendik
63b7fa5634
Merge branch 'issue-4954' of https://github.com/Snuffleupagus/pdf.js into hashes
...
Conflicts:
web/viewer.js
2014-09-19 18:25:11 -05:00
Mitar
2f72ac1255
textLayer is not used anymore in render context.
...
It should be removed to prevent confusion when reading the code.
2014-09-19 15:13:01 -07:00
Manuel Padrón Martínez
293d566f67
Changed to lowercase everywhere the hashParams is compared
2014-09-18 20:18:23 +01:00
Manuel Padrón Martínez
4623f20221
Lowerize the params to allow case sensitive
2014-09-18 19:42:04 +01:00
Yury Delendik
ffb613bbac
Merge pull request #5275 from Snuffleupagus/exception-propagation
...
Fix the exception propagation when rejecting workerReadyCapability
2014-09-16 10:05:34 -05:00
Jonas Jenwald
ed5fc43510
Add |UnexpectedResponseException| to fix the exception handling when file loading fails because the server responds with a non 404 status message
2014-09-14 11:52:33 +02:00
Yury Delendik
74d02c3406
Merge pull request #5254 from mancas/bug
...
Avoid showing 'blob..' as a title when using pdfjs from B2G
2014-09-11 17:03:47 -05:00
sangm
f4ccb1b61c
Bug 1031612 - In PDF Viewer, the buggy XMP title "Untitled" overrides the document info title
2014-09-11 11:10:47 -05:00
Manuel Casas Barrado
f40fa1ac2a
Bug 1054643 - [B2G][PDF Viewer]PDF Viewer title is shown as blob:...
2014-09-11 08:09:56 +02:00
Yury Delendik
9261cd9766
Merge pull request #5271 from Rob--W/opera-fixes
...
Opera fixes
2014-09-09 10:10:04 -05:00
Yury Delendik
15059ea603
Merge pull request #5229 from cpeterso/cpeterso/auto-fit-landscape
...
Auto zoom landscape documents (like slide presentations) to fit their height
2014-09-09 09:49:15 -05:00
Fabian Lange
931b444e00
TextLayer selection coloring improvement for overlap.
...
As a consequence of merging #5221 it is more likely to have multiple
overlapping selection divs inside the text layer. Because each individual
element gets the selection style applied, the 30%opacity stacks, making a
60% bar visible where the overlap happens.
As proposed by @rocallahan, this can be fixed by making the selection
style solid and setting opacity for the overall layer.
I assume also that this should make the work for the renderer easier, but
was unable to bench it.
2014-09-09 15:21:50 +02:00
Jonas Jenwald
2701edc7c6
Change getDocumentError
in web/viewer.js to use instanceof
instead of the exception name
2014-09-08 22:34:25 +02:00
Jonas Jenwald
ca027ebfdb
Fix the exception propagation when rejecting workerReadyCapability
...
Currently when an exception is thrown, we try to reject `workerReadyCapability` with multiple arguments in src/core/api.js. This obviously doesn't work, hence this patch changes that to instead reject with the exception object as is.
In src/core/worker.js the exception is currently (unncessarily) wrapped in an object, so this patch also simplifies that to directly send the exception object instead.
2014-09-08 22:20:41 +02:00
Yury Delendik
b3be74d81c
Merge pull request #5221 from nnethercote/dont-scale-single-char-text-divs
...
Don't scale single-char text divs.
2014-09-08 11:17:25 -05:00
Rob Wu
c9b3ea2f84
Adjust use of chrome.storage.managed for Opera
...
It turns out that chrome.storage.managed is defined for Opera, so the
previous feature detection method did not work.
2014-09-06 00:37:30 +02:00
Tim van der Meij
8c76501a49
Merge pull request #5226 from Snuffleupagus/issue-5224
...
Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)
2014-09-05 19:06:39 +02:00
Tim van der Meij
2158fcc0f1
Merge pull request #5259 from Rob--W/handtool-unfocus
...
Handtool: Remove focus from previous node on click
2014-09-03 20:34:20 +02:00
Tim van der Meij
d9ec0e58e0
Merge pull request #5237 from Snuffleupagus/fix-findInput-RTL-loading-indicator
...
Fix the placement of the findInput loading indicator in RTL locales
2014-09-03 20:31:33 +02:00
Rob Wu
204d540af2
Handtool: Remove focus from previous node on click
...
"This commit fixes the issue that a focused element cannot lose
focus when the draggable element is clicked."
https://github.com/Rob--W/grab-to-pan.js/commit/11c368f97cebe19
Steps to reproduce/verify:
1. Enable the hand tool (e.g. by using the H shortcut)
2. Click on the Page number input.
3. Click or drag the PDF canvas.
4. Observe that the page number input is still focused.
Consequently, the hand tool cannot be disabled using the H shortcut.
2014-09-03 16:31:47 +02:00
yscumc
4acb744f77
Update document_properties.js
...
Fix for minutes tz calculation
2014-08-28 16:22:57 -04:00
Jonas Jenwald
5c84dd319f
Fix the placement of the findInput loading indicator in RTL locales
...
Currently in RTL locales, the loading indicator is placed such that it is in the way when entring a search term. Hence this patch moves it to the other side of the input field to fix this.
2014-08-25 22:58:44 +02:00
Chris Peterson
81d5bd86ea
Replace magic scale value 0 with UNKNOWN_SCALE
2014-08-23 00:14:44 -07:00
Chris Peterson
50a4510ab7
Auto zoom landscape documents to fit their height
2014-08-23 00:14:18 -07:00
Jonas Jenwald
5abe1cae6a
Fix Zoom box resizing when it's hidden when the viewer loads (issue 5224)
2014-08-21 17:57:57 +02:00
Nicholas Nethercote
cd61aad24f
Don't scale single-char text divs.
...
This change makes scrolling noticeably smoother on files with many
single-char text divs, such as the one in #1045 . The trade-off is that
the visual appearance of text selection in such documents is slightly
worse, because more text divs overlap.
This change also uses `scaleX(N)` instead of `scale(N, 1)`. This might
be marginally more efficient in terms of JS string concatenation.
2014-08-20 19:34:33 -07:00
Tim van der Meij
b4fb1e21e7
Merge pull request #5209 from CodingFabian/text-layer-transform-origin
...
Set transformOrigin for text layer in css.
2014-08-19 22:59:55 +02:00
Fabian Lange
1da38ec91e
no need to set textlayer properties which are overwritten in individual styles.
2014-08-19 22:47:39 +02:00
Fabian Lange
6a0aa2cf49
Set transformOrigin for text layer in css.
...
transformOrigin is set to 0% 0% in all cases. This adds extra memory
impact into the dom tree. It also involves the CustomStyles workaround
to determine the correct css rule for the browser.
By setting all vendor and standard variants in css, the rule is applied
without the dom memory overhead and without the minor computation
overhead to set the value.
2014-08-19 22:46:09 +02:00
Yury Delendik
2f5c6d6c3a
Merge pull request #5208 from CodingFabian/debounce-scroll
...
Debounces scroll events in web viewer.
2014-08-18 22:53:28 -05:00
Fabian Lange
403a4e2bda
Debounces scroll events in web viewer.
...
As requested in #5178 , this change debounces the scroll events.
The reason for doing so is that browsers can event-storm especially on
scroll, communicating hundreds of subpixel changes.
The main reason for this resulting in poor performance is that on each
scroll event `scrollTop` was queried, which forces layouting.
This change will use `requestAnimationFrame` to make sure the browser can
allocate enough time to other tasks. The delay is however quite small, thus
the reduction in executions is less noticeable. Modern browsers however utilize
`requestAnimationFrame` to smoothen out rendering.
2014-08-18 23:23:32 +02:00
Yury Delendik
4ef70588de
Merge pull request #5193 from nnethercote/data-font-name
...
Only use data-font-name attributes when necessary.
2014-08-18 13:54:07 -05:00
Nicholas Nethercote
eda7dcbb9e
Only use data-font-name attributes when necessary.
...
The data-font-name attribute of textLayer divs are only used by the Font
Inspector. This change ensures they are only present when the pdfBug
tools are enabled.
2014-08-17 15:56:11 -07:00
Jonas Jenwald
61e24c6f45
Small re-factoring of DocumentProperties
...
With the changes made in PR 5169 to enable quicker display of the File size, `setFileSize()` can now be called during file loading. This function parses *and* localizes the file size, where the l10n is a synchronous operation.
This patch:
* Re-factors `setFileSize()` to *only* update `rawFileSize`, and moves parsing and fetching of the l10n string to a separate method that isn't called until the Document Properties dialog is actually opened.
* Adds a couple of checks to make sure that `rawFileSize` is set to a positive number.
* Removes the `fileName` and `fileSize` properties. Since they are parsed every time the Document Properties dialog is opened, it doesn't seem necessary to cache them.
2014-08-16 12:15:49 +02:00
Yan Or
d8bc16362c
Bug 1054590 - [pdf.js] Update to use gaia-header
2014-08-15 17:57:07 -07:00
Yury Delendik
c2f4b9d301
Merge pull request #5194 from nnethercote/no-absolute
...
Remove `position: absolute` from text divs.
2014-08-15 10:38:23 -05:00
Nicholas Nethercote
9695958ebc
Remove position: absolute
from text divs.
...
It's not necessary in each text div, because it's specified in the
`.textLayer > div` rule.
2014-08-15 08:17:20 -07:00
Jonas Jenwald
ca1dbda348
Disable the "Go to First/Last Page" buttons when the first/last page is currently active
...
Since the "Previous/Next Page" buttons are disabled when the first/last page is active, I think that for the sake of consistency the "Go to First/Last Page" should behave the same way.
2014-08-12 12:58:59 +02:00
Adolfo Jayme Barrientos
ba426f479e
Reduce load progress bar’s height to 4 pixels
2014-08-11 23:09:38 -05:00
Jonas Jenwald
3fd6c468b7
Attempt to display the File size quicker in the Document Properties dialog
...
Currently the File size field in the Document Properties dialog isn't set until `PDFView.pdfDocument.getDownloadInfo()` is resolved. If the Document Properties dialog is opened while a PDF file is loading with range requests, this leads to the less desirable situation where all fields *except* File size are available.
In cases where `PDFView.open()` is called with the `args` parameter defined, and `args` contains the property `length`, we actually know the File size when the PDF file begins to load. (This is usually the case when ranged loading is used in the Firefox addon/built-in version.)
Hence we can use `args.length` to set the File size immediately when `PDFView.open()` is called, resulting in a better user experience.
2014-08-11 16:44:36 +02:00
Tim van der Meij
0e4d9061b2
Merge pull request #5166 from Snuffleupagus/pdfViewClose-cleanup
...
Remove old unused code from PDFView.close()
2014-08-10 22:49:04 +02:00
Jonas Jenwald
4737e1ad8d
Remove old unused code from PDFView.close()
2014-08-10 16:50:21 +02:00
Tom De Wolf
a265861ba6
only convert in IE9 if the requested responseType is actually an arraybuffer, otherwise just return the responseText. That way the compatibility.js does not break other frameworks like angular that not always want an array from xhr requests.
2014-08-10 10:26:32 +02:00
Nicholas Nethercote
be29fc44e0
Avoid repeated creation of a simple RegExp object.
2014-08-07 22:08:23 -07:00
Yury Delendik
e8af56ffc5
Fixes text-selection example
2014-08-06 10:09:27 -05:00
Yury Delendik
196416cc17
Merge pull request #5100 from Rob--W/load-file-in-main-thread
...
Load file:-URLs in the main thread.
2014-08-06 09:54:46 -05:00
Yury Delendik
666cf02f91
Merge pull request #5137 from CodingFabian/optimize-textbuilder-renderLayer
...
Optimize TextLayerBuilder_renderLayer() for text heavy documents.
2014-08-06 09:09:32 -05:00
Yury Delendik
df8d2573dd
Merge pull request #5007 from timvandermeij/pdfview-tlb
...
Converting PDFFindBar and PDFFindController to classes
2014-08-05 18:32:38 -05:00
Fabian Lange
39129fc441
Optimize TextLayerBuilder_renderLayer() for text heavy documents.
...
This change improves the text layer creation of "normal" text heavy documents.
It changes 2 things:
* If the text element is not rotated, it will neither calculate nor apply a
textTransform: rotate(0deg) to the text layer element.
* For scaling the text layer div, the context will measure the width of the
text in the given font. For many text documents the font changes seldom.
If the font stays the same, the context does not need to be set to a new font
especially avoiding the temporary creation of the same font string over and
over again.
2014-08-06 00:40:48 +02:00
Hengjie
eaa587753b
Fix issue where pdfDocument is null
...
Happens when no file is loaded
2014-08-04 12:27:47 +12:00
Tim van der Meij
097bf41285
Use strict equalities in web/compatibility.js
2014-08-01 19:21:33 +02:00
Tim van der Meij
ddd3c8fc2f
Use strict equalities in web/debugger.js
2014-08-01 19:21:32 +02:00
Rob Wu
bd25f6be94
Load file:-URLs in the main thread.
...
QtWebKit does not support file:-URLs in Web Workers.
To solve this issue, I'm loading file:-URLs in the main thread
for generic builds. file:-URLs load relatively quick, so there
is no need for sophisticated load progress notifications.
2014-08-01 16:53:41 +02:00
Tim van der Meij
7ca6f0839f
Use strict equalities in web/document_properties.js
2014-07-31 22:06:39 +02:00
Tim van der Meij
ea85a2f7a7
Use strict equalities in web/viewer.js
2014-07-31 22:06:38 +02:00
Tim van der Meij
24cf969422
Use strict equalities in web/ui_utils.js
2014-07-31 22:06:38 +02:00
Tim van der Meij
bf3aad8a95
Merge pull request #5082 from Rob--W/chromium-managed-preferences
...
Managed preferences for Chrome administrators
2014-07-30 23:58:25 +02:00
Rob Wu
00746011a3
Managed preferences for Chrome administrators
...
Implement support for managed preferences. This feature allows users
(administrators) to easily change the default settings of the PDF Viewer for
all Chrome or Chromium browsers within their organization.
External resources for end users (administrators)
- http://www.chromium.org/administrators/
- http://www.chromium.org/administrators/configuring-policy-for-extensions
- http://www.chromium.org/administrators/windows-quick-start
- http://www.chromium.org/administrators/mac-quick-start
- http://www.chromium.org/administrators/linux-quick-start
- http://www.chromium.org/administrators/policy-templates
Administrators can read one of the previous links to learn more about creating
policies. We want to auto-generate these templates, but there are no public
tools for doing that. It will be added in the future, see:
https://code.google.com/p/chromium/issues/detail?id=389061
Resources for PDF.js/extension developers
- http://cs.chromium.org/file:policy_templates.json
- https://developer.chrome.com/extensions/manifest/storage
2014-07-30 22:51:56 +02:00
Yury Delendik
7026543663
Merge pull request #5059 from timvandermeij/unused-code
...
Removing unused code and enforcing additional JSHint options
2014-07-29 15:04:43 -05:00
Tim van der Meij
dbe22475e1
Converting PDFFindBar and PDFFindController to classes
2014-07-29 21:59:01 +02:00
Rob Wu
bb13fb939e
Initialize PDFView.url = ''
...
The absence of this property caused the following error in PDFView.download:
Cannot read property 'split' of undefined
This property was unset when the PDF was loaded through a typed array instead
of a URL. With the fix, the file name will default to "document.pdf", as
defined by getPDFFileNameFromURL in web/ui_utils.js
2014-07-24 23:37:31 +02:00
Lu Wang
91b7030bf4
fix typo
2014-07-23 23:59:27 -07:00
Yury Delendik
561fc8f98b
Adds ImageData set support for legacy safari
2014-07-22 11:40:32 -05:00
Jonas Jenwald
28e194f670
Adjust the tabindices in the viewer
...
The current way that the tabindices are defined, has the unfortunate consequence that adding a single button to the UI might mean having to change almost all tabindices. (This was the case in e.g. PR 4329.)
This patch attempts to avoid that situation happening again, by re-defining the tabindices slightly.
2014-07-19 12:31:11 +02:00
Tim van der Meij
34728ee49b
Removing unused code
2014-07-18 22:34:50 +02:00
Tim van der Meij
0ac83802ba
Merge pull request #5004 from CodingFabian/issue-5002
...
Improving CanvasPixelArray polyfill for Android
2014-06-30 22:16:03 +02:00
Fabian Lange
54fb1f7226
Improving CanvasPixelArray polyfill for Android
2014-06-25 18:44:49 +02:00
Fabian Lange
6447397c04
Do not run cleanup while printing is ongoing.
2014-06-25 12:53:58 +02:00
Fabian Lange
9fd6cc7f1e
Fixes CanvasPixelArray set polyfill for chrome < 21 ( #4974 )
2014-06-24 19:36:02 +02:00
Yury Delendik
6d86c92514
Merge pull request #4991 from timvandermeij/text-layer-builder-refactoring
...
Refactoring text layer builder and converting text layer builder to a class
2014-06-23 16:00:57 -05:00
Tim van der Meij
fa33b9c643
Refactoring PDFFindController in the text layer builder
2014-06-23 22:19:18 +02:00
Tim van der Meij
a968da8887
Convert the text layer builder to a class
2014-06-23 22:07:21 +02:00
Tim van der Meij
2a052c4aad
Refactoring text layer builder
2014-06-23 21:40:37 +02:00
Tim van der Meij
fbfb9458d6
Implement text normalization for page content and queries
2014-06-20 23:32:44 +02:00
Tim van der Meij
ec1b58a30a
Fix code style issues in pdf_find_controller.js and build strings more efficiently
2014-06-20 21:14:29 +02:00
Yury Delendik
c1c950ce74
Fixes AnnotationUtils in the extension build
2014-06-18 16:42:08 -05:00
Jonas Jenwald
2282c98500
Merge pull request #4965 from yurydelendik/annotations
...
Splits shared/annotation.js into core/ and display/
2014-06-18 17:01:38 +02:00
Yury Delendik
bdeca30fbf
Splits shared/annotation.js into core/ and display/
2014-06-17 17:43:33 -05:00
Jonas Jenwald
bab40caf7b
Merge pull request #4961 from yurydelendik/raf-ios
...
Disables broken rAF on iOS
2014-06-17 21:13:38 +02:00
Yury Delendik
df87df59b6
Increases page cache size when needed
2014-06-17 13:41:40 -05:00
Yury Delendik
dccc709b50
Disables broken rAF on iOS
2014-06-17 12:44:52 -05:00
Yury Delendik
6f79aef03a
Uplift for B2G bug 1009780 - Improve open mechanism for downloads.
2014-06-16 19:06:36 -05:00
Jonas Jenwald
22cfcbcf8a
Merge pull request #4952 from yurydelendik/telemetry
...
Collect More Telemetry Data
2014-06-17 00:36:58 +02:00
Jonas Jenwald
3ead6e6a94
Disable the developer hash parameters by default in PRODUCTION builds of PDF.js
2014-06-17 00:32:57 +02:00
Yury Delendik
0cd28ebfa3
Telemetry for used stream and font types
2014-06-16 16:41:04 -05:00
Jonas Jenwald
1ba31a6cb7
Add pdfBugEnabled to the default preferences
2014-06-16 21:46:39 +02:00
Yury Delendik
7ac1c6b034
Reporting print usage
2014-06-14 15:55:21 -05:00
Yury Delendik
13efe84d37
Merge pull request #4941 from Snuffleupagus/avoid-rendering-pages-when-home/end-keys
...
Prevent rendering unnecessary pages when the HOME/END keys are pressed
2014-06-14 11:37:07 -05:00
Jonas Jenwald
c145f0e063
Add larger zoom values to zoom dropdown box
2014-06-14 15:51:55 +02:00
Jonas Jenwald
5ac4dd9593
Prevent rendering unnecessary pages when the HOME/END keys are pressed
...
Currently (at least in Firefox) when the HOME/END keys are pressed, this will trigger unnecessary rendering of pages that lay between the current page and the first/last page. Avoid this by going straight to the first/last page instead.
2014-06-14 14:11:42 +02:00
Yury Delendik
69d722792d
Merge pull request #4936 from nnethercote/fix-cache-splice
...
Fix PageView cache re-insertions.
2014-06-13 10:19:55 -05:00
Nicholas Nethercote
5b7df1830d
Fix PageView cache re-insertions.
2014-06-13 07:57:58 -07:00
Nicholas Nethercote
f852cefdd8
Halve the size of the PageView cache.
2014-06-13 07:53:36 -07:00
Yury Delendik
2efbdfe8d4
Merge pull request #4834 from dferer/canvas-max-size
...
Limit the size of canvases to 5MP (iOS restriction)
2014-06-13 09:37:42 -05:00
Yury Delendik
cab043028b
Merge pull request #4924 from yurydelendik/fixthumb
...
Fixes drawImage for thumbs
2014-06-13 09:07:41 -05:00
Nicholas Nethercote
29d3db4422
Cache pages at the start of drawing, not the end.
2014-06-12 22:54:37 -07:00
Samuel Chantaraud
952545e20f
Limit the size of canvases to 5MP (iOS restriction)
2014-06-12 17:58:58 -04:00
Yury Delendik
d57f83e087
Reverting back disableWebGL preferences check
2014-06-12 14:47:46 -05:00
Yury Delendik
3b405cf611
Protects PDFJS.disableXXX == true from change
2014-06-12 12:40:59 -05:00
Yury Delendik
a338a7966d
Fixes drawImage for thumbs
2014-06-12 10:28:42 -05:00
Nicholas Nethercote
97cc06a7f9
Zero the height and width of the PageView canvas before deleting.
2014-06-12 16:33:30 +10:00
deathy
7d975dfe22
Fix destination name for 'Fit' zoom levels in hash params
2014-06-11 21:11:56 +03:00
Samuel Chantaraud
221d00a11f
Removed non-base64 bytes before the last 3 characters
2014-06-11 09:12:26 -04:00
Mohammed Abu-alsaad
2b595e6d32
Fixed IE links bug by adding a base64 transparent gif for anchor tags for
...
IE only.
2014-06-03 11:06:43 +12:00
Yury Delendik
5ded0ea163
Merge pull request #4866 from yurydelendik/issue4673
...
Removes mozResponseArrayBuffer
2014-06-02 12:51:29 -05:00
Yury Delendik
f9befa189b
Disables worker if XHR does not support arraybuffer
2014-05-29 20:38:50 -05:00
Yury Delendik
9c87fa24f7
Removes mozResponseArrayBuffer
2014-05-29 20:38:50 -05:00
Mohammed Abu-alsaad
e6546642db
Added more preference variables from the available hash parameters
2014-05-30 10:44:41 +12:00
Yury Delendik
34089212e0
Reverts mozRequestAnimationFrame to compatibility.js
2014-05-29 16:23:13 -05:00
Jonas Jenwald
ff0672e0fa
Merge pull request #4865 from yurydelendik/issue4854
...
Adds compatibility.js to the Firefox extension
2014-05-29 23:06:24 +02:00
Yury Delendik
825762f22a
Merge pull request #4803 from mzgol/compatibility
...
[WIP] Update web/compatibility.js
2014-05-29 11:57:34 -05:00
Yury Delendik
d95f78610e
Adds compatibility.js to the Firefox extension
2014-05-29 11:50:16 -05:00
Jonas Jenwald
7e6cdc74af
Merge pull request #4832 from yurydelendik/showtext
...
Refactors showText: split type3, remove showSpacedText
2014-05-29 12:58:09 +02:00
Tim van der Meij
5b16323916
Merge pull request #4856 from Snuffleupagus/overlay-manager-keydown-preventDefault
...
[OverlayManager] Add preventDefault to the keydown event handler
2014-05-28 19:16:49 +02:00
Yury Delendik
68b037ffb0
Add preprocessor directives for the extension; and refactor FirefoxCom callback
2014-05-28 10:24:06 -05:00
Michał Gołębiowski
85291dd8da
Update web/compatibility.js
...
1) Remove obsolete workarounds
2) Add support comments
2014-05-28 09:57:25 +02:00
Jonas Jenwald
164535fa93
[OverlayManager] Add preventDefault to the keydown event handler
2014-05-27 23:48:02 +02:00
Tim van der Meij
1f1de20d11
Small comment fix
2014-05-27 22:13:00 +02:00
Jonas Jenwald
5cd6dddeee
Convert the existing overlays to use the OverlayManager
2014-05-25 21:33:15 +02:00
Jonas Jenwald
6dc7a52e35
Simplify the interaction with overlays by adding an OverlayManager
2014-05-25 21:33:14 +02:00
Jonas Jenwald
002607502c
Merge pull request #4824 from yurydelendik/movecs
...
Moves colorspace.js and function.js into core/
2014-05-23 21:14:58 +02:00
Yury Delendik
fcc4dfd9b5
Moves shared/function.js to core/
2014-05-23 14:11:47 -05:00
Yury Delendik
7a19085159
Moves shared/colorspace.js into core/
2014-05-23 14:11:47 -05:00
Yury Delendik
d53dc2e7d6
Refactors showText: split type3, remove showSpacedText
2014-05-23 13:36:54 -05:00
Samuel Chantaraud
37c3641fad
Added Promise.catch
...
Fixed Promise so it rejects on uncaught exception
Catch possible rejection on ViewHistory.setMultiple
2014-05-22 13:53:19 -04:00
Yury Delendik
09b24d5231
Merge pull request #4808 from fkaelberer/fixAndroidButtons
...
Fix strange looking buttons in mobile Firefox
2014-05-19 11:56:57 -05:00
fkaelberer
2d4c35cda7
fix buttons under android
2014-05-18 17:32:26 +02:00
Yury Delendik
97782cafa4
Update text layer correctly when zooming with USE_ONLY_CSS_ZOOM
2014-05-14 09:47:58 -05:00
Jonas Jenwald
73a9d50fd1
Refactor the CSS rules for the overlayContainer
2014-05-13 10:43:38 +02:00
Michał Gołębiowski
e625af3fef
Remove type="text/javascript" from script tags.
...
"text/javascript" is not a correct MIME type (the correct one is
"application/javascript") but it's not even needed; all browsers default
to the correct type and treat it as executable JS when type is ommited.
Since not all browsers recognize the "application/javascript" MIME type
the only way to both stay compliant and to support all popular browsers
is to omit the type. It's also shorter this way.
2014-05-13 02:41:01 +02:00
Jonas Jenwald
b88c5330a9
Reduce the number of calls to PDFView.getVisiblePages from updateViewarea
2014-05-10 16:43:22 +02:00
Tim van der Meij
53f3b1326a
Removes unused code from web/compatibility.js
2014-05-09 21:26:07 +02:00
Yury Delendik
c5eb058b09
Uses rAF to interrupt the operator list execution
2014-05-09 07:00:47 -05:00
Jonas Jenwald
ec50aa4e8c
Refactor how the database is read in ViewHistory
2014-04-29 15:59:51 +02:00
Jonas Jenwald
8bb19fac2d
Catch error when the creation of localStorage polyfill fails in the generic viewer
2014-04-29 15:50:48 +02:00
Yury Delendik
6c5a308dcc
Merge pull request #4689 from timvandermeij/ie-attachments
...
Fixes DownloadManager for IE10 and above
2014-04-28 16:31:57 -05:00
Tim van der Meij
19586721fb
Fixes DownloadManager for IE10 and above
2014-04-28 22:43:05 +02:00
Jonas Jenwald
c53bcb2992
Add a preference to set the sidebarView on load
2014-04-28 20:32:41 +02:00
Jonas Jenwald
159e86f7ab
Ensure that the viewer loads even if there are errors when the preferences are read
2014-04-28 11:01:58 +02:00
Yury Delendik
42ed9025ef
Merge pull request #4692 from Snuffleupagus/viewHistory-setMultiple
...
Add support for setting multiple values at once in ViewHistory
2014-04-27 23:26:38 -05:00
Jonas Jenwald
51d6ad7176
Fix the display of the indeterminate progress bar when the loaded percentage is NaN (issue 4696)
2014-04-27 22:11:25 +02:00
Tim van der Meij
9d6ffbb3bf
Converts attachment items to buttons instead of links
2014-04-25 23:15:25 +02:00
Jonas Jenwald
69eafaa58f
Add support for setting multiple values at once in ViewHistory
2014-04-25 22:57:01 +02:00
Jonas Jenwald
48399a3ec7
Add writeToStorage method to ViewHistory
2014-04-25 20:13:17 +02:00
Jonas Jenwald
447d115ec1
[Firefox] Workaround for sessionStorage error when the preference network.cookie.lifetimePolicy is set to 1 (bug 1000777)
2014-04-25 18:12:25 +02:00
Tim van der Meij
107cd8007f
Move DocumentAttachmentsView to its own file
2014-04-24 22:58:21 +02:00
Tim van der Meij
1e119e093b
Move DocumentOutlineView to its own file
2014-04-24 22:58:13 +02:00
Yury Delendik
b088690f1a
Merge pull request #4645 from Snuffleupagus/issue-4642
...
Only handle scroll events when PDFView.pdfDocument is defined (issue 4642)
2014-04-23 20:23:41 -05:00
Jonas Jenwald
8edb5cc804
Fix regression preventing the setting of breakpoints in the Stepper (PDFBug)
2014-04-20 01:05:38 +02:00
Jonas Jenwald
4e1362642a
Only handle scroll events when PDFView.pdfDocument is defined (issue 4642)
2014-04-19 01:55:10 +02:00
Samuel Chantaraud
25ee0e8572
Preliminary attachments support
...
Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
2014-04-18 12:11:00 -04:00
Samuel Chantaraud
7a4543e348
Prevent the annotationLayer to be recreated when the page is redrawn
...
This allows interactive annotations to keep their states after a resize
2014-04-16 08:13:54 -04:00
Rob Wu
d7dfa447cd
Remove unused (local) variables in web/
2014-04-15 17:10:23 +02:00
Yury Delendik
b4a81cb472
Merge pull request #4628 from Snuffleupagus/issue-4625
...
Ensure that the errorWrapper is closed when a new document is opened (issue 4625)
2014-04-15 08:38:00 -05:00
Yury Delendik
689927282e
Removes reference to the Makefile
2014-04-15 08:27:35 -05:00
Jonas Jenwald
12f3d58506
Ensure that the errorWrapper is closed when a new document is opened (issue 4625)
2014-04-15 13:51:40 +02:00
Tim van der Meij
d05768078b
Setting empty tooltips for zoom select box items
2014-04-14 23:35:29 +02:00
Manuel Braun
e7da8edb91
Refactoring - remove duplicated code in TextLayerBuilder
2014-04-14 19:05:21 +02:00
Yury Delendik
1fd43a87db
Changes 'documentload' event behavior.
2014-04-13 21:07:36 -05:00
Yury Delendik
f6c631bc31
Reverts #4556 due to flicker on Chome
2014-04-11 14:07:36 -05:00
Yury Delendik
012a727eed
Merge pull request #4598 from Rob--W/crx-filesystem-worker
...
Work-around for filesystem:-URL bug
2014-04-11 13:50:41 -05:00
Yury Delendik
c88696cf5f
Merge pull request #4595 from brendandahl/search-regression
...
Append whitespace divs so matches still line up.
2014-04-11 11:48:57 -05:00
Rob Wu
bfcc8af6ed
Move logic from viewer.js to chromecom.js
...
and also default to '' instead of DEFAULT_URL to avoid trying to
load a non-existent file when no file has been specified.
2014-04-11 17:37:48 +02:00
Rob Wu
b64c06f68d
Work-around for filesystem:-URL bug ( #4592 ).
...
Visit https://robwu.nl/pdfjs/filesystem-worker-bug.htm and follow the
steps to verify that the extension works as intended with this patch.
2014-04-11 15:33:34 +02:00
Jonas Jenwald
965f7a7b14
Print WebGL status in the console
2014-04-11 13:37:50 +02:00
Yury Delendik
2c61f60a4e
Merge pull request #4577 from timvandermeij/reporter
...
Removes custom test/reporter.js from the lint process
2014-04-10 19:17:48 -05:00
Tim van der Meij
b348243866
Fixes lint warning W004 in /web
2014-04-11 00:02:33 +02:00
Tim van der Meij
a71a87a821
Fixes lint warning W018: confusing use of exclamation mark
2014-04-11 00:02:31 +02:00
Yury Delendik
d61ee23afc
Merge pull request #4556 from p01/OpaqueCanvas
...
Use Opaque Canvas
2014-04-10 16:54:26 -05:00
Brendan Dahl
5ba674c996
Append whitespace divs so matches still line up.
2014-04-10 14:01:21 -07:00
Jonas Jenwald
eb7f369c54
Remove leading and trailing spaces from info.Producer and info.Creator when printing debug info in the console (bug 872827)
2014-04-10 12:20:39 +02:00
p01
b10aa18b3e
Use Opaque Canvas where possible
2014-04-10 11:50:20 +02:00
Brendan Dahl
5bd8a83c9b
Build the text layer geometry on the worker.
2014-04-09 16:44:07 -07:00
Brendan Dahl
ed1f8c33bd
Merge pull request #4286 from yurydelendik/webgl
...
WebGL and misc memory optimizations
2014-04-07 14:33:34 -07:00
Yury Delendik
b39f0c311c
Refactors history and how the database is stored
2014-04-03 13:23:18 -05:00
Yury Delendik
30ab878835
Add enableWebGL to the preferences
2014-04-03 12:20:53 -05:00
Yury Delendik
9c59437ac3
Merge pull request #4455 from aib/master
...
Fix download button waiting if document has started but not completed downloading
2014-04-03 09:40:06 -05:00
Yury Delendik
4be65a9477
Merge pull request #4516 from dferer/ios-scrolling
...
Added CSS rules to improve scrolling on iOS devices
2014-04-03 09:34:20 -05:00
Yury Delendik
f57c6935d7
Implements WebGL support
2014-04-03 08:36:22 -05:00
Jonas Jenwald
42f9541081
Add preference to automatically enable the Hand Tool when the viewer loads
2014-04-03 10:17:35 +02:00
Jonas Jenwald
4c9c43f82b
Modify {get, set}Preferences in PdfStreamConverter.jsm to support async
2014-04-03 10:17:35 +02:00
Jonas Jenwald
c920372ff2
Rewrite 'Preferences' to make it async
2014-04-03 10:08:33 +02:00
Yury Delendik
bd11111465
Merge pull request #4545 from Rob--W/crx-api-enhancements
...
Use new Chromium APIs for FTP and redirects
2014-04-02 09:40:13 -05:00
Yury Delendik
75d09fd820
Merge pull request #4524 from fkaelberer/fullWidthInPresentationMode
...
Use full screen width in presentation mode
2014-04-02 09:03:37 -05:00
Jonas Jenwald
edfc78dfe7
Only update the Document Properties if the dialog is still visible when the dataAvailablePromise is resolved
2014-04-02 11:55:35 +02:00
Jonas Jenwald
c7a0b68d9a
Remove superfluous 'self' variable from web/document_properties.js
2014-03-31 23:16:44 +02:00
Jonas Jenwald
025f340228
Prevent the Document Properties from being empty when the dialog is opened before the file has started loading
2014-03-31 23:12:48 +02:00
Samuel Chantaraud
50aa49bb06
Added CSS rules to allow smooth (momentum) scrolling on iOS devices
2014-03-31 11:09:18 -04:00
Rob Wu
d04f81b964
Improved FTP support for Chromium extension
2014-03-30 00:08:02 +01:00
fkaelberer
db84851e27
Use full screen width in presentation mode
2014-03-28 08:58:18 +01:00
Jonas Jenwald
7989c125ba
Merge pull request #4529 from stratosv/patch-1
...
Fix error message typo
2014-03-27 23:54:33 +01:00
Brendan Dahl
a06fca142e
Merge pull request #4519 from yurydelendik/pdfbugclean
...
Cleaning up the viewer and pdfbug; fixes bugs in Stepper
2014-03-27 13:27:15 -07:00
Stratos Voukelatos
6a8c998ebd
Fix error message typo
...
It should read 'PDFFindController cannot be initialized without a PDFFindBar instance'.
2014-03-27 21:43:58 +02:00
Yury Delendik
17eded9065
Partially reverts #3641
2014-03-27 10:50:42 -05:00
Yury Delendik
ed8ecfd00a
Cleaning up the viewer and pdfbug; fixes repeats in Stepper
2014-03-26 15:18:53 -05:00
Jonas Jenwald
f6cfab0061
[Firefox] Stop importing default_preferences.js as a module and include it instead
2014-03-26 00:37:32 +01:00
Yury Delendik
cebf7836f4
Simulate support of the Int8Array for IE9
2014-03-20 18:50:34 -05:00
Brendan Dahl
68be273c69
Merge pull request #4470 from yurydelendik/packcmap
...
CMaps binary packing
2014-03-17 12:27:35 -07:00
Yury Delendik
1d8f6cf0e7
Updates make.js for cmaps and make binary cmaps by default
2014-03-17 13:30:43 -05:00
Yury Delendik
e4d0af2687
Fixes HiDPI icons of the secondary toolbar for Chrome
2014-03-17 11:25:50 -05:00
Yury Delendik
69efd9cb96
CMaps binary packing
2014-03-14 16:46:35 -05:00
aib
2870a6108c
Fix download button waiting if document has started but not completed downloading
2014-03-14 05:23:47 +02:00
Tim van der Meij
e5cd75083f
Merge pull request #4132 from yurydelendik/minified
...
Adds make minified command
2014-03-13 21:38:50 +01:00
Yury Delendik
7963f22545
Merge pull request #4259 from brendandahl/built-in-cmaps-squash
...
Adds built in CMaps and unifies the glyph mapping.
2014-03-13 10:27:48 -05:00
Yury Delendik
31ea4e0f4d
Merge pull request #4420 from prometheansacrifice/RemovingCheckSetPresence
...
Removing set-presence-in-ImageData check from canvas.js
2014-03-13 08:31:53 -05:00
Manas (prometheansacrifice)
30e00bc573
Removing set-presence-in-ImageData check from canvas.js
2014-03-11 08:48:37 +05:30
Brendan Dahl
3b209b5347
Add note about adobe license.
2014-03-10 13:03:35 -07:00
Brendan Dahl
48323b8066
Merge pull request #4225 from Snuffleupagus/prefs-v3
...
Improve handling of preferences in Firefox
2014-03-10 10:39:56 -07:00
Jonas Jenwald
9192fb966d
Move globals in web/pdf_find_bar.js
2014-03-10 15:58:18 +01:00
Jonas Jenwald
5dcc92430c
Fix coding style in web/text_layer_builder.js
2014-03-10 11:48:20 +01:00
Jonas Jenwald
9e0ed5ca7e
Fix coding style in web/viewer.js
2014-03-09 12:20:32 +01:00
Jonas Jenwald
0bd865b329
Fix coding style in web/ui_utils.js
2014-03-09 12:04:56 +01:00
Jonas Jenwald
af4e977848
Fix coding style in web/pdf_find_controller.js
2014-03-09 11:51:16 +01:00
Jonas Jenwald
2e09f14a80
Fix coding style in web/pdf_find_bar.js
2014-03-09 11:51:16 +01:00
Jonas Jenwald
6df9cc46b4
Fix coding style in web/firefoxcom.js
2014-03-09 11:51:15 +01:00
Jonas Jenwald
e9cfae84a0
Fix coding style in web/debugger.js
2014-03-09 11:51:15 +01:00
Jonas Jenwald
665b862b7f
Fix coding style in web/compatibility.js
2014-03-09 11:51:15 +01:00
Jonas Jenwald
047a82a07e
Fix coding style in web/chromecom.js
2014-03-09 11:51:14 +01:00
Samuel Chantaraud
076b3433b4
Improved annotations' display/behavior.
...
Added an "InteractiveAnnotation" class to homogenize the annotations' structure (highlighting) and user interactions (for now, used for text and link annotations).
Text annotations:
The appearance (AP) has priority over the icon (Name).
The popup extends horizontally (up to a limit) as well as vertically.
Reduced the title's font size.
The annotation's color (C) is used to color the popup's background.
On top of the mouseover show/hide behavior, a click on the icon will lock the annotation open (for mobile purposes). It can be closed with another click on either the icon or the popup.
An annotation printing is conditioned by its "print" bit
Unsupported annotations are not displayed at all.
2014-03-07 10:48:42 -04:00
Jonas Jenwald
6fd0b063e9
Fix scrolling using Shift+Spacebar in Firefox
2014-03-06 15:26:23 +01:00
Yury Delendik
15847ef94f
Fixes CSS for webkit
2014-03-05 08:50:31 -06:00
Jonas Jenwald
c158894d94
Improve handling of preferences in Firefox
2014-03-05 11:58:12 +01:00
Brendan Dahl
ce9e9e6ff7
Remove embeddedFontsUsed from API.
2014-02-27 14:06:03 -08:00
Samuel Chantaraud
dcb174ed58
Made viewer's webViewerLoad callable from outside viewer.js
...
To allow manual triggering when DOMContentLoaded can not be relied upon.
2014-02-27 13:45:02 -04:00
Rob Wu
3f96d0dabb
Ctrl/cmd + S = save PDF instead of viewer.html
2014-02-27 16:21:47 +01:00
Yury Delendik
7657011985
Merge pull request #4342 from timvandermeij/retina
...
Implement Retina assets
2014-02-26 15:27:11 -06:00
Tim van der Meij
f281669151
Implement Retina assets
2014-02-26 22:22:38 +01:00
Yury Delendik
9c4101b51a
Merge pull request #4335 from dferer/locales-handling
...
Correct formatting of locale id before submitting to l10n
2014-02-26 14:31:17 -06:00
Samuel Chantaraud
cbc9ad3cb6
Correct formatting of locale to make it compatible with l10n (safari issue)
2014-02-26 16:09:58 -04:00
Brendan Dahl
d0f87457d7
Merge pull request #4331 from nnethercote/cleanups
...
Minor clean-ups
2014-02-26 12:06:13 -08:00
Brendan Dahl
6cce1e44dd
Merge pull request #4292 from Snuffleupagus/issue-4232
...
Fix wrong page being displayed when entering/exiting Presentation mode with zoom set to 'page-fit'
2014-02-26 11:43:42 -08:00
Jonas Jenwald
4ee1fb7956
Fix spacebar scrolling in Firefox (4224 follow-up)
2014-02-26 20:17:58 +01:00
Brendan Dahl
0af0c6c99d
Merge pull request #4229 from Rob--W/crx-stream-progress
...
Get progress bar for PDF streams in Chromium by passing the expected content length to the page
2014-02-26 11:12:34 -08:00
Brendan Dahl
890752680b
Merge pull request #4224 from Rob--W/shortcut-responsiveness
...
Focus container when arrow/navigation keys are pressed
2014-02-26 10:52:17 -08:00
Nicholas Nethercote
d4e8b41639
Remove some unnecessary local variables.
2014-02-24 18:25:59 -08:00
Tim van der Meij
6d703ca640
Merge pull request #4327 from Snuffleupagus/issue-4315-followup
...
Move print icons now that all icons are the same size
2014-02-24 21:44:41 +01:00
Jonas Jenwald
2337e974f7
Move print icons now that all icons are the same size
2014-02-20 22:49:16 +01:00
shorlander
bef10a938a
Clean up toolbar images and add Retina assets.
2014-02-20 16:10:46 -05:00
Yury Delendik
d28b890aa1
Merge pull request #4299 from peerlibrary/bind-compatibility
...
Fix for bind compatibility implementation (polyfill)
2014-02-18 09:00:17 -06:00
Mitar
628de8a1f4
Fix for bind compatibility implementation (polyfill).
...
Previously, reconstruction of arguments was incorrect if arguments contained
arrays. Arrays were added to arguments as their elements and not as a whole
array. It is enough to simply pass whole array to concat and it will be (only
one level deep) added to arguments.
In addition, we call slice on arguments for maximum compatibility (it is used
in Underscore.js library, with which I was comparing implementations while
debugging).
2014-02-15 03:48:18 -08:00
Gabriele Svelto
f4d54517c4
Bug 972435 - Recompress all PNG assets
2014-02-13 17:57:10 +01:00
Jonas Jenwald
d6ca563f46
Fix wrong page being displayed when entering/exiting Presentation mode with zoom set to 'page-fit'
2014-02-11 22:51:14 +01:00
Yury Delendik
4563f6cd58
Merge pull request #4191 from Rob--W/crx-chrome-os
...
Register PDF Viewer as PDF handler in Chrome OS's file browser
2014-02-11 12:51:36 -06:00
Brendan Dahl
b5b94a4af3
Use built in CMaps and unify the glyph mapping.
2014-02-11 10:27:09 -08:00
Brendan Dahl
e477958b74
Remove inline script warnings.
2014-02-03 14:14:54 -08:00
Rob Wu
ce9400dc8b
Handle navigation keys when viewer is not focused
...
Restrict the scrollbar hack to the keycode for "spacebar",
since the bug only occurs in Firefox with spacebar.
Keyboard navigation is only activated for the spacebar if
the currently focused element is not a button.
2014-01-31 14:59:49 +01:00
Rob Wu
eaf7daf7db
[CRX] Pass expected length of stream to viewer
...
To get a progress bar for POST/FTP requests in Chromium.
2014-01-30 23:03:15 +01:00
Rob Wu
64a4a27455
Remove obsolete code from shortcut handler
...
These lines were introduced in 612f59aa10
when the only shortcuts were +/-/=/0 (to change zoom level).
Back then, when the input fields were focused, using these keys would
add these unwanted characters to the input field and change the zoom
level of the viewer. Having both operations at the same time was an
undesired event, so a check was inserted, to ignore shortcuts when
the toolbar is focused.
The #toolbar element doesn't exist any more, so these lines are obsolete.
2014-01-30 15:26:51 +01:00
Rob Wu
65701f941d
Get rid of weird scrollbar on mouse down
2014-01-30 15:06:04 +01:00
Yury Delendik
b4eceac826
Merge pull request #4209 from Rob--W/grab-to-pan-performance
...
Update Grab to pan to fix performance issue
2014-01-29 15:30:58 -08:00
Rob Wu
45c633b072
Update Grab to pan to fix performance issue
...
Reported at http://stackoverflow.com/questions/21392844/pdf-js-recalculating-problme
See also e0f893753a
Changes versus grab-to-pan.js: Moved inline style to viewer.css,
lowered z-index from 2e9 to 50000 (note to future maintainers:
make sure that all other z-index values stay below 50000!).
2014-01-30 00:16:25 +01:00
Rob Wu
9df998914d
Print shortcut: Ctrl + (Shift +) P only
...
The previous version interfered with the full screen shortcut
(Ctrl + Alt + P).
The new version only intercepts Cmd/Ctrl + P (all browsers).
And Ctrl + Shift + P in Chrome / Opera (Presto and Chromium),
because these browsers also associate a Print operation with
the shortcut.
2014-01-29 18:38:42 +01:00
Brendan Dahl
c2e31cd1ef
Merge pull request #4205 from yurydelendik/blob-open-file
...
Using blob URL for open file
2014-01-28 14:15:35 -08:00
Brendan Dahl
0e000392ae
Merge pull request #4179 from yurydelendik/dataLoaded
...
Fixes PDFDocumentProxy.getDataLoaded API name (and refactoring)
2014-01-28 13:56:01 -08:00
Yury Delendik
e5e9c6e243
Fixes PDFDocumentProxy.getDownloadInfo API name (and refactoring)
2014-01-28 15:13:47 -06:00
Tim van der Meij
b4b145507c
Implements mouse wheel behaviour for non-Firefox browsers
2014-01-28 20:52:25 +01:00
Yury Delendik
48f0d0a131
Refactors nextPageMatch (nits)
2014-01-28 11:11:02 -06:00
Yury Delendik
187c9007ef
Merge pull request #4131 from karlden/findUnboundedRecursionBug960409
...
Fixes find functionality recursion (bugzilla FF bug 960409)
2014-01-28 06:44:42 -08:00
Brendan Dahl
59526a7cf1
Merge pull request #4189 from yurydelendik/split-pattern
...
Refactors shared/pattern.js into core/ and display/
2014-01-27 17:40:22 -08:00
Yury Delendik
18515b8668
Using blob URL for open file
2014-01-27 13:11:02 -06:00
Yury Delendik
570c4f5660
Merge pull request #4203 from timvandermeij/outline-chrome
...
Removes button outline as visible in Chrome
2014-01-27 06:40:01 -08:00
Tim van der Meij
fa603af391
Removes button outline as visible in Chrome
2014-01-27 11:57:33 +01:00
Rob Wu
7bbff32a4d
[security] Verify message source in Firefox add-on
...
And put initPassiveLoading within a preprocessor block because
it is only used by Firefox.
2014-01-26 12:55:48 +01:00
Rob Wu
60fb28caf0
Register as File browser handler in Chrome OS
2014-01-25 22:37:19 +01:00
Rob Wu
b0e18a0703
[CRX] Remove redundant location.origin check
...
The PDF Viewer will always be rendered directly from the extension,
so checking "origin == chrome-extension:/.." is not needed any more.
( since edd4bae903
)
2014-01-25 21:44:58 +01:00
Rob Wu
aeaf11ca43
[CRX] Fall back to sender.tab.url if !tab.url
...
sender.url is relatively new (Chromium 29)
( https://chromiumcodereview.appspot.com/14301016 )
2014-01-25 20:15:43 +01:00
Yury Delendik
bf432a37bb
Refactors shared/pattern.js into core/ and display/
2014-01-25 12:18:22 -06:00
Tim van der Meij
c952b6fb85
Miscellaneous improvements for the document properties dialog
2014-01-23 00:30:48 +01:00
Yury Delendik
ba1eb4d1d1
Merge pull request #4126 from Rob--W/crx-using-streams-api
...
Chromium extension using streamsPrivate API!
2014-01-22 05:12:07 -08:00
Tim van der Meij
5f7ded4ff6
Document properties
2014-01-22 00:07:07 +01:00
Tim van der Meij
d25b0a74d0
RTL CSS improvements
2014-01-21 22:56:19 +01:00
Brendan Dahl
e13500e46b
Merge pull request #4140 from timvandermeij/close-secondary-toolbar
...
Close the secondary toolbar when an action is performed once
2014-01-21 11:47:11 -08:00
Brendan Dahl
f18e3e9e0f
Merge pull request #4144 from yurydelendik/api-doc
...
Misc fixes for the API docs
2014-01-21 11:31:16 -08:00
Sriram
151cd6dee8
Terminate worker of previous doc
2014-01-21 07:13:27 +05:30
Yury Delendik
96fff4cc74
Refactors getTextContent return value
2014-01-17 13:26:00 -06:00
Yury Delendik
2b298a7a34
Adds make minified command
2014-01-17 10:50:54 -06:00
Jonas Jenwald
80f5ae518f
Remove old CSS rules
2014-01-17 16:31:51 +01:00
Tim van der Meij
e14d917161
Close the secondary toolbar when an action is only performed once
2014-01-17 12:16:43 +01:00
Karl Denninghoff
1be27e3c81
Fixes but 960409 and adresses review comments including removal of do-while construct
2014-01-16 13:58:29 -08:00
Brendan Dahl
ff66c23e6e
Merge pull request #4089 from yurydelendik/issue3725
...
Takes ascent/descent in account in the text layer
2014-01-16 13:12:04 -08:00
Brendan Dahl
3b829f4a45
Merge pull request #4103 from yurydelendik/issue3977
...
Introduces disableObjectCreateURL
2014-01-16 10:51:22 -08:00
Jonas Jenwald
181e06f30a
Fix regression that disabled the "Open With Different Viewer" button on the fallback bar
2014-01-16 13:49:39 +01:00
Rob Wu
cdadb0db4d
Proof of concept using chrome.streamsPrivate API
...
This method captures all application/pdf streams, loads the viewer
and passes the stream to the PDF.js viewer.
This commit shows a proof of concept using the chrome.streamsPrivate API.
Advantages of new method:
- Access to the response body of the original request, thus fewer
network requests.
- PDFs from non-GET requests (e.g. POST) are now supported.
- FTP files are also supported.
Possible improvements:
- Use declared content scripts instead of dynamic chrome.tabs.executeScript.
This allows the extension to render the viewer in frames when the
extension is disallowed to run executeScript for the top URL.
- Use chrome.declarativeWebRequest instead of webRequest, and replace
background page with event page (don't forget to profile the
difference & will the background/event page still work as intended?).
2014-01-15 23:04:15 +01:00
Brendan Dahl
a340336269
Merge pull request #4081 from yurydelendik/doubledraw
...
Avoiding double draw() calls
2014-01-14 14:33:16 -08:00
Tim van der Meij
3e8795f8b8
Prevent the open file button from appearing in the B2G viewer/preview
2014-01-14 00:09:54 +01:00
Tim van der Meij
e05bda4045
De-inline CSS for the 'open file' button
2014-01-13 22:04:36 +01:00
Tim van der Meij
08e1ef356a
Make presentation mode use a black background
2014-01-13 21:30:47 +01:00
Tim van der Meij
ee48522a86
Merge pull request #4109 from Snuffleupagus/css-zoom-annotations
...
Update the annotationLayer when using CSS only zoom
2014-01-13 12:14:12 -08:00
Jonas Jenwald
3c637b7ca9
Update the annotationLayer when using CSS only zoom
2014-01-12 23:07:56 +01:00
Jonas Jenwald
05c331c295
Maintain the current position in the document when zooming
2014-01-11 13:01:25 +01:00
Yury Delendik
a8c11ad1e5
Introduces disableObjectCreateURL
2014-01-10 16:30:41 -06:00
Yury Delendik
2f4246abe4
Fixes FitV scrolling
2014-01-10 12:15:09 -06:00
Tim van der Meij
ae117c296a
Merge pull request #4088 from Rob--W/handtool-button-is-null
...
Allow hand tool toggle button to be optional
2014-01-08 14:41:20 -08:00
Yury Delendik
0131101275
Takes ascent/descent in account in the text layer
2014-01-08 13:50:52 -06:00
Brendan Dahl
ebdd710da3
Merge pull request #4034 from Snuffleupagus/setScale-regression
...
Fix setScale regression that affects exiting Presentation Mode on narrow window widths
2014-01-08 10:04:35 -08:00
Rob Wu
838802c2d3
Explain meaning of elements in secondary_toolbar
2014-01-08 11:59:30 +01:00
Brendan Dahl
5d080a03bb
Show a different warning for PDF’s with forms.
2014-01-07 16:03:45 -08:00
Rob Wu
f2d13a2e2c
Test if toggleHandTool is null before using it
...
Do not break the viewer if the buttons are not
available for some reason.
2014-01-07 22:55:38 +01:00
Yury Delendik
378c49c2d8
Avoiding double draw() calls
2014-01-07 10:59:54 -06:00
Yury Delendik
5bf3e44e30
Introduces LegacyPromise; polyfills DOM Promise
2014-01-03 18:17:05 -06:00
Yury Delendik
122cd150d4
Merge pull request #4048 from brendandahl/unsupported-features
...
Only trigger warning bar on certain unsupported features.
2014-01-03 16:01:20 -08:00
Tim van der Meij
149057cf8f
Merge pull request #4067 from fkaelberer/PNGs_recompressed
...
Recompressed PNG assets
2014-01-03 11:58:12 -08:00
Brendan Dahl
2228343f77
Only trigger warning bar on certain unsupported features.
2014-01-03 09:34:13 -08:00
Yury Delendik
c389451a5b
Merge pull request #4045 from brendandahl/verbosity
...
Add verbosity as an api setting.
2014-01-02 12:25:00 -08:00
fkaelberer
1b35bf6c5e
Recompressed PNG assets
2014-01-02 21:11:01 +01:00
Brendan Dahl
d005353115
Merge pull request #4055 from Snuffleupagus/fix-thumbnail-rotation-regression
...
Fix thumbnail rotation regression
2014-01-02 10:39:13 -08:00
Jonas Jenwald
3d523000b9
Fix thumbnail rotation regression
2013-12-25 23:10:17 +01:00
Jonas Jenwald
4bd9767112
Rename 'Settings' to 'ViewHistory'
2013-12-22 00:07:42 +01:00
Jonas Jenwald
31ec36d64f
Fix typo in 'isViewFinished' function name
2013-12-20 15:32:16 +01:00
Brendan Dahl
53549411b4
Add verbosity as an api setting.
2013-12-18 13:39:03 -08:00
Jonas Jenwald
e4f799a09c
Small cleanup in 'set page'
2013-12-18 03:08:50 +01:00
Brendan Dahl
58407cfa94
Merge pull request #4006 from Rob--W/crx-url-in-pageaction
...
[CRX] Add a pageAction to omnibox showing PDF URL
2013-12-17 11:33:29 -08:00
Brendan Dahl
738ae57960
Merge pull request #3967 from Snuffleupagus/scrollIntoView-horizontal
...
Add support for horizontal scrolling in 'scrollIntoView' in ui_utils.js
2013-12-17 11:30:22 -08:00
Jonas Jenwald
356ebf25cc
Merge pull request #4038 from Rob--W/css-unprefixed-cursor-grab
...
Add unprefixed "grab" / "grabbing" values for cursor
2013-12-16 10:42:51 -08:00
Rob Wu
364676823b
Add unprefixed grab/grabbing cursor
...
Unprefixed "grab" / "grabbing" values of cursor will land in Firefox 27
(https://bugzilla.mozilla.org/show_bug.cgi?id=880672 )
(https://github.com/Rob--W/grab-to-pan.js/commit/fda961a3 )
2013-12-16 19:01:59 +01:00
Rob Wu
8526d3c600
[CRX] Add a pageAction to omnibox showing PDF URL
...
In Chromium extensions, the viewer's URL looks like this:
chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf
Furthermore, the PDF Viewer itself can also add something to the reference fragment:
chrome-extension://oemmndcbldboiebfnladdacbdfmadadm/http://example.com/file.pdf#page=2
Consequently, it is difficult to copy a clean URL (e.g. for sharing over mail)
without having to tidy-up the URL manually.
This commit solves this issue by adding a button to the omnibox,
which shows the clean PDF URL on click.
2013-12-16 19:00:32 +01:00
Jonas Jenwald
694b3d55b1
Fix setScale regression that affects exiting Presentation Mode on narrow window widths
2013-12-14 23:09:36 +01:00
Tim van der Meij
b1e5c7e068
Fix typo in viewer.css
2013-12-14 23:01:49 +01:00
Jonathan Watt
3eaa421c74
Prevent the page number field from having a spinner (spin buttons) in mozilla now that it supports <input type=number>
2013-12-10 15:15:22 +00:00
Brendan Dahl
1b54530b81
Merge pull request #3684 from Rob--W/hand-tool
...
Implement hand tool
2013-12-06 18:20:40 -08:00
Jonas Jenwald
736c570231
Add support for horizontal scrolling in 'scrollIntoView' in ui_utils.js
2013-12-03 19:55:35 +01:00
Yury Delendik
1d276b0396
Merge pull request #3941 from Snuffleupagus/search-from-current-page
...
Begin searching from current page
2013-12-03 08:53:16 -08:00
Rob Wu
3914768085
Implement hand tool
...
The logic for the hand tool is implemented in a separate project,
maintained at https://github.com/Rob--W/grab-to-pan.js
Integration notes
- Added toggle as an entry under the Secondary toolbar
- Added shortcut "h" to toggle hand tool (to-do: document this in wiki
after merge). This shortcut is also used in Adobe's Acrobat Reader.
To-do: localizations for:
hand_tool_enable.title=
hand_tool_enable_label=
hand_tool_disable.title=
hand_tool_disable_label=
To-do (wish): persistence of hand tool preference, preferably a global setting.
secondaryToolbarButton-handTool.png created by Stephen Horlander <shorlander@mozilla.com>
2013-12-03 15:51:41 +01:00
Yury Delendik
f0c830dba2
Merge pull request #3978 from brendandahl/wait-for-render
...
Wait for one page to render before fetching all pages.
2013-12-03 06:48:17 -08:00
Jonas Jenwald
6dda3ce0cf
Remove </input> tag
2013-11-27 22:14:26 +01:00
Brendan Dahl
d0312aa6ba
Wait for one page to render before fetching all pages.
2013-11-26 13:55:50 -08:00
Yury Delendik
585a3d0f10
Merge pull request #3972 from brendandahl/print-reg
...
Fix printing regression from #3848 .
2013-11-26 11:13:51 -08:00
Brendan Dahl
9ac950f9a8
Append entire DOM fragment at once.
2013-11-26 11:01:28 -08:00
Brendan Dahl
c9f2390567
Fix printing regression from #3848 .
2013-11-25 16:13:40 -08:00
Brendan Dahl
1bbf0e55b0
Fix rotation regression from #3970 .
2013-11-25 14:08:28 -08:00
Brendan Dahl
c20476bfca
Fix page rotation for unloaded pages.
2013-11-25 10:05:23 -08:00
Yury Delendik
fdd5d414ed
Fixes find position in HiDPI displays
2013-11-25 09:07:10 -06:00
Jonas Jenwald
7542d50167
Fix issues with /FitR destinations
2013-11-23 18:27:03 +01:00
Jonas Jenwald
44725d4657
[PDFHistory] Fix "Warning: Unhandled rejection: [Exception... "The operation is insecure."" in Firefox 25
2013-11-23 12:15:39 +01:00
Brendan Dahl
dca5edea21
Add BOM to viewer.
2013-11-22 11:10:43 -08:00
Yury Delendik
78b61fedfc
Merge branch 'maxsong1002/shortcutkeytonavigate'
2013-11-22 08:22:12 -06:00
maxsong1002
807e4fef34
Add shortcut for goto page
2013-11-22 08:20:05 -06:00
Jonas Jenwald
ca8e3ea06f
[PDFHistory] Fix "Warning: Unhandled rejection: [Exception... "The operation is insecure."" when opening local file
2013-11-22 11:49:16 +01:00
Yury Delendik
124eb30e8d
Merge pull request #3936 from brendandahl/initial-data
...
Leave initial request open until the viewer is ready to switch to range requests.
2013-11-21 06:22:24 -08:00
Yury Delendik
bd7985a83b
Fixes cleaning up of the rendered pages
2013-11-19 17:08:36 -06:00
Jonas Jenwald
982a286f7b
Begin searching from current page
2013-11-19 12:24:42 +01:00
Jonas Jenwald
60610cd625
Implement default preferences
2013-11-18 23:51:06 +01:00
Brendan Dahl
3132c9e7e9
Merge pull request #3911 from yurydelendik/mem-redux2
...
Cleaning up fonts when viewer is idle for some time
2013-11-18 13:01:23 -08:00
Brendan Dahl
0385131a9a
Leave initial request open until the viewer is ready to switch to range requests.
2013-11-18 11:17:26 -08:00
Yury Delendik
e712c4136a
Cleaning up fonts when viewer is idle for some time
2013-11-18 13:01:54 -06:00
Rob Wu
f013d44999
Ctrl + F opens find bar instead of toggling it
2013-11-14 23:56:11 +01:00
Brendan Dahl
a64cd42de9
Use page promise for text extraction.
2013-11-14 10:26:27 -08:00
Brendan Dahl
c2d65fc4ab
Don't traverse all pages to get a single page.
2013-11-13 15:27:46 -08:00
Brendan Dahl
f4942b11f8
Reduce the memory usage of the operator list.
2013-11-13 11:43:38 -08:00
Yury Delendik
a6e7f2226a
Merge pull request #3864 from Snuffleupagus/independent-zoom-parameter
...
Make 'zoom' independent from 'page' in the hash parameters
2013-11-12 11:07:15 -08:00
Yury Delendik
d4cdf5ce41
Increase default auto scale to 125%
2013-11-11 16:51:50 -06:00
Lu Wang
6553bd6c0c
add 'contains' for the classList implementation
2013-11-06 14:52:04 +08:00
Jonas Jenwald
1c259ce806
Fix type mismatch causing wrong scale value in the viewBookmark button
2013-11-02 21:54:54 +01:00
Tim van der Meij
867c667690
Merge pull request #3854 from Snuffleupagus/round-viewBookmark-scale-value
...
Round the scale value displayed by the viewBookmark button to two decimal places
2013-11-02 13:35:02 -07:00
Jonas Jenwald
e41d98f9f0
Make 'zoom' independent from 'page' in the hash parameters
2013-10-30 20:39:44 +01:00
Jonas Jenwald
1cae737d03
Fix zoom parameter regression
2013-10-30 14:28:59 +01:00
Jonas Jenwald
4ee2c96503
Round the scale value displayed by the viewBookmark button to two decimal places
2013-10-28 12:34:35 +01:00
Jonas Jenwald
6102b6197f
Fix scroll keys in Firefox
2013-10-21 23:39:17 +02:00
Jonas Jenwald
f35e777d81
Apply the current zoom level value to each page in Presentation Mode
2013-10-19 18:33:36 +02:00
Jonas Jenwald
bee1b734c2
A few small tweaks of the SecondaryToolbar code
2013-10-18 23:03:28 +02:00
Tim van der Meij
26fb376b65
Merge pull request #3820 from Snuffleupagus/prevent-enter-PresentationMode-during-load
...
Disable Presentation Mode until the document has started rendering
2013-10-18 11:05:45 -07:00
Yury Delendik
b16b3be5c3
Merge pull request #3791 from brendandahl/css-rotate
...
Fix css rotation for canvas and text layer.
2013-10-17 17:59:39 -07:00
Tim van der Meij
46d74bdc51
Decrease dependence of SecondaryToolbar on UI buttons
2013-10-17 23:49:30 +02:00
Tim van der Meij
1c9fc5d7bb
Merge pull request #3822 from Snuffleupagus/fix-chromium-PR-bot-breakage
...
Fix bot breakage caused by Chromium extension PR
2013-10-17 14:24:11 -07:00
Brendan Dahl
ca1806025c
Merge pull request #3794 from brendandahl/b2g-fix
...
Fix the B2G viewer and enable bot preview.
2013-10-17 14:14:17 -07:00
Jonas Jenwald
8405d16379
Fix bot breakage caused by Chromium extension PR
2013-10-17 22:55:25 +02:00
Jonas Jenwald
e367f49686
Disable Presentation Mode until the document has started rendering
2013-10-17 16:52:36 +02:00
Rob Wu
83b780af81
[CRX] Show nicely formatted URL in omnibox
...
Before commit:
chrome-extension://EXTENSIONID/content/web/viewer.html?file=http%3A%2F%2Fexample.com%2Ffile.pdf
After commit:
chrome-extension://EXTENSIONID/http://example/file.pdf
Technical details:
- The extension's background page uses the webRequest API to intercept
requests for <extension host>/<real path to pdf>, and redirect it to
the viewer's URL.
- viewer.js uses history.replaceState to rewrite the URL, so that it's
easier for users to recognize and copy-paste URLs.
- The fake paths /http:, /https:, /file:, etc. have been added to the
web_accessible_resources section of the manifest file, in order to
avoid seeing chrome-extension://invalid/ instead of the actual URL
when using history back/forward to navigate from/to the PDF viewer.
- Since the relative path resolving doesn't work because relative URLs
are inaccurate, a <base> tag has been added. This method has already
been proven to work in the Firefox add-on.
Notes:
- This commit has been cherry-picked from crx-using-streams-api.
- Need to merge https://github.com/mozilla/pdf.js/pull/3582 to deal with
a bug in Chrome <=30
- In Chrome, getting the contents of a FTP file is not possible, so
there's no support for FTP files, even though the extension router
recognizes the ftp: scheme.
2013-10-16 23:14:46 +02:00
Jonas Jenwald
1f4d85db37
Inline setScale in parseScale
2013-10-16 00:26:42 +02:00
Brendan Dahl
702ae3b5e8
Merge pull request #3777 from Snuffleupagus/webkitHideCursor-PresentationMode
...
Fix hiding of the cursor in Presentation Mode in WebKit browsers
2013-10-11 09:19:12 -07:00
Brendan Dahl
c79acf5861
Fix the B2G viewer and enable bot preview.
2013-10-09 15:04:58 -07:00
Tim van der Meij
b1b661a274
Refactoring thumbnail scroll code to fix jumps
2013-10-09 20:40:21 +02:00
Brendan Dahl
f1a6e9015f
Fix css rotation for canvas and text layer.
2013-10-09 11:29:05 -07:00
Tim van der Meij
ec7064ea74
Trivial typo fix
2013-10-09 20:24:12 +02:00
Brendan Dahl
6f61a9c83e
Merge pull request #3727 from brendandahl/css-zoom2
...
Use css to initially scale on zoom.
2013-10-08 20:34:22 -07:00
Brendan Dahl
52e429550c
Simplify the output scale for css zoom.
2013-10-08 20:31:49 -07:00
Jonas Jenwald
631333c486
Fix hiding of the cursor in Presentation Mode in WebKit browsers
2013-10-08 20:42:35 +02:00
Tim van der Meij
64757dd481
Merge pull request #3774 from Snuffleupagus/contextMenu-PresentationMode
...
Enabling clicking to close the context menu in Presentation Mode, without going to the next page
2013-10-08 11:31:02 -07:00
Jonas Jenwald
dfb8e62079
Enabling clicking to close the context menu in Presentation Mode, without going to the next page
2013-10-08 20:11:04 +02:00
Rob Wu
194a734e5d
Resolved severe memory leak (mozPrintCallback)
...
Do NOT save the temporary <canvas> element as `this.canvas`.
`PDFViewer.pages[i].canvas` appears to be used to generate the thumbnail
icons. Well, that's no justification for preventing GC of those
temporary <canvas> elements used during mozPrintCallback.
With a document consisting of 79 pages, this resulted in a 600-700MB
leaked memory.
2013-10-08 19:50:45 +02:00
Rob Wu
1731c0fb42
Add mozPrintCallback shim
...
This shim does the following:
1. Intercept window.print()
2. For a window.print() call (if allowed, ie. no previous print job):
1. Dispatch the beforeprint event.
2. Render a printg progress dialog.
3. For each canvas, call mozPrintCallback if existent (one at a time, async).
4. During each mozPrintCallback callback, update the progress dialog.
5. When all <canvas>es have been rendered, invoke the real window.print().
6. Dispatch the afterprint event.
The shim is not included in Firefox through the preprocessor.
Keyboard shortcuts (Ctrl/Cmd + P) are intercepted and default behavior
(i.e. printing) is prevented, and the steps for window.print() are run.
window.attachEvent is used, in order to cancel printing in IE10 and
earlier (courtesy of Stack Overflow - http://stackoverflow.com/a/15302847 ).
Unfortunately, this doesn't work in IE11 - if Ctrl + P is used, the
print dialog will be shown twice: Once because of Ctrl + P, and again
when all pages have finished rendering.
This logic of this polyfill is not specific to PDF.js, so it can also
be used in other projects.
There's one additional modification in PDF.js's viewer.js: The printed
<canvas> element is wrapped in a <div>. This is needed, because Chrome
would otherwise print one canvas on two pages.
2013-10-08 19:46:59 +02:00
Jonas Jenwald
d795c8ec14
Refactor Presentation Mode code
2013-10-06 20:10:26 +02:00
Tim van der Meij
e2f44361f5
Merge pull request #3759 from Snuffleupagus/issue-3755
...
Fix external links in Presentation Mode (issue 3755)
2013-10-04 13:49:30 -07:00
Tim van der Meij
a68375c48e
Merge pull request #3739 from Snuffleupagus/bug-921162
...
Add the viewBookmark button to the Secondary Toolbar
2013-10-04 13:16:38 -07:00
Brendan Dahl
2d489bab22
Merge pull request #3582 from Rob--W/pushState
...
Set URL in history.replaceState/pushState
2013-10-03 11:35:36 -07:00
Brendan Dahl
df249da923
Use css to initially scale on zoom.
2013-10-02 09:05:46 -07:00
Jonas Jenwald
87eb2dccbe
Fix external links in Presentation Mode (issue #3755 )
2013-10-02 16:17:38 +02:00
Jonas Jenwald
43b0b66ada
Fix coding style and improve comment in settings.js
2013-10-02 15:57:23 +02:00
Jonas Jenwald
d6ab0c61e8
Move Settings from viewer.js to its own file
2013-10-02 15:55:31 +02:00
Jonas Jenwald
bfc66626a0
Move Presentation Mode related code from viewer.js to its own file
2013-10-01 23:11:46 +02:00
Brendan Dahl
17a953c7b3
Merge pull request #3643 from Snuffleupagus/issue-3423
...
Change the cursor so that text selection doesn't appear possible in presentation mode
2013-10-01 13:27:19 -07:00
Jonas Jenwald
b148c9cb51
Add the viewBookmark button to the secondary toolbar
2013-09-27 11:51:32 +02:00
Jonas Jenwald
9fcb1a9e40
Merge pull request #3671 from Rob--W/toolbar-layout-fix
...
Fix layout of main toolbar
2013-09-26 07:55:52 -07:00
Tim van der Meij
63233fa8c2
Improved password prompt
2013-09-24 17:46:54 +02:00
Brendan Dahl
e79935d8b3
Merge pull request #3691 from Snuffleupagus/PDFHistory-followup-3341
...
[PDFHistory] Prevent the history from skipping entries in certain edge cases, when specifying an initialBookmark in the hash parameters on document load
2013-09-23 18:06:21 -07:00
mark-5
866186dcaa
dont display file input when printing
...
closes #2464
2013-09-20 19:08:41 -04:00
Brendan Dahl
6ef44da10b
Use canvas and css width/height instead of css transform for high dpi.
2013-09-20 12:11:14 -07:00
Tim van der Meij
31fda50123
Merge pull request #3663 from Snuffleupagus/move-PageView
...
Move PageView from viewer.js to its own file
2013-09-20 10:52:21 -07:00
Tim van der Meij
bf1b945101
Merge pull request #3692 from Snuffleupagus/issue-3690
...
Prevent trying to set the 'maxHeight' property of the secondaryToolbar before the viewer is completely loaded
2013-09-20 10:43:15 -07:00
Jonas Jenwald
2cf2eb0dfc
Fix coding style in page_view.js
2013-09-20 09:28:03 +02:00
Jonas Jenwald
cebf3c60e2
Move PageView from viewer.js to its own file
2013-09-20 09:25:41 +02:00
Yury Delendik
a8320b2e18
Merge pull request #3695 from SSk123/transform
...
Adding transformation to the extract code
2013-09-19 18:45:59 -07:00
Srishti
3808d02a53
implementing transform matrix to getTextContent
2013-09-20 06:37:08 +05:30
Yury Delendik
9cdcb3881d
Merge pull request #3686 from timvandermeij/rtl-improvements
...
Improvements for RTL languages
2013-09-19 16:21:39 -07:00
Brendan Dahl
c270d7e056
Merge pull request #3641 from Snuffleupagus/properly-disable-presentationMode-when-embedded
...
Properly disable presentation mode when the viewer is embedded
2013-09-17 13:49:11 -07:00
Brendan Dahl
0b7d54f9f6
Merge pull request #3623 from Snuffleupagus/disable-range-requests-in-old-Android
...
Disable range requests in old Android versions
2013-09-17 11:36:31 -07:00
Tim van der Meij
67e4c03786
Improvements for RTL languages
2013-09-14 19:33:00 +02:00
Jonas Jenwald
fabed80b5f
Prevent trying to set the 'maxHeight' property of the secondaryToolbar before the viewer is completely loaded
2013-09-14 18:00:36 +02:00
Jonas Jenwald
fc73dbe695
[PDFHistory] Prevent the history from skipping entries in certain edge cases, when specifying an initialBookmark in the hash parameters on document load
2013-09-14 17:14:04 +02:00
Rob Wu
d45d622354
Fix layout of main toolbar
...
Before this commit there were two main issues:
- In small windows, the zoom controls visually floated above the page number
(e.g. 733px).
- In small windows, the (transparent) zoom container covered the go-to-page
input box, which prevented one from using the input field to quickly navigate
to a different page.
2013-09-11 18:56:10 +02:00
Thor Larholm
3c2d079c42
Fixed review notes: Adding specificity and removing redundant declaration
2013-09-10 22:17:40 +02:00
Thor Larholm
0f07d8ad55
Squashed: Added basic support for presentationMode in IE11
2013-09-10 21:40:14 +02:00
Brendan Dahl
da1c944929
Merge pull request #3656 from timvandermeij/annotation-svg
...
Fixing annotation icon issues
2013-09-09 12:46:26 -07:00
Yury Delendik
69eff38d09
Merge pull request #3660 from maxidirienzo/master
...
viewer.js: Do not process keyboard shortcuts when focused element is a t...
2013-09-09 08:17:50 -07:00
maxidirienzo
ee5d8ca56d
viewer.js: Do not process keyboard shortcuts when focused element is a textarea
...
If focused element is a textarea, viewer should not process keyboard shortcuts (as it does with input and select elements) because while writing on a textarea, if you press k,p,l, or n, the viewer scrolls next/prev page and the letter is not added to the textarea (eg. in my case I had a viewer displaying a product specs in PDF and a "request a quote" form at it's right, the form had a textarea field and users complains that they couldn't write in it, after checking it, I've realized it was this particular issue and fixd it with the change I'm commiting.
2013-09-09 11:50:49 -03:00
Tim van der Meij
48a24a48c1
Fixing annotation icon issues
2013-09-06 21:00:02 +02:00
Brendan Dahl
ec52dea70e
Merge pull request #3645 from Snuffleupagus/presentationMode-fix-search
...
Fix searching in presentation mode in Firefox
2013-09-06 08:18:46 -07:00
Jonas
b118ade9ae
Fix searching in presentation mode in Firefox
2013-09-06 09:08:43 +02:00
Tim van der Meij
14912b5a03
Annotation selection
2013-09-05 23:19:04 +02:00