Commit 5be63e0e authored by Ujvari Gergely's avatar Ujvari Gergely

Moving functionality to host

parent 33bf5458
......@@ -116,11 +116,11 @@ class Annotator.Host extends Annotator
$(this).removeClass('annotator-hl-active')
getHref: =>
uri = document.location.href
uri = decodeURIComponent document.location.href
if document.location.hash
uri = uri.slice 0, (-1 * location.hash.length)
$('meta[property^="og:url"]').each -> uri = this.content
$('link[rel^="canonical"]').each -> uri = this.href
uri = uri.slice 0, (-1 * location.hash.length)
$('meta[property^="og:url"]').each -> uri = decodeURIComponent this.content
$('link[rel^="canonical"]').each -> uri = decodeURIComponent this.href
return uri
getMaxBottom: =>
......
......@@ -90,13 +90,12 @@ class Hypothesis extends Annotator
onReady: =>
# Get the location of the annotated document
@provider.getHref (href) =>
stable_href = ((decodeURIComponent href).split /(#.+)?$/ )[0]
this.addPlugin 'Store',
annotationData:
uri: stable_href
uri: href
loadFromSearch:
limit: 1000
uri: stable_href
uri: href
prefix: '/api/current'
# When the store plugin finishes a request, update the annotation
......
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