Commit c932ea25 authored by Kristof Csillag's avatar Kristof Csillag

Merge pull request #1817 from hypothesis/update-annotator

Update PDF plugin
parents eed7b635 463a2b08
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-bee2b25
** Annotator 1.2.6-dev-4627466
** 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-12-11 02:43:05Z
** Built at: 2014-12-18 11:08:27Z
*/
......@@ -18,11 +18,31 @@
// Generated by CoffeeScript 1.6.3
(function() {
var _ref,
var compareVersions, detectedPDFjsVersion, _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
detectedPDFjsVersion = typeof PDFJS !== "undefined" && PDFJS !== null ? PDFJS.version.split(".").map(parseFloat) : void 0;
compareVersions = function(v1, v2) {
var i, _i, _ref;
if (!(Array.isArray(v1) && Array.isArray(v2))) {
throw new Error("Expecting arrays, in the form of [1, 0, 123]");
}
if (v1.length !== v2.length) {
throw new Error("Can't compare versions in different formats.");
}
for (i = _i = 0, _ref = v1.length; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
if (v1[i] < v2[i]) {
return -1;
} else if (v1[i] > v2[i]) {
return 1;
}
}
return 0;
};
window.PDFTextMapper = (function(_super) {
__extends(PDFTextMapper, _super);
......@@ -88,6 +108,9 @@
};
}
this.setEvents();
if (compareVersions(detectedPDFjsVersion, [1, 0, 822]) >= 0) {
this._viewer.container.className += " has-transparent-text-layer";
}
}
PDFTextMapper.prototype.setEvents = function() {
......
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