Commit 60fdade9 authored by Randall Leeds's avatar Randall Leeds

Upgrade annotator to 1.2.7-dev-5cb9c6a

From hypothesis/annotator@develop
parent 0f58e9b5
......@@ -187,8 +187,6 @@ class Annotator.Host extends Annotator
if not @ignoreMouseup
setTimeout =>
unless @selectedRanges?.length then @panel?.notify method: 'back'
this._setupMatching()
@domMatcher.setRootNode @wrapper[0]
this
_setupDocumentEvents: ->
......
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-794ee6a
** Annotator 1.2.7-dev-5cb9c6a
** 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: 2013-07-25 10:20:52Z
** Built at: 2013-07-25 12:53:32Z
*/
/*
//
*/
// Generated by CoffeeScript 1.6.3
(function() {
var base64Decode, base64UrlDecode, createDateFromISO8601, parseToken,
__hasProp = {}.hasOwnProperty,
......@@ -17,7 +24,7 @@
createDateFromISO8601 = function(string) {
var d, date, offset, regexp, time, _ref;
regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" + "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" + "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\\.([0-9]+))?)?" + "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
d = string.match(new RegExp(regexp));
offset = 0;
date = new Date(d[1], 0, 1);
......@@ -223,3 +230,9 @@
})(Annotator.Plugin);
}).call(this);
/*
//
*/
//@ sourceMappingURL=annotator.auth.map
\ No newline at end of file
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-b61d9f7
** Annotator 1.2.7-dev-5cb9c6a
** 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: 2013-05-28 12:14:39Z
** Built at: 2013-07-25 12:53:33Z
*/
/*
//
*/
// Generated by CoffeeScript 1.6.3
(function() {
var _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
......@@ -25,13 +32,18 @@
this._getFavicon = __bind(this._getFavicon, this);
this._getLinks = __bind(this._getLinks, this);
this._getTitle = __bind(this._getTitle, this);
this._getOpenGraph = __bind(this._getOpenGraph, this);
this._getMetaTags = __bind(this._getMetaTags, this);
this._getEprints = __bind(this._getEprints, this);
this._getPrism = __bind(this._getPrism, this);
this._getDublinCore = __bind(this._getDublinCore, this);
this._getScholar = __bind(this._getScholar, this);
this._getTwitter = __bind(this._getTwitter, this);
this._getFacebook = __bind(this._getFacebook, this);
this._getHighwire = __bind(this._getHighwire, this);
this.getDocumentMetadata = __bind(this.getDocumentMetadata, this);
this.beforeAnnotationCreated = __bind(this.beforeAnnotationCreated, this);
this.uris = __bind(this.uris, this);
this.uri = __bind(this.uri, this); _ref = Document.__super__.constructor.apply(this, arguments);
this.uri = __bind(this.uri, this);
_ref = Document.__super__.constructor.apply(this, arguments);
return _ref;
}
......@@ -47,7 +59,6 @@
Document.prototype.uri = function() {
var link, uri, _i, _len, _ref1;
uri = decodeURIComponent(document.location.href);
_ref1 = this.metadata;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
......@@ -61,7 +72,6 @@
Document.prototype.uris = function() {
var href, link, uniqueUrls, _i, _len, _ref1;
uniqueUrls = {};
_ref1 = this.metadata.link;
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
......@@ -72,7 +82,6 @@
}
return (function() {
var _results;
_results = [];
for (href in uniqueUrls) {
_results.push(href);
......@@ -87,95 +96,76 @@
Document.prototype.getDocumentMetadata = function() {
this.metadata = {};
this._getScholar();
this._getHighwire();
this._getDublinCore();
this._getOpenGraph();
this._getFacebook();
this._getEprints();
this._getPrism();
this._getTwitter();
this._getFavicon();
this._getTitle();
this._getLinks();
return this.metadata;
};
Document.prototype._getScholar = function() {
var content, meta, name, _i, _len, _ref1, _results;
Document.prototype._getHighwire = function() {
return this.metadata.highwire = this._getMetaTags("citation", "name", "_");
};
this.metadata.scholar = {};
_ref1 = $("meta");
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
meta = _ref1[_i];
name = $(meta).prop("name");
content = $(meta).prop("content");
if (name.match(/^citation_/)) {
if (this.metadata.scholar[name]) {
_results.push(this.metadata.scholar[name].push(content));
} else {
_results.push(this.metadata.scholar[name] = [content]);
}
} else {
_results.push(void 0);
}
}
return _results;
Document.prototype._getFacebook = function() {
return this.metadata.facebook = this._getMetaTags("og", "property", ":");
};
Document.prototype._getTwitter = function() {
return this.metadata.twitter = this._getMetaTags("twitter", "name", ":");
};
Document.prototype._getDublinCore = function() {
var content, meta, n, name, nameParts, _i, _len, _ref1, _results;
return this.metadata.dc = this._getMetaTags("dc", "name", ".");
};
this.metadata.dc = {};
_ref1 = $("meta");
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
meta = _ref1[_i];
name = $(meta).prop("name");
content = $(meta).prop("content");
nameParts = name.split(".");
if (nameParts.length === 2 && nameParts[0].toLowerCase() === "dc") {
n = nameParts[1];
if (this.metadata.dc[n]) {
_results.push(this.metadata.dc[n].push(content));
} else {
_results.push(this.metadata.dc[n] = [content]);
}
} else {
_results.push(void 0);
}
}
return _results;
Document.prototype._getPrism = function() {
return this.metadata.prism = this._getMetaTags("prism", "name", ".");
};
Document.prototype._getOpenGraph = function() {
var content, match, meta, n, property, _i, _len, _ref1, _results;
Document.prototype._getEprints = function() {
return this.metadata.eprints = this._getMetaTags("eprints", "name", ".");
};
this.metadata.og = {};
Document.prototype._getMetaTags = function(prefix, attribute, delimiter) {
var content, match, meta, n, name, tags, _i, _len, _ref1;
tags = {};
_ref1 = $("meta");
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
meta = _ref1[_i];
property = $(meta).attr("property");
name = $(meta).attr(attribute);
content = $(meta).prop("content");
if (property) {
match = property.match(/^og:(.+)$/);
if (name) {
match = name.match(RegExp("^" + prefix + delimiter + "(.+)$", "i"));
if (match) {
n = match[1];
if (this.metadata.og[n]) {
_results.push(this.metadata.og[n].push(content));
if (tags[n]) {
tags[n].push(content);
} else {
_results.push(this.metadata.og[n] = [content]);
tags[n] = [content];
}
} else {
_results.push(void 0);
}
} else {
_results.push(void 0);
}
}
return _results;
return tags;
};
Document.prototype._getTitle = function() {
if (this.metadata.scholar.citation_title) {
return this.metadata.title = this.metadata.scholar.citation_title[0];
if (this.metadata.highwire.title) {
return this.metadata.title = this.metadata.highwire.title[0];
} else if (this.metadata.eprints.title) {
return this.metadata.title = this.metadata.eprints.title;
} else if (this.metadata.prism.title) {
return this.metadata.title = this.metadata.prism.title;
} else if (this.metadata.facebook.title) {
return this.metadata.title = this.metadata.facebook.title;
} else if (this.metadata.twitter.title) {
return this.metadata.title = this.metadata.twitter.title;
} else if (this.metadata.dc.title) {
return this.metadata.title = this.metadata.dc.title;
} else {
......@@ -185,7 +175,6 @@
Document.prototype._getLinks = function() {
var doi, href, id, l, link, name, rel, type, url, values, _i, _j, _k, _len, _len1, _len2, _ref1, _ref2, _ref3, _results;
this.metadata.link = [
{
href: document.location.href
......@@ -206,10 +195,10 @@
});
}
}
_ref2 = this.metadata.scholar;
_ref2 = this.metadata.highwire;
for (name in _ref2) {
values = _ref2[name];
if (name === "citation_pdf_url") {
if (name === "pdf_url") {
for (_j = 0, _len1 = values.length; _j < _len1; _j++) {
url = values[_j];
this.metadata.link.push({
......@@ -218,7 +207,7 @@
});
}
}
if (name === "citation_doi") {
if (name === "doi") {
for (_k = 0, _len2 = values.length; _k < _len2; _k++) {
doi = values[_k];
if (doi.slice(0, 4) !== "doi:") {
......@@ -237,7 +226,6 @@
if (name === "identifier") {
_results.push((function() {
var _l, _len3, _results1;
_results1 = [];
for (_l = 0, _len3 = values.length; _l < _len3; _l++) {
id = values[_l];
......@@ -260,7 +248,6 @@
Document.prototype._getFavicon = function() {
var link, _i, _len, _ref1, _ref2, _results;
_ref1 = $("link");
_results = [];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
......@@ -276,7 +263,6 @@
Document.prototype._absoluteUrl = function(url) {
var img;
img = $("<img src='" + url + "'>");
url = img.prop('src');
img.prop('src', null);
......@@ -288,3 +274,9 @@
})(Annotator.Plugin);
}).call(this);
/*
//
*/
//@ sourceMappingURL=annotator.document.map
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.7-dev-9612762
** Annotator 1.2.7-dev-5cb9c6a
** 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: 2013-07-17 12:06:57Z
** Built at: 2013-07-25 12:53:36Z
*/
......
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.7-dev-48fa9e6
** Annotator 1.2.7-dev-5cb9c6a
** 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: 2013-07-16 23:25:13Z
** Built at: 2013-07-25 12:53:37Z
*/
......
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