pdfjs-dist 2.1.266 → 2.2.228
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pdfjs-dist might be problematic. Click here for more details.
- package/CODE_OF_CONDUCT.md +15 -0
- package/bower.json +1 -1
- package/build/pdf.js +3349 -2324
- package/build/pdf.js.map +1 -1
- package/build/pdf.min.js +1 -1
- package/build/pdf.worker.js +2804 -1975
- package/build/pdf.worker.js.map +1 -1
- package/build/pdf.worker.min.js +1 -1
- package/image_decoders/pdf.image_decoders.js +431 -511
- package/image_decoders/pdf.image_decoders.js.map +1 -1
- package/image_decoders/pdf.image_decoders.min.js +1 -1
- package/lib/core/annotation.js +294 -224
- package/lib/core/arithmetic_decoder.js +1 -1
- package/lib/core/bidi.js +1 -1
- package/lib/core/ccitt.js +1 -1
- package/lib/core/ccitt_stream.js +1 -1
- package/lib/core/cff_parser.js +61 -12
- package/lib/core/charsets.js +1 -1
- package/lib/core/chunked_stream.js +24 -14
- package/lib/core/cmap.js +17 -13
- package/lib/core/colorspace.js +1 -1
- package/lib/core/core_utils.js +147 -0
- package/lib/core/crypto.js +1 -1
- package/lib/core/document.js +47 -40
- package/lib/core/encodings.js +1 -1
- package/lib/core/evaluator.js +346 -279
- package/lib/core/font_renderer.js +1 -1
- package/lib/core/fonts.js +23 -11
- package/lib/core/function.js +1 -1
- package/lib/core/glyphlist.js +2 -2
- package/lib/core/image.js +2 -2
- package/lib/core/image_utils.js +111 -0
- package/lib/core/jbig2.js +1 -1
- package/lib/core/jbig2_stream.js +1 -1
- package/lib/core/jpeg_stream.js +1 -1
- package/lib/core/jpg.js +2 -1
- package/lib/core/jpx.js +1 -1
- package/lib/core/jpx_stream.js +1 -1
- package/lib/core/metrics.js +13 -13
- package/lib/core/murmurhash3.js +37 -33
- package/lib/core/obj.js +245 -41
- package/lib/core/operator_list.js +43 -32
- package/lib/core/parser.js +228 -133
- package/lib/core/pattern.js +4 -2
- package/lib/core/pdf_manager.js +17 -15
- package/lib/core/primitives.js +40 -6
- package/lib/core/ps_parser.js +1 -1
- package/lib/core/standard_fonts.js +9 -9
- package/lib/core/stream.js +1 -1
- package/lib/core/type1_parser.js +1 -1
- package/lib/core/unicode.js +2 -2
- package/lib/core/worker.js +54 -171
- package/lib/core/worker_stream.js +277 -0
- package/lib/display/annotation_layer.js +112 -33
- package/lib/display/api.js +211 -123
- package/lib/display/api_compatibility.js +1 -1
- package/lib/display/canvas.js +40 -19
- package/lib/display/content_disposition.js +1 -1
- package/lib/display/display_utils.js +747 -0
- package/lib/display/fetch_stream.js +19 -12
- package/lib/display/font_loader.js +11 -8
- package/lib/display/metadata.js +1 -1
- package/lib/display/network.js +563 -521
- package/lib/display/network_utils.js +1 -1
- package/lib/display/node_stream.js +21 -12
- package/lib/display/pattern_helper.js +24 -25
- package/lib/display/svg.js +1068 -565
- package/lib/display/text_layer.js +24 -14
- package/lib/display/transport_stream.js +192 -70
- package/lib/display/webgl.js +1 -1
- package/lib/display/worker_options.js +1 -1
- package/lib/display/xml_parser.js +1 -1
- package/lib/examples/node/domstubs.js +4 -1
- package/lib/pdf.js +20 -15
- package/lib/pdf.worker.js +3 -3
- package/lib/shared/compatibility.js +6 -6
- package/lib/shared/global_scope.js +1 -1
- package/lib/shared/is_node.js +2 -2
- package/lib/shared/message_handler.js +7 -7
- package/lib/shared/streams_polyfill.js +1 -1
- package/lib/shared/url_polyfill.js +1 -1
- package/lib/shared/util.js +13 -125
- package/lib/test/unit/annotation_spec.js +278 -93
- package/lib/test/unit/api_spec.js +198 -188
- package/lib/test/unit/bidi_spec.js +1 -1
- package/lib/test/unit/cff_parser_spec.js +15 -1
- package/lib/test/unit/clitests_helper.js +3 -3
- package/lib/test/unit/cmap_spec.js +20 -20
- package/lib/test/unit/colorspace_spec.js +17 -12
- package/lib/test/unit/core_utils_spec.js +191 -0
- package/lib/test/unit/crypto_spec.js +1 -1
- package/lib/test/unit/custom_spec.js +8 -8
- package/lib/test/unit/display_svg_spec.js +8 -8
- package/lib/test/unit/display_utils_spec.js +273 -0
- package/lib/test/unit/document_spec.js +7 -12
- package/lib/test/unit/encodings_spec.js +5 -5
- package/lib/test/unit/evaluator_spec.js +8 -10
- package/lib/test/unit/fetch_stream_spec.js +109 -0
- package/lib/test/unit/function_spec.js +1 -1
- package/lib/test/unit/jasmine-boot.js +4 -4
- package/lib/test/unit/message_handler_spec.js +1 -1
- package/lib/test/unit/metadata_spec.js +1 -1
- package/lib/test/unit/murmurhash3_spec.js +1 -1
- package/lib/test/unit/network_spec.js +5 -55
- package/lib/test/unit/network_utils_spec.js +51 -1
- package/lib/test/unit/node_stream_spec.js +8 -8
- package/lib/test/unit/parser_spec.js +150 -86
- package/lib/test/unit/pdf_find_controller_spec.js +1 -1
- package/lib/test/unit/pdf_find_utils_spec.js +1 -1
- package/lib/test/unit/pdf_history_spec.js +1 -1
- package/lib/test/unit/primitives_spec.js +30 -17
- package/lib/test/unit/stream_spec.js +1 -1
- package/lib/test/unit/test_utils.js +197 -43
- package/lib/test/unit/testreporter.js +1 -1
- package/lib/test/unit/type1_parser_spec.js +1 -1
- package/lib/test/unit/ui_utils_spec.js +20 -20
- package/lib/test/unit/unicode_spec.js +5 -5
- package/lib/test/unit/util_spec.js +1 -164
- package/lib/web/annotation_layer_builder.js +1 -1
- package/lib/web/app.js +104 -60
- package/lib/web/app_options.js +45 -37
- package/lib/web/base_viewer.js +7 -7
- package/lib/web/chromecom.js +8 -8
- package/lib/web/debugger.js +7 -7
- package/lib/web/download_manager.js +3 -2
- package/lib/web/firefox_print_service.js +4 -2
- package/lib/web/firefoxcom.js +50 -19
- package/lib/web/genericcom.js +8 -8
- package/lib/web/genericl10n.js +10 -10
- package/lib/web/grab_to_pan.js +3 -1
- package/lib/web/interfaces.js +13 -13
- package/lib/web/overlay_manager.js +10 -10
- package/lib/web/password_prompt.js +2 -2
- package/lib/web/pdf_attachment_viewer.js +1 -1
- package/lib/web/pdf_cursor_tools.js +1 -1
- package/lib/web/pdf_document_properties.js +188 -119
- package/lib/web/pdf_find_bar.js +1 -1
- package/lib/web/pdf_find_controller.js +3 -3
- package/lib/web/pdf_find_utils.js +1 -1
- package/lib/web/pdf_history.js +1 -1
- package/lib/web/pdf_link_service.js +2 -2
- package/lib/web/pdf_outline_viewer.js +53 -28
- package/lib/web/pdf_page_view.js +9 -18
- package/lib/web/pdf_presentation_mode.js +1 -1
- package/lib/web/pdf_print_service.js +5 -3
- package/lib/web/pdf_rendering_queue.js +4 -7
- package/lib/web/pdf_sidebar.js +24 -17
- package/lib/web/pdf_sidebar_resizer.js +1 -1
- package/lib/web/pdf_single_page_viewer.js +1 -1
- package/lib/web/pdf_thumbnail_view.js +2 -2
- package/lib/web/pdf_thumbnail_viewer.js +3 -3
- package/lib/web/pdf_viewer.component.js +3 -3
- package/lib/web/pdf_viewer.js +3 -3
- package/lib/web/preferences.js +30 -30
- package/lib/web/secondary_toolbar.js +1 -1
- package/lib/web/text_layer_builder.js +23 -45
- package/lib/web/toolbar.js +1 -1
- package/lib/web/ui_utils.js +14 -14
- package/lib/web/view_history.js +15 -15
- package/lib/web/viewer_compatibility.js +1 -1
- package/package.json +1 -1
- package/web/pdf_viewer.css +21 -10
- package/web/pdf_viewer.js +126 -194
- package/web/pdf_viewer.js.map +1 -1
- package/lib/display/dom_utils.js +0 -494
- package/lib/test/unit/dom_utils_spec.js +0 -89
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -117,12 +117,18 @@ function () {
|
|
117
117
|
}
|
118
118
|
}, {
|
119
119
|
key: "_addToggleButton",
|
120
|
-
value: function _addToggleButton(div) {
|
120
|
+
value: function _addToggleButton(div, _ref4) {
|
121
121
|
var _this = this;
|
122
122
|
|
123
|
+
var count = _ref4.count,
|
124
|
+
items = _ref4.items;
|
123
125
|
var toggler = document.createElement('div');
|
124
126
|
toggler.className = 'outlineItemToggler';
|
125
127
|
|
128
|
+
if (count < 0 && Math.abs(count) === items.length) {
|
129
|
+
toggler.classList.add('outlineItemsHidden');
|
130
|
+
}
|
131
|
+
|
126
132
|
toggler.onclick = function (evt) {
|
127
133
|
evt.stopPropagation();
|
128
134
|
toggler.classList.toggle('outlineItemsHidden');
|
@@ -155,8 +161,8 @@ function () {
|
|
155
161
|
_iteratorError = err;
|
156
162
|
} finally {
|
157
163
|
try {
|
158
|
-
if (!_iteratorNormalCompletion && _iterator
|
159
|
-
_iterator
|
164
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
165
|
+
_iterator["return"]();
|
160
166
|
}
|
161
167
|
} finally {
|
162
168
|
if (_didIteratorError) {
|
@@ -176,8 +182,8 @@ function () {
|
|
176
182
|
}
|
177
183
|
}, {
|
178
184
|
key: "render",
|
179
|
-
value: function render(
|
180
|
-
var outline =
|
185
|
+
value: function render(_ref5) {
|
186
|
+
var outline = _ref5.outline;
|
181
187
|
var outlineCount = 0;
|
182
188
|
|
183
189
|
if (this.outline) {
|
@@ -201,41 +207,60 @@ function () {
|
|
201
207
|
|
202
208
|
while (queue.length > 0) {
|
203
209
|
var levelData = queue.shift();
|
210
|
+
var _iteratorNormalCompletion2 = true;
|
211
|
+
var _didIteratorError2 = false;
|
212
|
+
var _iteratorError2 = undefined;
|
204
213
|
|
205
|
-
|
206
|
-
var
|
207
|
-
|
208
|
-
|
209
|
-
|
214
|
+
try {
|
215
|
+
for (var _iterator2 = levelData.items[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
216
|
+
var item = _step2.value;
|
217
|
+
var div = document.createElement('div');
|
218
|
+
div.className = 'outlineItem';
|
219
|
+
var element = document.createElement('a');
|
210
220
|
|
211
|
-
|
221
|
+
this._bindLink(element, item);
|
212
222
|
|
213
|
-
|
223
|
+
this._setStyles(element, item);
|
214
224
|
|
215
|
-
|
216
|
-
|
225
|
+
element.textContent = (0, _pdf.removeNullCharacters)(item.title) || DEFAULT_TITLE;
|
226
|
+
div.appendChild(element);
|
217
227
|
|
218
|
-
|
219
|
-
|
228
|
+
if (item.items.length > 0) {
|
229
|
+
hasAnyNesting = true;
|
220
230
|
|
221
|
-
|
231
|
+
this._addToggleButton(div, item);
|
222
232
|
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
233
|
+
var itemsDiv = document.createElement('div');
|
234
|
+
itemsDiv.className = 'outlineItems';
|
235
|
+
div.appendChild(itemsDiv);
|
236
|
+
queue.push({
|
237
|
+
parent: itemsDiv,
|
238
|
+
items: item.items
|
239
|
+
});
|
240
|
+
}
|
231
241
|
|
232
|
-
|
233
|
-
|
242
|
+
levelData.parent.appendChild(div);
|
243
|
+
outlineCount++;
|
244
|
+
}
|
245
|
+
} catch (err) {
|
246
|
+
_didIteratorError2 = true;
|
247
|
+
_iteratorError2 = err;
|
248
|
+
} finally {
|
249
|
+
try {
|
250
|
+
if (!_iteratorNormalCompletion2 && _iterator2["return"] != null) {
|
251
|
+
_iterator2["return"]();
|
252
|
+
}
|
253
|
+
} finally {
|
254
|
+
if (_didIteratorError2) {
|
255
|
+
throw _iteratorError2;
|
256
|
+
}
|
257
|
+
}
|
234
258
|
}
|
235
259
|
}
|
236
260
|
|
237
261
|
if (hasAnyNesting) {
|
238
262
|
this.container.classList.add('outlineWithDeepNesting');
|
263
|
+
this.lastToggleIsShow = fragment.querySelectorAll('.outlineItemsHidden').length === 0;
|
239
264
|
}
|
240
265
|
|
241
266
|
this.container.appendChild(fragment);
|
package/lib/web/pdf_page_view.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -36,7 +36,7 @@ var _pdf_rendering_queue = require("./pdf_rendering_queue");
|
|
36
36
|
|
37
37
|
var _viewer_compatibility = require("./viewer_compatibility");
|
38
38
|
|
39
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
40
40
|
|
41
41
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
42
42
|
|
@@ -130,7 +130,7 @@ function () {
|
|
130
130
|
}
|
131
131
|
|
132
132
|
var zoomLayerCanvas = this.zoomLayer.firstChild;
|
133
|
-
this.paintedViewportMap
|
133
|
+
this.paintedViewportMap["delete"](zoomLayerCanvas);
|
134
134
|
zoomLayerCanvas.width = 0;
|
135
135
|
zoomLayerCanvas.height = 0;
|
136
136
|
|
@@ -146,6 +146,7 @@ function () {
|
|
146
146
|
var keepZoomLayer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
147
147
|
var keepAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
148
148
|
this.cancelRendering(keepAnnotations);
|
149
|
+
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
149
150
|
var div = this.div;
|
150
151
|
div.style.width = Math.floor(this.viewport.width) + 'px';
|
151
152
|
div.style.height = Math.floor(this.viewport.height) + 'px';
|
@@ -174,7 +175,7 @@ function () {
|
|
174
175
|
|
175
176
|
if (!currentZoomLayerNode) {
|
176
177
|
if (this.canvas) {
|
177
|
-
this.paintedViewportMap
|
178
|
+
this.paintedViewportMap["delete"](this.canvas);
|
178
179
|
this.canvas.width = 0;
|
179
180
|
this.canvas.height = 0;
|
180
181
|
delete this.canvas;
|
@@ -184,7 +185,7 @@ function () {
|
|
184
185
|
}
|
185
186
|
|
186
187
|
if (this.svg) {
|
187
|
-
this.paintedViewportMap
|
188
|
+
this.paintedViewportMap["delete"](this.svg);
|
188
189
|
delete this.svg;
|
189
190
|
}
|
190
191
|
|
@@ -254,14 +255,12 @@ function () {
|
|
254
255
|
key: "cancelRendering",
|
255
256
|
value: function cancelRendering() {
|
256
257
|
var keepAnnotations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
257
|
-
var renderingState = this.renderingState;
|
258
258
|
|
259
259
|
if (this.paintTask) {
|
260
260
|
this.paintTask.cancel();
|
261
261
|
this.paintTask = null;
|
262
262
|
}
|
263
263
|
|
264
|
-
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
265
264
|
this.resume = null;
|
266
265
|
|
267
266
|
if (this.textLayer) {
|
@@ -273,14 +272,6 @@ function () {
|
|
273
272
|
this.annotationLayer.cancel();
|
274
273
|
this.annotationLayer = null;
|
275
274
|
}
|
276
|
-
|
277
|
-
if (renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {
|
278
|
-
this.eventBus.dispatch('pagecancelled', {
|
279
|
-
source: this,
|
280
|
-
pageNumber: this.id,
|
281
|
-
renderingState: renderingState
|
282
|
-
});
|
283
|
-
}
|
284
275
|
}
|
285
276
|
}, {
|
286
277
|
key: "cssTransform",
|
@@ -426,8 +417,8 @@ function () {
|
|
426
417
|
function () {
|
427
418
|
var _ref = _asyncToGenerator(
|
428
419
|
/*#__PURE__*/
|
429
|
-
_regenerator
|
430
|
-
return _regenerator
|
420
|
+
_regenerator["default"].mark(function _callee(error) {
|
421
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
431
422
|
while (1) {
|
432
423
|
switch (_context.prev = _context.next) {
|
433
424
|
case 0:
|
@@ -478,7 +469,7 @@ function () {
|
|
478
469
|
return _context.stop();
|
479
470
|
}
|
480
471
|
}
|
481
|
-
}, _callee
|
472
|
+
}, _callee);
|
482
473
|
}));
|
483
474
|
|
484
475
|
return function finishPaintTask(_x) {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -30,6 +30,8 @@ var _ui_utils = require("./ui_utils");
|
|
30
30
|
|
31
31
|
var _app = require("./app");
|
32
32
|
|
33
|
+
var _app_options = require("./app_options");
|
34
|
+
|
33
35
|
var _pdf = require("../pdf");
|
34
36
|
|
35
37
|
var activeService = null;
|
@@ -37,7 +39,7 @@ var overlayManager = null;
|
|
37
39
|
|
38
40
|
function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size) {
|
39
41
|
var scratchCanvas = activeService.scratchCanvas;
|
40
|
-
var PRINT_RESOLUTION = 150;
|
42
|
+
var PRINT_RESOLUTION = _app_options.AppOptions.get('printResolution') || 150;
|
41
43
|
var PRINT_UNITS = PRINT_RESOLUTION / 72.0;
|
42
44
|
scratchCanvas.width = Math.floor(size.width * PRINT_UNITS);
|
43
45
|
scratchCanvas.height = Math.floor(size.height * PRINT_UNITS);
|
@@ -221,7 +223,7 @@ window.print = function print() {
|
|
221
223
|
var activeServiceOnEntry = activeService;
|
222
224
|
activeService.renderPages().then(function () {
|
223
225
|
return activeServiceOnEntry.performPrint();
|
224
|
-
})
|
226
|
+
})["catch"](function () {}).then(function () {
|
225
227
|
if (activeServiceOnEntry.active) {
|
226
228
|
abort();
|
227
229
|
}
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -104,7 +104,7 @@ function () {
|
|
104
104
|
var numVisible = visibleViews.length;
|
105
105
|
|
106
106
|
if (numVisible === 0) {
|
107
|
-
return
|
107
|
+
return null;
|
108
108
|
}
|
109
109
|
|
110
110
|
for (var i = 0; i < numVisible; ++i) {
|
@@ -156,12 +156,9 @@ function () {
|
|
156
156
|
|
157
157
|
case RenderingStates.INITIAL:
|
158
158
|
this.highestPriorityPage = view.renderingId;
|
159
|
-
|
160
|
-
var continueRendering = function continueRendering() {
|
159
|
+
view.draw()["finally"](function () {
|
161
160
|
_this.renderHighestPriority();
|
162
|
-
};
|
163
|
-
|
164
|
-
view.draw().then(continueRendering, continueRendering);
|
161
|
+
});
|
165
162
|
break;
|
166
163
|
}
|
167
164
|
|
package/lib/web/pdf_sidebar.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -50,8 +50,15 @@ exports.SidebarView = SidebarView;
|
|
50
50
|
var PDFSidebar =
|
51
51
|
/*#__PURE__*/
|
52
52
|
function () {
|
53
|
-
function PDFSidebar(
|
54
|
-
var
|
53
|
+
function PDFSidebar(_ref) {
|
54
|
+
var elements = _ref.elements,
|
55
|
+
pdfViewer = _ref.pdfViewer,
|
56
|
+
pdfThumbnailViewer = _ref.pdfThumbnailViewer,
|
57
|
+
eventBus = _ref.eventBus,
|
58
|
+
_ref$l10n = _ref.l10n,
|
59
|
+
l10n = _ref$l10n === void 0 ? _ui_utils.NullL10n : _ref$l10n,
|
60
|
+
_ref$disableNotificat = _ref.disableNotification,
|
61
|
+
disableNotification = _ref$disableNotificat === void 0 ? false : _ref$disableNotificat;
|
55
62
|
|
56
63
|
_classCallCheck(this, PDFSidebar);
|
57
64
|
|
@@ -59,20 +66,20 @@ function () {
|
|
59
66
|
this.active = SidebarView.THUMBS;
|
60
67
|
this.isInitialViewSet = false;
|
61
68
|
this.onToggled = null;
|
62
|
-
this.pdfViewer =
|
63
|
-
this.pdfThumbnailViewer =
|
64
|
-
this.outerContainer =
|
65
|
-
this.viewerContainer =
|
66
|
-
this.toggleButton =
|
67
|
-
this.thumbnailButton =
|
68
|
-
this.outlineButton =
|
69
|
-
this.attachmentsButton =
|
70
|
-
this.thumbnailView =
|
71
|
-
this.outlineView =
|
72
|
-
this.attachmentsView =
|
73
|
-
this.disableNotification = options.disableNotification || false;
|
69
|
+
this.pdfViewer = pdfViewer;
|
70
|
+
this.pdfThumbnailViewer = pdfThumbnailViewer;
|
71
|
+
this.outerContainer = elements.outerContainer;
|
72
|
+
this.viewerContainer = elements.viewerContainer;
|
73
|
+
this.toggleButton = elements.toggleButton;
|
74
|
+
this.thumbnailButton = elements.thumbnailButton;
|
75
|
+
this.outlineButton = elements.outlineButton;
|
76
|
+
this.attachmentsButton = elements.attachmentsButton;
|
77
|
+
this.thumbnailView = elements.thumbnailView;
|
78
|
+
this.outlineView = elements.outlineView;
|
79
|
+
this.attachmentsView = elements.attachmentsView;
|
74
80
|
this.eventBus = eventBus;
|
75
81
|
this.l10n = l10n;
|
82
|
+
this._disableNotification = disableNotification;
|
76
83
|
|
77
84
|
this._addEventListeners();
|
78
85
|
}
|
@@ -272,7 +279,7 @@ function () {
|
|
272
279
|
value: function _showUINotification(view) {
|
273
280
|
var _this = this;
|
274
281
|
|
275
|
-
if (this.
|
282
|
+
if (this._disableNotification) {
|
276
283
|
return;
|
277
284
|
}
|
278
285
|
|
@@ -301,7 +308,7 @@ function () {
|
|
301
308
|
value: function _hideUINotification(view) {
|
302
309
|
var _this2 = this;
|
303
310
|
|
304
|
-
if (this.
|
311
|
+
if (this._disableNotification) {
|
305
312
|
return;
|
306
313
|
}
|
307
314
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -159,6 +159,7 @@ function () {
|
|
159
159
|
key: "reset",
|
160
160
|
value: function reset() {
|
161
161
|
this.cancelRendering();
|
162
|
+
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
162
163
|
this.pageWidth = this.viewport.width;
|
163
164
|
this.pageHeight = this.viewport.height;
|
164
165
|
this.pageRatio = this.pageWidth / this.pageHeight;
|
@@ -209,7 +210,6 @@ function () {
|
|
209
210
|
this.renderTask = null;
|
210
211
|
}
|
211
212
|
|
212
|
-
this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;
|
213
213
|
this.resume = null;
|
214
214
|
}
|
215
215
|
}, {
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -180,7 +180,7 @@ function () {
|
|
180
180
|
|
181
181
|
var thumbnailView = _this._thumbnails[_this._currentPageNumber - 1];
|
182
182
|
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
|
183
|
-
})
|
183
|
+
})["catch"](function (reason) {
|
184
184
|
console.error('Unable to initialize thumbnail viewer', reason);
|
185
185
|
});
|
186
186
|
}
|
@@ -234,7 +234,7 @@ function () {
|
|
234
234
|
thumbView.setPdfPage(pdfPage);
|
235
235
|
_this2._pagesRequests[pageNumber] = null;
|
236
236
|
return pdfPage;
|
237
|
-
})
|
237
|
+
})["catch"](function (reason) {
|
238
238
|
console.error('Unable to get page for thumb view', reason);
|
239
239
|
_this2._pagesRequests[pageNumber] = null;
|
240
240
|
});
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -143,6 +143,6 @@ var _pdf_single_page_viewer = require("./pdf_single_page_viewer");
|
|
143
143
|
|
144
144
|
var _pdf_viewer = require("./pdf_viewer.js");
|
145
145
|
|
146
|
-
var pdfjsVersion = '2.
|
147
|
-
var pdfjsBuild = '
|
146
|
+
var pdfjsVersion = '2.2.228';
|
147
|
+
var pdfjsBuild = 'd7afb74a';
|
148
148
|
(0, _ui_utils.getGlobalEventBus)(true);
|
package/lib/web/pdf_viewer.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -133,8 +133,8 @@ function (_BaseViewer) {
|
|
133
133
|
_iteratorError = err;
|
134
134
|
} finally {
|
135
135
|
try {
|
136
|
-
if (!_iteratorNormalCompletion && _iterator
|
137
|
-
_iterator
|
136
|
+
if (!_iteratorNormalCompletion && _iterator["return"] != null) {
|
137
|
+
_iterator["return"]();
|
138
138
|
}
|
139
139
|
} finally {
|
140
140
|
if (_didIteratorError) {
|
package/lib/web/preferences.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|
@@ -28,7 +28,7 @@ exports.BasePreferences = void 0;
|
|
28
28
|
|
29
29
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
30
30
|
|
31
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
31
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
32
32
|
|
33
33
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
34
34
|
|
@@ -47,27 +47,27 @@ var defaultPreferences = null;
|
|
47
47
|
function getDefaultPreferences() {
|
48
48
|
if (!defaultPreferences) {
|
49
49
|
defaultPreferences = Promise.resolve({
|
50
|
-
"viewOnLoad": 0,
|
51
|
-
"defaultZoomValue": "",
|
52
|
-
"sidebarViewOnLoad": -1,
|
53
50
|
"cursorToolOnLoad": 0,
|
51
|
+
"defaultZoomValue": "",
|
52
|
+
"disablePageLabels": false,
|
53
|
+
"enablePrintAutoRotate": false,
|
54
54
|
"enableWebGL": false,
|
55
55
|
"eventBusDispatchToDOM": false,
|
56
|
-
"pdfBugEnabled": false,
|
57
|
-
"disableRange": false,
|
58
|
-
"disableStream": false,
|
59
|
-
"disableAutoFetch": false,
|
60
|
-
"disableFontFace": false,
|
61
|
-
"textLayerMode": 1,
|
62
|
-
"useOnlyCssZoom": false,
|
63
56
|
"externalLinkTarget": 0,
|
57
|
+
"historyUpdateUrl": false,
|
58
|
+
"pdfBugEnabled": false,
|
64
59
|
"renderer": "canvas",
|
65
60
|
"renderInteractiveForms": false,
|
66
|
-
"
|
67
|
-
"disablePageLabels": false,
|
68
|
-
"historyUpdateUrl": false,
|
61
|
+
"sidebarViewOnLoad": -1,
|
69
62
|
"scrollModeOnLoad": -1,
|
70
|
-
"spreadModeOnLoad": -1
|
63
|
+
"spreadModeOnLoad": -1,
|
64
|
+
"textLayerMode": 1,
|
65
|
+
"useOnlyCssZoom": false,
|
66
|
+
"viewOnLoad": 0,
|
67
|
+
"disableAutoFetch": false,
|
68
|
+
"disableFontFace": false,
|
69
|
+
"disableRange": false,
|
70
|
+
"disableStream": false
|
71
71
|
});
|
72
72
|
}
|
73
73
|
|
@@ -119,8 +119,8 @@ function () {
|
|
119
119
|
value: function () {
|
120
120
|
var _writeToStorage2 = _asyncToGenerator(
|
121
121
|
/*#__PURE__*/
|
122
|
-
_regenerator
|
123
|
-
return _regenerator
|
122
|
+
_regenerator["default"].mark(function _callee(prefObj) {
|
123
|
+
return _regenerator["default"].wrap(function _callee$(_context) {
|
124
124
|
while (1) {
|
125
125
|
switch (_context.prev = _context.next) {
|
126
126
|
case 0:
|
@@ -131,7 +131,7 @@ function () {
|
|
131
131
|
return _context.stop();
|
132
132
|
}
|
133
133
|
}
|
134
|
-
}, _callee
|
134
|
+
}, _callee);
|
135
135
|
}));
|
136
136
|
|
137
137
|
function _writeToStorage(_x) {
|
@@ -145,8 +145,8 @@ function () {
|
|
145
145
|
value: function () {
|
146
146
|
var _readFromStorage2 = _asyncToGenerator(
|
147
147
|
/*#__PURE__*/
|
148
|
-
_regenerator
|
149
|
-
return _regenerator
|
148
|
+
_regenerator["default"].mark(function _callee2(prefObj) {
|
149
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
150
150
|
while (1) {
|
151
151
|
switch (_context2.prev = _context2.next) {
|
152
152
|
case 0:
|
@@ -157,7 +157,7 @@ function () {
|
|
157
157
|
return _context2.stop();
|
158
158
|
}
|
159
159
|
}
|
160
|
-
}, _callee2
|
160
|
+
}, _callee2);
|
161
161
|
}));
|
162
162
|
|
163
163
|
function _readFromStorage(_x2) {
|
@@ -171,8 +171,8 @@ function () {
|
|
171
171
|
value: function () {
|
172
172
|
var _reset = _asyncToGenerator(
|
173
173
|
/*#__PURE__*/
|
174
|
-
_regenerator
|
175
|
-
return _regenerator
|
174
|
+
_regenerator["default"].mark(function _callee3() {
|
175
|
+
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
176
176
|
while (1) {
|
177
177
|
switch (_context3.prev = _context3.next) {
|
178
178
|
case 0:
|
@@ -202,9 +202,9 @@ function () {
|
|
202
202
|
value: function () {
|
203
203
|
var _set = _asyncToGenerator(
|
204
204
|
/*#__PURE__*/
|
205
|
-
_regenerator
|
205
|
+
_regenerator["default"].mark(function _callee4(name, value) {
|
206
206
|
var defaultValue, valueType, defaultType;
|
207
|
-
return _regenerator
|
207
|
+
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
208
208
|
while (1) {
|
209
209
|
switch (_context4.prev = _context4.next) {
|
210
210
|
case 0:
|
@@ -285,9 +285,9 @@ function () {
|
|
285
285
|
value: function () {
|
286
286
|
var _get = _asyncToGenerator(
|
287
287
|
/*#__PURE__*/
|
288
|
-
_regenerator
|
288
|
+
_regenerator["default"].mark(function _callee5(name) {
|
289
289
|
var defaultValue, prefValue;
|
290
|
-
return _regenerator
|
290
|
+
return _regenerator["default"].wrap(function _callee5$(_context5) {
|
291
291
|
while (1) {
|
292
292
|
switch (_context5.prev = _context5.next) {
|
293
293
|
case 0:
|
@@ -336,8 +336,8 @@ function () {
|
|
336
336
|
value: function () {
|
337
337
|
var _getAll = _asyncToGenerator(
|
338
338
|
/*#__PURE__*/
|
339
|
-
_regenerator
|
340
|
-
return _regenerator
|
339
|
+
_regenerator["default"].mark(function _callee6() {
|
340
|
+
return _regenerator["default"].wrap(function _callee6$(_context6) {
|
341
341
|
while (1) {
|
342
342
|
switch (_context6.prev = _context6.next) {
|
343
343
|
case 0:
|
@@ -2,7 +2,7 @@
|
|
2
2
|
* @licstart The following is the entire license notice for the
|
3
3
|
* Javascript code in this page
|
4
4
|
*
|
5
|
-
* Copyright
|
5
|
+
* Copyright 2019 Mozilla Foundation
|
6
6
|
*
|
7
7
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
8
8
|
* you may not use this file except in compliance with the License.
|