Commit Graph

291 Commits

Author SHA1 Message Date
Tim van der Meij
ca8f842d87 Rename DocumentProperties to PDFDocumentProperties 2015-04-24 20:35:11 +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
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
Collin Anderson
54e984c763 cleaned whitespace 2015-02-17 11:07:37 -05: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
3eeb571425 Rename document_outline_view.js to pdf_outline_view.js 2015-01-27 22:38:45 +01:00
Jonas Jenwald
64ba38008f Rename the thumbnail_view.js file 2015-01-25 17:21:53 +01:00
Jonas Jenwald
c55dcf19a0 Move PDFThumbnailViewer to its own file 2015-01-24 15:41:18 +01:00
Yury Delendik
9f384bbb41 Creates AnnotationsLayerBuilder. 2014-12-19 13:07:28 -06:00
Yury Delendik
863d583ae1 Renames page_view.js file. 2014-12-17 10:32:07 -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
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
cfeb4c1019 Small refactoring of the loadingBar hiding code 2014-10-05 23:15:10 +02:00
Yury Delendik
70a0935737 Move text_layer_builder and pdf_viewer styles out 2014-09-30 10:48:29 -05:00
Yury Delendik
a1eca2084d Moves constants to avoid dependency on PDFView 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
7af8748151 Moves viewer code into PDFViewer and some code from PageView. 2014-09-21 12:47:07 -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
Yury Delendik
bdeca30fbf Splits shared/annotation.js into core/ and display/ 2014-06-17 17:43:33 -05:00
Jonas Jenwald
c145f0e063 Add larger zoom values to zoom dropdown box 2014-06-14 15:51:55 +02:00
Yury Delendik
d95f78610e Adds compatibility.js to the Firefox extension 2014-05-29 11:50:16 -05:00
Jonas Jenwald
5cd6dddeee Convert the existing overlays to use the OverlayManager 2014-05-25 21:33:15 +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
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
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
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
Tim van der Meij
d05768078b Setting empty tooltips for zoom select box items 2014-04-14 23:35:29 +02:00
Yury Delendik
f57c6935d7 Implements WebGL support 2014-04-03 08:36:22 -05: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
Brendan Dahl
3b209b5347 Add note about adobe license. 2014-03-10 13:03:35 -07: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
Tim van der Meij
5f7ded4ff6 Document properties 2014-01-22 00:07:07 +01:00
Yury Delendik
2b298a7a34 Adds make minified command 2014-01-17 10:50:54 -06:00
Jonas Jenwald
4bd9767112 Rename 'Settings' to 'ViewHistory' 2013-12-22 00:07:42 +01: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
Jonas Jenwald
6dda3ce0cf Remove </input> tag 2013-11-27 22:14:26 +01:00
Brendan Dahl
dca5edea21 Add BOM to viewer. 2013-11-22 11:10:43 -08:00
Jonas Jenwald
60610cd625 Implement default preferences 2013-11-18 23:51:06 +01:00
Jonas Jenwald
6102b6197f Fix scroll keys in Firefox 2013-10-21 23:39:17 +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
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
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
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
Jonas Jenwald
b148c9cb51 Add the viewBookmark button to the secondary toolbar 2013-09-27 11:51:32 +02:00
Tim van der Meij
63233fa8c2 Improved password prompt 2013-09-24 17:46:54 +02:00
Jonas Jenwald
cebf3c60e2 Move PageView from viewer.js to its own file 2013-09-20 09:25:41 +02:00
Tim van der Meij
3c0ac37292 Secondary toolbar 2013-09-04 23:48:31 +02:00
Brendan Dahl
c17a7c9d04 Merge pull request #3505 from Snuffleupagus/move-ThumbnailView
Move ThumbnailView from viewer.js to its own file
2013-08-26 10:30:24 -07:00
Brendan Dahl
bb2529de03 Move the creation of canvas path fonts to the worker. 2013-08-19 16:33:20 -07:00
Brendan Dahl
5ecce4996b Split files into worker and main thread pieces. 2013-08-12 10:48:06 -07:00
Jonas
d99879bfbf Move ThumbnailView from viewer.js to its own file 2013-08-06 22:19:03 +02:00
Yury Delendik
99c9079f54 [CSP] removes inlined styles and scripts 2013-07-30 21:00:37 -05:00
Jonas
8708f8beb5 Fixes regression that cause scrolling using spacebar to break in Firefox 2013-07-19 22:09:37 +02:00
Jonas
09e0c9b65d Move PDFHistory from viewer.js to its own file 2013-07-18 17:18:27 +02:00
Yury Delendik
fb189f4fdf Merge pull request #3476 from Rob--W/no-google-translate
Disable Google Translate on viewer in Chrome.
2013-07-18 06:21:57 -07:00
Rob Wu
d5e16ab85c Viewer: Remove inline events; set height on error
Move inline event handlers to viewer.js to comply with a
Content-Security-Policy where directive "unsafe-inline" is not set.

