修改禅道已知bug

This commit is contained in:
范强强
2022-09-08 19:46:40 +08:00
parent 58b461d213
commit b8d0fbafb9
97 changed files with 111506 additions and 68028 deletions
+18887 -13036
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+73252 -39522
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-128
View File
@@ -1,128 +0,0 @@
let DEFAULT_URL = ''
let url = decodeURIComponent(window.location.search)
let attIdIndex = url.indexOf('&fileId=')
let typeIndex = url.indexOf('?sarType=')
let numberIndex = url.indexOf('&pageNumber=')
let attId = ''
let sarType = 'INLAND_STAND'
let pageNumber = 1
let pageCount = 1
let fileId = ''
let queryAttUrl = '/api/lawss/sarStandFile/queryConvertAtt'
if (attIdIndex > -1) {
attId = url.substring(attIdIndex + 8, url.length)
pageNumber = url.substring(numberIndex + 12, attIdIndex)
sarType = url.substring(typeIndex + 9, numberIndex)
if (sarType === 'INLAND_LAWS' || sarType === 'FOREIGN_LAWS') {
queryAttUrl = '/api/lawss/sarLawsFile/queryConvertAtt'
} else if (sarType === 'BUSS') {
queryAttUrl = '/api/lawss/sarBussStandFile/queryConvertAtt'
}
$.ajax({
url: queryAttUrl,
async: false,
type: 'GET',
data: {
attId: attId
},
success: function (res) {
// res = JSON.parse(res)
if (res.data != null) {
pageCount = res.data.pageCount
if (res.data.fileOldName !== null && res.data.fileOldName !== undefined) {
document.title = res.data.fileOldName + '-在线查看'
}
// $('#pageCount').html(res.data.pageCount)
fileId = res.data.id
getFileInfo()
} else {
alert('文档未转换成功或本地读取不到该文档')
}
},
error: function (data) {
alert('文档未转换成功或本地读取不到该文档')
}
})
}
// document.onkeydown = function () {
// var e = window.event || arguments[0]
// if (e.keyCode === 123) {
// return false
// } else if (e.ctrlKey || e.keyCode === 73) {
// return false
// }
// }
// document.oncontextmenu = function () {
// return false
// }
function getFileInfo () {
$.ajax({
url: '/api/lawss/sarFileInfo/getPdfFileInfo',
async: false,
type: 'GET',
data: {
sarFileId: fileId,
filePageNumber: pageNumber
},
success: function (res) {
res = JSON.parse(res)
if (res.data != null) {
if (res.data.fileInfo != null) {
let data = res.data.fileInfo
let resultFileMsg = data.substring(30, data.length - 50)
resultFileMsg = resultFileMsg.replace(/\*/g, 'A')
let password = res.data.filePwd
sessionStorage.setItem('fileInfoSteam', password)
writeFile(resultFileMsg)
}
}
},
error: function (data) {
alert('文档未转换成功或本地读取不到该文档')
}
})
}
function writeFile (data) {
var BASE64_MARKER = ';base64,' // 声明文件流编码格式
var pdfAsDataUri = data
var pdfAsArray = convertDataURIToBinary(pdfAsDataUri)
DEFAULT_URL = pdfAsArray
if (Number(pageCount) > 1) {
if (Number(pageNumber) === 1 && Number(pageNumber) !== Number(pageCount)) {
$('#upLoadingFile').hide()
$('#downLoadingFile').show()
} else if (Number(pageNumber) !== 1 && Number(pageNumber) !== Number(pageCount)) {
$('#upLoadingFile').show()
$('#downLoadingFile').show()
} else {
$('#upLoadingFile').hide()
$('#downLoadingFile').hide()
}
} else {
$('#upLoadingFile').hide()
$('#downLoadingFile').hide()
}
}
function clickLoadFile (type) {
if (type === 'up') {
pageNumber = Number(pageNumber) - Number(1)
} else {
pageNumber = Number(pageNumber) + Number(1)
}
window.location.href = '/static/pdf/web/viewer.html?sarType=' + sarType + '&pageNumber=' + pageNumber + '&fileId=' + encodeURIComponent(attId)
}
function convertDataURIToBinary (dataURI) {
var raw = window.atob(dataURI) // 这个方法在ie内核下无法正常解析。
var rawLength = raw.length
// 转换成pdf.js能直接解析的Uint8Array类型
var array = new Uint8Array(new ArrayBuffer(rawLength))
for (let i = 0; i < rawLength; i++) {
array[i] = raw.charCodeAt(i)
}
return array
}
-562
View File
@@ -1,562 +0,0 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals VBArray, PDFJS */
'use strict'
// Initializing PDFJS global object here, it case if we need to change/disable
// some PDF.js features, e.g. range requests
if (typeof PDFJS === 'undefined') {
(typeof window !== 'undefined' ? window : this).PDFJS = {}
}
// Checking if the typed arrays are supported
// Support: iOS<6.0 (subarray), IE<10, Android<4.0
(function checkTypedArrayCompatibility () {
if (typeof Uint8Array !== 'undefined') {
// Support: iOS<6.0
if (typeof Uint8Array.prototype.subarray === 'undefined') {
Uint8Array.prototype.subarray = function subarray (start, end) {
return new Uint8Array(this.slice(start, end))
}
Float32Array.prototype.subarray = function subarray (start, end) {
return new Float32Array(this.slice(start, end))
}
}
// Support: Android<4.1
if (typeof Float64Array === 'undefined') {
window.Float64Array = Float32Array
}
return
}
function subarray (start, end) {
return new TypedArray(this.slice(start, end))
}
function setArrayOffset (array, offset) {
if (arguments.length < 2) {
offset = 0
}
for (var i = 0, n = array.length; i < n; ++i, ++offset) {
this[offset] = array[i] & 0xFF
}
}
function TypedArray (arg1) {
var result, i, n
if (typeof arg1 === 'number') {
result = []
for (i = 0; i < arg1; ++i) {
result[i] = 0
}
} else if ('slice' in arg1) {
result = arg1.slice(0)
} else {
result = []
for (i = 0, n = arg1.length; i < n; ++i) {
result[i] = arg1[i]
}
}
result.subarray = subarray
result.buffer = result
result.byteLength = result.length
result.set = setArrayOffset
if (typeof arg1 === 'object' && arg1.buffer) {
result.buffer = arg1.buffer
}
return result
}
window.Uint8Array = TypedArray
window.Int8Array = TypedArray
// we don't need support for set, byteLength for 32-bit array
// so we can use the TypedArray as well
window.Uint32Array = TypedArray
window.Int32Array = TypedArray
window.Uint16Array = TypedArray
window.Float32Array = TypedArray
window.Float64Array = TypedArray
})();
// URL = URL || webkitURL
// Support: Safari<7, Android 4.2+
(function normalizeURLObject () {
if (!window.URL) {
window.URL = window.webkitURL
}
})();
// Object.defineProperty()?
// Support: Android<4.0, Safari<5.1
(function checkObjectDefinePropertyCompatibility () {
if (typeof Object.defineProperty !== 'undefined') {
var definePropertyPossible = true
try {
// some browsers (e.g. safari) cannot use defineProperty() on DOM objects
// and thus the native version is not sufficient
Object.defineProperty(new Image(), 'id', { value: 'test' })
// ... another test for android gb browser for non-DOM objects
var Test = function Test () {}
Test.prototype = { get id () { } }
Object.defineProperty(new Test(), 'id',
{ value: '', configurable: true, enumerable: true, writable: false })
} catch (e) {
definePropertyPossible = false
}
if (definePropertyPossible) {
return
}
}
Object.defineProperty = function objectDefineProperty (obj, name, def) {
delete obj[name]
if ('get' in def) {
obj.__defineGetter__(name, def['get'])
}
if ('set' in def) {
obj.__defineSetter__(name, def['set'])
}
if ('value' in def) {
obj.__defineSetter__(name, function objectDefinePropertySetter (value) {
this.__defineGetter__(name, function objectDefinePropertyGetter () {
return value
})
return value
})
obj[name] = def.value
}
}
})();
// No XMLHttpRequest#response?
// Support: IE<11, Android <4.0
(function checkXMLHttpRequestResponseCompatibility () {
var xhrPrototype = XMLHttpRequest.prototype
var xhr = new XMLHttpRequest()
if (!('overrideMimeType' in xhr)) {
// IE10 might have response, but not overrideMimeType
// Support: IE10
Object.defineProperty(xhrPrototype, 'overrideMimeType', {
value: function xmlHttpRequestOverrideMimeType (mimeType) {}
})
}
if ('responseType' in xhr) {
return
}
// The worker will be using XHR, so we can save time and disable worker.
PDFJS.disableWorker = true
// Support: IE9
if (typeof VBArray !== 'undefined') {
Object.defineProperty(xhrPrototype, 'response', {
get: function xmlHttpRequestResponseGet () {
if (this.responseType === 'arraybuffer') {
return new Uint8Array(new VBArray(this.responseBody).toArray())
} else {
return this.responseText
}
}
})
return
}
// other browsers
function responseTypeSetter () {
// will be only called to set "arraybuffer"
this.overrideMimeType('text/plain; charset=x-user-defined')
}
if (typeof xhr.overrideMimeType === 'function') {
Object.defineProperty(xhrPrototype, 'responseType',
{ set: responseTypeSetter })
}
function responseGetter () {
var text = this.responseText
var i, n = text.length
var result = new Uint8Array(n)
for (i = 0; i < n; ++i) {
result[i] = text.charCodeAt(i) & 0xFF
}
return result.buffer
}
Object.defineProperty(xhrPrototype, 'response', { get: responseGetter })
})();
// window.btoa (base64 encode function) ?
// Support: IE<10
(function checkWindowBtoaCompatibility () {
if ('btoa' in window) {
return
}
var digits =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
window.btoa = function windowBtoa (chars) {
var buffer = ''
var i, n
for (i = 0, n = chars.length; i < n; i += 3) {
var b1 = chars.charCodeAt(i) & 0xFF
var b2 = chars.charCodeAt(i + 1) & 0xFF
var b3 = chars.charCodeAt(i + 2) & 0xFF
var d1 = b1 >> 2, d2 = ((b1 & 3) << 4) | (b2 >> 4)
var d3 = i + 1 < n ? ((b2 & 0xF) << 2) | (b3 >> 6) : 64
var d4 = i + 2 < n ? (b3 & 0x3F) : 64
buffer += (digits.charAt(d1) + digits.charAt(d2) +
digits.charAt(d3) + digits.charAt(d4))
}
return buffer
}
})();
// window.atob (base64 encode function)?
// Support: IE<10
(function checkWindowAtobCompatibility () {
if ('atob' in window) {
return
}
// https://github.com/davidchambers/Base64.js
var digits =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
window.atob = function (input) {
input = input.replace(/=+$/, '')
if (input.length % 4 === 1) {
throw new Error('bad atob input')
}
for (
// initialize result and counters
var bc = 0, bs, buffer, idx = 0, output = '';
// get next character
buffer = input.charAt(idx++);
// character found in table?
// initialize bit storage and add its ascii value
~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,
// and if not first of each 4 characters,
// convert the first 8 bits to one ascii character
bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0
) {
// try to find character in table (0-63, not found => -1)
buffer = digits.indexOf(buffer)
}
return output
}
})();
// Function.prototype.bind?
// Support: Android<4.0, iOS<6.0
(function checkFunctionPrototypeBindCompatibility () {
if (typeof Function.prototype.bind !== 'undefined') {
return
}
Function.prototype.bind = function functionPrototypeBind (obj) {
var fn = this, headArgs = Array.prototype.slice.call(arguments, 1)
var bound = function functionPrototypeBindBound () {
var args = headArgs.concat(Array.prototype.slice.call(arguments))
return fn.apply(obj, args)
}
return bound
}
})();
// HTMLElement dataset property
// Support: IE<11, Safari<5.1, Android<4.0
(function checkDatasetProperty () {
var div = document.createElement('div')
if ('dataset' in div) {
return // dataset property exists
}
Object.defineProperty(HTMLElement.prototype, 'dataset', {
get: function () {
if (this._dataset) {
return this._dataset
}
var dataset = {}
for (var j = 0, jj = this.attributes.length; j < jj; j++) {
var attribute = this.attributes[j]
if (attribute.name.substring(0, 5) !== 'data-') {
continue
}
var key = attribute.name.substring(5).replace(/\-([a-z])/g,
function (all, ch) {
return ch.toUpperCase()
})
dataset[key] = attribute.value
}
Object.defineProperty(this, '_dataset', {
value: dataset,
writable: false,
enumerable: false
})
return dataset
},
enumerable: true
})
})();
// HTMLElement classList property
// Support: IE<10, Android<4.0, iOS<5.0
(function checkClassListProperty () {
var div = document.createElement('div')
if ('classList' in div) {
return // classList property exists
}
function changeList (element, itemName, add, remove) {
var s = element.className || ''
var list = s.split(/\s+/g)
if (list[0] === '') {
list.shift()
}
var index = list.indexOf(itemName)
if (index < 0 && add) {
list.push(itemName)
}
if (index >= 0 && remove) {
list.splice(index, 1)
}
element.className = list.join(' ')
return (index >= 0)
}
var classListPrototype = {
add: function (name) {
changeList(this.element, name, true, false)
},
contains: function (name) {
return changeList(this.element, name, false, false)
},
remove: function (name) {
changeList(this.element, name, false, true)
},
toggle: function (name) {
changeList(this.element, name, true, true)
}
}
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function () {
if (this._classList) {
return this._classList
}
var classList = Object.create(classListPrototype, {
element: {
value: this,
writable: false,
enumerable: true
}
})
Object.defineProperty(this, '_classList', {
value: classList,
writable: false,
enumerable: false
})
return classList
},
enumerable: true
})
})();
// Check console compatibility
// In older IE versions the console object is not available
// unless console is open.
// Support: IE<10
(function checkConsoleCompatibility () {
if (!('console' in window)) {
window.console = {
log: function () {},
error: function () {},
warn: function () {}
}
} else if (!('bind' in console.log)) {
// native functions in IE9 might not have bind
console.log = (function (fn) {
return function (msg) { return fn(msg) }
})(console.log)
console.error = (function (fn) {
return function (msg) { return fn(msg) }
})(console.error)
console.warn = (function (fn) {
return function (msg) { return fn(msg) }
})(console.warn)
}
})();
// Check onclick compatibility in Opera
// Support: Opera<15
(function checkOnClickCompatibility () {
// workaround for reported Opera bug DSK-354448:
// onclick fires on disabled buttons with opaque content
function ignoreIfTargetDisabled (event) {
if (isDisabled(event.target)) {
event.stopPropagation()
}
}
function isDisabled (node) {
return node.disabled || (node.parentNode && isDisabled(node.parentNode))
}
if (navigator.userAgent.indexOf('Opera') !== -1) {
// use browser detection since we cannot feature-check this bug
document.addEventListener('click', ignoreIfTargetDisabled, true)
}
})();
// Checks if possible to use URL.createObjectURL()
// Support: IE
(function checkOnBlobSupport () {
// sometimes IE loosing the data created with createObjectURL(), see #3977
if (navigator.userAgent.indexOf('Trident') >= 0) {
PDFJS.disableCreateObjectURL = true
}
})();
// Checks if navigator.language is supported
(function checkNavigatorLanguage () {
if ('language' in navigator &&
/^[a-z]+(-[A-Z]+)?$/.test(navigator.language)) {
return
}
function formatLocale (locale) {
var split = locale.split(/[-_]/)
split[0] = split[0].toLowerCase()
if (split.length > 1) {
split[1] = split[1].toUpperCase()
}
return split.join('-')
}
var language = navigator.language || navigator.userLanguage || 'en-US'
PDFJS.locale = formatLocale(language)
})();
(function checkRangeRequests () {
// Safari has issues with cached range requests see:
// https://github.com/mozilla/pdf.js/issues/3260
// Last tested with version 6.0.4.
// Support: Safari 6.0+
var isSafari = Object.prototype.toString.call(
window.HTMLElement).indexOf('Constructor') > 0
// Older versions of Android (pre 3.0) has issues with range requests, see:
// https://github.com/mozilla/pdf.js/issues/3381.
// Make sure that we only match webkit-based Android browsers,
// since Firefox/Fennec works as expected.
// Support: Android<3.0
var regex = /Android\s[0-2][^\d]/
var isOldAndroid = regex.test(navigator.userAgent)
if (isSafari || isOldAndroid) {
PDFJS.disableRange = true
}
})();
// Check if the browser supports manipulation of the history.
// Support: IE<10, Android<4.2
(function checkHistoryManipulation () {
// Android 2.x has so buggy pushState support that it was removed in
// Android 3.0 and restored as late as in Android 4.2.
// Support: Android 2.x
if (!history.pushState || navigator.userAgent.indexOf('Android 2.') >= 0) {
PDFJS.disableHistory = true
}
})();
// Support: IE<11, Chrome<21, Android<4.4, Safari<6
(function checkSetPresenceInImageData () {
// IE < 11 will use window.CanvasPixelArray which lacks set function.
if (window.CanvasPixelArray) {
if (typeof window.CanvasPixelArray.prototype.set !== 'function') {
window.CanvasPixelArray.prototype.set = function (arr) {
for (var i = 0, ii = this.length; i < ii; i++) {
this[i] = arr[i]
}
}
}
} else {
// Old Chrome and Android use an inaccessible CanvasPixelArray prototype.
// Because we cannot feature detect it, we rely on user agent parsing.
var polyfill = false, versionMatch
if (navigator.userAgent.indexOf('Chrom') >= 0) {
versionMatch = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)
// Chrome < 21 lacks the set function.
polyfill = versionMatch && parseInt(versionMatch[2]) < 21
} else if (navigator.userAgent.indexOf('Android') >= 0) {
// Android < 4.4 lacks the set function.
// Android >= 4.4 will contain Chrome in the user agent,
// thus pass the Chrome check above and not reach this block.
polyfill = /Android\s[0-4][^\d]/g.test(navigator.userAgent)
} else if (navigator.userAgent.indexOf('Safari') >= 0) {
versionMatch = navigator.userAgent
.match(/Version\/([0-9]+)\.([0-9]+)\.([0-9]+) Safari\//)
// Safari < 6 lacks the set function.
polyfill = versionMatch && parseInt(versionMatch[1]) < 6
}
if (polyfill) {
var contextPrototype = window.CanvasRenderingContext2D.prototype
contextPrototype._createImageData = contextPrototype.createImageData
contextPrototype.createImageData = function (w, h) {
var imageData = this._createImageData(w, h)
imageData.data.set = function (arr) {
for (var i = 0, ii = this.length; i < ii; i++) {
this[i] = arr[i]
}
}
return imageData
}
}
}
})();
// Support: IE<10, Android<4.0, iOS
(function checkRequestAnimationFrame () {
function fakeRequestAnimationFrame (callback) {
window.setTimeout(callback, 20)
}
var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent)
if (isIOS) {
// requestAnimationFrame on iOS is broken, replacing with fake one.
window.requestAnimationFrame = fakeRequestAnimationFrame
return
}
if ('requestAnimationFrame' in window) {
return
}
window.requestAnimationFrame =
window.mozRequestAnimationFrame ||
window.webkitRequestAnimationFrame ||
fakeRequestAnimationFrame
})();
(function checkCanvasSizeLimitation () {
var isIOS = /(iPad|iPhone|iPod)/g.test(navigator.userAgent)
var isAndroid = /Android/g.test(navigator.userAgent)
if (isIOS || isAndroid) {
// 5MP
PDFJS.maxCanvasPixels = 5242880
}
})()
+327 -335
View File
@@ -13,43 +13,42 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict'; let opMap;
var FontInspector = (function FontInspectorClosure() { const FontInspector = (function FontInspectorClosure() {
var fonts; let fonts;
var active = false; let active = false;
var fontAttribute = 'data-font-name'; const fontAttribute = "data-font-name";
function removeSelection() { function removeSelection() {
var divs = document.querySelectorAll('div[' + fontAttribute + ']'); const divs = document.querySelectorAll(`span[${fontAttribute}]`);
for (var i = 0, ii = divs.length; i < ii; ++i) { for (const div of divs) {
var div = divs[i]; div.className = "";
div.className = '';
} }
} }
function resetSelection() { function resetSelection() {
var divs = document.querySelectorAll('div[' + fontAttribute + ']'); const divs = document.querySelectorAll(`span[${fontAttribute}]`);
for (var i = 0, ii = divs.length; i < ii; ++i) { for (const div of divs) {
var div = divs[i]; div.className = "debuggerHideText";
div.className = 'debuggerHideText';
} }
} }
function selectFont(fontName, show) { function selectFont(fontName, show) {
var divs = document.querySelectorAll('div[' + fontAttribute + '=' + const divs = document.querySelectorAll(
fontName + ']'); `span[${fontAttribute}=${fontName}]`
for (var i = 0, ii = divs.length; i < ii; ++i) { );
var div = divs[i]; for (const div of divs) {
div.className = show ? 'debuggerShowText' : 'debuggerHideText'; div.className = show ? "debuggerShowText" : "debuggerHideText";
} }
} }
function textLayerClick(e) { function textLayerClick(e) {
if (!e.target.dataset.fontName || if (
e.target.tagName.toUpperCase() !== 'DIV') { !e.target.dataset.fontName ||
e.target.tagName.toUpperCase() !== "SPAN"
) {
return; return;
} }
var fontName = e.target.dataset.fontName; const fontName = e.target.dataset.fontName;
var selects = document.getElementsByTagName('input'); const selects = document.getElementsByTagName("input");
for (var i = 0; i < selects.length; ++i) { for (const select of selects) {
var select = selects[i];
if (select.dataset.fontName !== fontName) { if (select.dataset.fontName !== fontName) {
continue; continue;
} }
@@ -60,23 +59,22 @@ var FontInspector = (function FontInspectorClosure() {
} }
return { return {
// Properties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'FontInspector', id: "FontInspector",
name: 'Font Inspector', name: "Font Inspector",
panel: null, panel: null,
manager: null, manager: null,
init: function init(pdfjsLib) { init(pdfjsLib) {
var panel = this.panel; const panel = this.panel;
panel.setAttribute('style', 'padding: 5px;'); const tmp = document.createElement("button");
var tmp = document.createElement('button'); tmp.addEventListener("click", resetSelection);
tmp.addEventListener('click', resetSelection); tmp.textContent = "Refresh";
tmp.textContent = 'Refresh'; panel.append(tmp);
panel.appendChild(tmp);
fonts = document.createElement('div'); fonts = document.createElement("div");
panel.appendChild(fonts); panel.append(fonts);
}, },
cleanup: function cleanup() { cleanup() {
fonts.textContent = ''; fonts.textContent = "";
}, },
enabled: false, enabled: false,
get active() { get active() {
@@ -85,68 +83,59 @@ var FontInspector = (function FontInspectorClosure() {
set active(value) { set active(value) {
active = value; active = value;
if (active) { if (active) {
document.body.addEventListener('click', textLayerClick, true); document.body.addEventListener("click", textLayerClick, true);
resetSelection(); resetSelection();
} else { } else {
document.body.removeEventListener('click', textLayerClick, true); document.body.removeEventListener("click", textLayerClick, true);
removeSelection(); removeSelection();
} }
}, },
// FontInspector specific functions. // FontInspector specific functions.
fontAdded: function fontAdded(fontObj, url) { fontAdded(fontObj, url) {
function properties(obj, list) { function properties(obj, list) {
var moreInfo = document.createElement('table'); const moreInfo = document.createElement("table");
for (var i = 0; i < list.length; i++) { for (const entry of list) {
var tr = document.createElement('tr'); const tr = document.createElement("tr");
var td1 = document.createElement('td'); const td1 = document.createElement("td");
td1.textContent = list[i]; td1.textContent = entry;
tr.appendChild(td1); tr.append(td1);
var td2 = document.createElement('td'); const td2 = document.createElement("td");
td2.textContent = obj[list[i]].toString(); td2.textContent = obj[entry].toString();
tr.appendChild(td2); tr.append(td2);
moreInfo.appendChild(tr); moreInfo.append(tr);
} }
return moreInfo; return moreInfo;
} }
var moreInfo = properties(fontObj, ['name', 'type']); const moreInfo = properties(fontObj, ["name", "type"]);
var fontName = fontObj.loadedName; const fontName = fontObj.loadedName;
var font = document.createElement('div'); const font = document.createElement("div");
var name = document.createElement('span'); const name = document.createElement("span");
name.textContent = fontName; name.textContent = fontName;
var download = document.createElement('a'); const download = document.createElement("a");
if (url) { if (url) {
url = /url\(['"]?([^\)"']+)/.exec(url); url = /url\(['"]?([^)"']+)/.exec(url);
download.href = url[1]; download.href = url[1];
} else if (fontObj.data) { } else if (fontObj.data) {
url = URL.createObjectURL(new Blob([fontObj.data], { download.href = URL.createObjectURL(
type: fontObj.mimeType, new Blob([fontObj.data], { type: fontObj.mimetype })
})); );
download.href = url;
} }
download.textContent = 'Download'; download.textContent = "Download";
var logIt = document.createElement('a'); const logIt = document.createElement("a");
logIt.href = ''; logIt.href = "";
logIt.textContent = 'Log'; logIt.textContent = "Log";
logIt.addEventListener('click', function(event) { logIt.addEventListener("click", function (event) {
event.preventDefault(); event.preventDefault();
// console.log(fontObj); console.log(fontObj);
}); });
var select = document.createElement('input'); const select = document.createElement("input");
select.setAttribute('type', 'checkbox'); select.setAttribute("type", "checkbox");
select.dataset.fontName = fontName; select.dataset.fontName = fontName;
select.addEventListener('click', (function(select, fontName) { select.addEventListener("click", function () {
return (function() { selectFont(fontName, select.checked);
selectFont(fontName, select.checked); });
}); font.append(select, name, " ", download, " ", logIt, moreInfo);
})(select, fontName)); fonts.append(font);
font.appendChild(select);
font.appendChild(name);
font.appendChild(document.createTextNode(' '));
font.appendChild(download);
font.appendChild(document.createTextNode(' '));
font.appendChild(logIt);
font.appendChild(moreInfo);
fonts.appendChild(font);
// Somewhat of a hack, should probably add a hook for when the text layer // Somewhat of a hack, should probably add a hook for when the text layer
// is done rendering. // is done rendering.
setTimeout(() => { setTimeout(() => {
@@ -158,100 +147,88 @@ var FontInspector = (function FontInspectorClosure() {
}; };
})(); })();
var opMap;
// Manages all the page steppers. // Manages all the page steppers.
var StepperManager = (function StepperManagerClosure() { const StepperManager = (function StepperManagerClosure() {
var steppers = []; let steppers = [];
var stepperDiv = null; let stepperDiv = null;
var stepperControls = null; let stepperControls = null;
var stepperChooser = null; let stepperChooser = null;
var breakPoints = Object.create(null); let breakPoints = Object.create(null);
return { return {
// Properties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'Stepper', id: "Stepper",
name: 'Stepper', name: "Stepper",
panel: null, panel: null,
manager: null, manager: null,
init: function init(pdfjsLib) { init(pdfjsLib) {
var self = this; const self = this;
this.panel.setAttribute('style', 'padding: 5px;'); stepperControls = document.createElement("div");
stepperControls = document.createElement('div'); stepperChooser = document.createElement("select");
stepperChooser = document.createElement('select'); stepperChooser.addEventListener("change", function (event) {
stepperChooser.addEventListener('change', function(event) {
self.selectStepper(this.value); self.selectStepper(this.value);
}); });
stepperControls.appendChild(stepperChooser); stepperControls.append(stepperChooser);
stepperDiv = document.createElement('div'); stepperDiv = document.createElement("div");
this.panel.appendChild(stepperControls); this.panel.append(stepperControls, stepperDiv);
this.panel.appendChild(stepperDiv); if (sessionStorage.getItem("pdfjsBreakPoints")) {
if (sessionStorage.getItem('pdfjsBreakPoints')) { breakPoints = JSON.parse(sessionStorage.getItem("pdfjsBreakPoints"));
breakPoints = JSON.parse(sessionStorage.getItem('pdfjsBreakPoints'));
} }
opMap = Object.create(null); opMap = Object.create(null);
for (var key in pdfjsLib.OPS) { for (const key in pdfjsLib.OPS) {
opMap[pdfjsLib.OPS[key]] = key; opMap[pdfjsLib.OPS[key]] = key;
} }
}, },
cleanup: function cleanup() { cleanup() {
stepperChooser.textContent = ''; stepperChooser.textContent = "";
stepperDiv.textContent = ''; stepperDiv.textContent = "";
steppers = []; steppers = [];
}, },
enabled: false, enabled: false,
active: false, active: false,
// Stepper specific functions. // Stepper specific functions.
create: function create(pageIndex) { create(pageIndex) {
var debug = document.createElement('div'); const debug = document.createElement("div");
debug.id = 'stepper' + pageIndex; debug.id = "stepper" + pageIndex;
debug.setAttribute('hidden', true); debug.hidden = true;
debug.className = 'stepper'; debug.className = "stepper";
stepperDiv.appendChild(debug); stepperDiv.append(debug);
var b = document.createElement('option'); const b = document.createElement("option");
b.textContent = 'Page ' + (pageIndex + 1); b.textContent = "Page " + (pageIndex + 1);
b.value = pageIndex; b.value = pageIndex;
stepperChooser.appendChild(b); stepperChooser.append(b);
var initBreakPoints = breakPoints[pageIndex] || []; const initBreakPoints = breakPoints[pageIndex] || [];
var stepper = new Stepper(debug, pageIndex, initBreakPoints); const stepper = new Stepper(debug, pageIndex, initBreakPoints);
steppers.push(stepper); steppers.push(stepper);
if (steppers.length === 1) { if (steppers.length === 1) {
this.selectStepper(pageIndex, false); this.selectStepper(pageIndex, false);
} }
return stepper; return stepper;
}, },
selectStepper: function selectStepper(pageIndex, selectPanel) { selectStepper(pageIndex, selectPanel) {
var i; pageIndex |= 0;
pageIndex = pageIndex | 0;
if (selectPanel) { if (selectPanel) {
this.manager.selectPanel(this); this.manager.selectPanel(this);
} }
for (i = 0; i < steppers.length; ++i) { for (const stepper of steppers) {
var stepper = steppers[i]; stepper.panel.hidden = stepper.pageIndex !== pageIndex;
if (stepper.pageIndex === pageIndex) {
stepper.panel.removeAttribute('hidden');
} else {
stepper.panel.setAttribute('hidden', true);
}
} }
var options = stepperChooser.options; for (const option of stepperChooser.options) {
for (i = 0; i < options.length; ++i) {
var option = options[i];
option.selected = (option.value | 0) === pageIndex; option.selected = (option.value | 0) === pageIndex;
} }
}, },
saveBreakPoints: function saveBreakPoints(pageIndex, bps) { saveBreakPoints(pageIndex, bps) {
breakPoints[pageIndex] = bps; breakPoints[pageIndex] = bps;
sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints)); sessionStorage.setItem("pdfjsBreakPoints", JSON.stringify(breakPoints));
}, },
}; };
})(); })();
// The stepper for each page's IRQueue. // The stepper for each page's operatorList.
var Stepper = (function StepperClosure() { const Stepper = (function StepperClosure() {
// Shorter way to create element and optionally set textContent. // Shorter way to create element and optionally set textContent.
function c(tag, textContent) { function c(tag, textContent) {
var d = document.createElement(tag); const d = document.createElement(tag);
if (textContent) { if (textContent) {
d.textContent = textContent; d.textContent = textContent;
} }
@@ -259,63 +236,72 @@ var Stepper = (function StepperClosure() {
} }
function simplifyArgs(args) { function simplifyArgs(args) {
if (typeof args === 'string') { if (typeof args === "string") {
var MAX_STRING_LENGTH = 75; const MAX_STRING_LENGTH = 75;
return args.length <= MAX_STRING_LENGTH ? args : return args.length <= MAX_STRING_LENGTH
args.substr(0, MAX_STRING_LENGTH) + '...'; ? args
: args.substring(0, MAX_STRING_LENGTH) + "...";
} }
if (typeof args !== 'object' || args === null) { if (typeof args !== "object" || args === null) {
return args; return args;
} }
if ('length' in args) { // array if ("length" in args) {
var simpleArgs = [], i, ii; // array
var MAX_ITEMS = 10; const MAX_ITEMS = 10,
simpleArgs = [];
let i, ii;
for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) { for (i = 0, ii = Math.min(MAX_ITEMS, args.length); i < ii; i++) {
simpleArgs.push(simplifyArgs(args[i])); simpleArgs.push(simplifyArgs(args[i]));
} }
if (i < args.length) { if (i < args.length) {
simpleArgs.push('...'); simpleArgs.push("...");
} }
return simpleArgs; return simpleArgs;
} }
var simpleObj = {}; const simpleObj = {};
for (var key in args) { for (const key in args) {
simpleObj[key] = simplifyArgs(args[key]); simpleObj[key] = simplifyArgs(args[key]);
} }
return simpleObj; return simpleObj;
} }
function Stepper(panel, pageIndex, initialBreakPoints) { // eslint-disable-next-line no-shadow
this.panel = panel; class Stepper {
this.breakPoint = 0; constructor(panel, pageIndex, initialBreakPoints) {
this.nextBreakPoint = null; this.panel = panel;
this.pageIndex = pageIndex; this.breakPoint = 0;
this.breakPoints = initialBreakPoints; this.nextBreakPoint = null;
this.currentIdx = -1; this.pageIndex = pageIndex;
this.operatorListIdx = 0; this.breakPoints = initialBreakPoints;
} this.currentIdx = -1;
Stepper.prototype = { this.operatorListIdx = 0;
init: function init(operatorList) { this.indentLevel = 0;
var panel = this.panel; }
var content = c('div', 'c=continue, s=step');
var table = c('table'); init(operatorList) {
content.appendChild(table); const panel = this.panel;
const content = c("div", "c=continue, s=step");
const table = c("table");
content.append(table);
table.cellSpacing = 0; table.cellSpacing = 0;
var headerRow = c('tr'); const headerRow = c("tr");
table.appendChild(headerRow); table.append(headerRow);
headerRow.appendChild(c('th', 'Break')); headerRow.append(
headerRow.appendChild(c('th', 'Idx')); c("th", "Break"),
headerRow.appendChild(c('th', 'fn')); c("th", "Idx"),
headerRow.appendChild(c('th', 'args')); c("th", "fn"),
panel.appendChild(content); c("th", "args")
);
panel.append(content);
this.table = table; this.table = table;
this.updateOperatorList(operatorList); this.updateOperatorList(operatorList);
}, }
updateOperatorList: function updateOperatorList(operatorList) {
var self = this; updateOperatorList(operatorList) {
const self = this;
function cboxOnClick() { function cboxOnClick() {
var x = +this.dataset.idx; const x = +this.dataset.idx;
if (this.checked) { if (this.checked) {
self.breakPoints.push(x); self.breakPoints.push(x);
} else { } else {
@@ -324,130 +310,142 @@ var Stepper = (function StepperClosure() {
StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints); StepperManager.saveBreakPoints(self.pageIndex, self.breakPoints);
} }
var MAX_OPERATORS_COUNT = 15000; const MAX_OPERATORS_COUNT = 15000;
if (this.operatorListIdx > MAX_OPERATORS_COUNT) { if (this.operatorListIdx > MAX_OPERATORS_COUNT) {
return; return;
} }
var chunk = document.createDocumentFragment(); const chunk = document.createDocumentFragment();
var operatorsToDisplay = Math.min(MAX_OPERATORS_COUNT, const operatorsToDisplay = Math.min(
operatorList.fnArray.length); MAX_OPERATORS_COUNT,
for (var i = this.operatorListIdx; i < operatorsToDisplay; i++) { operatorList.fnArray.length
var line = c('tr'); );
line.className = 'line'; for (let i = this.operatorListIdx; i < operatorsToDisplay; i++) {
const line = c("tr");
line.className = "line";
line.dataset.idx = i; line.dataset.idx = i;
chunk.appendChild(line); chunk.append(line);
var checked = this.breakPoints.indexOf(i) !== -1; const checked = this.breakPoints.includes(i);
var args = operatorList.argsArray[i] || []; const args = operatorList.argsArray[i] || [];
var breakCell = c('td'); const breakCell = c("td");
var cbox = c('input'); const cbox = c("input");
cbox.type = 'checkbox'; cbox.type = "checkbox";
cbox.className = 'points'; cbox.className = "points";
cbox.checked = checked; cbox.checked = checked;
cbox.dataset.idx = i; cbox.dataset.idx = i;
cbox.onclick = cboxOnClick; cbox.onclick = cboxOnClick;
breakCell.appendChild(cbox); breakCell.append(cbox);
line.appendChild(breakCell); line.append(breakCell, c("td", i.toString()));
line.appendChild(c('td', i.toString())); const fn = opMap[operatorList.fnArray[i]];
var fn = opMap[operatorList.fnArray[i]]; let decArgs = args;
var decArgs = args; if (fn === "showText") {
if (fn === 'showText') { const glyphs = args[0];
var glyphs = args[0]; const charCodeRow = c("tr");
var newArgs = []; const fontCharRow = c("tr");
var str = []; const unicodeRow = c("tr");
for (var j = 0; j < glyphs.length; j++) { for (const glyph of glyphs) {
var glyph = glyphs[j]; if (typeof glyph === "object" && glyph !== null) {
if (typeof glyph === 'object' && glyph !== null) { charCodeRow.append(c("td", glyph.originalCharCode));
str.push(glyph.fontChar); fontCharRow.append(c("td", glyph.fontChar));
unicodeRow.append(c("td", glyph.unicode));
} else { } else {
if (str.length > 0) { // null or number
newArgs.push(str.join('')); const advanceEl = c("td", glyph);
str = []; advanceEl.classList.add("advance");
} charCodeRow.append(advanceEl);
newArgs.push(glyph); // null or number fontCharRow.append(c("td"));
unicodeRow.append(c("td"));
} }
} }
if (str.length > 0) { decArgs = c("td");
newArgs.push(str.join('')); const table = c("table");
} table.classList.add("showText");
decArgs = [newArgs]; decArgs.append(table);
table.append(charCodeRow, fontCharRow, unicodeRow);
} else if (fn === "restore") {
this.indentLevel--;
}
line.append(c("td", " ".repeat(this.indentLevel * 2) + fn));
if (fn === "save") {
this.indentLevel++;
}
if (decArgs instanceof HTMLElement) {
line.append(decArgs);
} else {
line.append(c("td", JSON.stringify(simplifyArgs(decArgs))));
} }
line.appendChild(c('td', fn));
line.appendChild(c('td', JSON.stringify(simplifyArgs(decArgs))));
} }
if (operatorsToDisplay < operatorList.fnArray.length) { if (operatorsToDisplay < operatorList.fnArray.length) {
line = c('tr'); const lastCell = c("td", "...");
var lastCell = c('td', '...');
lastCell.colspan = 4; lastCell.colspan = 4;
chunk.appendChild(lastCell); chunk.append(lastCell);
} }
this.operatorListIdx = operatorList.fnArray.length; this.operatorListIdx = operatorList.fnArray.length;
this.table.appendChild(chunk); this.table.append(chunk);
}, }
getNextBreakPoint: function getNextBreakPoint() {
this.breakPoints.sort(function(a, b) { getNextBreakPoint() {
this.breakPoints.sort(function (a, b) {
return a - b; return a - b;
}); });
for (var i = 0; i < this.breakPoints.length; i++) { for (const breakPoint of this.breakPoints) {
if (this.breakPoints[i] > this.currentIdx) { if (breakPoint > this.currentIdx) {
return this.breakPoints[i]; return breakPoint;
} }
} }
return null; return null;
}, }
breakIt: function breakIt(idx, callback) {
breakIt(idx, callback) {
StepperManager.selectStepper(this.pageIndex, true); StepperManager.selectStepper(this.pageIndex, true);
var self = this; this.currentIdx = idx;
var dom = document;
self.currentIdx = idx; const listener = evt => {
var listener = function(e) { switch (evt.keyCode) {
switch (e.keyCode) {
case 83: // step case 83: // step
dom.removeEventListener('keydown', listener); document.removeEventListener("keydown", listener);
self.nextBreakPoint = self.currentIdx + 1; this.nextBreakPoint = this.currentIdx + 1;
self.goTo(-1); this.goTo(-1);
callback(); callback();
break; break;
case 67: // continue case 67: // continue
dom.removeEventListener('keydown', listener); document.removeEventListener("keydown", listener);
var breakPoint = self.getNextBreakPoint(); this.nextBreakPoint = this.getNextBreakPoint();
self.nextBreakPoint = breakPoint; this.goTo(-1);
self.goTo(-1);
callback(); callback();
break; break;
} }
}; };
dom.addEventListener('keydown', listener); document.addEventListener("keydown", listener);
self.goTo(idx); this.goTo(idx);
}, }
goTo: function goTo(idx) {
var allRows = this.panel.getElementsByClassName('line'); goTo(idx) {
for (var x = 0, xx = allRows.length; x < xx; ++x) { const allRows = this.panel.getElementsByClassName("line");
var row = allRows[x]; for (const row of allRows) {
if ((row.dataset.idx | 0) === idx) { if ((row.dataset.idx | 0) === idx) {
row.style.backgroundColor = 'rgb(251,250,207)'; row.style.backgroundColor = "rgb(251,250,207)";
row.scrollIntoView(); row.scrollIntoView();
} else { } else {
row.style.backgroundColor = null; row.style.backgroundColor = null;
} }
} }
}, }
}; }
return Stepper; return Stepper;
})(); })();
var Stats = (function Stats() { const Stats = (function Stats() {
var stats = []; let stats = [];
function clear(node) { function clear(node) {
while (node.hasChildNodes()) { node.textContent = ""; // Remove any `node` contents from the DOM.
node.removeChild(node.lastChild);
}
} }
function getStatIndex(pageNumber) { function getStatIndex(pageNumber) {
for (var i = 0, ii = stats.length; i < ii; ++i) { for (const [i, stat] of stats.entries()) {
if (stats[i].pageNumber === pageNumber) { if (stat.pageNumber === pageNumber) {
return i; return i;
} }
} }
@@ -455,14 +453,11 @@ var Stats = (function Stats() {
} }
return { return {
// Properties/functions needed by PDFBug. // Properties/functions needed by PDFBug.
id: 'Stats', id: "Stats",
name: 'Stats', name: "Stats",
panel: null, panel: null,
manager: null, manager: null,
init(pdfjsLib) { init(pdfjsLib) {},
this.panel.setAttribute('style', 'padding: 5px;');
pdfjsLib.PDFJS.enableStats = true;
},
enabled: false, enabled: false,
active: false, active: false,
// Stats specific functions. // Stats specific functions.
@@ -470,28 +465,26 @@ var Stats = (function Stats() {
if (!stat) { if (!stat) {
return; return;
} }
var statsIndex = getStatIndex(pageNumber); const statsIndex = getStatIndex(pageNumber);
if (statsIndex !== false) { if (statsIndex !== false) {
var b = stats[statsIndex]; stats[statsIndex].div.remove();
this.panel.removeChild(b.div);
stats.splice(statsIndex, 1); stats.splice(statsIndex, 1);
} }
var wrapper = document.createElement('div'); const wrapper = document.createElement("div");
wrapper.className = 'stats'; wrapper.className = "stats";
var title = document.createElement('div'); const title = document.createElement("div");
title.className = 'title'; title.className = "title";
title.textContent = 'Page: ' + pageNumber; title.textContent = "Page: " + pageNumber;
var statsDiv = document.createElement('div'); const statsDiv = document.createElement("div");
statsDiv.textContent = stat.toString(); statsDiv.textContent = stat.toString();
wrapper.appendChild(title); wrapper.append(title, statsDiv);
wrapper.appendChild(statsDiv); stats.push({ pageNumber, div: wrapper });
stats.push({ pageNumber, div: wrapper, }); stats.sort(function (a, b) {
stats.sort(function(a, b) {
return a.pageNumber - b.pageNumber; return a.pageNumber - b.pageNumber;
}); });
clear(this.panel); clear(this.panel);
for (var i = 0, ii = stats.length; i < ii; ++i) { for (const entry of stats) {
this.panel.appendChild(stats[i].div); this.panel.append(entry.div);
} }
}, },
cleanup() { cleanup() {
@@ -502,40 +495,35 @@ var Stats = (function Stats() {
})(); })();
// Manages all the debugging tools. // Manages all the debugging tools.
window.PDFBug = (function PDFBugClosure() { const PDFBug = (function PDFBugClosure() {
var panelWidth = 300; const panelWidth = 300;
var buttons = []; const buttons = [];
var activePanel = null; let activePanel = null;
return { return {
tools: [ tools: [FontInspector, StepperManager, Stats],
FontInspector,
StepperManager,
Stats
],
enable(ids) { enable(ids) {
var all = false, tools = this.tools; const all = ids.length === 1 && ids[0] === "all";
if (ids.length === 1 && ids[0] === 'all') { const tools = this.tools;
all = true; for (const tool of tools) {
} if (all || ids.includes(tool.id)) {
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
if (all || ids.indexOf(tool.id) !== -1) {
tool.enabled = true; tool.enabled = true;
} }
} }
if (!all) { if (!all) {
// Sort the tools by the order they are enabled. // Sort the tools by the order they are enabled.
tools.sort(function(a, b) { tools.sort(function (a, b) {
var indexA = ids.indexOf(a.id); let indexA = ids.indexOf(a.id);
indexA = indexA < 0 ? tools.length : indexA; indexA = indexA < 0 ? tools.length : indexA;
var indexB = ids.indexOf(b.id); let indexB = ids.indexOf(b.id);
indexB = indexB < 0 ? tools.length : indexB; indexB = indexB < 0 ? tools.length : indexB;
return indexA - indexB; return indexA - indexB;
}); });
} }
}, },
init(pdfjsLib, container) { init(pdfjsLib, container, ids) {
this.loadCSS();
this.enable(ids);
/* /*
* Basic Layout: * Basic Layout:
* PDFBug * PDFBug
@@ -545,76 +533,80 @@ window.PDFBug = (function PDFBugClosure() {
* Panel * Panel
* ... * ...
*/ */
var ui = document.createElement('div'); const ui = document.createElement("div");
ui.id = 'PDFBug'; ui.id = "PDFBug";
var controls = document.createElement('div'); const controls = document.createElement("div");
controls.setAttribute('class', 'controls'); controls.setAttribute("class", "controls");
ui.appendChild(controls); ui.append(controls);
var panels = document.createElement('div'); const panels = document.createElement("div");
panels.setAttribute('class', 'panels'); panels.setAttribute("class", "panels");
ui.appendChild(panels); ui.append(panels);
container.appendChild(ui); container.append(ui);
container.style.right = panelWidth + 'px'; container.style.right = panelWidth + "px";
// Initialize all the debugging tools. // Initialize all the debugging tools.
var tools = this.tools; for (const tool of this.tools) {
var self = this; const panel = document.createElement("div");
for (var i = 0; i < tools.length; ++i) { const panelButton = document.createElement("button");
var tool = tools[i];
var panel = document.createElement('div');
var panelButton = document.createElement('button');
panelButton.textContent = tool.name; panelButton.textContent = tool.name;
panelButton.addEventListener('click', (function(selected) { panelButton.addEventListener("click", event => {
return function(event) { event.preventDefault();
event.preventDefault(); this.selectPanel(tool);
self.selectPanel(selected); });
}; controls.append(panelButton);
})(i)); panels.append(panel);
controls.appendChild(panelButton);
panels.appendChild(panel);
tool.panel = panel; tool.panel = panel;
tool.manager = this; tool.manager = this;
if (tool.enabled) { if (tool.enabled) {
tool.init(pdfjsLib); tool.init(pdfjsLib);
} else { } else {
panel.textContent = tool.name + ' is disabled. To enable add ' + panel.textContent =
' "' + tool.id + '" to the pdfBug parameter ' + `${tool.name} is disabled. To enable add "${tool.id}" to ` +
'and refresh (separate multiple by commas).'; "the pdfBug parameter and refresh (separate multiple by commas).";
} }
buttons.push(panelButton); buttons.push(panelButton);
} }
this.selectPanel(0); this.selectPanel(0);
}, },
loadCSS() {
const { url } = import.meta;
const link = document.createElement("link");
link.rel = "stylesheet";
link.href = url.replace(/.js$/, ".css");
document.head.append(link);
},
cleanup() { cleanup() {
for (var i = 0, ii = this.tools.length; i < ii; i++) { for (const tool of this.tools) {
if (this.tools[i].enabled) { if (tool.enabled) {
this.tools[i].cleanup(); tool.cleanup();
} }
} }
}, },
selectPanel(index) { selectPanel(index) {
if (typeof index !== 'number') { if (typeof index !== "number") {
index = this.tools.indexOf(index); index = this.tools.indexOf(index);
} }
if (index === activePanel) { if (index === activePanel) {
return; return;
} }
activePanel = index; activePanel = index;
var tools = this.tools; for (const [j, tool] of this.tools.entries()) {
for (var j = 0; j < tools.length; ++j) { const isActive = j === index;
if (j === index) { buttons[j].classList.toggle("active", isActive);
buttons[j].setAttribute('class', 'active'); tool.active = isActive;
tools[j].active = true; tool.panel.hidden = !isActive;
tools[j].panel.removeAttribute('hidden');
} else {
buttons[j].setAttribute('class', '');
tools[j].active = false;
tools[j].panel.setAttribute('hidden', 'true');
}
} }
}, },
}; };
})(); })();
globalThis.FontInspector = FontInspector;
globalThis.StepperManager = StepperManager;
globalThis.Stats = Stats;
export { PDFBug };
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 304 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 933 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 583 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 276 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 360 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 731 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 461 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 B

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 260 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 425 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 398 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 586 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 464 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 243 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 859 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 331 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 B

File diff suppressed because one or more lines are too long
-8
View File
@@ -1,8 +0,0 @@
/*!
* jQuery Cookie Plugin v1.3.1
* https://github.com/carhartl/jquery-cookie
*
* Copyright 2013 Klaus Hartl
* Released under the MIT license
*/
(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(e){var a=/\+/g;function d(g){return g}function b(g){return decodeURIComponent(g.replace(a," "))}function f(g){if(g.indexOf('"')===0){g=g.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}try{return c.json?JSON.parse(g):g}catch(h){}}var c=e.cookie=function(p,o,u){if(o!==undefined){u=e.extend({},c.defaults,u);if(typeof u.expires==="number"){var q=u.expires,s=u.expires=new Date();s.setDate(s.getDate()+q)}o=c.json?JSON.stringify(o):String(o);return(document.cookie=[c.raw?p:encodeURIComponent(p),"=",c.raw?o:encodeURIComponent(o),u.expires?"; expires="+u.expires.toUTCString():"",u.path?"; path="+u.path:"",u.domain?"; domain="+u.domain:"",u.secure?"; secure":""].join(""))}var g=c.raw?d:b;var r=document.cookie.split("; ");var v=p?undefined:{};for(var n=0,k=r.length;n<k;n++){var m=r[n].split("=");var h=g(m.shift());var j=g(m.join("="));if(p&&p===h){v=f(j);break}if(!p){v[h]=f(j)}}return v};c.defaults={};e.removeCookie=function(h,g){if(e.cookie(h)!==undefined){e.cookie(h,"",e.extend({},g,{expires:-1}));return true}return false}}));
@@ -1,506 +0,0 @@
/******************************************************************************
* jquery.i18n.properties
*
* Dual licensed under the GPL (http://dev.jquery.com/browser/trunk/jquery/GPL-LICENSE.txt) and
* MIT (http://dev.jquery.com/browser/trunk/jquery/MIT-LICENSE.txt) licenses.
*
* @version 1.2.7
* @url https://github.com/jquery-i18n-properties/jquery-i18n-properties
* @inspiration Localisation assistance for jQuery (http://keith-wood.name/localisation.html)
* by Keith Wood (kbwood{at}iinet.com.au) June 2007
*
*****************************************************************************/
(function ($) {
$.i18n = {};
/**
* Map holding bundle keys if mode is 'map' or 'both'. Values of this can also be an
* Object, in which case the key is a namespace.
*/
$.i18n.map = {};
var debug = function (message) {
window.console && console.log('i18n::' + message);
};
/**
* Load and parse message bundle files (.properties),
* making bundles keys available as javascript variables.
*
* i18n files are named <name>.js, or <name>_<language>.js or <name>_<language>_<country>.js
* Where:
* The <language> argument is a valid ISO Language Code. These codes are the lower-case,
* two-letter codes as defined by ISO-639. You can find a full list of these codes at a
* number of sites, such as: http://www.loc.gov/standards/iso639-2/englangn.html
* The <country> argument is a valid ISO Country Code. These codes are the upper-case,
* two-letter codes as defined by ISO-3166. You can find a full list of these codes at a
* number of sites, such as: http://www.iso.ch/iso/en/prods-services/iso3166ma/02iso-3166-code-lists/list-en1.html
*
* Sample usage for a bundles/Messages.properties bundle:
* $.i18n.properties({
* name: 'Messages',
* language: 'en_US',
* path: 'bundles'
* });
* @param name (string/string[], optional) names of file to load (eg, 'Messages' or ['Msg1','Msg2']). Defaults to "Messages"
* @param language (string, optional) language/country code (eg, 'en', 'en_US', 'pt_BR'). if not specified, language reported by the browser will be used instead.
* @param path (string, optional) path of directory that contains file to load
* @param mode (string, optional) whether bundles keys are available as JavaScript variables/functions or as a map (eg, 'vars' or 'map')
* @param debug (boolean, optional) whether debug statements are logged at the console
* @param cache (boolean, optional) whether bundles should be cached by the browser, or forcibly reloaded on each page load. Defaults to false (i.e. forcibly reloaded)
* @param encoding (string, optional) the encoding to request for bundles. Property file resource bundles are specified to be in ISO-8859-1 format. Defaults to UTF-8 for backward compatibility.
* @param callback (function, optional) callback function to be called after script is terminated
*/
$.i18n.properties = function (settings) {
var defaults = {
name: 'Messages',
language: '',
path: '',
namespace: null,
mode: 'vars',
cache: false,
debug: false,
encoding: 'UTF-8',
async: false,
callback: null
};
settings = $.extend(defaults, settings);
if (settings.namespace && typeof settings.namespace == 'string') {
// A namespace has been supplied, initialise it.
if (settings.namespace.match(/^[a-z]*$/)) {
$.i18n.map[settings.namespace] = {};
} else {
debug('Namespaces can only be lower case letters, a - z');
settings.namespace = null;
}
}
// Ensure a trailing slash on the path
if (!settings.path.match(/\/$/)) settings.path += '/';
// Try to ensure that we have at a least a two letter language code
settings.language = this.normaliseLanguageCode(settings);
// Ensure an array
var files = (settings.name && settings.name.constructor === Array) ? settings.name : [settings.name];
// A locale is at least a language code which means at least two files per name. If
// we also have a country code, thats an extra file per name.
settings.totalFiles = (files.length * 2) + ((settings.language.length >= 5) ? files.length : 0);
if (settings.debug) {
debug('totalFiles: ' + settings.totalFiles);
}
settings.filesLoaded = 0;
files.forEach(function (file) {
var defaultFileName, shortFileName, longFileName, fileNames;
// 1. load base (eg, Messages.properties)
defaultFileName = settings.path + file + '.properties';
// 2. with language code (eg, Messages_pt.properties)
var shortCode = settings.language.substring(0, 2);
shortFileName = settings.path + file + '_' + shortCode + '.properties';
// 3. with language code and country code (eg, Messages_pt_BR.properties)
if (settings.language.length >= 5) {
var longCode = settings.language.substring(0, 5);
longFileName = settings.path + file + '_' + longCode + '.properties';
fileNames = [defaultFileName, shortFileName, longFileName];
} else {
fileNames = [defaultFileName, shortFileName];
}
loadAndParseFiles(fileNames, settings);
});
// call callback
if (settings.callback && !settings.async) {
settings.callback();
}
}; // properties
/**
* When configured with mode: 'map', allows access to bundle values by specifying its key.
* Eg, jQuery.i18n.prop('com.company.bundles.menu_add')
*/
$.i18n.prop = function (key /* Add parameters as function arguments as necessary */) {
var args = [].slice.call(arguments);
var phvList, namespace;
if (args.length == 2) {
if ($.isArray(args[1])) {
// An array was passed as the second parameter, so assume it is the list of place holder values.
phvList = args[1];
} else if (typeof args[1] === 'object') {
// Second argument is an options object {namespace: 'mynamespace', replacements: ['egg', 'nog']}
namespace = args[1].namespace;
var replacements = args[1].replacements;
args.splice(-1, 1);
if (replacements) {
Array.prototype.push.apply(args, replacements);
}
}
}
var value = (namespace) ? $.i18n.map[namespace][key] : $.i18n.map[key];
if (value === null) {
return '[' + ((namespace) ? namespace + '#' + key : key) + ']';
}
// Place holder replacement
/**
* Tested with:
* test.t1=asdf ''{0}''
* test.t2=asdf '{0}' '{1}'{1}'zxcv
* test.t3=This is \"a quote" 'a''{0}''s'd{fgh{ij'
* test.t4="'''{'0}''" {0}{a}
* test.t5="'''{0}'''" {1}
* test.t6=a {1} b {0} c
* test.t7=a 'quoted \\ s\ttringy' \t\t x
*
* Produces:
* test.t1, p1 ==> asdf 'p1'
* test.t2, p1 ==> asdf {0} {1}{1}zxcv
* test.t3, p1 ==> This is "a quote" a'{0}'sd{fgh{ij
* test.t4, p1 ==> "'{0}'" p1{a}
* test.t5, p1 ==> "'{0}'" {1}
* test.t6, p1 ==> a {1} b p1 c
* test.t6, p1, p2 ==> a p2 b p1 c
* test.t6, p1, p2, p3 ==> a p2 b p1 c
* test.t7 ==> a quoted \ s tringy x
*/
var i;
if (typeof(value) == 'string') {
// Handle escape characters. Done separately from the tokenizing loop below because escape characters are
// active in quoted strings.
i = 0;
while ((i = value.indexOf('\\', i)) != -1) {
if (value.charAt(i + 1) == 't') {
value = value.substring(0, i) + '\t' + value.substring((i++) + 2); // tab
} else if (value.charAt(i + 1) == 'r') {
value = value.substring(0, i) + '\r' + value.substring((i++) + 2); // return
} else if (value.charAt(i + 1) == 'n') {
value = value.substring(0, i) + '\n' + value.substring((i++) + 2); // line feed
} else if (value.charAt(i + 1) == 'f') {
value = value.substring(0, i) + '\f' + value.substring((i++) + 2); // form feed
} else if (value.charAt(i + 1) == '\\') {
value = value.substring(0, i) + '\\' + value.substring((i++) + 2); // \
} else {
value = value.substring(0, i) + value.substring(i + 1); // Quietly drop the character
}
}
// Lazily convert the string to a list of tokens.
var arr = [], j, index;
i = 0;
while (i < value.length) {
if (value.charAt(i) == '\'') {
// Handle quotes
if (i == value.length - 1) {
value = value.substring(0, i); // Silently drop the trailing quote
} else if (value.charAt(i + 1) == '\'') {
value = value.substring(0, i) + value.substring(++i); // Escaped quote
} else {
// Quoted string
j = i + 2;
while ((j = value.indexOf('\'', j)) != -1) {
if (j == value.length - 1 || value.charAt(j + 1) != '\'') {
// Found start and end quotes. Remove them
value = value.substring(0, i) + value.substring(i + 1, j) + value.substring(j + 1);
i = j - 1;
break;
} else {
// Found a double quote, reduce to a single quote.
value = value.substring(0, j) + value.substring(++j);
}
}
if (j == -1) {
// There is no end quote. Drop the start quote
value = value.substring(0, i) + value.substring(i + 1);
}
}
} else if (value.charAt(i) == '{') {
// Beginning of an unquoted place holder.
j = value.indexOf('}', i + 1);
if (j == -1) {
i++; // No end. Process the rest of the line. Java would throw an exception
} else {
// Add 1 to the index so that it aligns with the function arguments.
index = parseInt(value.substring(i + 1, j));
if (!isNaN(index) && index >= 0) {
// Put the line thus far (if it isn't empty) into the array
var s = value.substring(0, i);
if (s !== "") {
arr.push(s);
}
// Put the parameter reference into the array
arr.push(index);
// Start the processing over again starting from the rest of the line.
i = 0;
value = value.substring(j + 1);
} else {
i = j + 1; // Invalid parameter. Leave as is.
}
}
} else {
i++;
}
} // while
// Put the remainder of the no-empty line into the array.
if (value !== "") {
arr.push(value);
}
value = arr;
// Make the array the value for the entry.
if (namespace) {
$.i18n.map[settings.namespace][key] = arr;
} else {
$.i18n.map[key] = arr;
}
}
if (value.length === 0) {
return "";
}
if (value.length == 1 && typeof(value[0]) == "string") {
return value[0];
}
var str = "";
for (i = 0, j = value.length; i < j; i++) {
if (typeof(value[i]) == "string") {
str += value[i];
} else if (phvList && value[i] < phvList.length) {
// Must be a number
str += phvList[value[i]];
} else if (!phvList && value[i] + 1 < args.length) {
str += args[value[i] + 1];
} else {
str += "{" + value[i] + "}";
}
}
return str;
};
function callbackIfComplete(settings) {
if (settings.debug) {
debug('callbackIfComplete()');
debug('totalFiles: ' + settings.totalFiles);
debug('filesLoaded: ' + settings.filesLoaded);
}
if (settings.async) {
if (settings.filesLoaded === settings.totalFiles) {
if (settings.callback) {
settings.callback();
}
}
}
}
function loadAndParseFiles(fileNames, settings) {
if (settings.debug) debug('loadAndParseFiles');
if (fileNames !== null && fileNames.length > 0) {
loadAndParseFile(fileNames[0], settings, function () {
fileNames.shift();
loadAndParseFiles(fileNames,settings);
});
} else {
callbackIfComplete(settings);
}
}
/** Load and parse .properties files */
function loadAndParseFile(filename, settings, nextFile) {
if (settings.debug) {
debug('loadAndParseFile(\'' + filename +'\')');
debug('totalFiles: ' + settings.totalFiles);
debug('filesLoaded: ' + settings.filesLoaded);
}
if (filename !== null && typeof filename !== 'undefined') {
$.ajax({
url: filename,
async: settings.async,
cache: settings.cache,
dataType: 'text',
success: function (data, status) {
if (settings.debug) {
debug('Succeeded in downloading ' + filename + '.');
debug(data);
}
parseData(data, settings);
nextFile();
},
error: function (jqXHR, textStatus, errorThrown) {
if (settings.debug) {
debug('Failed to download or parse ' + filename + '. errorThrown: ' + errorThrown);
}
if (jqXHR.status === 404) {
settings.totalFiles -= 1;
}
nextFile();
}
});
}
}
/** Parse .properties files */
function parseData(data, settings) {
var parsed = '';
var lines = data.split(/\n/);
var regPlaceHolder = /(\{\d+})/g;
var regRepPlaceHolder = /\{(\d+)}/g;
var unicodeRE = /(\\u.{4})/ig;
for (var i=0,j=lines.length;i<j;i++) {
var line = lines[i];
line = line.trim();
if (line.length > 0 && line.match("^#") != "#") { // skip comments
var pair = line.split('=');
if (pair.length > 0) {
/** Process key & value */
var name = decodeURI(pair[0]).trim();
var value = pair.length == 1 ? "" : pair[1];
// process multi-line values
while (value.search(/\\$/) != -1) {
value = value.substring(0, value.length - 1);
value += lines[++i].trimRight();
}
// Put values with embedded '='s back together
for (var s = 2; s < pair.length; s++) {
value += '=' + pair[s];
}
value = value.trim();
/** Mode: bundle keys in a map */
if (settings.mode == 'map' || settings.mode == 'both') {
// handle unicode chars possibly left out
var unicodeMatches = value.match(unicodeRE);
if (unicodeMatches) {
unicodeMatches.forEach(function (match) {
value = value.replace(match, unescapeUnicode(match));
});
}
// add to map
if (settings.namespace) {
$.i18n.map[settings.namespace][name] = value;
} else {
$.i18n.map[name] = value;
}
}
/** Mode: bundle keys as vars/functions */
if (settings.mode == 'vars' || settings.mode == 'both') {
value = value.replace(/"/g, '\\"'); // escape quotation mark (")
// make sure namespaced key exists (eg, 'some.key')
checkKeyNamespace(name);
// value with variable substitutions
if (regPlaceHolder.test(value)) {
var parts = value.split(regPlaceHolder);
// process function args
var first = true;
var fnArgs = '';
var usedArgs = [];
parts.forEach(function (part) {
if (regPlaceHolder.test(part) && (usedArgs.length === 0 || usedArgs.indexOf(part) == -1)) {
if (!first) {
fnArgs += ',';
}
fnArgs += part.replace(regRepPlaceHolder, 'v$1');
usedArgs.push(part);
first = false;
}
});
parsed += name + '=function(' + fnArgs + '){';
// process function body
var fnExpr = '"' + value.replace(regRepPlaceHolder, '"+v$1+"') + '"';
parsed += 'return ' + fnExpr + ';' + '};';
// simple value
} else {
parsed += name + '="' + value + '";';
}
} // END: Mode: bundle keys as vars/functions
} // END: if(pair.length > 0)
} // END: skip comments
}
eval(parsed);
settings.filesLoaded += 1;
}
/** Make sure namespace exists (for keys with dots in name) */
// TODO key parts that start with numbers quietly fail. i.e. month.short.1=Jan
function checkKeyNamespace(key) {
var regDot = /\./;
if (regDot.test(key)) {
var fullname = '';
var names = key.split(/\./);
for (var i=0,j=names.length;i<j;i++) {
var name = names[i];
if (i > 0) {
fullname += '.';
}
fullname += name;
if (eval('typeof ' + fullname + ' == "undefined"')) {
eval(fullname + '={};');
}
}
}
}
/** Ensure language code is in the format aa_AA. */
$.i18n.normaliseLanguageCode = function (settings) {
var lang = settings.language;
if (!lang || lang.length < 2) {
if (settings.debug) debug('No language supplied. Pulling it from the browser ...');
lang = (navigator.languages && navigator.languages.length > 0) ? navigator.languages[0]
: (navigator.language || navigator.userLanguage /* IE */ || 'en');
if (settings.debug) debug('Language from browser: ' + lang);
}
lang = lang.toLowerCase();
lang = lang.replace(/-/,"_"); // some browsers report language as en-US instead of en_US
if (lang.length > 3) {
lang = lang.substring(0, 3) + lang.substring(3).toUpperCase();
}
return lang;
};
/** Unescape unicode chars ('\u00e3') */
function unescapeUnicode(str) {
// unescape unicode codes
var codes = [];
var code = parseInt(str.substr(2), 16);
if (code >= 0 && code < Math.pow(2, 16)) {
codes.push(code);
}
// convert codes to text
return codes.reduce(function (acc, val) { return acc + String.fromCharCode(val); }, '');
}
}) (jQuery);
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,327 @@
[ach]
@import url(ach/viewer.properties)
[af]
@import url(af/viewer.properties)
[an]
@import url(an/viewer.properties)
[ar]
@import url(ar/viewer.properties)
[ast]
@import url(ast/viewer.properties)
[az]
@import url(az/viewer.properties)
[be]
@import url(be/viewer.properties)
[bg]
@import url(bg/viewer.properties)
[bn]
@import url(bn/viewer.properties)
[bo]
@import url(bo/viewer.properties)
[br]
@import url(br/viewer.properties)
[brx]
@import url(brx/viewer.properties)
[bs]
@import url(bs/viewer.properties)
[ca]
@import url(ca/viewer.properties)
[cak]
@import url(cak/viewer.properties)
[ckb]
@import url(ckb/viewer.properties)
[cs]
@import url(cs/viewer.properties)
[cy]
@import url(cy/viewer.properties)
[da]
@import url(da/viewer.properties)
[de]
@import url(de/viewer.properties)
[dsb]
@import url(dsb/viewer.properties)
[el]
@import url(el/viewer.properties)
[en-CA]
@import url(en-CA/viewer.properties)
[en-GB]
@import url(en-GB/viewer.properties)
[en-US]
@import url(en-US/viewer.properties)
[eo]
@import url(eo/viewer.properties)
[es-AR]
@import url(es-AR/viewer.properties)
[es-CL]
@import url(es-CL/viewer.properties)
[es-ES]
@import url(es-ES/viewer.properties)
[es-MX]
@import url(es-MX/viewer.properties)
[et]
@import url(et/viewer.properties)
[eu]
@import url(eu/viewer.properties)
[fa]
@import url(fa/viewer.properties)
[ff]
@import url(ff/viewer.properties)
[fi]
@import url(fi/viewer.properties)
[fr]
@import url(fr/viewer.properties)
[fy-NL]
@import url(fy-NL/viewer.properties)
[ga-IE]
@import url(ga-IE/viewer.properties)
[gd]
@import url(gd/viewer.properties)
[gl]
@import url(gl/viewer.properties)
[gn]
@import url(gn/viewer.properties)
[gu-IN]
@import url(gu-IN/viewer.properties)
[he]
@import url(he/viewer.properties)
[hi-IN]
@import url(hi-IN/viewer.properties)
[hr]
@import url(hr/viewer.properties)
[hsb]
@import url(hsb/viewer.properties)
[hu]
@import url(hu/viewer.properties)
[hy-AM]
@import url(hy-AM/viewer.properties)
[hye]
@import url(hye/viewer.properties)
[ia]
@import url(ia/viewer.properties)
[id]
@import url(id/viewer.properties)
[is]
@import url(is/viewer.properties)
[it]
@import url(it/viewer.properties)
[ja]
@import url(ja/viewer.properties)
[ka]
@import url(ka/viewer.properties)
[kab]
@import url(kab/viewer.properties)
[kk]
@import url(kk/viewer.properties)
[km]
@import url(km/viewer.properties)
[kn]
@import url(kn/viewer.properties)
[ko]
@import url(ko/viewer.properties)
[lij]
@import url(lij/viewer.properties)
[lo]
@import url(lo/viewer.properties)
[lt]
@import url(lt/viewer.properties)
[ltg]
@import url(ltg/viewer.properties)
[lv]
@import url(lv/viewer.properties)
[meh]
@import url(meh/viewer.properties)
[mk]
@import url(mk/viewer.properties)
[mr]
@import url(mr/viewer.properties)
[ms]
@import url(ms/viewer.properties)
[my]
@import url(my/viewer.properties)
[nb-NO]
@import url(nb-NO/viewer.properties)
[ne-NP]
@import url(ne-NP/viewer.properties)
[nl]
@import url(nl/viewer.properties)
[nn-NO]
@import url(nn-NO/viewer.properties)
[oc]
@import url(oc/viewer.properties)
[pa-IN]
@import url(pa-IN/viewer.properties)
[pl]
@import url(pl/viewer.properties)
[pt-BR]
@import url(pt-BR/viewer.properties)
[pt-PT]
@import url(pt-PT/viewer.properties)
[rm]
@import url(rm/viewer.properties)
[ro]
@import url(ro/viewer.properties)
[ru]
@import url(ru/viewer.properties)
[sat]
@import url(sat/viewer.properties)
[sc]
@import url(sc/viewer.properties)
[scn]
@import url(scn/viewer.properties)
[sco]
@import url(sco/viewer.properties)
[si]
@import url(si/viewer.properties)
[sk]
@import url(sk/viewer.properties)
[sl]
@import url(sl/viewer.properties)
[son]
@import url(son/viewer.properties)
[sq]
@import url(sq/viewer.properties)
[sr]
@import url(sr/viewer.properties)
[sv-SE]
@import url(sv-SE/viewer.properties)
[szl]
@import url(szl/viewer.properties)
[ta]
@import url(ta/viewer.properties)
[te]
@import url(te/viewer.properties)
[tg]
@import url(tg/viewer.properties)
[th]
@import url(th/viewer.properties)
[tl]
@import url(tl/viewer.properties)
[tr]
@import url(tr/viewer.properties)
[trs]
@import url(trs/viewer.properties)
[uk]
@import url(uk/viewer.properties)
[ur]
@import url(ur/viewer.properties)
[uz]
@import url(uz/viewer.properties)
[vi]
@import url(vi/viewer.properties)
[wo]
@import url(wo/viewer.properties)
[xh]
@import url(xh/viewer.properties)
[zh-CN] [zh-CN]
@import url(zh-CN/viewer.properties) @import url(zh-CN/viewer.properties)
[zh-TW]
@import url(zh-TW/viewer.properties)
@@ -48,16 +48,12 @@ bookmark_label=当前在看
tools.title=工具 tools.title=工具
tools_label=工具 tools_label=工具
first_page.title=转到第一页 first_page.title=转到第一页
first_page.label=转到第一页
first_page_label=转到第一页 first_page_label=转到第一页
last_page.title=转到最后一页 last_page.title=转到最后一页
last_page.label=转到最后一页
last_page_label=转到最后一页 last_page_label=转到最后一页
page_rotate_cw.title=顺时针旋转 page_rotate_cw.title=顺时针旋转
page_rotate_cw.label=顺时针旋转
page_rotate_cw_label=顺时针旋转 page_rotate_cw_label=顺时针旋转
page_rotate_ccw.title=逆时针旋转 page_rotate_ccw.title=逆时针旋转
page_rotate_ccw.label=逆时针旋转
page_rotate_ccw_label=逆时针旋转 page_rotate_ccw_label=逆时针旋转
cursor_text_select_tool.title=启用文本选择工具 cursor_text_select_tool.title=启用文本选择工具
@@ -65,6 +61,22 @@ cursor_text_select_tool_label=文本选择工具
cursor_hand_tool.title=启用手形工具 cursor_hand_tool.title=启用手形工具
cursor_hand_tool_label=手形工具 cursor_hand_tool_label=手形工具
scroll_page.title=使用页面滚动
scroll_page_label=页面滚动
scroll_vertical.title=使用垂直滚动
scroll_vertical_label=垂直滚动
scroll_horizontal.title=使用水平滚动
scroll_horizontal_label=水平滚动
scroll_wrapped.title=使用平铺滚动
scroll_wrapped_label=平铺滚动
spread_none.title=不加入衔接页
spread_none_label=单页视图
spread_odd.title=加入衔接页使奇数页作为起始页
spread_odd_label=双页视图
spread_even.title=加入衔接页使偶数页作为起始页
spread_even_label=书籍视图
# Document properties dialog box # Document properties dialog box
document_properties.title=文档属性… document_properties.title=文档属性…
document_properties_label=文档属性… document_properties_label=文档属性…
@@ -86,9 +98,31 @@ document_properties_modification_date=修改日期:
# will be replaced by the creation/modification date, and time, of the PDF file. # will be replaced by the creation/modification date, and time, of the PDF file.
document_properties_date_string={{date}}, {{time}} document_properties_date_string={{date}}, {{time}}
document_properties_creator=创建者: document_properties_creator=创建者:
document_properties_producer=PDF 制作者: document_properties_producer=PDF 生成器:
document_properties_version=PDF 版本: document_properties_version=PDF 版本:
document_properties_page_count=页数: document_properties_page_count=页数:
document_properties_page_size=页面大小:
document_properties_page_size_unit_inches=英寸
document_properties_page_size_unit_millimeters=毫米
document_properties_page_size_orientation_portrait=纵向
document_properties_page_size_orientation_landscape=横向
document_properties_page_size_name_a3=A3
document_properties_page_size_name_a4=A4
document_properties_page_size_name_letter=文本
document_properties_page_size_name_legal=法律
# LOCALIZATION NOTE (document_properties_page_size_dimension_string):
# "{{width}}", "{{height}}", {{unit}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement and orientation, of the (current) page.
document_properties_page_size_dimension_string={{width}} × {{height}} {{unit}}{{orientation}}
# LOCALIZATION NOTE (document_properties_page_size_dimension_name_string):
# "{{width}}", "{{height}}", {{unit}}, {{name}}, and {{orientation}} will be replaced by
# the size, respectively their unit of measurement, name, and orientation, of the (current) page.
document_properties_page_size_dimension_name_string={{width}} × {{height}} {{unit}}{{name}}{{orientation}}
# LOCALIZATION NOTE (document_properties_linearized): The linearization status of
# the document; usually called "Fast Web View" in English locales of Adobe software.
document_properties_linearized=快速 Web 视图:
document_properties_linearized_yes=
document_properties_linearized_no=
document_properties_close=关闭 document_properties_close=关闭
print_progress_message=正在准备打印文档… print_progress_message=正在准备打印文档…
@@ -101,21 +135,28 @@ print_progress_close=取消
# (the _label strings are alt text for the buttons, the .title strings are # (the _label strings are alt text for the buttons, the .title strings are
# tooltips) # tooltips)
toggle_sidebar.title=切换侧栏 toggle_sidebar.title=切换侧栏
toggle_sidebar_notification.title=切换侧栏(文档所含的大纲/附件) toggle_sidebar_notification2.title=切换侧栏(文档所含的大纲/附件/图层
toggle_sidebar_label=切换侧栏 toggle_sidebar_label=切换侧栏
document_outline.title=显示文档大纲(双击展开/折叠所有项) document_outline.title=显示文档大纲(双击展开/折叠所有项)
document_outline_label=文档大纲 document_outline_label=文档大纲
attachments.title=显示附件 attachments.title=显示附件
attachments_label=附件 attachments_label=附件
layers.title=显示图层(双击即可将所有图层重置为默认状态)
layers_label=图层
thumbs.title=显示缩略图 thumbs.title=显示缩略图
thumbs_label=缩略图 thumbs_label=缩略图
current_outline_item.title=查找当前大纲项目
current_outline_item_label=当前大纲项目
findbar.title=在文档中查找 findbar.title=在文档中查找
findbar_label=查找 findbar_label=查找
additional_layers=其他图层
# LOCALIZATION NOTE (page_landmark): "{{page}}" will be replaced by the page number.
page_landmark=第 {{page}} 页
# Thumbnails panel item (tooltip and alt text for images) # Thumbnails panel item (tooltip and alt text for images)
# LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page # LOCALIZATION NOTE (thumb_page_title): "{{page}}" will be replaced by the page
# number. # number.
thumb_page_title=页码 {{page}} thumb_page_title= {{page}}
# LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page # LOCALIZATION NOTE (thumb_page_canvas): "{{page}}" will be replaced by the page
# number. # number.
thumb_page_canvas=页面 {{page}} 的缩略图 thumb_page_canvas=页面 {{page}} 的缩略图
@@ -129,8 +170,31 @@ find_next.title=查找词语后一次出现的位置
find_next_label=下一页 find_next_label=下一页
find_highlight=全部高亮显示 find_highlight=全部高亮显示
find_match_case_label=区分大小写 find_match_case_label=区分大小写
find_match_diacritics_label=匹配变音符号
find_entire_word_label=字词匹配
find_reached_top=到达文档开头,从末尾继续 find_reached_top=到达文档开头,从末尾继续
find_reached_bottom=到达文档末尾,从开头继续 find_reached_bottom=到达文档末尾,从开头继续
# LOCALIZATION NOTE (find_match_count): The supported plural forms are
# [one|two|few|many|other], with [other] as the default value.
# "{{current}}" and "{{total}}" will be replaced by a number representing the
# index of the currently active find result, respectively a number representing
# the total number of matches in the document.
find_match_count={[ plural(total) ]}
find_match_count[one]=第 {{current}} 项,共匹配 {{total}} 项
find_match_count[two]=第 {{current}} 项,共匹配 {{total}} 项
find_match_count[few]=第 {{current}} 项,共匹配 {{total}} 项
find_match_count[many]=第 {{current}} 项,共匹配 {{total}} 项
find_match_count[other]=第 {{current}} 项,共匹配 {{total}} 项
# LOCALIZATION NOTE (find_match_count_limit): The supported plural forms are
# [zero|one|two|few|many|other], with [other] as the default value.
# "{{limit}}" will be replaced by a numerical value.
find_match_count_limit={[ plural(limit) ]}
find_match_count_limit[zero]=超过 {{limit}} 项匹配
find_match_count_limit[one]=超过 {{limit}} 项匹配
find_match_count_limit[two]=超过 {{limit}} 项匹配
find_match_count_limit[few]=超过 {{limit}} 项匹配
find_match_count_limit[many]=超过 {{limit}} 项匹配
find_match_count_limit[other]=超过 {{limit}} 项匹配
find_not_found=找不到指定词语 find_not_found=找不到指定词语
# Error panel labels # Error panel labels
@@ -162,23 +226,56 @@ page_scale_actual=实际大小
page_scale_percent={{scale}}% page_scale_percent={{scale}}%
# Loading indicator messages # Loading indicator messages
loading_error_indicator=错误 loading=正在载入…
loading_error=载入PDF时发生错误。 loading_error=载入 PDF 时发生错误。
invalid_file_error=无效或损坏的PDF文件。 invalid_file_error=无效或损坏的 PDF 文件。
missing_file_error=缺少PDF文件。 missing_file_error=缺少 PDF 文件。
unexpected_response_error=意外的服务器响应。 unexpected_response_error=意外的服务器响应。
# LOCALIZATION NOTE (annotation_date_string): "{{date}}" and "{{time}}" will be
# replaced by the modification date, and time, of the annotation.
annotation_date_string={{date}}{{time}}
# LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip. # LOCALIZATION NOTE (text_annotation_type.alt): This is used as a tooltip.
# "{{type}}" will be replaced with an annotation type from a list defined in # "{{type}}" will be replaced with an annotation type from a list defined in
# the PDF spec (32000-1:2008 Table 169 Annotation types). # the PDF spec (32000-1:2008 Table 169 Annotation types).
# Some common types are e.g.: "Check", "Text", "Comment", "Note" # Some common types are e.g.: "Check", "Text", "Comment", "Note"
text_annotation_type.alt=[{{type}} 注] text_annotation_type.alt=[{{type}} 注]
password_label=输入密码以打开此 PDF 文件。 password_label=输入密码以打开此 PDF 文件。
password_invalid=密码无效。请重试。 password_invalid=密码无效。请重试。
password_ok=确定 password_ok=确定
password_cancel=取消 password_cancel=取消
printing_not_supported=警告:此浏览器尚未完整支持打印功能。 printing_not_supported=警告:此浏览器尚未完整支持打印功能。
printing_not_ready=警告: PDF 未完载入以供打印。 printing_not_ready=警告: PDF 未完载入,无法打印。
web_fonts_disabled=Web 字体已被禁用:无法使用嵌入的PDF字体。 web_fonts_disabled=Web 字体已被禁用:无法使用嵌入的 PDF 字体。
document_colors_not_allowed=不允许 PDF 文档使用自己的颜色:浏览器中“允许页面选择自己的颜色”的选项已停用。
# Editor
editor_none.title=禁用编辑注释
editor_none_label=禁用编辑
editor_free_text.title=添加文本注释
editor_free_text_label=文本注释
editor_ink.title=添加墨迹注释
editor_ink_label=墨迹注释
freetext_default_content=输入一段文本…
free_text_default_content=输入文本…
# Editor Parameters
editor_free_text_font_color=字体颜色
editor_free_text_font_size=字体大小
editor_ink_line_color=线条颜色
editor_ink_line_thickness=线条粗细
# Editor Parameters
editor_free_text_color=颜色
editor_free_text_size=字号
editor_ink_color=颜色
editor_ink_thickness=粗细
editor_ink_opacity=不透明度
# Editor aria
editor_free_text_aria_label=文本编辑器
editor_ink_aria_label=墨迹编辑器
editor_ink_canvas_aria_label=用户创建图像
File diff suppressed because it is too large Load Diff
+246 -361
View File
@@ -20,230 +20,52 @@ Adobe CMap resources are covered by their own copyright but the same license:
See https://github.com/adobe-type-tools/cmap-resources See https://github.com/adobe-type-tools/cmap-resources
--> -->
<html dir="ltr" mozdisallowselectionprint moznomarginboxes> <html dir="ltr" mozdisallowselectionprint>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate"> <meta name="google" content="notranslate">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>PDF.js viewer</title>
<title>在线查看</title>
<link rel="stylesheet" href="viewer.css"> <link rel="stylesheet" href="viewer.css">
<!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="locale/locale.properties"> <!-- This snippet is used in production (included from viewer.html) -->
<!-- <link rel="stylesheet" href="../../zTree/css/demo.css" type="text/css">--> <link rel="resource" type="application/l10n" href="locale/locale.properties">
<!-- <link rel="stylesheet" href="../../zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">--> <script src="../build/pdf.js"></script>
<style>
/*.pdfViewer .page{*/ <script src="viewer.js"></script>
/* margin: 1px auto -8px 232px;*/
/*}*/
.right-click-box{
position: fixed;
width: 100px;
min-height: 100px;
border-radius: 5px;
background: #ffffff;
display: none;
z-index: 999;
box-shadow: inset 0 0 2px 1px #e5e5e5;
}
.right-click-box p{
padding: 5px 10px;
cursor: pointer;
border-bottom: 1px solid #e5e5e5;
}
/*.note-box{*/
/* display: none;*/
/* padding: 15px;*/
/* width: 500px;*/
/* height: 380px;*/
/* position: fixed;*/
/* top: 50%;*/
/* left: 50%;*/
/* transform: translate(-50%, -50%);*/
/* border: 1px solid #e5e5e5;*/
/* border-radius: 8px;*/
/* background: #e5e5e5;*/
/* z-index: 999;*/
/*}*/
/*.note-title{*/
/* padding-bottom: 10px;*/
/*}*/
/*.note-textarea{*/
/* width: 500px;*/
/* height: 300px;*/
/*}*/
/*.note-footer, .tree-add-footer{*/
/* float: right;*/
/* padding-top: 15px;*/
/*}*/
/*.note-footer button, .tree-add-footer button{*/
/* width: 60px;*/
/* height: 35px;*/
/* line-height: 35px;*/
/* background-color: #3391CE;*/
/* border: #3391CE;*/
/* color: #ffffff;*/
/* border-radius: 3px;*/
/* cursor: pointer;*/
/*}*/
/*.note-float{*/
/* box-shadow: inset 0 0 2px 1px #e5e5e5;*/
/* min-width: 100px;*/
/* min-height: 40px;*/
/* padding: 10px;*/
/* background: lemonchiffon;*/
/*}*/
/*.note-del{*/
/* position: absolute;*/
/* top: 2px;*/
/* right: 5px;*/
/* color: #707070;*/
/* cursor: pointer;*/
/*}*/
/*.ztree{*/
/* position: fixed;*/
/* top: 32px;*/
/* left: 0;*/
/* z-index: 99;*/
/* height: 100% !important;*/
/*}*/
/*#rMenu{*/
/* position: fixed !important;*/
/* z-index: 1000;*/
/*}*/
/*div#rMenu {position:absolute; visibility:hidden; top:0;text-align: left;padding: 2px;}*/
/*div#rMenu ul li{*/
/* padding: 0 15px;*/
/* cursor: pointer;*/
/* list-style: none;*/
/* border: 1px solid #888;*/
/* border-bottom: 1px solid transparent;*/
/* background: #FFEBC0;*/
/*}*/
/*div#rMenu ul li:last-child{*/
/* border-bottom: 1px solid #888;*/
/* }*/
/*div#rMenu ul li:hover{*/
/* background: #FFC774;*/
/* }*/
/*.tree-add-modal{*/
/* display: none;*/
/* padding: 15px;*/
/* width: 400px;*/
/* height: 180px;*/
/* position: fixed;*/
/* top: 50%;*/
/* left: 50%;*/
/* transform: translate(-50%, -50%);*/
/* border: 1px solid #e5e5e5;*/
/* border-radius: 8px;*/
/* background: #e5e5e5;*/
/* z-index: 999;*/
/*}*/
/*.tree-add-modal .form-box label{*/
/* display: block;*/
/* margin-top: 10px;*/
/*}*/
/*.tree-add-modal .form-box label span{*/
/* display: inline-block;*/
/* font-size: 14px;*/
/* width: 80px;*/
/*}*/
/*.tree-add-modal .form-box label input{*/
/* width: 200px;*/
/* height: 40px;*/
/* text-indent: 10px;*/
/*}*/
/*.mask{*/
/* display: none;*/
/* width: 100%;*/
/* height: 100%;*/
/* position: fixed;*/
/* top: 0;*/
/* bottom: 0;*/
/* left: 0;*/
/* right: 0;*/
/* background: #000000;*/
/* opacity: 0.5;*/
/* z-index: 998;*/
/*}*/
.button-box{
display: none;
position: fixed;
height: 26px;
line-height: 26px;
z-index: 999;
border: 1px solid #e5e5e5;
border-right: none;
background: #ffffff;
}
.button-box span{
display: inline-block;
width: 52px;
text-align: center;
font-size: 14px;
font-weight: 500;
border-right: 1px solid #e5e5e5;
cursor: default;
}
.hidden-textarea{
position: fixed;
z-index: -1;
}
</style>
<script src="js/jquery-3.3.1.min.js"></script>
<script src="compatibility.js"></script>
<script src="l10n.js"></script>
<script src="../build/pdf.js"></script>
<!-- <script type="text/javascript" src="../../zTree/js/jquery.ztree.core.js"></script>-->
<!--<script type="text/javascript" src="../../../src/assets/zTree/js/jquery.ztree.excheck.js"></script>-->
<!--<script type="text/javascript" src="../../../src/assets/zTree/js/jquery.ztree.exedit.js"></script>-->
<!--<script type="text/javascript" src="../../../src/assets/zTree/js/jquery.ztree.exhide.js"></script>-->
<script src="viewer.js"></script>
</head> </head>
<body tabindex="1" class="loadingInProgress"> <body tabindex="1" class="loadingInProgress">
<!--遮罩层--> <div id="outerContainer" >
<div class="mask"></div>
<!-- <a href="/pdf/web/viewer.html?file=http://10.0.1.31:3000/file/demo.pdf">-->
<!-- 预览文件-->
<!-- </a>-->
<!-- <ul id="treeDemo" class="ztree"></ul>-->
<!-- <div id="rMenu">-->
<!-- &lt;!&ndash; 不需要权限 &ndash;&gt;-->
<!-- <ul>-->
<!-- <li class="m_add" id="rightAdd">节点新增</li>-->
<!-- &lt;!&ndash;<li class="m_edit" @click="rightEdit" v-show="!isRoot || root">{{ editTitle }}</li>&ndash;&gt;-->
<!-- <li class="m_del" id="rightRemove">节点删除</li>-->
<!-- &lt;!&ndash;<li class="m_copy" @click="rightCopy" v-show="!isRoot|| root">{{ copyTitle }}</li>&ndash;&gt;-->
<!-- </ul>-->
<!-- </div>-->
<!-- &lt;!&ndash;新增tree弹窗&ndash;&gt;-->
<!-- <div class="tree-add-modal">-->
<!-- <h5>节点新增</h5>-->
<!-- <div class="form-box">-->
<!-- <label><span>节点位置:</span><input class="title-name" type="number" name="titleName" placeholder="请输入页码" autocomplete="off" disabled/></label>-->
<!-- <label><span>节点名称:</span><input class="menu-name" type="text" name="menuName" placeholder="请输入节点名称" autocomplete="off"/></label>-->
<!-- </div>-->
<!-- <div class="tree-add-footer">-->
<!-- <button id="treeAddCancel">取消</button>-->
<!-- <button id="treeAddSave">保存</button>-->
<!-- </div>-->
<!-- </div>-->
<div id="outerContainer">
<div id="sidebarContainer"> <div id="sidebarContainer">
<div id="toolbarSidebar"> <div id="toolbarSidebar">
<div class="splitToolbarButton toggled"> <div id="toolbarSidebarLeft">
<button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs"> <div id="sidebarViewButtons" class="splitToolbarButton toggled" role="radiogroup">
<span data-l10n-id="thumbs_label">Thumbnails</span> <button id="viewThumbnail" class="toolbarButton toggled" title="Show Thumbnails" tabindex="2" data-l10n-id="thumbs" role="radio" aria-checked="true" aria-controls="thumbnailView">
</button> <span data-l10n-id="thumbs_label">Thumbnails</span>
<button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline"> </button>
<span data-l10n-id="document_outline_label">Document Outline</span> <button id="viewOutline" class="toolbarButton" title="Show Document Outline (double-click to expand/collapse all items)" tabindex="3" data-l10n-id="document_outline" role="radio" aria-checked="false" aria-controls="outlineView">
</button> <span data-l10n-id="document_outline_label">Document Outline</span>
<button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments"> </button>
<span data-l10n-id="attachments_label">Attachments</span> <button id="viewAttachments" class="toolbarButton" title="Show Attachments" tabindex="4" data-l10n-id="attachments" role="radio" aria-checked="false" aria-controls="attachmentsView">
</button> <span data-l10n-id="attachments_label">Attachments</span>
</button>
<button id="viewLayers" class="toolbarButton" title="Show Layers (double-click to reset all layers to the default state)" tabindex="5" data-l10n-id="layers" role="radio" aria-checked="false" aria-controls="layersView">
<span data-l10n-id="layers_label">Layers</span>
</button>
</div>
</div>
<div id="toolbarSidebarRight">
<div id="outlineOptionsContainer" class="hidden">
<div class="verticalToolbarSeparator"></div>
<button id="currentOutlineItem" class="toolbarButton" disabled="disabled" title="Find Current Outline Item" tabindex="6" data-l10n-id="current_outline_item">
<span data-l10n-id="current_outline_item_label">Current Outline Item</span>
</button>
</div>
</div> </div>
</div> </div>
<div id="sidebarContent"> <div id="sidebarContent">
@@ -253,89 +75,161 @@ See https://github.com/adobe-type-tools/cmap-resources
</div> </div>
<div id="attachmentsView" class="hidden"> <div id="attachmentsView" class="hidden">
</div> </div>
<div id="layersView" class="hidden">
</div>
</div> </div>
<div id="sidebarResizer"></div>
</div> <!-- sidebarContainer --> </div> <!-- sidebarContainer -->
<div id="mainContainer"> <div id="mainContainer">
<div class="findbar hidden doorHanger" id="findbar"> <div class="findbar hidden doorHanger" id="findbar">
<div id="findbarInputContainer"> <div id="findbarInputContainer">
<input id="findInput" class="toolbarField" title="Find" placeholder="Find in document" tabindex="91" data-l10n-id="find_input"> <input id="findInput" class="toolbarField" title="Find" placeholder="Find in document" tabindex="91" data-l10n-id="find_input" aria-invalid="false">
<div class="splitToolbarButton"> <div class="splitToolbarButton">
<button id="findPrevious" class="toolbarButton findPrevious" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous"> <button id="findPrevious" class="toolbarButton" title="Find the previous occurrence of the phrase" tabindex="92" data-l10n-id="find_previous">
<span data-l10n-id="find_previous_label">Previous</span> <span data-l10n-id="find_previous_label">Previous</span>
</button> </button>
<div class="splitToolbarButtonSeparator"></div> <div class="splitToolbarButtonSeparator"></div>
<button id="findNext" class="toolbarButton findNext" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next"> <button id="findNext" class="toolbarButton" title="Find the next occurrence of the phrase" tabindex="93" data-l10n-id="find_next">
<span data-l10n-id="find_next_label">Next</span> <span data-l10n-id="find_next_label">Next</span>
</button> </button>
</div> </div>
</div> </div>
<div id="findbarOptionsContainer"> <div id="findbarOptionsOneContainer">
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94"> <input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label> <label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight All</label>
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95"> <input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label> <label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match Case</label>
<span id="findResultsCount" class="toolbarLabel hidden"></span> </div>
<div id="findbarOptionsTwoContainer">
<input type="checkbox" id="findMatchDiacritics" class="toolbarField" tabindex="96">
<label for="findMatchDiacritics" class="toolbarLabel" data-l10n-id="find_match_diacritics_label">Match Diacritics</label>
<input type="checkbox" id="findEntireWord" class="toolbarField" tabindex="97">
<label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole Words</label>
</div> </div>
<div id="findbarMessageContainer"> <div id="findbarMessageContainer" aria-live="polite">
<span id="findResultsCount" class="toolbarLabel"></span>
<span id="findMsg" class="toolbarLabel"></span> <span id="findMsg" class="toolbarLabel"></span>
</div> </div>
</div> <!-- findbar --> </div> <!-- findbar -->
<div class="editorParamsToolbar hidden doorHangerRight" id="editorFreeTextParamsToolbar">
<div class="editorParamsToolbarContainer">
<div class="editorParamsSetter">
<label for="editorFreeTextColor" class="editorParamsLabel" data-l10n-id="editor_free_text_color">Color</label>
<input type="color" id="editorFreeTextColor" class="editorParamsColor" tabindex="100">
</div>
<div class="editorParamsSetter">
<label for="editorFreeTextFontSize" class="editorParamsLabel" data-l10n-id="editor_free_text_size">Size</label>
<input type="range" id="editorFreeTextFontSize" class="editorParamsSlider" value="10" min="5" max="100" step="1" tabindex="101">
</div>
</div>
</div>
<div class="editorParamsToolbar hidden doorHangerRight" id="editorInkParamsToolbar">
<div class="editorParamsToolbarContainer">
<div class="editorParamsSetter">
<label for="editorInkColor" class="editorParamsLabel" data-l10n-id="editor_ink_color">Color</label>
<input type="color" id="editorInkColor" class="editorParamsColor" tabindex="102">
</div>
<div class="editorParamsSetter">
<label for="editorInkThickness" class="editorParamsLabel" data-l10n-id="editor_ink_thickness">Thickness</label>
<input type="range" id="editorInkThickness" class="editorParamsSlider" value="1" min="1" max="20" step="1" tabindex="103">
</div>
<div class="editorParamsSetter">
<label for="editorInkOpacity" class="editorParamsLabel" data-l10n-id="editor_ink_opacity">Opacity</label>
<input type="range" id="editorInkOpacity" class="editorParamsSlider" value="100" min="1" max="100" step="1" tabindex="104">
</div>
</div>
</div>
<div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight"> <div id="secondaryToolbar" class="secondaryToolbar hidden doorHangerRight">
<div id="secondaryToolbarButtonContainer"> <div id="secondaryToolbarButtonContainer">
<button id="secondaryPresentationMode" class="secondaryToolbarButton presentationMode visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode"> <button id="secondaryPresentationMode" class="secondaryToolbarButton visibleLargeView" title="Switch to Presentation Mode" tabindex="51" data-l10n-id="presentation_mode">
<span data-l10n-id="presentation_mode_label">Presentation Mode</span> <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button> </button>
<button id="secondaryOpenFile" class="secondaryToolbarButton openFile visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file"> <button id="secondaryOpenFile" class="secondaryToolbarButton visibleLargeView" title="Open File" tabindex="52" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span> <span data-l10n-id="open_file_label">Open</span>
</button> </button>
<button id="secondaryPrint" class="secondaryToolbarButton print visibleMediumView" title="Print" tabindex="53" data-l10n-id="print"> <button id="secondaryPrint" class="secondaryToolbarButton visibleMediumView" title="Print" tabindex="53" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span> <span data-l10n-id="print_label">Print</span>
</button> </button>
<button id="secondaryDownload" class="secondaryToolbarButton download visibleMediumView" title="Download" tabindex="54" data-l10n-id="download"> <button id="secondaryDownload" class="secondaryToolbarButton visibleMediumView" title="Download" tabindex="54" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span> <span data-l10n-id="download_label">Download</span>
</button> </button>
<a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton bookmark visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark"> <a href="#" id="secondaryViewBookmark" class="secondaryToolbarButton visibleSmallView" title="Current view (copy or open in new window)" tabindex="55" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span> <span data-l10n-id="bookmark_label">Current View</span>
</a> </a>
<div class="horizontalToolbarSeparator visibleLargeView"></div> <div class="horizontalToolbarSeparator visibleLargeView"></div>
<button id="firstPage" class="secondaryToolbarButton firstPage" title="Go to First Page" tabindex="56" data-l10n-id="first_page"> <button id="firstPage" class="secondaryToolbarButton" title="Go to First Page" tabindex="56" data-l10n-id="first_page">
<span data-l10n-id="first_page_label">Go to First Page</span> <span data-l10n-id="first_page_label">Go to First Page</span>
</button> </button>
<button id="lastPage" class="secondaryToolbarButton lastPage" title="Go to Last Page" tabindex="57" data-l10n-id="last_page"> <button id="lastPage" class="secondaryToolbarButton" title="Go to Last Page" tabindex="57" data-l10n-id="last_page">
<span data-l10n-id="last_page_label">Go to Last Page</span> <span data-l10n-id="last_page_label">Go to Last Page</span>
</button> </button>
<div class="horizontalToolbarSeparator"></div> <div class="horizontalToolbarSeparator"></div>
<button id="pageRotateCw" class="secondaryToolbarButton rotateCw" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw"> <button id="pageRotateCw" class="secondaryToolbarButton" title="Rotate Clockwise" tabindex="58" data-l10n-id="page_rotate_cw">
<span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span> <span data-l10n-id="page_rotate_cw_label">Rotate Clockwise</span>
</button> </button>
<button id="pageRotateCcw" class="secondaryToolbarButton rotateCcw" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw"> <button id="pageRotateCcw" class="secondaryToolbarButton" title="Rotate Counterclockwise" tabindex="59" data-l10n-id="page_rotate_ccw">
<span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span> <span data-l10n-id="page_rotate_ccw_label">Rotate Counterclockwise</span>
</button> </button>
<div class="horizontalToolbarSeparator"></div> <div class="horizontalToolbarSeparator"></div>
<button id="cursorSelectTool" class="secondaryToolbarButton selectTool toggled" title="Enable Text Selection Tool" tabindex="60" data-l10n-id="cursor_text_select_tool"> <div id="cursorToolButtons" role="radiogroup">
<span data-l10n-id="cursor_text_select_tool_label">Text Selection Tool</span> <button id="cursorSelectTool" class="secondaryToolbarButton toggled" title="Enable Text Selection Tool" tabindex="60" data-l10n-id="cursor_text_select_tool" role="radio" aria-checked="true">
</button> <span data-l10n-id="cursor_text_select_tool_label">Text Selection Tool</span>
<button id="cursorHandTool" class="secondaryToolbarButton handTool" title="Enable Hand Tool" tabindex="61" data-l10n-id="cursor_hand_tool"> </button>
<span data-l10n-id="cursor_hand_tool_label">Hand Tool</span> <button id="cursorHandTool" class="secondaryToolbarButton" title="Enable Hand Tool" tabindex="61" data-l10n-id="cursor_hand_tool" role="radio" aria-checked="false">
</button> <span data-l10n-id="cursor_hand_tool_label">Hand Tool</span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div> <div class="horizontalToolbarSeparator"></div>
<button id="documentProperties" style="display: none" class="secondaryToolbarButton documentProperties" title="Document Properties" tabindex="62" data-l10n-id="document_properties"> <div id="scrollModeButtons" role="radiogroup">
<button id="scrollPage" class="secondaryToolbarButton" title="Use Page Scrolling" tabindex="62" data-l10n-id="scroll_page" role="radio" aria-checked="false">
<span data-l10n-id="scroll_page_label">Page Scrolling</span>
</button>
<button id="scrollVertical" class="secondaryToolbarButton toggled" title="Use Vertical Scrolling" tabindex="63" data-l10n-id="scroll_vertical" role="radio" aria-checked="true">
<span data-l10n-id="scroll_vertical_label" >Vertical Scrolling</span>
</button>
<button id="scrollHorizontal" class="secondaryToolbarButton" title="Use Horizontal Scrolling" tabindex="64" data-l10n-id="scroll_horizontal" role="radio" aria-checked="false">
<span data-l10n-id="scroll_horizontal_label">Horizontal Scrolling</span>
</button>
<button id="scrollWrapped" class="secondaryToolbarButton" title="Use Wrapped Scrolling" tabindex="65" data-l10n-id="scroll_wrapped" role="radio" aria-checked="false">
<span data-l10n-id="scroll_wrapped_label">Wrapped Scrolling</span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div>
<div id="spreadModeButtons" role="radiogroup">
<button id="spreadNone" class="secondaryToolbarButton toggled" title="Do not join page spreads" tabindex="66" data-l10n-id="spread_none" role="radio" aria-checked="true">
<span data-l10n-id="spread_none_label">No Spreads</span>
</button>
<button id="spreadOdd" class="secondaryToolbarButton" title="Join page spreads starting with odd-numbered pages" tabindex="67" data-l10n-id="spread_odd" role="radio" aria-checked="false">
<span data-l10n-id="spread_odd_label">Odd Spreads</span>
</button>
<button id="spreadEven" class="secondaryToolbarButton" title="Join page spreads starting with even-numbered pages" tabindex="68" data-l10n-id="spread_even" role="radio" aria-checked="false">
<span data-l10n-id="spread_even_label">Even Spreads</span>
</button>
</div>
<div class="horizontalToolbarSeparator"></div>
<button id="documentProperties" class="secondaryToolbarButton" title="Document Properties" tabindex="69" data-l10n-id="document_properties" aria-controls="documentPropertiesDialog">
<span data-l10n-id="document_properties_label">Document Properties…</span> <span data-l10n-id="document_properties_label">Document Properties…</span>
</button> </button>
</div> </div>
@@ -345,58 +239,70 @@ See https://github.com/adobe-type-tools/cmap-resources
<div id="toolbarContainer"> <div id="toolbarContainer">
<div id="toolbarViewer"> <div id="toolbarViewer">
<div id="toolbarViewerLeft"> <div id="toolbarViewerLeft">
<button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar"> <button id="sidebarToggle" class="toolbarButton" title="Toggle Sidebar" tabindex="11" data-l10n-id="toggle_sidebar" aria-expanded="false" aria-controls="sidebarContainer">
<span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span> <span data-l10n-id="toggle_sidebar_label">Toggle Sidebar</span>
</button> </button>
<div class="toolbarButtonSpacer"></div> <div class="toolbarButtonSpacer"></div>
<button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar"> <button id="viewFind" class="toolbarButton" title="Find in Document" tabindex="12" data-l10n-id="findbar" aria-expanded="false" aria-controls="findbar">
<span data-l10n-id="findbar_label">Find</span> <span data-l10n-id="findbar_label">Find</span>
</button> </button>
<div class="splitToolbarButton hiddenSmallView"> <div class="splitToolbarButton hiddenSmallView">
<button class="toolbarButton pageUp" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous"> <button class="toolbarButton" title="Previous Page" id="previous" tabindex="13" data-l10n-id="previous">
<span data-l10n-id="previous_label">Previous</span> <span data-l10n-id="previous_label">Previous</span>
</button> </button>
<div class="splitToolbarButtonSeparator"></div> <div class="splitToolbarButtonSeparator"></div>
<button class="toolbarButton pageDown" title="Next Page" id="next" tabindex="14" data-l10n-id="next"> <button class="toolbarButton" title="Next Page" id="next" tabindex="14" data-l10n-id="next">
<span data-l10n-id="next_label">Next</span> <span data-l10n-id="next_label">Next</span>
</button> </button>
</div> </div>
<input type="number" id="pageNumber" class="toolbarField pageNumber" title="Page" value="1" size="4" min="1" tabindex="15" data-l10n-id="page"> <input type="number" id="pageNumber" class="toolbarField" title="Page" value="1" size="4" min="1" tabindex="15" data-l10n-id="page" autocomplete="off">
<span id="numPages" class="toolbarLabel"></span> <span id="numPages" class="toolbarLabel"></span>
</div> </div>
<div id="toolbarViewerRight"> <div id="toolbarViewerRight">
<button id="presentationMode" class="toolbarButton presentationMode hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode"> <button id="presentationMode" class="toolbarButton hiddenLargeView" title="Switch to Presentation Mode" tabindex="31" data-l10n-id="presentation_mode">
<span data-l10n-id="presentation_mode_label">Presentation Mode</span> <span data-l10n-id="presentation_mode_label">Presentation Mode</span>
</button> </button>
<button id="openFile" class="toolbarButton openFile hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file"> <button id="openFile" class="toolbarButton hiddenLargeView" title="Open File" tabindex="32" data-l10n-id="open_file">
<span data-l10n-id="open_file_label">Open</span> <span data-l10n-id="open_file_label">Open</span>
</button> </button>
<button id="print" data-print="KLO98GHSDD" class="toolbarButton print hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print"> <button id="print" class="toolbarButton hiddenMediumView" title="Print" tabindex="33" data-l10n-id="print">
<span data-l10n-id="print_label">Print</span> <span data-l10n-id="print_label">Print</span>
</button> </button>
<button id="download" style="visibility:hidden" class="toolbarButton download hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download"> <button id="download" class="toolbarButton hiddenMediumView" title="Download" tabindex="34" data-l10n-id="download">
<span data-l10n-id="download_label">Download</span> <span data-l10n-id="download_label">Download</span>
</button> </button>
<a href="#" id="viewBookmark" style="visibility:hidden" class="toolbarButton bookmark hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark"> <a href="#" id="viewBookmark" class="toolbarButton hiddenSmallView" title="Current view (copy or open in new window)" tabindex="35" data-l10n-id="bookmark">
<span data-l10n-id="bookmark_label">Current View</span> <span data-l10n-id="bookmark_label">Current View</span>
</a> </a>
<div class="verticalToolbarSeparator hiddenSmallView"></div> <div class="verticalToolbarSeparator hiddenSmallView"></div>
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="36" data-l10n-id="tools"> <div id="editorModeButtons" class="splitToolbarButton toggled hidden" role="radiogroup">
<button id="editorFreeText" class="toolbarButton" disabled="disabled" title="Add FreeText Annotation" role="radio" aria-checked="false" tabindex="36" data-l10n-id="editor_free_text">
<span data-l10n-id="editor_free_text_label">FreeText Annotation</span>
</button>
<button id="editorInk" class="toolbarButton" disabled="disabled" title="Add Ink Annotation" role="radio" aria-checked="false" tabindex="37" data-l10n-id="editor_ink">
<span data-l10n-id="editor_ink_label">Ink Annotation</span>
</button>
</div>
<!-- Should be visible when the "editorModeButtons" are visible. -->
<div id="editorModeSeparator" class="verticalToolbarSeparator hidden"></div>
<button id="secondaryToolbarToggle" class="toolbarButton" title="Tools" tabindex="48" data-l10n-id="tools" aria-expanded="false" aria-controls="secondaryToolbar">
<span data-l10n-id="tools_label">Tools</span> <span data-l10n-id="tools_label">Tools</span>
</button> </button>
</div> </div>
<div id="toolbarViewerMiddle"> <div id="toolbarViewerMiddle">
<div class="splitToolbarButton"> <div class="splitToolbarButton">
<button id="zoomOut" class="toolbarButton zoomOut" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out"> <button id="zoomOut" class="toolbarButton" title="Zoom Out" tabindex="21" data-l10n-id="zoom_out">
<span data-l10n-id="zoom_out_label">Zoom Out</span> <span data-l10n-id="zoom_out_label">Zoom Out</span>
</button> </button>
<div class="splitToolbarButtonSeparator"></div> <div class="splitToolbarButtonSeparator"></div>
<button id="zoomIn" class="toolbarButton zoomIn" title="Zoom In" tabindex="22" data-l10n-id="zoom_in"> <button id="zoomIn" class="toolbarButton" title="Zoom In" tabindex="22" data-l10n-id="zoom_in">
<span data-l10n-id="zoom_in_label">Zoom In</span> <span data-l10n-id="zoom_in_label">Zoom In</span>
</button> </button>
</div> </div>
@@ -428,17 +334,6 @@ See https://github.com/adobe-type-tools/cmap-resources
</div> </div>
</div> </div>
<menu type="context" id="viewerContextMenu">
<menuitem id="contextFirstPage" label="First Page"
data-l10n-id="first_page"></menuitem>
<menuitem id="contextLastPage" label="Last Page"
data-l10n-id="last_page"></menuitem>
<menuitem id="contextPageRotateCw" label="Rotate Clockwise"
data-l10n-id="page_rotate_cw"></menuitem>
<menuitem id="contextPageRotateCcw" label="Rotate Counter-Clockwise"
data-l10n-id="page_rotate_ccw"></menuitem>
</menu>
<div id="viewerContainer" tabindex="0"> <div id="viewerContainer" tabindex="0">
<div id="viewer" class="pdfViewer"></div> <div id="viewer" class="pdfViewer"></div>
</div> </div>
@@ -458,115 +353,105 @@ See https://github.com/adobe-type-tools/cmap-resources
Close Close
</button> </button>
</div> </div>
<div class="clearBoth"></div> <div id="errorSpacer"></div>
<textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea> <textarea id="errorMoreInfo" hidden='true' readonly="readonly"></textarea>
</div> </div>
</div> <!-- mainContainer --> </div> <!-- mainContainer -->
<div id="overlayContainer" class="hidden"> <div id="dialogContainer">
<div id="passwordOverlay" class="container hidden"> <dialog id="passwordDialog">
<div class="dialog"> <div class="row">
<div class="row"> <label for="password" id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</label>
<p id="passwordText" data-l10n-id="password_label">Enter the password to open this PDF file:</p>
</div>
<div class="row">
<input type="password" id="password" class="toolbarField">
</div>
<div class="buttonRow">
<button id="passwordCancel" class="overlayButton"><span data-l10n-id="password_cancel">Cancel</span></button>
<button id="passwordSubmit" class="overlayButton"><span data-l10n-id="password_ok">OK</span></button>
</div>
</div> </div>
</div> <div class="row">
<div id="documentPropertiesOverlay" class="container hidden"> <input type="password" id="password" class="toolbarField">
<div class="dialog">
<div class="row">
<span data-l10n-id="document_properties_file_name">File name:</span> <p id="fileNameField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_file_size">File size:</span> <p id="fileSizeField">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_title">Title:</span> <p id="titleField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_author">Author:</span> <p id="authorField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_subject">Subject:</span> <p id="subjectField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_keywords">Keywords:</span> <p id="keywordsField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_creation_date">Creation Date:</span> <p id="creationDateField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_modification_date">Modification Date:</span> <p id="modificationDateField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_creator">Creator:</span> <p id="creatorField">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span data-l10n-id="document_properties_producer">PDF Producer:</span> <p id="producerField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_version">PDF Version:</span> <p id="versionField">-</p>
</div>
<div class="row">
<span data-l10n-id="document_properties_page_count">Page Count:</span> <p id="pageCountField">-</p>
</div>
<div class="buttonRow">
<button id="documentPropertiesClose" class="overlayButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div>
</div> </div>
</div> <div class="buttonRow">
<div id="printServiceOverlay" class="container hidden"> <button id="passwordCancel" class="dialogButton"><span data-l10n-id="password_cancel">Cancel</span></button>
<div class="dialog"> <button id="passwordSubmit" class="dialogButton"><span data-l10n-id="password_ok">OK</span></button>
<div class="row">
<span data-l10n-id="print_progress_message">Preparing document for printing…</span>
</div>
<div class="row">
<progress value="0" max="100"></progress>
<span data-l10n-id="print_progress_percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
</div>
<div class="buttonRow">
<button id="printCancel" class="overlayButton"><span data-l10n-id="print_progress_close">Cancel</span></button>
</div>
</div> </div>
</div> </dialog>
</div> <!-- overlayContainer --> <dialog id="documentPropertiesDialog">
<div class="row">
<span id="fileNameLabel" data-l10n-id="document_properties_file_name">File name:</span>
<p id="fileNameField" aria-labelledby="fileNameLabel">-</p>
</div>
<div class="row">
<span id="fileSizeLabel" data-l10n-id="document_properties_file_size">File size:</span>
<p id="fileSizeField" aria-labelledby="fileSizeLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="titleLabel" data-l10n-id="document_properties_title">Title:</span>
<p id="titleField" aria-labelledby="titleLabel">-</p>
</div>
<div class="row">
<span id="authorLabel" data-l10n-id="document_properties_author">Author:</span>
<p id="authorField" aria-labelledby="authorLabel">-</p>
</div>
<div class="row">
<span id="subjectLabel" data-l10n-id="document_properties_subject">Subject:</span>
<p id="subjectField" aria-labelledby="subjectLabel">-</p>
</div>
<div class="row">
<span id="keywordsLabel" data-l10n-id="document_properties_keywords">Keywords:</span>
<p id="keywordsField" aria-labelledby="keywordsLabel">-</p>
</div>
<div class="row">
<span id="creationDateLabel" data-l10n-id="document_properties_creation_date">Creation Date:</span>
<p id="creationDateField" aria-labelledby="creationDateLabel">-</p>
</div>
<div class="row">
<span id="modificationDateLabel" data-l10n-id="document_properties_modification_date">Modification Date:</span>
<p id="modificationDateField" aria-labelledby="modificationDateLabel">-</p>
</div>
<div class="row">
<span id="creatorLabel" data-l10n-id="document_properties_creator">Creator:</span>
<p id="creatorField" aria-labelledby="creatorLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="producerLabel" data-l10n-id="document_properties_producer">PDF Producer:</span>
<p id="producerField" aria-labelledby="producerLabel">-</p>
</div>
<div class="row">
<span id="versionLabel" data-l10n-id="document_properties_version">PDF Version:</span>
<p id="versionField" aria-labelledby="versionLabel">-</p>
</div>
<div class="row">
<span id="pageCountLabel" data-l10n-id="document_properties_page_count">Page Count:</span>
<p id="pageCountField" aria-labelledby="pageCountLabel">-</p>
</div>
<div class="row">
<span id="pageSizeLabel" data-l10n-id="document_properties_page_size">Page Size:</span>
<p id="pageSizeField" aria-labelledby="pageSizeLabel">-</p>
</div>
<div class="separator"></div>
<div class="row">
<span id="linearizedLabel" data-l10n-id="document_properties_linearized">Fast Web View:</span>
<p id="linearizedField" aria-labelledby="linearizedLabel">-</p>
</div>
<div class="buttonRow">
<button id="documentPropertiesClose" class="dialogButton"><span data-l10n-id="document_properties_close">Close</span></button>
</div>
</dialog>
<dialog id="printServiceDialog" style="min-width: 200px;">
<div class="row">
<span data-l10n-id="print_progress_message">Preparing document for printing…</span>
</div>
<div class="row">
<progress value="0" max="100"></progress>
<span data-l10n-id="print_progress_percent" data-l10n-args='{ "progress": 0 }' class="relative-progress">0%</span>
</div>
<div class="buttonRow">
<button id="printCancel" class="dialogButton"><span data-l10n-id="print_progress_close">Cancel</span></button>
</div>
</dialog>
</div> <!-- dialogContainer -->
</div> <!-- outerContainer --> </div> <!-- outerContainer -->
<!-- <div id="rightClickBox" class="right-click-box">-->
<!-- <p id="copy">开启复制</p>-->
<!-- </div>-->
<!-- <div class="button-box"> -->
<!--<span>翻译</span>-->
<!-- <span id="copyBtn">复制</span> -->
<!-- </div> -->
<textarea type="hidden" class="hidden-textarea"></textarea>
<div id="printContainer"></div> <div id="printContainer"></div>
<script>
window.onload = function () { <input type="file" id="fileInput" class="hidden">
var print = document.getElementById('print')
var printId = print.getAttribute('data-print')
var printParentNode = print.parentNode
var menuList = JSON.parse(localStorage.getItem('menuList'))
var visible = false
menuList.map(function (menu) {
if (menu.id === printId) {
visible = true
return
}
})
if (!visible) {
printParentNode.removeChild(print)
}
}
</script>
</body> </body>
</html> </html>
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -136,7 +136,7 @@ const user = {
window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot' window._CONFIG['domianPreviewURL'] = Vue.ls.get('domianPreviewURL') + '/jero-boot'
window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot' window._CONFIG['domianWebSocketURL'] = Vue.ls.get('domianWebSocketURL') + '/jero-boot'
window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview' window._CONFIG['onlinePreviewDomainURL'] = Vue.ls.get('onlinePreviewDomainURL') + '/onlinePreview'
window._CONFIG['httpsOnlinePreviewDomainURL'] = Vue.ls.get('httpsOnlinePreviewDomainURL') + '/onlinePreview' window._CONFIG['httpsOnlinePreviewDomainURL'] = Vue.ls.get('httpsOnlinePreviewDomainURL') + '/preview/onlinePreview'
//Vue.ls.set(USER_AUTH,authData); //Vue.ls.set(USER_AUTH,authData);
sessionStorage.setItem(USER_AUTH, JSON.stringify(authData)) sessionStorage.setItem(USER_AUTH, JSON.stringify(authData))
sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData)) sessionStorage.setItem(SYS_BUTTON_AUTH, JSON.stringify(allAuthData))
@@ -1,6 +1,6 @@
<template> <template>
<a-drawer <a-drawer
title="添加" :title="$t('bringInStandardInformation')"
:maskClosable="false" :maskClosable="false"
:width="1000" :width="1000"
placement="right" placement="right"
@@ -295,7 +295,7 @@
} }
.title-text { .title-text {
width: 33px; width: 69px;
color: #000F16; color: #000F16;
display: inline-block; display: inline-block;
font-weight: 500; font-weight: 500;
@@ -85,13 +85,15 @@
this.loadingRight = true this.loadingRight = true
// this.readExcelFromRemoteFileLeft(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) // this.readExcelFromRemoteFileLeft(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
// this.readExcelFromRemoteFileRight(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) // this.readExcelFromRemoteFileRight(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
let href = location.href.slice(0,5) let href = location.href.slice(0, 5)
if (href.indexOf('s') == '-1'){ if (href.indexOf('s') == '-1') {
this.detailUrlLeft = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) this.detailUrlLeft = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
this.detailUrlRight = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) this.detailUrlRight = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
}else{ console.log(this.detailUrlLeft)
} else {
this.detailUrlLeft = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix) this.detailUrlLeft = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
this.detailUrlRight = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix) this.detailUrlRight = window._CONFIG['httpsOnlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
console.log(this.detailUrlLeft)
} }
}, },
readExcelFromRemoteFileLeft: function(url) { readExcelFromRemoteFileLeft: function(url) {