viewerjs-rails 0.0.1 → 0.0.2
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.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/app/assets/javascripts/pdf.worker.js +85404 -39091
- data/app/assets/javascripts/viewerjs/ODFViewerPlugin.js +7 -6
- data/app/assets/javascripts/viewerjs/PDFViewerPlugin.js.erb +1 -1
- data/app/assets/javascripts/viewerjs/PluginLoader.js +0 -1
- data/app/assets/javascripts/viewerjs/compatibility.js +403 -383
- data/app/assets/javascripts/viewerjs/pdf.js +7202 -7216
- data/app/assets/javascripts/viewerjs/pdf_find_bar.js +135 -133
- data/app/assets/javascripts/viewerjs/pdf_find_controller.js +291 -289
- data/app/assets/javascripts/viewerjs/text_layer_builder.js +327 -327
- data/app/assets/javascripts/viewerjs/ui_utils.js +181 -181
- data/app/assets/javascripts/viewerjs/{viewer.js → viewer.js.erb} +19 -19
- data/app/assets/javascripts/viewerjs/webodf.js +11863 -606
- data/app/assets/stylesheets/ODFViewerPlugin.css.scss +1 -1
- data/app/assets/stylesheets/PDFViewerPlugin.css.scss +18 -13
- data/app/assets/stylesheets/example.local.css.scss +6 -12
- data/app/assets/stylesheets/viewer.css.scss +36 -36
- data/lib/viewerjs/rails/version.rb +1 -1
- data/lib/viewerjs/view_helpers.rb +63 -54
- metadata +2 -2
@@ -19,82 +19,82 @@
|
|
19
19
|
// optimised CSS custom property getter/setter
|
20
20
|
var CustomStyle = (function CustomStyleClosure() {
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
31
|
-
|
32
|
-
CustomStyle.getProp = function get(propName, element) {
|
33
|
-
// check cache only when no element is given
|
34
|
-
if (arguments.length == 1 && typeof _cache[propName] == 'string') {
|
35
|
-
return _cache[propName];
|
22
|
+
// As noted on: http://www.zachstronaut.com/posts/2009/02/17/
|
23
|
+
// animate-css-transforms-firefox-webkit.html
|
24
|
+
// in some versions of IE9 it is critical that ms appear in this list
|
25
|
+
// before Moz
|
26
|
+
var prefixes = ['ms', 'Moz', 'Webkit', 'O'];
|
27
|
+
var _cache = { };
|
28
|
+
|
29
|
+
function CustomStyle() {
|
36
30
|
}
|
37
31
|
|
38
|
-
|
39
|
-
|
32
|
+
CustomStyle.getProp = function get(propName, element) {
|
33
|
+
// check cache only when no element is given
|
34
|
+
if (arguments.length == 1 && typeof _cache[propName] == 'string') {
|
35
|
+
return _cache[propName];
|
36
|
+
}
|
40
37
|
|
41
|
-
|
42
|
-
|
43
|
-
return (_cache[propName] = propName);
|
44
|
-
}
|
38
|
+
element = element || document.documentElement;
|
39
|
+
var style = element.style, prefixed, uPropName;
|
45
40
|
|
46
|
-
|
47
|
-
|
41
|
+
// test standard property first
|
42
|
+
if (typeof style[propName] == 'string') {
|
43
|
+
return (_cache[propName] = propName);
|
44
|
+
}
|
48
45
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
46
|
+
// capitalize
|
47
|
+
uPropName = propName.charAt(0).toUpperCase() + propName.slice(1);
|
48
|
+
|
49
|
+
// test vendor specific properties
|
50
|
+
for (var i = 0, l = prefixes.length; i < l; i++) {
|
51
|
+
prefixed = prefixes[i] + uPropName;
|
52
|
+
if (typeof style[prefixed] == 'string') {
|
53
|
+
return (_cache[propName] = prefixed);
|
54
|
+
}
|
55
|
+
}
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
|
57
|
+
//if all fails then set to undefined
|
58
|
+
return (_cache[propName] = 'undefined');
|
59
|
+
};
|
60
60
|
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
61
|
+
CustomStyle.setProp = function set(propName, element, str) {
|
62
|
+
var prop = this.getProp(propName);
|
63
|
+
if (prop != 'undefined')
|
64
|
+
element.style[prop] = str;
|
65
|
+
};
|
66
66
|
|
67
|
-
|
67
|
+
return CustomStyle;
|
68
68
|
})();
|
69
69
|
|
70
70
|
function getFileName(url) {
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
71
|
+
var anchor = url.indexOf('#');
|
72
|
+
var query = url.indexOf('?');
|
73
|
+
var end = Math.min(
|
74
|
+
anchor > 0 ? anchor : url.length,
|
75
|
+
query > 0 ? query : url.length);
|
76
|
+
return url.substring(url.lastIndexOf('/', end) + 1, end);
|
77
77
|
}
|
78
78
|
|
79
79
|
/**
|
80
80
|
* Returns scale factor for the canvas. It makes sense for the HiDPI displays.
|
81
81
|
* @return {Object} The object with horizontal (sx) and vertical (sy)
|
82
|
-
|
83
|
-
|
82
|
+
scales. The scaled property is set to false if scaling is
|
83
|
+
not required, true otherwise.
|
84
84
|
*/
|
85
85
|
function getOutputScale(ctx) {
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
86
|
+
var devicePixelRatio = window.devicePixelRatio || 1;
|
87
|
+
var backingStoreRatio = ctx.webkitBackingStorePixelRatio ||
|
88
|
+
ctx.mozBackingStorePixelRatio ||
|
89
|
+
ctx.msBackingStorePixelRatio ||
|
90
|
+
ctx.oBackingStorePixelRatio ||
|
91
|
+
ctx.backingStorePixelRatio || 1;
|
92
|
+
var pixelRatio = devicePixelRatio / backingStoreRatio;
|
93
|
+
return {
|
94
|
+
sx: pixelRatio,
|
95
|
+
sy: pixelRatio,
|
96
|
+
scaled: pixelRatio != 1
|
97
|
+
};
|
98
98
|
}
|
99
99
|
|
100
100
|
/**
|
@@ -104,45 +104,45 @@ function getOutputScale(ctx) {
|
|
104
104
|
* specifying the offset from the top left edge.
|
105
105
|
*/
|
106
106
|
function scrollIntoView(element, spot) {
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
if (!parent) {
|
114
|
-
console.error('offsetParent is not set -- cannot scroll');
|
115
|
-
return;
|
116
|
-
}
|
117
|
-
while (parent.clientHeight === parent.scrollHeight) {
|
118
|
-
if (parent.dataset._scaleY) {
|
119
|
-
offsetY /= parent.dataset._scaleY;
|
120
|
-
offsetX /= parent.dataset._scaleX;
|
121
|
-
}
|
122
|
-
offsetY += parent.offsetTop;
|
123
|
-
offsetX += parent.offsetLeft;
|
124
|
-
parent = parent.offsetParent;
|
107
|
+
// Assuming offsetParent is available (it's not available when viewer is in
|
108
|
+
// hidden iframe or object). We have to scroll: if the offsetParent is not set
|
109
|
+
// producing the error. See also animationStartedClosure.
|
110
|
+
var parent = element.offsetParent;
|
111
|
+
var offsetY = element.offsetTop + element.clientTop;
|
112
|
+
var offsetX = element.offsetLeft + element.clientLeft;
|
125
113
|
if (!parent) {
|
126
|
-
|
114
|
+
console.error('offsetParent is not set -- cannot scroll');
|
115
|
+
return;
|
127
116
|
}
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
117
|
+
while (parent.clientHeight === parent.scrollHeight) {
|
118
|
+
if (parent.dataset._scaleY) {
|
119
|
+
offsetY /= parent.dataset._scaleY;
|
120
|
+
offsetX /= parent.dataset._scaleX;
|
121
|
+
}
|
122
|
+
offsetY += parent.offsetTop;
|
123
|
+
offsetX += parent.offsetLeft;
|
124
|
+
parent = parent.offsetParent;
|
125
|
+
if (!parent) {
|
126
|
+
return; // no need to scroll
|
127
|
+
}
|
132
128
|
}
|
133
|
-
if (spot
|
134
|
-
|
135
|
-
|
129
|
+
if (spot) {
|
130
|
+
if (spot.top !== undefined) {
|
131
|
+
offsetY += spot.top;
|
132
|
+
}
|
133
|
+
if (spot.left !== undefined) {
|
134
|
+
offsetX += spot.left;
|
135
|
+
parent.scrollLeft = offsetX;
|
136
|
+
}
|
136
137
|
}
|
137
|
-
|
138
|
-
parent.scrollTop = offsetY;
|
138
|
+
parent.scrollTop = offsetY;
|
139
139
|
}
|
140
140
|
|
141
141
|
/**
|
142
142
|
* Event handler to suppress context menu.
|
143
143
|
*/
|
144
144
|
function noContextMenuHandler(e) {
|
145
|
-
|
145
|
+
e.preventDefault();
|
146
146
|
}
|
147
147
|
|
148
148
|
/**
|
@@ -151,120 +151,120 @@ function noContextMenuHandler(e) {
|
|
151
151
|
* @return {String} Guessed PDF file name.
|
152
152
|
*/
|
153
153
|
function getPDFFileNameFromURL(url) {
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
154
|
+
var reURI = /^(?:([^:]+:)?\/\/[^\/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/;
|
155
|
+
// SCHEME HOST 1.PATH 2.QUERY 3.REF
|
156
|
+
// Pattern to get last matching NAME.pdf
|
157
|
+
var reFilename = /[^\/?#=]+\.pdf\b(?!.*\.pdf\b)/i;
|
158
|
+
var splitURI = reURI.exec(url);
|
159
|
+
var suggestedFilename = reFilename.exec(splitURI[1]) ||
|
160
|
+
reFilename.exec(splitURI[2]) ||
|
161
|
+
reFilename.exec(splitURI[3]);
|
162
|
+
if (suggestedFilename) {
|
163
|
+
suggestedFilename = suggestedFilename[0];
|
164
|
+
if (suggestedFilename.indexOf('%') != -1) {
|
165
|
+
// URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf
|
166
|
+
try {
|
167
|
+
suggestedFilename =
|
168
|
+
reFilename.exec(decodeURIComponent(suggestedFilename))[0];
|
169
|
+
} catch (e) { // Possible (extremely rare) errors:
|
170
|
+
// URIError "Malformed URI", e.g. for "%AA.pdf"
|
171
|
+
// TypeError "null has no properties", e.g. for "%2F.pdf"
|
172
|
+
}
|
173
|
+
}
|
173
174
|
}
|
174
|
-
|
175
|
-
return suggestedFilename || 'document.pdf';
|
175
|
+
return suggestedFilename || 'document.pdf';
|
176
176
|
}
|
177
177
|
|
178
178
|
var ProgressBar = (function ProgressBarClosure() {
|
179
179
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
function ProgressBar(id, opts) {
|
180
|
+
function clamp(v, min, max) {
|
181
|
+
return Math.min(Math.max(v, min), max);
|
182
|
+
}
|
185
183
|
|
186
|
-
|
187
|
-
this.div = document.querySelector(id + ' .progress');
|
184
|
+
function ProgressBar(id, opts) {
|
188
185
|
|
189
|
-
|
190
|
-
|
186
|
+
// Fetch the sub-elements for later.
|
187
|
+
this.div = document.querySelector(id + ' .progress');
|
191
188
|
|
192
|
-
|
193
|
-
|
194
|
-
this.width = opts.width || 100;
|
195
|
-
this.units = opts.units || '%';
|
189
|
+
// Get the loading bar element, so it can be resized to fit the viewer.
|
190
|
+
this.bar = this.div.parentNode;
|
196
191
|
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
192
|
+
// Get options, with sensible defaults.
|
193
|
+
this.height = opts.height || 100;
|
194
|
+
this.width = opts.width || 100;
|
195
|
+
this.units = opts.units || '%';
|
201
196
|
|
202
|
-
|
197
|
+
// Initialize heights.
|
198
|
+
this.div.style.height = this.height + this.units;
|
199
|
+
this.percent = 0;
|
200
|
+
}
|
203
201
|
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
202
|
+
ProgressBar.prototype = {
|
203
|
+
|
204
|
+
updateBar: function ProgressBar_updateBar() {
|
205
|
+
if (this._indeterminate) {
|
206
|
+
this.div.classList.add('indeterminate');
|
207
|
+
this.div.style.width = this.width + this.units;
|
208
|
+
return;
|
209
|
+
}
|
210
|
+
|
211
|
+
this.div.classList.remove('indeterminate');
|
212
|
+
var progressSize = this.width * this._percent / 100;
|
213
|
+
this.div.style.width = progressSize + this.units;
|
214
|
+
},
|
215
|
+
|
216
|
+
get percent() {
|
217
|
+
return this._percent;
|
218
|
+
},
|
219
|
+
|
220
|
+
set percent(val) {
|
221
|
+
this._indeterminate = isNaN(val);
|
222
|
+
this._percent = clamp(val, 0, 100);
|
223
|
+
this.updateBar();
|
224
|
+
},
|
225
|
+
|
226
|
+
setWidth: function ProgressBar_setWidth(viewer) {
|
227
|
+
if (viewer) {
|
228
|
+
var container = viewer.parentNode;
|
229
|
+
var scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
|
230
|
+
if (scrollbarWidth > 0) {
|
231
|
+
this.bar.setAttribute('style', 'width: calc(100% - ' +
|
232
|
+
scrollbarWidth + 'px);');
|
233
|
+
}
|
234
|
+
}
|
235
|
+
},
|
236
|
+
|
237
|
+
hide: function ProgressBar_hide() {
|
238
|
+
this.bar.classList.add('hidden');
|
239
|
+
this.bar.removeAttribute('style');
|
233
240
|
}
|
234
|
-
|
235
|
-
},
|
241
|
+
};
|
236
242
|
|
237
|
-
|
238
|
-
this.bar.classList.add('hidden');
|
239
|
-
this.bar.removeAttribute('style');
|
240
|
-
}
|
241
|
-
};
|
242
|
-
|
243
|
-
return ProgressBar;
|
243
|
+
return ProgressBar;
|
244
244
|
})();
|
245
245
|
|
246
246
|
var Cache = function cacheCache(size) {
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
247
|
+
var data = [];
|
248
|
+
this.push = function cachePush(view) {
|
249
|
+
var i = data.indexOf(view);
|
250
|
+
if (i >= 0)
|
251
|
+
data.splice(i);
|
252
|
+
data.push(view);
|
253
|
+
if (data.length > size)
|
254
|
+
data.shift().destroy();
|
255
|
+
};
|
256
256
|
};
|
257
257
|
|
258
258
|
//#if !(FIREFOX || MOZCENTRAL || B2G)
|
259
259
|
var isLocalStorageEnabled = (function isLocalStorageEnabledClosure() {
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
260
|
+
// Feature test as per http://diveintohtml5.info/storage.html
|
261
|
+
// The additional localStorage call is to get around a FF quirk, see
|
262
|
+
// bug #495747 in bugzilla
|
263
|
+
try {
|
264
|
+
return ('localStorage' in window && window['localStorage'] !== null &&
|
265
265
|
localStorage);
|
266
|
-
|
267
|
-
|
268
|
-
|
266
|
+
} catch (e) {
|
267
|
+
return false;
|
268
|
+
}
|
269
269
|
})();
|
270
270
|
//#endif
|
@@ -9,7 +9,7 @@ function Viewer(c) {
|
|
9
9
|
n = document.createElement("div");
|
10
10
|
n.id = "aboutDialog";
|
11
11
|
n.innerHTML = '<h1>ViewerJS</h1><p>Open Source document viewer for webpages, built with HTML and JavaScript.</p><p>Learn more and get your own copy on the <a href="http://viewerjs.org/" target="_blank">ViewerJS website</a>.</p>' +
|
12
|
-
|
12
|
+
(c ? '<p>Using the <a href = "' + f + '" target="_blank">' + A + '</a> (<span id = "pluginVersion">' + d + "</span>) plugin to show you this document.</p>" : "") + '<p>Supported by <a href="http://nlnet.nl" target="_blank"><br><img src="<%=asset_path("nlnet.png")%>" width="160" height="60" alt="NLnet Foundation"></a></p><p>Made by <a href="http://kogmbh.com" target="_blank"><br><img src="<%=asset_path("kogmbh.png")%>" width="172" height="40" alt="KO GmbH"></a></p><button id = "aboutDialogCloseButton" class = "toolbarButton textButton">Close</button>';
|
13
13
|
u.appendChild(a);
|
14
14
|
a.appendChild(b);
|
15
15
|
b.appendChild(n);
|
@@ -53,7 +53,7 @@ function Viewer(c) {
|
|
53
53
|
function e(a, b, g) {
|
54
54
|
var e, f;
|
55
55
|
if (e = "custom" === a ? parseFloat(document.getElementById("customScaleOption").textContent) /
|
56
|
-
|
56
|
+
100 : parseFloat(a))C(e, !0, g); else {
|
57
57
|
e = d.clientWidth - p;
|
58
58
|
f = d.clientHeight - p;
|
59
59
|
switch (a) {
|
@@ -107,12 +107,12 @@ function Viewer(c) {
|
|
107
107
|
}
|
108
108
|
|
109
109
|
var b = this, p = 40, r = !1, l = !1, J = !1, s = !1, y, g = document.getElementById("viewer"), d = document.getElementById("canvasContainer"), w = document.getElementById("overlayNavigator"), h = document.getElementById("titlebar"), m = document.getElementById("toolbarContainer"), K = document.getElementById("toolbarLeft"),
|
110
|
-
|
110
|
+
Q = document.getElementById("toolbarMiddleContainer"), O = document.getElementById("scaleSelect"), u = document.getElementById("dialogOverlay"), N = document.getElementById("toolbarRight"), n, L, t = [], k, F, G, H;
|
111
111
|
this.initialize = function () {
|
112
112
|
var a = String(document.location), z = a.indexOf("#"), a = a.substr(z + 1);
|
113
|
-
-1 === z || 0 === a.length ? console.log("Could not parse file path argument.") : (y = a, L = y.replace(/^.*[\\\/]/, ""), document.title = L, document.getElementById("documentName").innerHTML = document.title, c.onLoad = function () {
|
113
|
+
-1 === z || 0 === a.length ? console.log("Could not parse file path argument.") : (y = a, L = y.replace(/^.*[\\\/]/, ""), document.title = L, document.getElementById("documentName").innerHTML = ((_document_title.trim().length <= 0 ) ? document.title : _document_title.trim()), c.onLoad = function () {
|
114
114
|
document.getElementById("pluginVersion").innerHTML =
|
115
|
-
|
115
|
+
c.getPluginVersion();
|
116
116
|
(s = c.isSlideshow()) ? (d.classList.add("slideshow"), K.style.visibility = "visible") : (Q.style.visibility = "visible", c.getPageInView && (K.style.visibility = "visible"));
|
117
117
|
J = !0;
|
118
118
|
t = c.getPages();
|
@@ -133,16 +133,16 @@ function Viewer(c) {
|
|
133
133
|
b.showPage(k + 1)
|
134
134
|
};
|
135
135
|
this.showPreviousPage =
|
136
|
-
|
137
|
-
|
138
|
-
|
136
|
+
function () {
|
137
|
+
b.showPage(k - 1)
|
138
|
+
};
|
139
139
|
this.download = function () {
|
140
140
|
var a = y.split("#")[0];
|
141
141
|
window.open(a + "#viewer.action=download", "_parent")
|
142
142
|
};
|
143
143
|
this.toggleFullScreen = function () {
|
144
144
|
l ? document.cancelFullScreen ? document.cancelFullScreen() : document.mozCancelFullScreen ? document.mozCancelFullScreen() : document.webkitCancelFullScreen ? document.webkitCancelFullScreen() : document.msExitFullscreen && document.msExitFullscreen() : g.requestFullScreen ? g.requestFullScreen() : g.mozRequestFullScreen ? g.mozRequestFullScreen() : g.webkitRequestFullScreen ?
|
145
|
-
|
145
|
+
g.webkitRequestFullScreen() : g.msRequestFullscreen && g.msRequestFullscreen()
|
146
146
|
};
|
147
147
|
this.togglePresentationMode = function () {
|
148
148
|
var a = document.getElementById("overlayCloseButton");
|
@@ -150,9 +150,9 @@ function Viewer(c) {
|
|
150
150
|
}, d.oncontextmenu = function () {
|
151
151
|
}, d.onmousedown = function () {
|
152
152
|
}, e("auto"), s = c.isSlideshow()) : (h.style.display = m.style.display = "none", a.style.display = "block", d.classList.add("presentationMode"), s = !0, d.onmousedown =
|
153
|
-
|
154
|
-
|
155
|
-
|
153
|
+
function (a) {
|
154
|
+
a.preventDefault()
|
155
|
+
}, d.oncontextmenu = function (a) {
|
156
156
|
a.preventDefault()
|
157
157
|
}, d.onmouseup = function (a) {
|
158
158
|
a.preventDefault();
|
@@ -177,7 +177,7 @@ function Viewer(c) {
|
|
177
177
|
(function () {
|
178
178
|
M();
|
179
179
|
c && (b.initialize(),
|
180
|
-
|
180
|
+
document.cancelFullScreen || document.mozCancelFullScreen || document.webkitCancelFullScreen || document.msExitFullscreen || (document.getElementById("fullscreen").style.visibility = "hidden", document.getElementById("presentation").style.visibility = "hidden"), document.getElementById("overlayCloseButton").addEventListener("click", b.toggleFullScreen), document.getElementById("fullscreen").addEventListener("click", b.toggleFullScreen), document.getElementById("presentation").addEventListener("click", function () {
|
181
181
|
l ||
|
182
182
|
b.toggleFullScreen();
|
183
183
|
b.togglePresentationMode()
|
@@ -188,9 +188,9 @@ function Viewer(c) {
|
|
188
188
|
}), document.getElementById("zoomIn").addEventListener("click", function () {
|
189
189
|
b.zoomIn()
|
190
190
|
}),
|
191
|
-
|
192
|
-
|
193
|
-
|
191
|
+
document.getElementById("previous").addEventListener("click", function () {
|
192
|
+
b.showPreviousPage()
|
193
|
+
}), document.getElementById("next").addEventListener("click", function () {
|
194
194
|
b.showNextPage()
|
195
195
|
}), document.getElementById("previousPage").addEventListener("click", function () {
|
196
196
|
b.showPreviousPage()
|
@@ -199,9 +199,9 @@ function Viewer(c) {
|
|
199
199
|
}), document.getElementById("pageNumber").addEventListener("change", function () {
|
200
200
|
b.showPage(this.value)
|
201
201
|
}), document.getElementById("scaleSelect").addEventListener("change",
|
202
|
-
|
203
|
-
|
204
|
-
|
202
|
+
function () {
|
203
|
+
e(this.value)
|
204
|
+
}), d.addEventListener("click", v), w.addEventListener("click", v), d.addEventListener("click", P), h.addEventListener("click", x), m.addEventListener("click", x), window.addEventListener("scalechange", function (a) {
|
205
205
|
var b = document.getElementById("customScaleOption"), c = B(String(a.scale));
|
206
206
|
b.selected = !1;
|
207
207
|
c || (b.textContent = Math.round(1E4 * a.scale) / 100 + "%", b.selected = !0)
|