Change textarea.rows = <number of newlines> to
textarea.style.height = textarea.scrollHeight.
(The former is extremely unreliable; consider long lines...)
2013-07-18 10:38:44 +02:00
Brendan Dahl
7a1049216c Merge pull request #3440 from peerlibrary/syncing-order
Syncing order of JS files in viewer.html and make.js. See #3414
2013-07-16 16:10:25 -07:00
Rob Wu
97efe7886e Disable Google Translate on viewer in Chrome.
test/pdfs/yo01.pdf triggered "This page is in Japanese. Would you like
to translate it?" info bar in Chrome.
2013-07-16 00:13:05 +02:00
Yury Delendik
ef658bf5f1 Refactoring download button logic 2013-07-12 13:14:13 -05:00
Rob Wu
4a2eefe1b6 Allow scrolling by keyboard in Chrome/Opera
Set "tabindex" attribute to allow focus;
Added "outline: none" to prevent focus ring from appearing.

Fixes #3443
2013-07-06 15:37:03 +02:00
Mitar
e0a2ee09b5 Syncing order of JS files in viewer.html and make.js. See #3414 2013-07-02 17:03:16 -07:00
Vivin Paliath
83b6eaed16 pr #3356
squashing commits.
2013-06-18 09:05:55 -07:00
Yury Delendik
0e133f0090 Drawing without fillText; refactoring ADD_TO_PATH 2013-05-15 15:57:27 -05:00
Mack Duan
f8f4b3f45d Refactor code for annotations 2013-05-07 14:22:13 -04:00
Kalervo Kujala
5e08f8039d Replace fullscreen with presentationMode 2013-05-01 09:22:17 +03:00
Jonas
93b8e1fc01 Fix disabling of zoom buttons and add camel case button names 2013-04-30 21:14:18 +02:00
Jonas
adf61ea5b0 Make spacebar work on document load - fixes bug 864619 2013-04-30 16:44:51 +02:00
Mack Duan
ef423ef30c Implement progressive loading of PDFs 2013-04-12 16:13:22 -07:00
Brendan Dahl
60edfce733 Don't hide the download/print buttons when view is small. 2013-02-25 16:53:54 -08:00
Jonas
e4e4b1ab4e Make navigation keys work on document load - avoid breaking embedded viewer, take 3 2013-02-24 17:49:42 +01:00
Julian Viereck
0721de45b0 Hide header/footer by default when printing from Firefox. See Bug 743252 2013-02-17 11:01:19 +01:00
Tim van der Meij
96ec48e634 Squashing commits for disabling zoom buttons feature 2013-02-10 15:01:37 +01:00
Yury Delendik
c53fa62e58 Merge pull request #2644 from SSk123/edit_slider_name
Bug #767698 Slider Rename
2013-01-31 06:06:06 -08:00
Srishti
a80234fee9 Bug #767698 Slider Rename
Bug #767698 Slider Rename
2013-01-31 19:25:02 +05:30
Brendan Dahl
971e202f0b Disable printing a selection for Firefox. 2013-01-30 09:22:00 -05:00
Brendan Dahl
fd4e40c82b New GUI for B2G viewer. 2012-11-29 17:01:51 -08:00
Yury Delendik
e5247e4895 Updates webL10n; using viewer.properties as is 2012-11-29 14:02:33 -06:00
Brendan Dahl
df0d9be4a5 Add close button and title bar for b2g. 2012-11-28 11:02:56 -08:00
Brendan Dahl
11175ba6fe Minor css tweaks for small viewer and aligning borders. 2012-10-29 14:35:07 -07:00
Yury Delendik
06f9b70f07 Merge pull request #2206 from timvandermeij/first-last-page-context-menu
Converted the first and last page buttons to context menu items
2012-10-10 10:36:21 -07:00
Tim van der Meij
6e13e3dd73 Final commit squash 2012-10-10 19:26:41 +02:00
Yury Delendik
94367bd161 Adds tabindex; remove search field type 2012-10-06 09:22:37 -05:00
Yury Delendik
ade5f96787 Add pilot find next/prev icons; localization 2012-10-05 19:15:06 -05:00
Brendan Dahl
95b1f74a30 Add support for firefox integrated find. 2012-10-05 13:59:13 -07:00
Yury Delendik
92770fdd84 Minor CSS fixed for find bar 2012-10-05 10:47:58 -05:00
Brendan Dahl
1f85b8b4ed Update the l10n for the html find bar. 2012-10-02 17:08:47 -07:00
Brendan Dahl
dd0cb37f38 Add some door hanger styling for the find bar 2012-09-28 12:30:07 -07:00
Brendan Dahl
38193b1887 Update the find bar ui status. 2012-09-28 11:18:45 -07:00
Artur Adib
e2a2085f62 remove find button in MOZCENTRAL 2012-09-26 16:47:26 -04:00
Artur Adib
1ec2e2a1a2 remove old unused code 2012-09-26 16:38:02 -04:00
Artur Adib
6864a07221 Use "find" instead of both find & search 2012-09-25 16:17:27 -04:00
Julian Viereck
da57e0f89e Julian's html-search-bar work 2012-09-25 14:48:05 -04:00
Yury Delendik
12a0faadad Renames fullscreen to presentation mode 2012-09-21 09:35:18 -05:00
gigaherz
bbcb05af7b Implement page rotation controls using keyboard (R/shift-R) and context menu. 2012-09-08 01:05:14 +02:00
Michael Payne
6ca9245a39 Changes to allowed versioned building of Chrome extension that meets new
Chrome extension security requirements
2012-09-06 12:39:49 -07:00