Skip to content

Commit

Permalink
pkp/pkp-lib#4749 Update PDF.js release to v2.0.943
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed May 13, 2019
1 parent 1fd2bf6 commit 980bee5
Show file tree
Hide file tree
Showing 146 changed files with 84,418 additions and 53,885 deletions.
26,316 changes: 18,143 additions & 8,173 deletions pdf.js/build/pdf.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pdf.js/build/pdf.js.map

Large diffs are not rendered by default.

83,021 changes: 45,843 additions & 37,178 deletions pdf.js/build/pdf.worker.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pdf.js/build/pdf.worker.js.map

Large diffs are not rendered by default.

47 changes: 23 additions & 24 deletions pdf.js/web/debugger.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* eslint-disable no-var */

'use strict';

var FontInspector = (function FontInspectorClosure() {
var fonts;
var fonts, createObjectURL;
var active = false;
var fontAttribute = 'data-font-name';
function removeSelection() {
Expand Down Expand Up @@ -74,6 +75,8 @@ var FontInspector = (function FontInspectorClosure() {

fonts = document.createElement('div');
panel.appendChild(fonts);

createObjectURL = pdfjsLib.createObjectURL;
},
cleanup: function cleanup() {
fonts.textContent = '';
Expand Down Expand Up @@ -118,10 +121,7 @@ var FontInspector = (function FontInspectorClosure() {
url = /url\(['"]?([^\)"']+)/.exec(url);
download.href = url[1];
} else if (fontObj.data) {
url = URL.createObjectURL(new Blob([fontObj.data], {
type: fontObj.mimeType
}));
download.href = url;
download.href = createObjectURL(fontObj.data, fontObj.mimeType);
}
download.textContent = 'Download';
var logIt = document.createElement('a');
Expand Down Expand Up @@ -149,12 +149,12 @@ var FontInspector = (function FontInspectorClosure() {
fonts.appendChild(font);
// Somewhat of a hack, should probably add a hook for when the text layer
// is done rendering.
setTimeout(function() {
setTimeout(() => {
if (this.active) {
resetSelection();
}
}.bind(this), 2000);
}
}, 2000);
},
};
})();

Expand Down Expand Up @@ -243,7 +243,7 @@ var StepperManager = (function StepperManagerClosure() {
saveBreakPoints: function saveBreakPoints(pageIndex, bps) {
breakPoints[pageIndex] = bps;
sessionStorage.setItem('pdfjsBreakPoints', JSON.stringify(breakPoints));
}
},
};
})();

Expand All @@ -262,7 +262,7 @@ var Stepper = (function StepperClosure() {
if (typeof args === 'string') {
var MAX_STRING_LENGTH = 75;
return args.length <= MAX_STRING_LENGTH ? args :
args.substr(0, MAX_STRING_LENGTH) + '...';
args.substring(0, MAX_STRING_LENGTH) + '...';
}
if (typeof args !== 'object' || args === null) {
return args;
Expand Down Expand Up @@ -337,7 +337,7 @@ var Stepper = (function StepperClosure() {
line.className = 'line';
line.dataset.idx = i;
chunk.appendChild(line);
var checked = this.breakPoints.indexOf(i) !== -1;
var checked = this.breakPoints.includes(i);
var args = operatorList.argsArray[i] || [];

var breakCell = c('td');
Expand Down Expand Up @@ -433,7 +433,7 @@ var Stepper = (function StepperClosure() {
row.style.backgroundColor = null;
}
}
}
},
};
return Stepper;
})();
Expand All @@ -459,14 +459,13 @@ var Stats = (function Stats() {
name: 'Stats',
panel: null,
manager: null,
init: function init(pdfjsLib) {
init(pdfjsLib) {
this.panel.setAttribute('style', 'padding: 5px;');
pdfjsLib.PDFJS.enableStats = true;
},
enabled: false,
active: false,
// Stats specific functions.
add: function(pageNumber, stat) {
add(pageNumber, stat) {
if (!stat) {
return;
}
Expand All @@ -485,7 +484,7 @@ var Stats = (function Stats() {
statsDiv.textContent = stat.toString();
wrapper.appendChild(title);
wrapper.appendChild(statsDiv);
stats.push({ pageNumber: pageNumber, div: wrapper });
stats.push({ pageNumber, div: wrapper, });
stats.sort(function(a, b) {
return a.pageNumber - b.pageNumber;
});
Expand All @@ -494,10 +493,10 @@ var Stats = (function Stats() {
this.panel.appendChild(stats[i].div);
}
},
cleanup: function () {
cleanup() {
stats = [];
clear(this.panel);
}
},
};
})();

Expand All @@ -513,14 +512,14 @@ window.PDFBug = (function PDFBugClosure() {
StepperManager,
Stats
],
enable: function(ids) {
enable(ids) {
var all = false, tools = this.tools;
if (ids.length === 1 && ids[0] === 'all') {
all = true;
}
for (var i = 0; i < tools.length; ++i) {
var tool = tools[i];
if (all || ids.indexOf(tool.id) !== -1) {
if (all || ids.includes(tool.id)) {
tool.enabled = true;
}
}
Expand All @@ -535,7 +534,7 @@ window.PDFBug = (function PDFBugClosure() {
});
}
},
init: function init(pdfjsLib, container) {
init(pdfjsLib, container) {
/*
* Basic Layout:
* PDFBug
Expand Down Expand Up @@ -588,14 +587,14 @@ window.PDFBug = (function PDFBugClosure() {
}
this.selectPanel(0);
},
cleanup: function cleanup() {
cleanup() {
for (var i = 0, ii = this.tools.length; i < ii; i++) {
if (this.tools[i].enabled) {
this.tools[i].cleanup();
}
}
},
selectPanel: function selectPanel(index) {
selectPanel(index) {
if (typeof index !== 'number') {
index = this.tools.indexOf(index);
}
Expand All @@ -615,6 +614,6 @@ window.PDFBug = (function PDFBugClosure() {
tools[j].panel.setAttribute('hidden', 'true');
}
}
}
},
};
})();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pdf.js/web/images/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 980bee5

Please sign in to comment.