Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
61f3a7ed
Commit
61f3a7ed
authored
May 22, 2014
by
csillag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update Annotator to e528d93b (typed-packaging branch)
Fixes #1219. Fixes #1227.
parent
c3cf9d03
Changes
21
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
142 additions
and
94 deletions
+142
-94
annotator.coffee
h/lib/_annotator_mapsrc/src/annotator.coffee
+6
-9
textposition.coffee
h/lib/_annotator_mapsrc/src/plugin/textposition.coffee
+29
-8
textquote.coffee
h/lib/_annotator_mapsrc/src/plugin/textquote.coffee
+20
-13
textrange.coffee
h/lib/_annotator_mapsrc/src/plugin/textrange.coffee
+1
-1
annotator.auth.js
h/lib/annotator.auth.js
+2
-2
annotator.document.js
h/lib/annotator.document.js
+2
-2
annotator.domtextmapper.js
h/lib/annotator.domtextmapper.js
+2
-2
annotator.fuzzytextanchors.js
h/lib/annotator.fuzzytextanchors.js
+2
-2
annotator.js
h/lib/annotator.js
+6
-16
annotator.map
h/lib/annotator.map
+1
-1
annotator.pdf.js
h/lib/annotator.pdf.js
+2
-2
annotator.permissions.js
h/lib/annotator.permissions.js
+2
-2
annotator.store.js
h/lib/annotator.store.js
+2
-2
annotator.textanchors.js
h/lib/annotator.textanchors.js
+2
-2
annotator.texthighlights.js
h/lib/annotator.texthighlights.js
+2
-2
annotator.textposition.js
h/lib/annotator.textposition.js
+28
-10
annotator.textposition.map
h/lib/annotator.textposition.map
+1
-1
annotator.textquote.js
h/lib/annotator.textquote.js
+27
-12
annotator.textquote.map
h/lib/annotator.textquote.map
+1
-1
annotator.textrange.js
h/lib/annotator.textrange.js
+3
-3
annotator.textrange.map
h/lib/annotator.textrange.map
+1
-1
No files found.
h/lib/_annotator_mapsrc/src/annotator.coffee
View file @
61f3a7ed
...
...
@@ -372,16 +372,13 @@ class Annotator extends Delegator
try
a
=
s
.
code
.
call
this
,
annotation
,
target
if
a
# console.log "Strategy '" + s.name + "' yielded an anchor
."
# console.log "Strategy '" + s.name + "' yielded an anchor
:", a
return
result
:
a
# else
# console.log "Strategy '" + s.name + "' did NOT yield an anchor."
catch
error
# console.log "Strategy '" + s.name + "' has thrown an error."
if
error
instanceof
Range
.
RangeError
return
error
:
error
else
throw
error
console
.
log
"Strategy '"
+
s
.
name
+
"' has thrown an error."
,
error
.
stack
?
error
return
error
:
"No strategies worked."
...
...
@@ -416,6 +413,7 @@ class Annotator extends Delegator
annotation
.
quote
=
[]
annotation
.
anchors
=
[]
# console.log "Running setupAnnotation for", annotation.id
for
t
in
annotation
.
target
try
# Create an anchor for this target
...
...
@@ -443,9 +441,8 @@ class Annotator extends Delegator
console
.
log
"Could not create anchor for annotation '"
,
annotation
.
id
,
"'."
catch
exception
if
exception
.
stack
?
then
console
.
log
exception
.
stack
console
.
log
exception
.
message
console
.
log
exception
console
.
log
"Error in setupAnnotation for"
,
annotation
.
id
,
":"
,
exception
.
stack
?
exception
# Join all the quotes into one string.
annotation
.
quote
=
annotation
.
quote
.
join
(
' / '
)
...
...
h/lib/_annotator_mapsrc/src/plugin/textposition.coffee
View file @
61f3a7ed
...
...
@@ -69,14 +69,27 @@ class Annotator.Plugin.TextPosition extends Annotator.Plugin
_getTextPositionSelector
:
(
selection
)
=>
return
[]
unless
selection
.
type
is
"text range"
startOffset
=
(
@
annotator
.
domMapper
.
getInfoForNode
selection
.
range
.
start
)
.
start
endOffset
=
(
@
annotator
.
domMapper
.
getInfoForNode
selection
.
range
.
end
)
.
end
startOffset
=
@
annotator
.
domMapper
.
getStartPosForNode
selection
.
range
.
start
endOffset
=
@
annotator
.
domMapper
.
getEndPosForNode
selection
.
range
.
end
if
startOffset
?
and
endOffset
?
[
type
:
"TextPositionSelector"
start
:
startOffset
end
:
endOffset
]
else
# It looks like we can't determine the start and end offsets.
# That means no valid TextPosition selector can be generated from this.
unless
startOffset
?
console
.
log
"Warning: can't generate TextPosition selector, because"
,
selection
.
range
.
start
,
"does not have a valid start position."
unless
endOffset
?
console
.
log
"Warning: can't generate TextPosition selector, because"
,
selection
.
range
.
end
,
"does not have a valid end position."
[
]
# Create an anchor using the saved TextPositionSelector.
# The quote is verified.
...
...
@@ -86,6 +99,14 @@ class Annotator.Plugin.TextPosition extends Annotator.Plugin
selector
=
@
annotator
.
findSelector
target
.
selector
,
"TextPositionSelector"
return
unless
selector
?
unless
selector
.
start
?
console
.
log
"Warning: 'start' field is missing from TextPositionSelector. Skipping."
return
null
unless
selector
.
end
?
console
.
log
"Warning: 'end' field is missing from TextPositionSelector. Skipping."
return
null
content
=
@
annotator
.
domMapper
.
getCorpus
()[
selector
.
start
..
selector
.
end
-
1
].
trim
()
currentQuote
=
@
annotator
.
normalizeString
content
savedQuote
=
@
annotator
.
getQuoteForTarget
?
target
...
...
h/lib/_annotator_mapsrc/src/plugin/textquote.coffee
View file @
61f3a7ed
...
...
@@ -34,25 +34,32 @@ class Annotator.Plugin.TextQuote extends Annotator.Plugin
unless
rangeEnd
?
throw
new
Error
"Called getTextQuoteSelector() on a range with no valid end."
[
if
@
annotator
.
plugins
.
DomTextMapper
# Calculate the quote and context using DTM
startOffset
=
(
@
annotator
.
domMapper
.
getInfoForNode
rangeStart
).
start
endOffset
=
(
@
annotator
.
domMapper
.
getInfoForNode
rangeEnd
).
end
startOffset
=
@
annotator
.
domMapper
.
getStartPosForNode
rangeStart
endOffset
=
@
annotator
.
domMapper
.
getEndPosForNode
rangeEnd
if
startOffset
?
and
endOffset
?
quote
=
@
annotator
.
domMapper
.
getCorpus
()[
startOffset
..
endOffset
-
1
].
trim
()
[
prefix
,
suffix
]
=
@
annotator
.
domMapper
.
getContextForCharRange
startOffset
,
endOffset
[
type
:
"TextQuoteSelector"
exact
:
quote
prefix
:
prefix
suffix
:
suffix
]
else
# It looks like we can't determine the start and end offsets.
# That means no valid TextQuote selector can be generated from this.
console
.
log
"Warning: can't generate TextQuote selector."
,
startOffset
,
endOffset
[
]
else
# Get the quote directly from the range
[
type
:
"TextQuoteSelector"
exact
:
selection
.
range
.
text
().
trim
()
]
h/lib/_annotator_mapsrc/src/plugin/textrange.coffee
View file @
61f3a7ed
...
...
@@ -106,7 +106,7 @@ class Annotator.Plugin.TextRange extends Annotator.Plugin
# " Current quote is '#{currentQuote}'.)"
return
null
if
startInfo
?
if
startInfo
?
.
start
?
and
endInfo
?
.
end
?
# Create a TextPositionAnchor from the start and end offsets
# of this range
# (to be used with dom-text-mapper)
...
...
h/lib/annotator.auth.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:28
Z
** Built at: 2014-05-2
2 14:28:52
Z
*/
...
...
h/lib/annotator.document.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:28
Z
** Built at: 2014-05-2
2 14:28:52
Z
*/
...
...
h/lib/annotator.domtextmapper.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:34
Z
** Built at: 2014-05-2
2 14:28:58
Z
*/
...
...
h/lib/annotator.fuzzytextanchors.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:40
Z
** Built at: 2014-05-2
2 14:29:04
Z
*/
...
...
h/lib/annotator.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:25
Z
** Built at: 2014-05-2
2 14:28:48
Z
*/
...
...
@@ -1378,7 +1378,7 @@
};
Annotator
.
prototype
.
createAnchor
=
function
(
annotation
,
target
)
{
var
a
,
anchor
,
error
,
s
,
_k
,
_len2
,
_ref1
;
var
a
,
anchor
,
error
,
s
,
_k
,
_len2
,
_ref1
,
_ref2
;
if
(
target
==
null
)
{
throw
new
Error
(
"Trying to find anchor for null target!"
);
}
...
...
@@ -1396,13 +1396,7 @@
}
}
catch
(
_error
)
{
error
=
_error
;
if
(
error
instanceof
Range
.
RangeError
)
{
return
{
error
:
error
};
}
else
{
throw
error
;
}
console
.
log
(
"Strategy '"
+
s
.
name
+
"' has thrown an error."
,
(
_ref2
=
error
.
stack
)
!=
null
?
_ref2
:
error
);
}
}
return
{
...
...
@@ -1411,7 +1405,7 @@
};
Annotator
.
prototype
.
setupAnnotation
=
function
(
annotation
)
{
var
anchor
,
exception
,
pageIndex
,
result
,
t
,
_base
,
_k
,
_l
,
_len2
,
_ref1
,
_ref2
,
_ref3
;
var
anchor
,
exception
,
pageIndex
,
result
,
t
,
_base
,
_k
,
_l
,
_len2
,
_ref1
,
_ref2
,
_ref3
,
_ref4
;
if
(
annotation
.
target
==
null
)
{
annotation
.
target
=
this
.
selectedTargets
;
}
...
...
@@ -1447,11 +1441,7 @@
}
}
catch
(
_error
)
{
exception
=
_error
;
if
(
exception
.
stack
!=
null
)
{
console
.
log
(
exception
.
stack
);
}
console
.
log
(
exception
.
message
);
console
.
log
(
exception
);
console
.
log
(
"Error in setupAnnotation for"
,
annotation
.
id
,
":"
,
(
_ref4
=
exception
.
stack
)
!=
null
?
_ref4
:
exception
);
}
}
annotation
.
quote
=
annotation
.
quote
.
join
(
' / '
);
...
...
h/lib/annotator.map
View file @
61f3a7ed
This diff is collapsed.
Click to expand it.
h/lib/annotator.pdf.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:40
Z
** Built at: 2014-05-2
2 14:29:05
Z
*/
...
...
h/lib/annotator.permissions.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:32
Z
** Built at: 2014-05-2
2 14:28:56
Z
*/
...
...
h/lib/annotator.store.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:32
Z
** Built at: 2014-05-2
2 14:28:56
Z
*/
...
...
h/lib/annotator.textanchors.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:35
Z
** Built at: 2014-05-2
2 14:29:00
Z
*/
...
...
h/lib/annotator.texthighlights.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:35
Z
** Built at: 2014-05-2
2 14:28:59
Z
*/
...
...
h/lib/annotator.textposition.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:38
Z
** Built at: 2014-05-2
2 14:29:02
Z
*/
...
...
@@ -86,8 +86,9 @@
if
(
selection
.
type
!==
"text range"
)
{
return
[];
}
startOffset
=
(
this
.
annotator
.
domMapper
.
getInfoForNode
(
selection
.
range
.
start
)).
start
;
endOffset
=
(
this
.
annotator
.
domMapper
.
getInfoForNode
(
selection
.
range
.
end
)).
end
;
startOffset
=
this
.
annotator
.
domMapper
.
getStartPosForNode
(
selection
.
range
.
start
);
endOffset
=
this
.
annotator
.
domMapper
.
getEndPosForNode
(
selection
.
range
.
end
);
if
((
startOffset
!=
null
)
&&
(
endOffset
!=
null
))
{
return
[
{
type
:
"TextPositionSelector"
,
...
...
@@ -95,6 +96,15 @@
end
:
endOffset
}
];
}
else
{
if
(
startOffset
==
null
)
{
console
.
log
(
"Warning: can't generate TextPosition selector, because"
,
selection
.
range
.
start
,
"does not have a valid start position."
);
}
if
(
endOffset
==
null
)
{
console
.
log
(
"Warning: can't generate TextPosition selector, because"
,
selection
.
range
.
end
,
"does not have a valid end position."
);
}
return
[];
}
};
TextPosition
.
prototype
.
createFromPositionSelector
=
function
(
annotation
,
target
)
{
...
...
@@ -103,6 +113,14 @@
if
(
selector
==
null
)
{
return
;
}
if
(
selector
.
start
==
null
)
{
console
.
log
(
"Warning: 'start' field is missing from TextPositionSelector. Skipping."
);
return
null
;
}
if
(
selector
.
end
==
null
)
{
console
.
log
(
"Warning: 'end' field is missing from TextPositionSelector. Skipping."
);
return
null
;
}
content
=
this
.
annotator
.
domMapper
.
getCorpus
().
slice
(
selector
.
start
,
+
(
selector
.
end
-
1
)
+
1
||
9
e9
).
trim
();
currentQuote
=
this
.
annotator
.
normalizeString
(
content
);
savedQuote
=
typeof
(
_base
=
this
.
annotator
).
getQuoteForTarget
===
"function"
?
_base
.
getQuoteForTarget
(
target
)
:
void
0
;
...
...
h/lib/annotator.textposition.map
View file @
61f3a7ed
{"version":3,"file":"annotator.textposition.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textposition.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACEA;CAAA,KAAA,kBAAA;KAAA;;uFAAA;;CAAA,CAAM;CAEJ;;CAAA,EAAa,CAAb,KAAA,SAAC;;CAEY,CAAY,CAAZ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,gBAAC;CAIZ,EAHG,CAAA,CAGH,CAHE;CAGF,EAHW,CAAA,EAAD;CAGV,CAAiB,GAAjB,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,wCAAM;CAMN,GAAO,EAAP,YAAA;CAAoB,GAAU,CAAA,SAAA,MAAA;QAN9B;CAOA,GAAO,EAAP,UAAA;CAAkB,GAAU,CAAA,SAAA,IAAA;QAP5B;CAAA,EASa,CAAZ,EAAD,GAAA,SAA+B;CAfjC,IAEa;;CAFb,EAkBkB,CAAA,KAAC,OAAnB;CAGE,SAAA,oCAAA;CAAA,CAAgE,CAArD,CAAC,CAAD,CAAX,EAAA,CAAqB,cAAV;CAAX,EAGY,CAAkB,EAA9B,EAAoB,CAApB;CAHA,EAMmB,CAAA,CAAgB,CAAnC,GAA6B,GAA7B;CANA,EASc,CAAwB,EAAtC,CAAwD,EAA1C,EAAd,CAA0B;CAGrB,CAA8B,EAA/B,KAAU,EAAV,EAAA;CAjCN,IAkBkB;;CAlBlB;;CAF+B,QAAS;;CAA1C,CAuCM,IAAgB,GAAP;CAEb;;;;;;;CAAA;;CAAA,EAAY,MAAA,CAAZ;CAEE,EAAa,CAAZ,EAAD,GAAA;AAGO,CAAP,GAAA,EAAA,CAAyB,EAAR,IAAjB;CACE,GAAA,GAAO,CAAP,wEAAA;CACA,aAAA;QALF;CAAA,GAQC,EAAD,GAAU,OAAiB;CACzB,CAAM,EAAN,IAAA,cAAA;CAAA,CACU,EAAC,IAAX,gBADA;CATF,OAQA;CARA,GAYC,EAAD,GAAU,UAAoB;CAI5B,CAAM,EAAN,IAAA,EAAA;CAAA,CACM,EAAN,IAAA,kBADA;CAhBF,OAYA;CAQC,EAA+B,CAA/B,KAAS,IAAV,KAAA;CAtBF,IAAY;;CAAZ,EAyB0B,MAAC,eAA3B;CACE,SAAA,YAAA;CAAA,GAAiB,CAAkB,CAAnC,GAA0B,GAA1B;CAAA,CAAA,aAAO;QAAP;CAAA,EAEc,CAAE,CAAkD,CAAlE,GAAyB,EAAzB,GAAe;CAFf,EAGY,CAAE,CAAkD,CAAhE,GAAA,KAAa;aAEb;SACE;CAAA,CAAM,EAAN,MAAA,YAAA;CAAA,CACO,GAAP,KAAA,CADA;CAAA,CAEK,CAAL,MAFA,CAEA;UAHF;CANwB;CAzB1B,IAyB0B;;CAzB1B,CAuCyC,CAAb,GAAA,GAAC,CAAD,gBAA5B;CAGE,SAAA,wCAAA;CAAA,CAAoD,CAAzC,CAAC,EAAZ,EAAA,CAAqB,GAAV,UAAA;CACX,GAAc,EAAd,UAAA;CAAA,aAAA;QADA;CAAA,EAGU,CAAC,EAAX,CAAA,EAAoB,6CAAwD;CAH5E,EAIe,CAAC,EAAhB,CAAe,EAAU,GAAzB,GAAe;CAJf,IAKuB,CAAvB,IAAA;CACA,GAAG,CAAkC,CAArC,IAAA,EAAmB,QAAhB;CAOD,GAAA,WAAO;QAbT;CAgBuB,CAAY,CAA/B,CAAA,CAAA,CAAA,EACM,CADN,CAAA,EAAA,CAAA,KAAA;CA1DN,IAuC4B;;CAvC5B;;CAF0C,QAAS;CAvCrD"}
\ No newline at end of file
{"version":3,"file":"annotator.textposition.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textposition.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACEA;CAAA,KAAA,kBAAA;KAAA;;uFAAA;;CAAA,CAAM;CAEJ;;CAAA,EAAa,C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AkB,CAAnC,GAA0B,GAA1B;CAAA,CAAA,aAAO;QAAP;CAAA,EAEc,CAAC,CAAsD,CAArE,GAAwB,EAAxB,OAAc;CAFd,EAGY,CAAC,CAAoD,CAAjE,GAAA,OAAY;CAEZ,GAAG,EAAH,aAAA,EAAG;eACD;WACE;CAAA,CAAM,EAAN,QAAA,UAAA;CAAA,CACO,GAAP,MADA,CACA;CADA,CAEK,CAAL,MAFA,GAEA;YAHF;CADF;MAAA,EAAA;CASE,GAAO,IAAP,WAAA;CACE,CACE,CADF,EACiB,EADV,EACI,CADX,6BAAA,iBAAA;UADF;CAIA,GAAO,IAAP,SAAA;CACE,CACE,CADF,EACiB,EADV,EACI,CADX,2BAAA,mBAAA;UALF;CATF,cAiBE;QAvBsB;CAzB1B,IAyB0B;;CAzB1B,CAoDyC,CAAb,GAAA,GAAC,CAAD,gBAA5B;CAGE,SAAA,wCAAA;CAAA,CAAoD,CAAzC,CAAC,EAAZ,EAAA,CAAqB,GAAV,UAAA;CACX,GAAc,EAAd,UAAA;CAAA,aAAA;QADA;CAGA,GAAO,EAAP,gBAAA;CACE,EAAA,IAAO,CAAP,gEAAA;CACA,GAAA,WAAO;QALT;CAOA,GAAO,EAAP,cAAA;CACE,EAAA,IAAO,CAAP,8DAAA;CACA,GAAA,WAAO;QATT;CAAA,EAWU,CAAC,EAAX,CAAA,EAAoB,6CAAwD;CAX5E,EAYe,CAAC,EAAhB,CAAe,EAAU,GAAzB,GAAe;CAZf,IAauB,CAAvB,IAAA;CACA,GAAG,CAAkC,CAArC,IAAA,EAAmB,QAAhB;CAOD,GAAA,WAAO;QArBT;CAwBuB,CAAY,CAA/B,CAAA,CAAA,CAAA,EACM,CADN,CAAA,EAAA,CAAA,KAAA;CA/EN,IAoD4B;;CApD5B;;CAF0C,QAAS;CAvCrD"}
\ No newline at end of file
h/lib/annotator.textquote.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:39
Z
** Built at: 2014-05-2
2 14:29:03
Z
*/
...
...
@@ -69,17 +69,32 @@
if
(
rangeEnd
==
null
)
{
throw
new
Error
(
"Called getTextQuoteSelector() on a range with no valid end."
);
}
if
(
this
.
annotator
.
plugins
.
DomTextMapper
)
{
startOffset
=
this
.
annotator
.
domMapper
.
getStartPosForNode
(
rangeStart
);
endOffset
=
this
.
annotator
.
domMapper
.
getEndPosForNode
(
rangeEnd
);
if
((
startOffset
!=
null
)
&&
(
endOffset
!=
null
))
{
quote
=
this
.
annotator
.
domMapper
.
getCorpus
().
slice
(
startOffset
,
+
(
endOffset
-
1
)
+
1
||
9
e9
).
trim
();
_ref1
=
this
.
annotator
.
domMapper
.
getContextForCharRange
(
startOffset
,
endOffset
),
prefix
=
_ref1
[
0
],
suffix
=
_ref1
[
1
];
return
[
this
.
annotator
.
plugins
.
DomTextMapper
?
(
startOffset
=
(
this
.
annotator
.
domMapper
.
getInfoForNode
(
rangeStart
)).
start
,
endOffset
=
(
this
.
annotator
.
domMapper
.
getInfoForNode
(
rangeEnd
)).
end
,
quote
=
this
.
annotator
.
domMapper
.
getCorpus
().
slice
(
startOffset
,
+
(
endOffset
-
1
)
+
1
||
9
e9
).
trim
(),
(
_ref1
=
this
.
annotator
.
domMapper
.
getContextForCharRange
(
startOffset
,
endOffset
),
prefix
=
_ref1
[
0
],
suffix
=
_ref1
[
1
],
_ref1
),
{
{
type
:
"TextQuoteSelector"
,
exact
:
quote
,
prefix
:
prefix
,
suffix
:
suffix
})
:
{
}
];
}
else
{
console
.
log
(
"Warning: can't generate TextQuote selector."
,
startOffset
,
endOffset
);
return
[];
}
}
else
{
return
[
{
type
:
"TextQuoteSelector"
,
exact
:
selection
.
range
.
text
().
trim
()
}
];
}
};
return
TextQuote
;
...
...
h/lib/annotator.textquote.map
View file @
61f3a7ed
{"version":3,"file":"annotator.textquote.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textquote.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACCA;CAAA,GAAA,EAAA;KAAA;;oSAAA;;CAAA,CAAM,IAAgB,GAAP;CAEb;;;;;;CAAA;;CAAA,EAAa,CAAb,KAAC;;CAAD,EACK,CAAL,KAAC;;CADD,EAIY,MAAA,CAAZ;CAGE,SAAA,EAAA;CAAA,GAAC,EAAD,GAAU,OAAiB;CACzB,CAAM,EAAN,IAAA,WAAA;CAAA,CACU,EAAC,IAAX,aADA;CADF,OAAA;CAKC,EAA8B,CAA9B,EAA8B,GAArB,IAAV,IAAA;CACE,OAAA,IAAA;CAAA,CAAoD,CAAzC,EAAC,CAA6B,EAAzC,CAAqB,GAAV,OAAA;CACX,GAAG,IAAH,QAAA;CACG,IAAA,GAAkC,CAAzB,MAAV,EAAA;MADF,IAAA;CAAA,gBAGE;UAL2B;CARrB,MAQqB;CAZjC,IAIY;;CAJZ,EAoBuB,MAAC,YAAxB;CACE,SAAA,gEAAA;CAAA,GAAiB,CAAkB,CAAnC,GAA0B,GAA1B;CAAA,CAAA,aAAO;QAAP;CAEA,GAAO,EAAP,iBAAA;CACE,GAAU,CAAA,SAAA,kCAAA;QAHZ;CAAA,EAKa,EAAe,CAA5B,GAAsB,CAAtB;CACA,GAAO,EAAP,YAAA;CACE,GAAU,CAAA,SAAA,iDAAA;QAPZ;CAAA,EAQW,EAAe,CAA1B,EAAA,CAAoB;CACpB,GAAO,EAAP,UAAA;CACE,GAAU,CAAA,SAAA,+CAAA;QAVZ;aAYA;CACM,CAIF,CADA,CAHE,CAGF,EAHmB,CAIN,CAJZ,CAGc,CAAf,EAHF,CAGiB,QAGI,0BADiD;CAGpE,CAAM,EAAN,MAAA,SAAA;CAAA,CACO,GAAP,KAAA;CADA,CAEQ,IAAR,IAAA;CAFA,CAGQ,IAAR,IAAA;CAXF,EAeE,OAZA;CAYA,CAAM,EAAN,MAAA,SAAA;CAAA,CACO,EAAA,CAAP,IAAgB,CAAhB;UAjBJ;CAbqB;CApBvB,IAoBuB;;CApBvB;;CAFuC,QAAS;CAAlD"}
\ No newline at end of file
{"version":3,"file":"annotator.textquote.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textquote.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACCA;CAAA,GAAA,EAAA;KAAA;;oSAAA;;CAAA,CAAM,IAAgB,GAAP;CAEb;;;;;;CAAA;;CAAA,EAAa,CAAb,KAAC;;CAAD,EACK,CAAL,KAAC;;CADD,EAIY,MAAA,CAAZ;CAGE,SAAA,EAAA;CAAA,GAAC,EAAD,GAAU,OAAiB;CACzB,CAAM,EAAN,IAAA,WAAA;CAAA,CACU,EAAC,IAAX,aADA;CADF,OAAA;CAKC,EAA8B,CAA9B,EAA8B,GAArB,IAAV,IAAA;CACE,OAAA,IAAA;CAAA,CAAoD,CAAzC,EAAC,CAA6B,EAAzC,CAAqB,GAAV,OAAA;CACX,GAAG,IAAH,QAAA;CACG,IAAA,GAAkC,CAAzB,MAAV,EAAA;MADF,IAAA;CAAA,gBAGE;UAL2B;CARrB,MAQqB;CAZjC,IAIY;;CAJZ,EAoBuB,MAAC,YAAxB;CACE,SAAA,gEAAA;CAAA,GAAiB,CAAkB,CAAnC,GAA0B,GAA1B;CAAA,CAAA,aAAO;QAAP;CAEA,GAAO,EAAP,iBAAA;CACE,GAAU,CAAA,SAAA,kCAAA;QAHZ;CAAA,EAKa,EAAe,CAA5B,GAAsB,CAAtB;CACA,GAAO,EAAP,YAAA;CACE,GAAU,CAAA,SAAA,iDAAA;QAPZ;CAAA,EAQW,EAAe,CAA1B,EAAA,CAAoB;CACpB,GAAO,EAAP,UAAA;CACE,GAAU,CAAA,SAAA,+CAAA;QAVZ;CAYA,GAAG,EAAH,CAAqB,EAAR,IAAb;CAGE,EAAc,CAAC,IAAf,CAAwB,CAAV,CAAd,OAAc;CAAd,EACY,CAAC,IAAb,CAAA,OAAY;CAEZ,GAAG,IAAH,WAAA,EAAG;CACD,EAAQ,CAAC,CAAT,IAAkB,CAAlB,sCAAoE;CAApE,CAC4E,EAAxD,IAAD,CAAU,CAA7B,CAAmB,WAAA;iBAEnB;aACE;CAAA,CAAM,EAAN,UAAA,KAAA;CAAA,CACO,GAAP,SAAA;CADA,CAEQ,IAAR,QAAA;CAFA,CAGQ,IAAR,QAAA;cAJF;CAJF;MAAA,IAAA;CAaE,CAA2D,CAA3D,IAAO,EAAP,CAAA,CAAA,kCAAA;CAbF,gBAcE;UApBJ;MAAA,EAAA;eAuBE;WACE;CAAA,CAAM,EAAN,QAAA,OAAA;CAAA,CACO,EAAA,CAAP,IAAgB,GAAhB;YAFF;CAvBF;QAbqB;CApBvB,IAoBuB;;CApBvB;;CAFuC,QAAS;CAAlD"}
\ No newline at end of file
h/lib/annotator.textrange.js
View file @
61f3a7ed
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-
2e8e3af
** Annotator 1.2.6-dev-
42b8bb1
** 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-05-2
1 11:45:37
Z
** Built at: 2014-05-2
2 14:29:01
Z
*/
...
...
@@ -103,7 +103,7 @@
if
((
savedQuote
!=
null
)
&&
currentQuote
!==
savedQuote
)
{
return
null
;
}
if
(
startInfo
!=
null
)
{
if
(
((
startInfo
!=
null
?
startInfo
.
start
:
void
0
)
!=
null
)
&&
((
endInfo
!=
null
?
endInfo
.
end
:
void
0
)
!=
null
)
)
{
return
new
this
.
Annotator
.
TextPositionAnchor
(
this
.
annotator
,
annotation
,
target
,
startInfo
.
start
,
endInfo
.
end
,
(
_ref1
=
startInfo
.
pageIndex
)
!=
null
?
_ref1
:
0
,
(
_ref2
=
endInfo
.
pageIndex
)
!=
null
?
_ref2
:
0
,
currentQuote
);
}
else
{
return
new
TextRangeAnchor
(
this
.
annotator
,
annotation
,
target
,
normedRange
,
currentQuote
);
...
...
h/lib/annotator.textrange.map
View file @
61f3a7ed
{"version":3,"file":"annotator.textrange.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textrange.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACmBA;CAAA,KAAA,eAAA;KAAA;;uFAAA;;CAAA,CAAM;CAEJ;;CAAA,EAAa,CAAb,KAAA,MAAC;;CAEY,CAAY,CAAZ,CAAA,CAAA,CAAA,GAAA,CAAA,eAAC;CAEZ,EAF4C,CAAA,CAE5C,CAF2C;CAE3C,CAAiB,GAAjB,CAAA,GAAA,CAAA,uCAAM;CAEN,GAAO,EAAP,YAAA;CAAoB,GAAU,CAAA,SAAA,MAAA;QAF9B;CAAA,EAIa,CAAZ,EAAD,GAAA,MAA4B;CAR9B,IAEa;;CAFb,EAWkB,MAAA,OAAlB;CAGO,CAA8B,EAA/B,CAAA,IAAU,IAAV;CAdN,IAWkB;;CAXlB;;CAF4B,QAAS;;CAAvC,CAqBM,IAAgB,GAAP;CAEb;;;;;;;CAAA;;CAAA,EAAY,MAAA,CAAZ;CAEE,EAAa,CAAZ,EAAD,GAAA;CAAA,GAGC,EAAD,GAAU,OAAiB;CACzB,CAAM,EAAN,IAAA,OAAA;CAAA,CACU,EAAC,IAAX,SADA;CAJF,OAGA;CAHA,GAQC,EAAD,GAAU,UAAoB;CAE5B,CAAM,EAAN,GAAA,CAAA;CAAA,CACM,EAAN,IAAA,eADA;CAVF,OAQA;CAMC,EAA4B,CAA5B,KAAS,IAAV,EAAA;CAhBF,IAAY;;CAAZ,EAoBmB,MAAC,QAApB;CACE,CAAA,QAAA;CAAA,GAAiB,CAAkB,CAAnC,GAA0B,GAA1B;CAAA,CAAA,aAAO;QAAP;CAAA,CACA,CAAK,CAA2B,CAAZ,CAApB,CAAkD,EAApC;aACd;SACE;CAAA,CAAM,EAAN,MAAA,KAAA;CAAA,CACgB,QAAhB,IAAA;CADA,CAEa,QAAb,CAAA;CAFA,CAGc,QAAd,EAAA;CAHA,CAIW,OAAX,CAAA;UALF;CAHiB;CApBnB,IAoBmB;;CApBnB,CAiCsC,CAAb,GAAA,GAAC,CAAD,aAAzB;CACE,SAAA,oHAAA;CAAA,CAAoD,CAAzC,CAAC,EAAZ,EAAA,CAAqB,GAAV,GAAA;CACX,GAAO,EAAP,UAAA;CAAsB,GAAA,WAAO;QAD7B;CAIA;CACE,EAAQ,CAAC,CAAT,GAAA,CAAkB;CAAlB,EACc,CAAiB,CAAZ,EAA8B,CAAjD,CAAc,EAAd;MAFF,EAAA;CAIE,KAAA,EADI;CACJ,GAAA,WAAO;QART;CAAA,CAeE,CAJa,CAAC,CAGF,CAHd,CAA+D,EAAtC,EAGoC,CAH7D,CAA0C,CAG5B,CAHC,iCAO+C;CAlB9D,IAyBuB,CAAvB,IAAA;CACA,GAAG,CAAkC,CAArC,IAAA,EAAmB,QAAhB;CAID,GAAA,WAAO;QA9BT;CAgCA,GAAG,EAAH,WAAA;CAIO,CAAyC,CAA1C,CAAA,CAAA,CAAA,CACsB,EADZ,CAAV,EAAA,GAAA,GAAA;MAJN,EAAA;CAWsB,CAAY,EAA5B,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA;QA5CiB;CAjCzB,IAiCyB;;CAjCzB;;CAFuC,QAAS;CArBlD"}
\ No newline at end of file
{"version":3,"file":"annotator.textrange.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/textrange.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACmBA;CAAA,KAAA,eAAA;KAAA;;uFAAA;;CAAA,CAAM;CAEJ;;CAAA,EAAa,CAAb,KAAA,MAAC;;CAEY,CAAY,CAAZ,CAAA,CAAA,CAAA,GAAA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iB,CAAZ,EAA8B,CAAjD,CAAc,EAAd;MAFF,EAAA;CAIE,KAAA,EADI;CACJ,GAAA,WAAO;QART;CAAA,CAeE,CAJa,CAAC,CAGF,CAHd,CAA+D,EAAtC,EAGoC,CAH7D,CAA0C,CAG5B,CAHC,iCAO+C;CAlB9D,IAyBuB,CAAvB,IAAA;CACA,GAAG,CAAkC,CAArC,IAAA,EAAmB,QAAhB;CAID,GAAA,WAAO;QA9BT;CAgCA,GAAG,EAAH,4CAAA,MAAG;CAII,CAAyC,CAA1C,CAAA,CAAA,CAAA,CACsB,EADZ,CAAV,EAAA,GAAA,GAAA;MAJN,EAAA;CAWsB,CAAY,EAA5B,EAAA,GAAA,CAAA,CAAA,CAAA,GAAA;QA5CiB;CAjCzB,IAiCyB;;CAjCzB;;CAFuC,QAAS;CArBlD"}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment