Commit c13d49b9 authored by csillag's avatar csillag

Update Annotor's PDF plugin to 9acc6554 (typed-packaging).

This change was necessary to adapt to updates of the PDF.js version
shipped with newer FF releases.

There were three small changes. Our code now works with both
the old version (currently used with Chrome) and the old version
(embedded in FF).
parent ac0e853c
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-5c36e53
** Annotator 1.2.6-dev-84bccda
** https://github.com/okfn/annotator/
**
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE
**
** Built at: 2014-06-17 21:13:19Z
** Built at: 2014-07-22 20:43:16Z
*/
......@@ -81,8 +81,8 @@
});
viewer = document.getElementById("viewer");
viewer.addEventListener("domChange", function(event) {
var data, endPage, node, startPage;
node = event.srcElement;
var data, endPage, node, startPage, _ref;
node = (_ref = event.srcElement) != null ? _ref : event.target;
data = event.data;
if ("viewer" === (typeof node.getAttribute === "function" ? node.getAttribute("id") : void 0)) {
console.log("Detected cross-page change event.");
......@@ -106,9 +106,10 @@
};
PDFTextMapper.prototype.scan = function() {
var _this = this;
var _ref,
_this = this;
if (this.pendingScan == null) {
this.pendingScan = new PDFJS.Promise();
this.pendingScan = (_ref = typeof PDFJS.Promise === "function" ? new PDFJS.Promise() : void 0) != null ? _ref : typeof PDFJS.LegacyPromise === "function" ? new PDFJS.LegacyPromise() : void 0;
}
if (PDFView.pdfDocument == null) {
setTimeout((function() {
......@@ -137,11 +138,11 @@
return page.getTextContent().then(function(data) {
var content, rawContent, text;
rawContent = ((function() {
var _i, _len, _ref, _results;
_ref = data.bidiTexts;
var _i, _len, _ref, _ref1, _results;
_ref1 = (_ref = data.bidiTexts) != null ? _ref : data;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
text = _ref[_i];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
text = _ref1[_i];
_results.push(text.str);
}
return _results;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment