Commit fbf909d4 authored by csillag's avatar csillag

Updated annotator to fca057ce (fix-event-signature branch)

parent d07ea18f
......@@ -19,39 +19,29 @@ class TextHighlight extends Annotator.Highlight
# List of annotators we have already set up events for
@_inited: []
# Collect the annotations impacted by an event
@getAnnotations: (event) ->
TextHighlight.$(event.target)
.parents('.annotator-hl')
.andSelf()
.map( -> TextHighlight.$(this).data("annotation"))
.toArray()
# Set up events for this annotator
@_init: (annotator) ->
return if annotator in @_inited
getAnnotations = (event) ->
# Collect the involved annotations
annotations = TextHighlight.$(event.target)
.parents('.annotator-hl')
.andSelf()
.map -> return TextHighlight.$(this).data("annotation")
# Make a proper array out of the list
TextHighlight.$.makeArray annotations
annotator.element.delegate ".annotator-hl", "mouseover",
type: @highlightType
getAnnotations: (event) => getAnnotations event,
((event) => annotator.onAnchorMouseover event)
annotator.element.delegate ".annotator-hl", "mouseout",
type: @highlightType
getAnnotations: (event) => getAnnotations event,
((event) => annotator.onAnchorMouseout event)
annotator.element.delegate ".annotator-hl", "mousedown",
type: @highlightType
getAnnotations: (event) => getAnnotations event,
((event) => annotator.onAnchorMousedown event)
annotator.element.delegate ".annotator-hl", "click",
type: @highlightType
getAnnotations: (event) => getAnnotations event,
((event) => annotator.onAnchorClick event)
annotator.element.delegate ".annotator-hl", "mouseover", this,
(event) => annotator.onAnchorMouseover event
annotator.element.delegate ".annotator-hl", "mouseout", this,
(event) => annotator.onAnchorMouseout event
annotator.element.delegate ".annotator-hl", "mousedown", this,
(event) => annotator.onAnchorMousedown event
annotator.element.delegate ".annotator-hl", "click", this,
(event) => annotator.onAnchorClick event
@_inited.push annotator
......
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-04d1465
** Annotator 1.2.6-dev-8b9bc0e
** 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-03-31 18:02:58Z
** Built at: 2014-03-31 22:37:06Z
*/
......@@ -42,51 +42,29 @@
TextHighlight._inited = [];
TextHighlight.getAnnotations = function(event) {
return TextHighlight.$(event.target).parents('.annotator-hl').andSelf().map(function() {
return TextHighlight.$(this).data("annotation");
}).toArray();
};
TextHighlight._init = function(annotator) {
var getAnnotations,
_this = this;
var _this = this;
if (__indexOf.call(this._inited, annotator) >= 0) {
return;
}
getAnnotations = function(event) {
var annotations;
annotations = TextHighlight.$(event.target).parents('.annotator-hl').andSelf().map(function() {
return TextHighlight.$(this).data("annotation");
});
return TextHighlight.$.makeArray(annotations);
};
annotator.element.delegate(".annotator-hl", "mouseover", {
type: this.highlightType,
getAnnotations: function(event) {
return getAnnotations(event);
}
}, (function(event) {
annotator.element.delegate(".annotator-hl", "mouseover", this, function(event) {
return annotator.onAnchorMouseover(event);
}));
annotator.element.delegate(".annotator-hl", "mouseout", {
type: this.highlightType,
getAnnotations: function(event) {
return getAnnotations(event);
}
}, (function(event) {
});
annotator.element.delegate(".annotator-hl", "mouseout", this, function(event) {
return annotator.onAnchorMouseout(event);
}));
annotator.element.delegate(".annotator-hl", "mousedown", {
type: this.highlightType,
getAnnotations: function(event) {
return getAnnotations(event);
}
}, (function(event) {
});
annotator.element.delegate(".annotator-hl", "mousedown", this, function(event) {
return annotator.onAnchorMousedown(event);
}));
annotator.element.delegate(".annotator-hl", "click", {
type: this.highlightType,
getAnnotations: function(event) {
return getAnnotations(event);
}
}, (function(event) {
});
annotator.element.delegate(".annotator-hl", "click", this, function(event) {
return annotator.onAnchorClick(event);
}));
});
return this._inited.push(annotator);
};
......
{"version":3,"file":"annotator.texthighlights.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/texthighlights.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACGA;CAAA,KAAA,aAAA;KAAA;;0JAAA;;CAAA,CAAM;CAIJ;;CAAA,EAAa,CAAb,KAAA,IAAC;;CAAD,EACK,CAAL,KAAc,IA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":3,"file":"annotator.texthighlights.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/texthighlights.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACGA;CAAA,KAAA,aAAA;KAAA;;0JAAA;;CAAA,CAAM;CAIJ;;CAAA,EAAa,CAAb,KAAA,IAAC;;CAAD,EACK,CAAL,KAAc,IAAb;;CADD,EAEiB,CAAjB,SAAC,EAFD;;CAAA,EAKa,CAAb,GAAa,EAAC,CAAd,GAAC;CAA0B,GAAA,GAAD,CAAA,KAAA,CAAA;CAL1B,IAKa;;CALb,EAQuB,CAAvB,GAAuB,EAAC,IAAvB,OAAD;CACG,GAAA,GAAD,MAAA,gBAAA;CATF,IAQuB;;CARvB,CAAA,CAYU,CAAV,GAAA,MAAC;;CAZD,EAeiB,CAAjB,CAAiB,IAAC,IAAjB,CAAD;CACgB,EAAd,EAAqB,CAArB,CAAA,EAGQ,IAHR,EAAA;CAGyB,GAAd,QAAA,CAAa,EAAb;CAHX,MAGQ;CAnBV,IAeiB;;CAfjB,EAuBQ,CAAR,CAAA,IAAS,IAAR;CACC,SAAA,EAAA;CAAA,CAAU,EAAA,EAAV,CAAU,EAAA,MAAa;CAAvB,aAAA;QAAA;CAAA,CAE4C,CACzC,CADH,CACG,CADH,CAAiB,CAAjB,CAAS,EAAT,IAAA;CACwB,IAAV,IAAS,MAAT,EAAA;CADd,MACG;CAHH,CAK4C,CACzC,CADH,CACG,CADH,CAAiB,CAAjB,CAAS,CAAT,KAAA;CACwB,IAAV,IAAS,MAAT,CAAA;CADd,MACG;CANH,CAQ4C,CACzC,CADH,CACG,CADH,CAAiB,CAAjB,CAAS,EAAT,IAAA;CACwB,IAAV,IAAS,MAAT,EAAA;CADd,MACG;CATH,CAW4C,CACzC,CADH,CACG,CADH,CAAiB,CAAjB,CAAS,MAAT;CACwB,IAAV,IAAS,IAAT,EAAA;CADd,MACG;CAEF,GAAA,GAAO,EAAR,IAAA;CAtCF,IAuBQ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,SAAA;MADF,EAAA;CAGG,GAAA,OAAD,IAAA,SAAA;QALU;CAhGd,IAgGc;;CAhGd,EAwGW,EAAA,IAAX;CACE,GAAG,CAAH,CAAA;CACG,GAAA,IAAD,GAAA,IAAA,MAAA;MADF,EAAA;CAGG,GAAA,OAAD,IAAA,MAAA;QAJO;CAxGX,IAwGW;;CAxGX,EA+GoB,MAAA,SAApB;CACE,SAAA,gCAAA;CAAA;CAAA;YAAA,+BAAA;uBAAA;CAEE,GAAG,IAAH,CAAgC,GAAV,WAAnB;CAED,CAAU,CAAF,EAAR,KAAA;CAAA,CACA,EAAC,MAAD,CAAA;CADA,EAGQ,EAAR,GAAgB,EAAhB,CAAQ;CAHR,CAI+B,EAA/B,CAAK,CAAL,IAAA,CAAA;CAJA,EAKe,EAAV,CAAL,IAAA,2BALA;CAAA,IAMK,KAAW,GAAhB;MARF,IAAA;CAAA;UAFF;CAAA;uBADkB;CA/GpB,IA+GoB;;CA/GpB,EA6HiB,MAAA,MAAjB;CAAqB,GAAA,SAAD;CA7HpB,IA6HiB;;CA7HjB;;CAJ0B,QAAS;;CAArC,CAmIM,IAAgB,GAAP;CAGb;;;;;CAAA;;CAAA,EAAY,MAAA,CAAZ;CAEY,EAAgB,MAAjB,IAAT;CAFF,IAAY;;CAAZ;;CAH4C,QAAS;CAnIvD"}
\ No newline at end of file
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