Commit bad15cc8 authored by csillag's avatar csillag

Update Annotator to 6623b2c2 (typed-packaging branch)

parent 3ab5ceaa
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
/* /*
** Annotator 1.2.6-dev-6da826c ** Annotator 1.2.6-dev-6623b2c
** https://github.com/okfn/annotator/ ** https://github.com/okfn/annotator/
** **
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning. ** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses. ** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE ** https://github.com/okfn/annotator/blob/master/LICENSE
** **
** Built at: 2014-11-21 11:06:29Z ** Built at: 2014-12-11 01:33:32Z
*/ */
...@@ -1205,9 +1205,7 @@ ...@@ -1205,9 +1205,7 @@
Annotator.prototype._scan = function() { Annotator.prototype._scan = function() {
var _this = this; var _this = this;
if (!this.domMapper) {
this._chooseAccessPolicy(); this._chooseAccessPolicy();
}
try { try {
this.pendingScan = this.domMapper.scan(); this.pendingScan = this.domMapper.scan();
} catch (_error) { } catch (_error) {
...@@ -1426,18 +1424,15 @@ ...@@ -1426,18 +1424,15 @@
}; };
Annotator.prototype.setupAnnotation = function(annotation) { Annotator.prototype.setupAnnotation = function(annotation) {
var anchor, exception, pageIndex, result, t, _base, _k, _l, _len2, _ref1, _ref2, _ref3, _ref4; var anchor, exception, pageIndex, result, t, _base, _k, _l, _len2, _ref1, _ref2, _ref3, _ref4, _ref5;
if (annotation.target == null) { if (annotation.target == null) {
annotation.target = this.selectedTargets; annotation.target = this.selectedTargets;
} }
this.selectedTargets = []; this.selectedTargets = [];
if (annotation.target == null) {
throw new Error("Can not run setupAnnotation(). No target or selection available.");
}
annotation.anchors = []; annotation.anchors = [];
_ref1 = annotation.target; _ref2 = (_ref1 = annotation.target) != null ? _ref1 : [];
for (_k = 0, _len2 = _ref1.length; _k < _len2; _k++) { for (_k = 0, _len2 = _ref2.length; _k < _len2; _k++) {
t = _ref1[_k]; t = _ref2[_k];
try { try {
result = this.createAnchor(annotation, t); result = this.createAnchor(annotation, t);
anchor = result.result; anchor = result.result;
...@@ -1448,7 +1443,7 @@ ...@@ -1448,7 +1443,7 @@
t.diffHTML = anchor.diffHTML; t.diffHTML = anchor.diffHTML;
t.diffCaseOnly = anchor.diffCaseOnly; t.diffCaseOnly = anchor.diffCaseOnly;
annotation.anchors.push(anchor); annotation.anchors.push(anchor);
for (pageIndex = _l = _ref2 = anchor.startPage, _ref3 = anchor.endPage; _ref2 <= _ref3 ? _l <= _ref3 : _l >= _ref3; pageIndex = _ref2 <= _ref3 ? ++_l : --_l) { for (pageIndex = _l = _ref3 = anchor.startPage, _ref4 = anchor.endPage; _ref3 <= _ref4 ? _l <= _ref4 : _l >= _ref4; pageIndex = _ref3 <= _ref4 ? ++_l : --_l) {
if ((_base = this.anchors)[pageIndex] == null) { if ((_base = this.anchors)[pageIndex] == null) {
_base[pageIndex] = []; _base[pageIndex] = [];
} }
...@@ -1458,7 +1453,7 @@ ...@@ -1458,7 +1453,7 @@
} }
} catch (_error) { } catch (_error) {
exception = _error; exception = _error;
console.log("Error in setupAnnotation for", annotation.id, ":", (_ref4 = exception.stack) != null ? _ref4 : exception); console.log("Error in setupAnnotation for", annotation.id, ":", (_ref5 = exception.stack) != null ? _ref5 : exception);
} }
} }
return annotation; return annotation;
...@@ -1509,9 +1504,6 @@ ...@@ -1509,9 +1504,6 @@
}; };
clone = annotations.slice(); clone = annotations.slice();
if (annotations.length) { if (annotations.length) {
if (!this.domMapper) {
this._scan();
}
if (this.pendingScan != null) { if (this.pendingScan != null) {
this.pendingScan.then(function() { this.pendingScan.then(function() {
return setTimeout(function() { return setTimeout(function() {
......
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
/* /*
** Annotator 1.2.6-dev-18d8f72 ** Annotator 1.2.6-dev-6623b2c
** https://github.com/okfn/annotator/ ** https://github.com/okfn/annotator/
** **
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning. ** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses. ** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE ** https://github.com/okfn/annotator/blob/master/LICENSE
** **
** Built at: 2014-12-08 17:27:52Z ** Built at: 2014-12-11 01:33:35Z
*/ */
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
(function() { (function() {
var PDFTextMapper, _ref, var _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty, __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; }; __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; };
PDFTextMapper = (function(_super) { window.PDFTextMapper = (function(_super) {
__extends(PDFTextMapper, _super); __extends(PDFTextMapper, _super);
PDFTextMapper.isPDFDocument = function() { PDFTextMapper.isPDFDocument = function() {
......
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
/* /*
** Annotator 1.2.6-dev-9e0eff3 ** Annotator 1.2.6-dev-6623b2c
** https://github.com/okfn/annotator/ ** https://github.com/okfn/annotator/
** **
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning. ** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses. ** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE ** https://github.com/okfn/annotator/blob/master/LICENSE
** **
** Built at: 2014-09-25 22:40:57Z ** Built at: 2014-12-11 01:33:34Z
*/ */
...@@ -101,14 +101,10 @@ ...@@ -101,14 +101,10 @@
Store.prototype.annotationDeleted = function(annotation) { Store.prototype.annotationDeleted = function(annotation) {
var _this = this; var _this = this;
if (__indexOf.call(this.annotations, annotation) >= 0) { if (__indexOf.call(this.annotations, annotation) >= 0) {
if (annotation._clientdeleteonly != null) {
return this.unregisterAnnotation(annotation);
} else {
return this._apiRequest('destroy', annotation, (function() { return this._apiRequest('destroy', annotation, (function() {
return _this.unregisterAnnotation(annotation); return _this.unregisterAnnotation(annotation);
})); }));
} }
}
}; };
Store.prototype.registerAnnotation = function(annotation) { Store.prototype.registerAnnotation = function(annotation) {
......
// Generated by CoffeeScript 1.6.3 // Generated by CoffeeScript 1.6.3
/* /*
** Annotator 1.2.6-dev-9e0eff3 ** Annotator 1.2.6-dev-95b7a09
** https://github.com/okfn/annotator/ ** https://github.com/okfn/annotator/
** **
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning. ** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses. ** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE ** https://github.com/okfn/annotator/blob/master/LICENSE
** **
** Built at: 2014-09-25 22:40:59Z ** Built at: 2014-12-03 11:41:09Z
*/ */
...@@ -91,19 +91,6 @@ ...@@ -91,19 +91,6 @@
return r; return r;
}; };
TextHighlight.prototype._highlightRanges = function(normedRanges, cssClass) {
var highlights, r, _i, _len;
if (cssClass == null) {
cssClass = 'annotator-hl';
}
highlights = [];
for (_i = 0, _len = normedRanges.length; _i < _len; _i++) {
r = normedRanges[_i];
this.$.merge(highlights, this._highlightRange(r, cssClass));
}
return highlights;
};
function TextHighlight(anchor, pageIndex, normedRange) { function TextHighlight(anchor, pageIndex, normedRange) {
TextHighlight.__super__.constructor.call(this, anchor, pageIndex); TextHighlight.__super__.constructor.call(this, anchor, pageIndex);
TextHighlight._init(this.annotator); TextHighlight._init(this.annotator);
......
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