Commit 15f866ab authored by csillag's avatar csillag

Update to Annotator f58a5f3, with source map support

parent 2fd7f1d3
This diff is collapsed.
# Public: Delegator is the base class that all of Annotators objects inherit
# from. It provides basic functionality such as instance options, event
# delegation and pub/sub methods.
class Delegator
# Public: Events object. This contains a key/pair hash of events/methods that
# should be bound. See Delegator#addEvents() for usage.
events: {}
# Public: Options object. Extended on initialisation.
options: {}
# A jQuery object wrapping the DOM Element provided on initialisation.
element: null
# Public: Constructor function that sets up the instance. Binds the @events
# hash and extends the @options object.
#
# element - The DOM element that this intance represents.
# options - An Object literal of options.
#
# Examples
#
# element = document.getElementById('my-element')
# instance = new Delegator(element, {
# option: 'my-option'
# })
#
# Returns a new instance of Delegator.
constructor: (element, options) ->
@options = $.extend(true, {}, @options, options)
@element = $(element)
this.on = this.subscribe
this.addEvents()
# Binds the function names in the @events Object to thier events.
#
# The @events Object should be a set of key/value pairs where the key is the
# event name with optional CSS selector. The value should be a String method
# name on the current class.
#
# Examples
#
# # This will bind the clickedElement() method to the click event on @element.
# @options = {"click": "clickedElement"}
#
# # This will delegate the submitForm() method to the submit event on the
# # form within the @element.
# @options = {"form submit": "submitForm"}
#
# # This will bind the updateAnnotationStore() method to the custom
# # annotation:save event. NOTE: Because this is a custom event the
# # Delegator#subscribe() method will be used and updateAnnotationStore()
# # will not recieve an event parameter like the previous two examples.
# @options = {"annotation:save": "updateAnnotationStore"}
#
# Returns nothing.
addEvents: ->
for sel, functionName of @events
[selector..., event] = sel.split ' '
this.addEvent selector.join(' '), event, functionName
# Binds an event to a callback function represented by a String. An optional
# bindTo selector can be provided in order to watch for events on a child
# element.
#
# The event can be any standard event supported by jQuery or a custom String.
# If a custom string is used the callback function will not recieve an
# event object as it's first parameter.
#
# bindTo - Selector String matching child elements. (default: @element)
# event - The event to listen for.
# functionName - A String function name to bind to the event.
#
# Examples
#
# # Listens for all click events on instance.element.
# instance.addEvent('', 'click', 'onClick')
#
# # Delegates the instance.onInputFocus() method to focus events on all
# # form inputs within instance.element.
# instance.addEvent('form :input', 'focus', 'onInputFocus')
#
# Returns itself.
addEvent: (bindTo, event, functionName) ->
closure = => this[functionName].apply(this, arguments)
isBlankSelector = typeof bindTo is 'string' and bindTo.replace(/\s+/g, '') is ''
bindTo = @element if isBlankSelector
if typeof bindTo is 'string'
@element.delegate bindTo, event, closure
else
if this.isCustomEvent(event)
this.subscribe event, closure
else
$(bindTo).bind event, closure
this
# Checks to see if the provided event is a DOM event supported by jQuery or
# a custom user event.
#
# event - String event name.
#
# Examples
#
# this.isCustomEvent('click') # => false
# this.isCustomEvent('mousedown') # => false
# this.isCustomEvent('annotation:created') # => true
#
# Returns true if event is a custom user event.
isCustomEvent: (event) ->
[event] = event.split('.')
$.inArray(event, Delegator.natives) == -1
# Public: Fires an event and calls all subscribed callbacks with any parameters
# provided. This is essentially an alias of @element.triggerHandler() but
# should be used to fire custom events.
#
# NOTE: Events fired using .publish() will not bubble up the DOM.
#
# event - A String event name.
# params - An Array of parameters to provide to callbacks.
#
# Examples
#
# instance.subscribe('annotation:save', (msg) -> console.log(msg))
# instance.publish('annotation:save', ['Hello World'])
# # => Outputs "Hello World"
#
# Returns itself.
publish: () ->
@element.triggerHandler.apply @element, arguments
this
# Public: Listens for custom event which when published will call the provided
# callback. This is essentially a wrapper around @element.bind() but removes
# the event parameter that jQuery event callbacks always recieve. These
# parameters are unnessecary for custom events.
#
# event - A String event name.
# callback - A callback function called when the event is published.
#
# Examples
#
# instance.subscribe('annotation:save', (msg) -> console.log(msg))
# instance.publish('annotation:save', ['Hello World'])
# # => Outputs "Hello World"
#
# Returns itself.
subscribe: (event, callback) ->
closure = -> callback.apply(this, [].slice.call(arguments, 1))
# Ensure both functions have the same unique id so that jQuery will accept
# callback when unbinding closure.
closure.guid = callback.guid = ($.guid += 1)
@element.bind event, closure
this
# Public: Unsubscribes a callback from an event. The callback will no longer
# be called when the event is published.
#
# event - A String event name.
# callback - A callback function to be removed.
#
# Examples
#
# callback = (msg) -> console.log(msg)
# instance.subscribe('annotation:save', callback)
# instance.publish('annotation:save', ['Hello World'])
# # => Outputs "Hello World"
#
# instance.unsubscribe('annotation:save', callback)
# instance.publish('annotation:save', ['Hello Again'])
# # => No output.
#
# Returns itself.
unsubscribe: ->
@element.unbind.apply @element, arguments
this
# Native jQuery events that should recieve an event object. Plugins can
# add thier own methods to this if required.
Delegator.natives = do ->
specials = (key for own key, val of jQuery.event.special)
"""
blur focus focusin focusout load resize scroll unload click dblclick
mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave
change select submit keydown keypress keyup error
""".split(/[^a-z]+/).concat(specials)
# Stub the console when not available so that everything still works.
functions = [
"log", "debug", "info", "warn", "exception", "assert", "dir", "dirxml",
"trace", "group", "groupEnd", "groupCollapsed", "time", "timeEnd", "profile",
"profileEnd", "count", "clear", "table", "error", "notifyFirebug", "firebug",
"userObjects"
]
if console?
# Opera's console doesn't have a group function as of 2010-07-01
if not console.group?
console.group = (name) -> console.log "GROUP: ", name
# Webkit's developer console has yet to implement groupCollapsed as of 2010-07-01
if not console.groupCollapsed?
console.groupCollapsed = console.group
# Stub out any remaining functions
for fn in functions
if not console[fn]?
console[fn] = -> console.log _t("Not implemented:") + " console.#{name}"
else
this.console = {}
for fn in functions
this.console[fn] = ->
this.console['error'] = (args...) ->
alert("ERROR: #{args.join(', ')}")
this.console['warn'] = (args...) ->
alert("WARNING: #{args.join(', ')}")
This diff is collapsed.
# I18N
gettext = null
if Gettext?
_gettext = new Gettext(domain: "annotator")
gettext = (msgid) -> _gettext.gettext(msgid)
else
gettext = (msgid) -> msgid
_t = (msgid) -> gettext(msgid)
unless jQuery?.fn?.jquery
console.error(_t("Annotator requires jQuery: have you included lib/vendor/jquery.js?"))
unless JSON and JSON.parse and JSON.stringify
console.error(_t("Annotator requires a JSON implementation: have you included lib/vendor/json2.js?"))
$ = jQuery
Util = {}
# Public: Flatten a nested array structure
#
# Returns an array
Util.flatten = (array) ->
flatten = (ary) ->
flat = []
for el in ary
flat = flat.concat(if el and $.isArray(el) then flatten(el) else el)
return flat
flatten(array)
# Public: Finds all text nodes within the elements in the current collection.
#
# Returns a new jQuery collection of text nodes.
Util.getTextNodes = (jq) ->
getTextNodes = (node) ->
if node and node.nodeType != Node.TEXT_NODE
nodes = []
# If not a comment then traverse children collecting text nodes.
# We traverse the child nodes manually rather than using the .childNodes
# property because IE9 does not update the .childNodes property after
# .splitText() is called on a child text node.
if node.nodeType != Node.COMMENT_NODE
# Start at the last child and walk backwards through siblings.
node = node.lastChild
while node
nodes.push getTextNodes(node)
node = node.previousSibling
# Finally reverse the array so that nodes are in the correct order.
return nodes.reverse()
else
return node
jq.map -> Util.flatten(getTextNodes(this))
Util.xpathFromNode = (el, relativeRoot) ->
try
result = simpleXPathJQuery.call el, relativeRoot
catch exception
console.log "jQuery-based XPath construction failed! Falling back to manual."
result = simpleXPathPure.call el, relativeRoot
result
Util.nodeFromXPath = (xp, root) ->
steps = xp.substring(1).split("/")
node = root
for step in steps
[name, idx] = step.split "["
idx = if idx? then parseInt (idx?.split "]")[0] else 1
node = findChild node, name.toLowerCase(), idx
node
Util.escape = (html) ->
html
.replace(/&(?!\w+;)/g, '&')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;')
.replace(/"/g, '&quot;')
Annotator = Annotator || {}
# Public: A simple notification system that can be used to display information,
# warnings and errors to the user. Display of notifications are controlled
# cmpletely by CSS by adding/removing the @options.classes.show class. This
# allows styling/animation using CSS rather than hardcoding styles.
class Annotator.Notification extends Delegator
# Sets events to be bound to the @element.
events:
"click": "hide"
# Default options.
options:
html: "<div class='annotator-notice'></div>"
classes:
show: "annotator-notice-show"
info: "annotator-notice-info"
success: "annotator-notice-success"
error: "annotator-notice-error"
# Public: Creates an instance of Notification and appends it to the
# document body.
#
# options - The following options can be provided.
# classes - A Object literal of classes used to determine state.
# html - An HTML string used to create the notification.
#
# Examples
#
# # Displays a notification with the text "Hello World"
# notification = new Annotator.Notification
# notification.show("Hello World")
#
# Returns
constructor: (options) ->
super $(@options.html).appendTo(document.body)[0], options
# Public: Displays the annotation with message and optional status. The
# message will hide itself after 5 seconds or if the user clicks on it.
#
# message - A message String to display (HTML will be escaped).
# status - A status constant. This will apply a class to the element for
# styling. (default: Annotator.Notification.INFO)
#
# Examples
#
# # Displays a notification with the text "Hello World"
# notification.show("Hello World")
#
# # Displays a notification with the text "An error has occurred"
# notification.show("An error has occurred", Annotator.Notification.ERROR)
#
# Returns itself.
show: (message, status=Annotator.Notification.INFO) =>
$(@element)
.addClass(@options.classes.show)
.addClass(@options.classes[status])
.html(Util.escape(message || ""))
setTimeout this.hide, 5000
this
# Public: Hides the notification.
#
# Examples
#
# # Hides the notification.
# notification.hide()
#
# Returns itself.
hide: =>
$(@element).removeClass(@options.classes.show)
this
# Constants for controlling the display of the notification. Each constant
# adds a different class to the Notification#element.
Annotator.Notification.INFO = 'show'
Annotator.Notification.SUCCESS = 'success'
Annotator.Notification.ERROR = 'error'
# Attach notification methods to the Annotation object on document ready.
$(->
notification = new Annotator.Notification
Annotator.showNotification = notification.show
Annotator.hideNotification = notification.hide
)
# Public: Plugin for managing user permissions under the rather more specialised
# permissions model used by [AnnotateIt](http://annotateit.org).
#
# element - A DOM Element upon which events are bound. When initialised by
# the Annotator it is the Annotator element.
# options - An Object literal containing custom options.
#
# Examples
#
# new Annotator.plugin.AnnotateItPermissions(annotator.element)
#
# Returns a new instance of the AnnotateItPermissions Object.
class Annotator.Plugin.AnnotateItPermissions extends Annotator.Plugin.Permissions
# A Object literal of default options for the class.
options:
# Displays an "Anyone can view this annotation" checkbox in the Editor.
showViewPermissionsCheckbox: true
# Displays an "Anyone can edit this annotation" checkbox in the Editor.
showEditPermissionsCheckbox: true
# Abstract user groups used by userAuthorize function
groups:
world: 'group:__world__'
authenticated: 'group:__authenticated__'
consumer: 'group:__consumer__'
userId: (user) -> user.userId
userString: (user) -> user.userId
# Public: Used by AnnotateItPermissions#authorize to determine whether a user can
# perform an action on an annotation.
#
# This should do more-or-less the same thing as the server-side authorization
# code, which is to be found at
# https://github.com/okfn/annotator-store/blob/master/annotator/authz.py
#
# Returns a Boolean, true if the user is authorised for the action provided.
userAuthorize: (action, annotation, user) ->
permissions = annotation.permissions or {}
action_field = permissions[action] or []
if @groups.world in action_field
return true
else if user? and user.userId? and user.consumerKey?
if user.userId == annotation.user and user.consumerKey == annotation.consumer
return true
else if @groups.authenticated in action_field
return true
else if user.consumerKey == annotation.consumer and @groups.consumer in action_field
return true
else if user.consumerKey == annotation.consumer and user.userId in action_field
return true
else if user.consumerKey == annotation.consumer and user.admin
return true
else
return false
else
return false
# Default permissions for all annotations. Anyone can
# read, but only annotation owners can update/delete/admin.
permissions: {
'read': ['group:__world__']
'update': []
'delete': []
'admin': []
}
# Event callback: Appends the @options.permissions, @options.user and
# @options.consumer objects to the provided annotation object.
#
# annotation - An annotation object.
#
# Examples
#
# annotation = {text: 'My comment'}
# permissions.addFieldsToAnnotation(annotation)
# console.log(annotation)
# # => {text: 'My comment', user: 'alice', consumer: 'annotateit', permissions: {...}}
#
# Returns nothing.
addFieldsToAnnotation: (annotation) =>
super
if annotation and @user
annotation.consumer = @user.consumerKey
# Field callback: Updates the state of the "anyone can…" checkboxes
#
# action - The action String, either "view" or "update"
# field - A DOM Element containing a form input.
# annotation - An annotation Object.
#
# Returns nothing.
updatePermissionsField: (action, field, annotation) =>
field = $(field).show()
input = field.find('input').removeAttr('disabled')
# Do not show field if current user is not admin.
field.hide() unless this.authorize('admin', annotation)
# See if we can authorise with any old user from this consumer
if @user and this.authorize(action, annotation || {}, {userId: '__nonexistentuser__', consumerKey: @user.consumerKey})
input.attr('checked', 'checked')
else
input.removeAttr('checked')
# Field callback: updates the annotation.permissions object based on the state
# of the field checkbox. If it is checked then permissions are set to world
# writable otherwise they use the original settings.
#
# action - The action String, either "view" or "update"
# field - A DOM Element representing the annotation editor.
# annotation - An annotation Object.
#
# Returns nothing.
updateAnnotationPermissions: (type, field, annotation) =>
annotation.permissions = @options.permissions unless annotation.permissions
dataKey = type + '-permissions'
if $(field).find('input').is(':checked')
annotation.permissions[type] = [if type == 'read' then @options.groups.world else @options.groups.consumer]
else
annotation.permissions[type] = []
# Sets the Permissions#user property on the basis of a received authToken. This plugin
# simply uses the entire token to represent the user.
#
# token - the authToken received by the Auth plugin
#
# Returns nothing.
_setAuthFromToken: (token) =>
this.setUser(token)
# Public: Creates a Date object from an ISO8601 formatted date String.
#
# string - ISO8601 formatted date String.
#
# Returns Date instance.
createDateFromISO8601 = (string) ->
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)
date.setMonth(d[3] - 1) if d[3]
date.setDate(d[5]) if d[5]
date.setHours(d[7]) if d[7]
date.setMinutes(d[8]) if d[8]
date.setSeconds(d[10]) if d[10]
date.setMilliseconds(Number("0." + d[12]) * 1000) if d[12]
if d[14]
offset = (Number(d[16]) * 60) + Number(d[17])
offset *= ((d[15] == '-') ? 1 : -1)
offset -= date.getTimezoneOffset()
time = (Number(date) + (offset * 60 * 1000))
date.setTime(Number(time))
date
base64Decode = (data) ->
if atob?
# Gecko and Webkit provide native code for this
atob(data)
else
# Adapted from MIT/BSD licensed code at http://phpjs.org/functions/base64_decode
# version 1109.2015
b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
i = 0
ac = 0
dec = ""
tmp_arr = []
if not data
return data
data += ''
while i < data.length
# unpack four hexets into three octets using index points in b64
h1 = b64.indexOf(data.charAt(i++))
h2 = b64.indexOf(data.charAt(i++))
h3 = b64.indexOf(data.charAt(i++))
h4 = b64.indexOf(data.charAt(i++))
bits = h1 << 18 | h2 << 12 | h3 << 6 | h4
o1 = bits >> 16 & 0xff
o2 = bits >> 8 & 0xff
o3 = bits & 0xff
if h3 == 64
tmp_arr[ac++] = String.fromCharCode(o1)
else if h4 == 64
tmp_arr[ac++] = String.fromCharCode(o1, o2)
else
tmp_arr[ac++] = String.fromCharCode(o1, o2, o3)
tmp_arr.join('')
base64UrlDecode = (data) ->
m = data.length % 4
if m != 0
for i in [0...4 - m]
data += '='
data = data.replace(/-/g, '+')
data = data.replace(/_/g, '/')
base64Decode(data)
parseToken = (token) ->
[head, payload, sig] = token.split('.')
JSON.parse(base64UrlDecode(payload))
# Public: Supports the Store plugin by providing Authentication headers.
class Annotator.Plugin.Auth extends Annotator.Plugin
# User options that can be provided.
options:
# An authentication token. Used to skip the request to the server for a
# a token.
token: null
# The URL on the local server to request an authentication token.
tokenUrl: '/auth/token'
# If true will try and fetch a token when the plugin is initialised.
autoFetch: true
# Public: Create a new instance of the Auth plugin.
#
# element - The element to bind all events to. Usually the Annotator#element.
# options - An Object literal containing user options.
#
# Examples
#
# plugin = new Annotator.Plugin.Auth(annotator.element, {
# tokenUrl: '/my/custom/path'
# })
#
# Returns instance of Auth.
constructor: (element, options) ->
super
# List of functions to be executed when we have a valid token.
@waitingForToken = []
if @options.token
this.setToken(@options.token)
else
this.requestToken()
# Public: Makes a request to the local server for an authentication token.
#
# Examples
#
# auth.requestToken()
#
# Returns jqXHR object.
requestToken: ->
@requestInProgress = true
$.ajax
url: @options.tokenUrl
dataType: 'text'
xhrFields:
     withCredentials: true # Send any auth cookies to the backend
# on success, set the auth token
.done (data, status, xhr) =>
this.setToken(data)
# on failure, relay any message given by the server to the user with a notification
.fail (xhr, status, err) =>
msg = Annotator._t("Couldn't get auth token:")
console.error "#{msg} #{err}", xhr
Annotator.showNotification("#{msg} #{xhr.responseText}", Annotator.Notification.ERROR)
# always reset the requestInProgress indicator
.always =>
@requestInProgress = false
# Public: Sets the @token and checks it's validity. If the token is invalid
# requests a new one from the server.
#
# token - A token string.
#
# Examples
#
# auth.setToken('eyJh...9jQ3I')
#
# Returns nothing.
setToken: (token) ->
@token = token
# Parse the token without verifying its authenticity:
@_unsafeToken = parseToken(token)
if this.haveValidToken()
if @options.autoFetch
# Set timeout to fetch new token 2 seconds before current token expiry
@refreshTimeout = setTimeout (() => this.requestToken()), (this.timeToExpiry() - 2) * 1000
# Set headers field on this.element
this.updateHeaders()
# Run callbacks waiting for token
while @waitingForToken.length > 0
@waitingForToken.pop()(@_unsafeToken)
else
console.warn Annotator._t("Didn't get a valid token.")
if @options.autoFetch
console.warn Annotator._t("Getting a new token in 10s.")
setTimeout (() => this.requestToken()), 10 * 1000
# Public: Checks the validity of the current token. Note that this *does
# not* check the authenticity of the token.
#
# Examples
#
# auth.haveValidToken() # => Returns true if valid.
#
# Returns true if the token is valid.
haveValidToken: () ->
allFields = @_unsafeToken &&
@_unsafeToken.issuedAt &&
@_unsafeToken.ttl &&
@_unsafeToken.consumerKey
if allFields && this.timeToExpiry() > 0
return true
else
return false
# Public: Calculates the time in seconds until the current token expires.
#
# Returns Number of seconds until token expires.
timeToExpiry: ->
now = new Date().getTime() / 1000
issue = createDateFromISO8601(@_unsafeToken.issuedAt).getTime() / 1000
expiry = issue + @_unsafeToken.ttl
timeToExpiry = expiry - now
if (timeToExpiry > 0) then timeToExpiry else 0
# Public: Updates the headers to be sent with the Store requests. This is
# achieved by updating the 'annotator:headers' key in the @element.data()
# store.
#
# Returns nothing.
updateHeaders: ->
current = @element.data('annotator:headers')
@element.data('annotator:headers', $.extend(current, {
'x-annotator-auth-token': @token,
}))
# Runs the provided callback if a valid token is available. Otherwise requests
# a token until it recieves a valid one.
#
# callback - A callback function to call once a valid token is obtained.
#
# Examples
#
# auth.withToken ->
# store.loadAnnotations()
#
# Returns nothing.
withToken: (callback) ->
if not callback?
return
if this.haveValidToken()
callback(@_unsafeToken)
else
this.waitingForToken.push(callback)
if not @requestInProgress
this.requestToken()
class Annotator.Plugin.Document extends Annotator.Plugin
$ = Annotator.$
events:
'beforeAnnotationCreated': 'beforeAnnotationCreated'
pluginInit: ->
this.getDocumentMetadata()
# returns the primary URI for the document being annotated
uri: =>
uri = decodeURIComponent document.location.href
for link in @metadata
if link.rel == "canonical"
uri = link.href
return uri
# returns all uris for the document being annotated
uris: =>
uniqueUrls = {}
for link in @metadata.link
uniqueUrls[link.href] = true if link.href
return (href for href of uniqueUrls)
beforeAnnotationCreated: (annotation) =>
annotation.document = @metadata
getDocumentMetadata: =>
@metadata = {}
# first look for some common metadata types
# TODO: look for microdata/rdfa?
this._getScholar()
this._getDublinCore()
this._getOpenGraph()
this._getFavicon()
# extract out/normalize some things
this._getTitle()
this._getLinks()
return @metadata
_getScholar: =>
@metadata.scholar = {}
for meta in $("meta")
name = $(meta).prop("name")
content = $(meta).prop("content")
if name.match(/^citation_/)
if @metadata.scholar[name]
@metadata.scholar[name].push(content)
else
@metadata.scholar[name] = [content]
_getDublinCore: =>
@metadata.dc = {}
for meta in $("meta")
name = $(meta).prop("name")
content = $(meta).prop("content")
nameParts = name.split(".")
if nameParts.length == 2 and nameParts[0].toLowerCase() == "dc"
n = nameParts[1]
if @metadata.dc[n]
@metadata.dc[n].push(content)
else
@metadata.dc[n] = [content]
_getOpenGraph: =>
@metadata.og = {}
for meta in $("meta")
property = $(meta).attr("property")
content = $(meta).prop("content")
if property
match = property.match(/^og:(.+)$/)
if match
n = match[1]
if @metadata.og[n]
@metadata.og[n].push(content)
else
@metadata.og[n] = [content]
_getTitle: =>
if @metadata.scholar.citation_title
@metadata.title = @metadata.scholar.citation_title[0]
else if @metadata.dc.title
@metadata.title = @metadata.dc.title
else
@metadata.title = $("head title").text()
_getLinks: =>
# we know our current location is a link for the document
@metadata.link = [href: document.location.href]
# look for some relevant link relations
for link in $("link")
l = $(link)
href = this._absoluteUrl(l.prop('href')) # get absolute url
rel = l.prop('rel')
type = l.prop('type')
if rel in ["alternate", "canonical", "bookmark"] and type not in ["application/rss+xml", "application/atom+xml"]
@metadata.link.push(href: href, rel: rel, type: type)
# look for links in scholar metadata
for name, values of @metadata.scholar
if name == "citation_pdf_url"
for url in values
@metadata.link.push
href: this._absoluteUrl(url)
type: "application/pdf"
# kind of a hack to express DOI identifiers as links but it's a
# convenient place to look them up later, and somewhat sane since
# they don't have a type
if name == "citation_doi"
for doi in values
if doi[0..3] != "doi:"
doi = "doi:" + doi
@metadata.link.push(href: doi)
# look for links in dublincore data
for name, values of @metadata.dc
if name == "identifier"
for id in values
if id[0..3] == "doi:"
@metadata.link.push(href: id)
_getFavicon: =>
for link in $("link")
if $(link).prop("rel") in ["shortcut icon", "icon"]
@metadata["favicon"] = this._absoluteUrl(link.href)
# hack to get a absolute url from a possibly relative one
_absoluteUrl: (url) ->
img = $("<img src='#{ url }'>")
url = img.prop('src')
img.prop('src', null)
return url
This diff is collapsed.
# Public: A initialization function that sets up the Annotator and some of the
# default plugins. Intended for use with the annotator-full package.
#
# NOTE: This method is intened to be called via the jQuery .annotator() method
# although it is available directly on the Annotator instance.
#
# config - An object containing config options for the AnnotateIt store.
# storeUrl: API endpoint for the store (default: "http://annotateit.org/api")
# tokenUrl: API endpoint for auth token provider (default: "http://annotateit.org/api/token")
#
# options - An object containing plugin settings to override the defaults.
# If a plugin is entered with a 'falsy' value, the plugin will not be loaded.
#
# Examples
#
# $('#content').annotator().annotator('setupPlugins');
#
# // Only display a filter for the user field and disable tags.
# $('#content').annotator().annotator('setupPlugins', null, {
# Tags: false,
# Filter: {
# filters: [{label: 'User', property: 'user'}],
# addAnnotationFilter: false
# }
# });
#
# Returns itself for chaining.
Annotator::setupPlugins = (config={}, options={}) ->
win = util.getGlobal()
# Set up the default plugins.
plugins = ['Unsupported', 'Auth', 'Tags', 'Filter', 'Store', 'AnnotateItPermissions']
# If Showdown is included add the Markdown plugin.
if win.Showdown
plugins.push('Markdown')
# Check the config for store credentials and add relevant plugins.
uri = win.location.href.split(/#|\?/).shift() or ''
pluginConfig =
Tags: {}
Filter:
filters: [
{label: Annotator._t('User'), property: 'user'}
{label: Annotator._t('Tags'), property: 'tags'}
]
Auth:
tokenUrl: config.tokenUrl or 'http://annotateit.org/api/token'
Store:
prefix: config.storeUrl or 'http://annotateit.org/api'
annotationData:
uri: uri
loadFromSearch:
uri: uri
for own name, opts of options
if name not in plugins
plugins.push(name)
$.extend true, pluginConfig, options
for name in plugins
if name not of pluginConfig or pluginConfig[name]
this.addPlugin(name, pluginConfig[name])
# Plugin that renders annotation comments displayed in the Viewer in Markdown.
# Requires Showdown library to be present in the page when initialised.
class Annotator.Plugin.Markdown extends Annotator.Plugin
# Events to be bound to the @element.
events:
'annotationViewerTextField': 'updateTextField'
# Public: Initailises an instance of the Markdown plugin.
#
# element - The Annotator#element.
# options - An options Object (there are currently no options).
#
# Examples
#
# plugin = new Annotator.Plugin.Markdown(annotator.element)
#
# Returns a new instance of Annotator.Plugin.Markdown.
constructor: (element, options) ->
if Showdown?.converter?
super
@converter = new Showdown.converter()
else
console.error Annotator._t("To use the Markdown plugin, you must include Showdown into the page first.")
# Annotator event callback. Displays the annotation.text as a Markdown
# rendered version.
#
# field - The viewer field Element.
# annotation - The annotation Object being displayed.
#
# Examples
#
# # Normally called by Annotator#viewer()
# plugin.updateTextField(field, {text: 'My _markdown_ comment'})
# $(field).html() # => Returns "My <em>markdown</em> comment"
#
# Returns nothing
updateTextField: (field, annotation) =>
# Escape any HTML in the text to prevent XSS.
text = Annotator.Util.escape(annotation.text || '')
$(field).html(this.convert(text))
# Converts provided text into markdown.
#
# text - A String of Markdown to render as HTML.
#
# Examples
#
# plugin.convert('This is _very_ basic [Markdown](http://daringfireball.com)')
# # => Returns "This is <em>very<em> basic <a href="http://...">Markdown</a>"
#
# Returns HTML string.
convert: (text) ->
@converter.makeHtml text
This diff is collapsed.
This diff is collapsed.
# Public: Tags plugin allows users to tag thier annotations with metadata
# stored in an Array on the annotation as tags.
class Annotator.Plugin.Tags extends Annotator.Plugin
options:
# Configurable function which accepts a string (the contents)
# of the tags input as an argument, and returns an array of
# tags.
parseTags: (string) ->
string = $.trim(string)
tags = []
tags = string.split(/\s+/) if string
tags
# Configurable function which accepts an array of tags and
# returns a string which will be used to fill the tags input.
stringifyTags: (array) ->
array.join(" ")
# The field element added to the Annotator.Editor wrapped in jQuery. Cached to
# save having to recreate it everytime the editor is displayed.
field: null
# The input element added to the Annotator.Editor wrapped in jQuery. Cached to
# save having to recreate it everytime the editor is displayed.
input: null
# Public: Initialises the plugin and adds custom fields to both the
# annotator viewer and editor. The plugin also checks if the annotator is
# supported by the current browser.
#
# Returns nothing.
pluginInit: ->
return unless Annotator.supported()
@field = @annotator.editor.addField({
label: Annotator._t('Add some tags here') + '\u2026'
load: this.updateField
submit: this.setAnnotationTags
})
@annotator.viewer.addField({
load: this.updateViewer
})
# Add a filter to the Filter plugin if loaded.
if @annotator.plugins.Filter
@annotator.plugins.Filter.addFilter
label: Annotator._t('Tag')
property: 'tags'
isFiltered: Annotator.Plugin.Tags.filterCallback
@input = $(@field).find(':input')
# Public: Extracts tags from the provided String.
#
# string - A String of tags seperated by spaces.
#
# Examples
#
# plugin.parseTags('cake chocolate cabbage')
# # => ['cake', 'chocolate', 'cabbage']
#
# Returns Array of parsed tags.
parseTags: (string) ->
@options.parseTags(string)
# Public: Takes an array of tags and serialises them into a String.
#
# array - An Array of tags.
#
# Examples
#
# plugin.stringifyTags(['cake', 'chocolate', 'cabbage'])
# # => 'cake chocolate cabbage'
#
# Returns Array of parsed tags.
stringifyTags: (array) ->
@options.stringifyTags(array)
# Annotator.Editor callback function. Updates the @input field with the
# tags attached to the provided annotation.
#
# field - The tags field Element containing the input Element.
# annotation - An annotation object to be edited.
#
# Examples
#
# field = $('<li><input /></li>')[0]
# plugin.updateField(field, {tags: ['apples', 'oranges', 'cake']})
# field.value # => Returns 'apples oranges cake'
#
# Returns nothing.
updateField: (field, annotation) =>
value = ''
value = this.stringifyTags(annotation.tags) if annotation.tags
@input.val(value)
# Annotator.Editor callback function. Updates the annotation field with the
# data retrieved from the @input property.
#
# field - The tags field Element containing the input Element.
# annotation - An annotation object to be updated.
#
# Examples
#
# annotation = {}
# field = $('<li><input value="cake chocolate cabbage" /></li>')[0]
#
# plugin.setAnnotationTags(field, annotation)
# annotation.tags # => Returns ['cake', 'chocolate', 'cabbage']
#
# Returns nothing.
setAnnotationTags: (field, annotation) =>
annotation.tags = this.parseTags(@input.val())
# Annotator.Viewer callback function. Updates the annotation display with tags
# removes the field from the Viewer if there are no tags to display.
#
# field - The Element to populate with tags.
# annotation - An annotation object to be display.
#
# Examples
#
# field = $('<div />')[0]
# plugin.updateField(field, {tags: ['apples']})
# field.innerHTML # => Returns '<span class="annotator-tag">apples</span>'
#
# Returns nothing.
updateViewer: (field, annotation) ->
field = $(field)
if annotation.tags and $.isArray(annotation.tags) and annotation.tags.length
field.addClass('annotator-tags').html(->
string = $.map(annotation.tags,(tag) ->
'<span class="annotator-tag">' + Annotator.Util.escape(tag) + '</span>'
).join(' ')
)
else
field.remove()
# Checks an input string of keywords against an array of tags. If the keywords
# match _all_ tags the function returns true. This should be used as a callback
# in the Filter plugin.
#
# input - A String of keywords from a input field.
#
# Examples
#
# Tags.filterCallback('cat dog mouse', ['cat', 'dog', 'mouse']) //=> true
# Tags.filterCallback('cat dog', ['cat', 'dog', 'mouse']) //=> true
# Tags.filterCallback('cat dog', ['cat']) //=> false
#
# Returns true if the input keywords match all tags.
Annotator.Plugin.Tags.filterCallback = (input, tags = []) ->
matches = 0
keywords = []
if input
keywords = input.split(/\s+/g)
for keyword in keywords when tags.length
matches += 1 for tag in tags when tag.indexOf(keyword) != -1
matches == keywords.length
# Plugin that will display a notification to the user if thier browser does
# not support the Annotator.
class Annotator.Plugin.Unsupported extends Annotator.Plugin
# Options Object, message sets the message displayed in the browser.
options:
message: Annotator._t("Sorry your current browser does not support the Annotator")
# Public: Checks the Annotator.supported() method and if unsupported displays
# @options.message in a notification.
#
# Returns nothing.
pluginInit: ->
unless Annotator.supported()
$(=>
# On document load display notification.
Annotator.showNotification(@options.message)
# Add a class if we're in IE6. A bit of a hack but we need to be able
# to set the notification position in the CSS.
if (window.XMLHttpRequest == undefined) and (ActiveXObject != undefined)
$('html').addClass('ie6')
)
This diff is collapsed.
# Public: Creates an element for viewing annotations.
class Annotator.Viewer extends Annotator.Widget
# Events to be bound to the @element.
events:
".annotator-edit click": "onEditClick"
".annotator-delete click": "onDeleteClick"
# Classes for toggling annotator state.
classes:
hide: 'annotator-hide'
showControls: 'annotator-visible'
# HTML templates for @element and @item properties.
html:
element:"""
<div class="annotator-outer annotator-viewer">
<ul class="annotator-widget annotator-listing"></ul>
</div>
"""
item: """
<li class="annotator-annotation annotator-item">
<span class="annotator-controls">
<a href="#" title="View as webpage" class="annotator-link">View as webpage</a>
<button title="Edit" class="annotator-edit">Edit</button>
<button title="Delete" class="annotator-delete">Delete</button>
</span>
</li>
"""
# Configuration options
options:
readOnly: false # Start the viewer in read-only mode. No controls will be shown.
# Public: Creates an instance of the Viewer object. This will create the
# @element from the @html.element string and set up all events.
#
# options - An Object literal containing options.
#
# Examples
#
# # Creates a new viewer, adds a custom field and displays an annotation.
# viewer = new Annotator.Viewer()
# viewer.addField({
# load: someLoadCallback
# })
# viewer.load(annotation)
#
# Returns a new Viewer instance.
constructor: (options) ->
super $(@html.element)[0], options
@item = $(@html.item)[0]
@fields = []
@annotations = []
# Public: Displays the Viewer and first the "show" event. Can be used as an
# event callback and will call Event#preventDefault() on the supplied event.
#
# event - Event object provided if method is called by event
# listener (default:undefined)
#
# Examples
#
# # Displays the editor.
# viewer.show()
#
# # Displays the viewer on click (prevents default action).
# $('a.show-viewer').bind('click', viewer.show)
#
# Returns itself.
show: (event) =>
util.preventEventDefault event
controls = @element
.find('.annotator-controls')
.addClass(@classes.showControls)
setTimeout((=> controls.removeClass(@classes.showControls)), 500)
@element.removeClass(@classes.hide)
this.checkOrientation().publish('show')
# Public: Checks to see if the Viewer is currently displayed.
#
# Examples
#
# viewer.show()
# viewer.isShown() # => Returns true
#
# viewer.hide()
# viewer.isShown() # => Returns false
#
# Returns true if the Viewer is visible.
isShown: ->
not @element.hasClass(@classes.hide)
# Public: Hides the Editor and fires the "hide" event. Can be used as an event
# callback and will call Event#preventDefault() on the supplied event.
#
# event - Event object provided if method is called by event
# listener (default:undefined)
#
# Examples
#
# # Hides the editor.
# viewer.hide()
#
# # Hide the viewer on click (prevents default action).
# $('a.hide-viewer').bind('click', viewer.hide)
#
# Returns itself.
hide: (event) =>
util.preventEventDefault event
@element.addClass(@classes.hide)
this.publish('hide')
# Public: Loads annotations into the viewer and shows it. Fires the "load"
# event once the viewer is loaded passing the annotations into the callback.
#
# annotation - An Array of annotation elements.
#
# Examples
#
# viewer.load([annotation1, annotation2, annotation3])
#
# Returns itslef.
load: (annotations) =>
@annotations = annotations || []
list = @element.find('ul:first').empty()
for annotation in @annotations
item = $(@item).clone().appendTo(list).data('annotation', annotation)
controls = item.find('.annotator-controls')
link = controls.find('.annotator-link')
edit = controls.find('.annotator-edit')
del = controls.find('.annotator-delete')
links = new LinkParser(annotation.links or []).get('alternate', {'type': 'text/html'})
if links.length is 0 or not links[0].href?
link.remove()
else
link.attr('href', links[0].href)
if @options.readOnly
edit.remove()
del.remove()
else
controller = {
showEdit: -> edit.removeAttr('disabled')
hideEdit: -> edit.attr('disabled', 'disabled')
showDelete: -> del.removeAttr('disabled')
hideDelete: -> del.attr('disabled', 'disabled')
}
for field in @fields
element = $(field.element).clone().appendTo(item)[0]
field.load(element, annotation, controller)
this.publish('load', [@annotations])
this.show()
# Public: Adds an addional field to an annotation view. A callback can be
# provided to update the view on load.
#
# options - An options Object. Options are as follows:
# load - Callback Function called when the view is loaded with an
# annotation. Recieves a newly created clone of @item and
# the annotation to be displayed (it will be called once
# for each annotation being loaded).
#
# Examples
#
# # Display a user name.
# viewer.addField({
# # This is called when the viewer is loaded.
# load: (field, annotation) ->
# field = $(field)
#
# if annotation.user
# field.text(annotation.user) # Display the user
# else
# field.remove() # Do not display the field.
# })
#
# Returns itself.
addField: (options) ->
field = $.extend({
load: ->
}, options)
field.element = $('<div />')[0]
@fields.push field
field.element
this
# Callback function: called when the edit button is clicked.
#
# event - An Event object.
#
# Returns nothing.
onEditClick: (event) =>
this.onButtonClick(event, 'edit')
# Callback function: called when the delete button is clicked.
#
# event - An Event object.
#
# Returns nothing.
onDeleteClick: (event) =>
this.onButtonClick(event, 'delete')
# Fires an event of type and passes in the associated annotation.
#
# event - An Event object.
# type - The type of event to fire. Either "edit" or "delete".
#
# Returns nothing.
onButtonClick: (event, type) ->
item = $(event.target).parents('.annotator-annotation')
this.publish(type, [item.data('annotation')])
# Private: simple parser for hypermedia link structure
#
# Examples:
#
# links = [
# { rel: 'alternate', href: 'http://example.com/pages/14.json', type: 'application/json' },
# { rel: 'prev': href: 'http://example.com/pages/13' }
# ]
#
# lp = LinkParser(links)
# lp.get('alternate') # => [ { rel: 'alternate', href: 'http://...', ... } ]
# lp.get('alternate', {type: 'text/html'}) # => []
#
class LinkParser
constructor: (@data) ->
get: (rel, cond={}) ->
cond = $.extend({}, cond, {rel: rel})
keys = (k for own k, v of cond)
for d in @data
match = keys.reduce ((m, k) -> m and (d[k] is cond[k])), true
if match
d
else
continue
# Public: Base class for the Editor and Viewer elements. Contains methods that
# are shared between the two.
class Annotator.Widget extends Delegator
# Classes used to alter the widgets state.
classes:
hide: 'annotator-hide'
invert:
x: 'annotator-invert-x'
y: 'annotator-invert-y'
# Public: Creates a new Widget instance.
#
# element - The Element that represents the widget in the DOM.
# options - An Object literal of options.
#
# Examples
#
# element = document.createElement('div')
# widget = new Annotator.Widget(element)
#
# Returns a new Widget instance.
constructor: (element, options) ->
super
@classes = $.extend {}, Annotator.Widget.prototype.classes, @classes
checkOrientation: ->
this.resetOrientation()
window = $(util.getGlobal())
widget = @element.children(":first")
offset = widget.offset()
viewport = {
top: window.scrollTop(),
right: window.width() + window.scrollLeft()
}
current = {
top: offset.top
right: offset.left + widget.width()
}
if (current.top - viewport.top) < 0
this.invertY()
if (current.right - viewport.right) > 0
this.invertX()
this
# Public: Resets orientation of widget on the X & Y axis.
#
# Examples
#
# widget.resetOrientation() # Widget is original way up.
#
# Returns itself for chaining.
resetOrientation: ->
@element.removeClass(@classes.invert.x).removeClass(@classes.invert.y)
this
# Public: Inverts the widget on the X axis.
#
# Examples
#
# widget.invertX() # Widget is now right aligned.
#
# Returns itself for chaining.
invertX: ->
@element.addClass @classes.invert.x
this
# Public: Inverts the widget on the Y axis.
#
# Examples
#
# widget.invertY() # Widget is now upside down.
#
# Returns itself for chaining.
invertY: ->
@element.addClass @classes.invert.y
this
# Public: Find out whether or not the widget is currently upside down
#
# Returns a boolean: true if the widget is upside down
isInvertedY: ->
@element.hasClass @classes.invert.y
# Public: Find out whether or not the widget is currently right aligned
#
# Returns a boolean: true if the widget is right aligned
isInvertedX: ->
@element.hasClass @classes.invert.x
# A simple XPath evaluator using jQuery which can evaluate queries of
simpleXPathJQuery = (relativeRoot) ->
jq = this.map ->
path = ''
elem = this
while elem?.nodeType == Node.ELEMENT_NODE and elem isnt relativeRoot
tagName = elem.tagName.replace(":", "\\:")
idx = $(elem.parentNode).children(tagName).index(elem) + 1
idx = "[#{idx}]"
path = "/" + elem.tagName.toLowerCase() + idx + path
elem = elem.parentNode
path
jq.get()
# A simple XPath evaluator using only standard DOM methods which can
# evaluate queries of the form /tag[index]/tag[index].
simpleXPathPure = (relativeRoot) ->
getPathSegment = (node) ->
name = getNodeName node
pos = getNodePosition node
"#{name}[#{pos}]"
rootNode = relativeRoot
getPathTo = (node) ->
xpath = '';
while node != rootNode
unless node?
throw new Error "Called getPathTo on a node which was not a descendant of @rootNode. " + rootNode
xpath = (getPathSegment node) + '/' + xpath
node = node.parentNode
xpath = '/' + xpath
xpath = xpath.replace /\/$/, ''
xpath
jq = this.map ->
path = getPathTo this
path
jq.get()
findChild = (node, type, index) ->
unless node.hasChildNodes()
throw new Error "XPath error: node has no children!"
children = node.childNodes
found = 0
for child in children
name = getNodeName child
if name is type
found += 1
if found is index
return child
throw new Error "XPath error: wanted child not found."
# Get the node name for use in generating an xpath expression.
getNodeName = (node) ->
nodeName = node.nodeName.toLowerCase()
switch nodeName
when "#text" then return "text()"
when "#comment" then return "comment()"
when "#cdata-section" then return "cdata-section()"
else return nodeName
# Get the index of the node as it appears in its parent's child list
getNodePosition = (node) ->
pos = 0
tmp = node
while tmp
if tmp.nodeName is node.nodeName
pos++
tmp = tmp.previousSibling
pos
\ No newline at end of file
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-794ee6a
** Annotator 1.2.6-dev-f58a5f3
** 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-09-04 16:14:21Z
*/
/*
//
*/
// Generated by CoffeeScript 1.6.3
(function() {
var base64Decode, base64UrlDecode, createDateFromISO8601, parseToken,
__hasProp = {}.hasOwnProperty,
......@@ -223,3 +230,6 @@
})(Annotator.Plugin);
}).call(this);
//
//@ sourceMappingURL=annotator.auth.map
\ No newline at end of file
{"version":3,"file":"annotator.auth.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/auth.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACKA;CAAA,KAAA,0DAAA;KAAA;oSAAA;;CAAA,CAAA,CAAwB,GAAA,GAAC,YAAzB;CACE,OAAA,2BAAA;CAAA,EAAS,CAAT,EAAA,8BAAS,MAAT,UAAS;CAAT,EAII,CAAJ,CAAI,CAAM;CAJV,EAMS,CAAT,EAAA;CANA,CAOsB,CAAX,CAAX;CAEA,GAAA;CAAA,EAAqB,CAAjB,EAAJ,EAAA;MATA;CAUA,GAAA;CAAA,GAAI,EAAJ,CAAA;MAVA;CAWA,GAAA;CAAA,GAAI,EAAJ,EAAA;MAXA;CAYA,GAAA;CAAA,GAAI,EAAJ,IAAA;MAZA;CAaA,CAA4B,EAA5B;CAAA,CAAkB,EAAd,EAAJ,IAAA;MAbA;CAcA,CAAuD,EAAvD;CAAA,CAAqC,CAAF,CAA/B,EAAJ,SAAA;MAdA;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;QAPjC;CAxHd,IAwHc;;CAxHd,EAsIe,MAAA,IAAf;CACE,MAAA,GAAA;CAAA,EAAU,CAAC,EAAX,CAAA,YAAU;CACT,CAAkC,EAAlC,EAAkC,CAA3B,MAAR,MAAA;CAAqD,CACzB,EAAC,CADwB,GACnD,gBAAA;CADF,OAAmC;CAxIrC,IAsIe;;CAtIf,EAuJW,KAAA,CAAX;CACE,GAAO,EAAP,UAAA;CACE,aAAA;QADF;CAGA,GAAG,EAAH,QAAG;CACQ,GAAC,IAAV,IAAA,GAAA;MADF,EAAA;CAGE,GAAI,IAAJ,OAAoB;AACb,CAAP,GAAG,IAAH,SAAA;CACO,GAAD,QAAJ,KAAA;UALJ;QAJS;CAvJX,IAuJW;;CAvJX;;CAFkC,QAAS;CAjF7C"}
\ No newline at end of file
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-b61d9f7
** Annotator 1.2.6-dev-f58a5f3
** 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-09-04 16:14:22Z
*/
/*
//
*/
// Generated by CoffeeScript 1.6.3
(function() {
var _ref,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
......@@ -31,7 +38,8 @@
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 +55,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 +68,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 +78,6 @@
}
return (function() {
var _results;
_results = [];
for (href in uniqueUrls) {
_results.push(href);
......@@ -98,7 +103,6 @@
Document.prototype._getScholar = function() {
var content, meta, name, _i, _len, _ref1, _results;
this.metadata.scholar = {};
_ref1 = $("meta");
_results = [];
......@@ -121,7 +125,6 @@
Document.prototype._getDublinCore = function() {
var content, meta, n, name, nameParts, _i, _len, _ref1, _results;
this.metadata.dc = {};
_ref1 = $("meta");
_results = [];
......@@ -146,7 +149,6 @@
Document.prototype._getOpenGraph = function() {
var content, match, meta, n, property, _i, _len, _ref1, _results;
this.metadata.og = {};
_ref1 = $("meta");
_results = [];
......@@ -185,7 +187,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
......@@ -237,7 +238,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 +260,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 +275,6 @@
Document.prototype._absoluteUrl = function(url) {
var img;
img = $("<img src='" + url + "'>");
url = img.prop('src');
img.prop('src', null);
......@@ -288,3 +286,6 @@
})(Annotator.Plugin);
}).call(this);
//
//@ sourceMappingURL=annotator.document.map
\ No newline at end of file
{"version":3,"file":"annotator.document.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/document.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACAA;CAAA,GAAA,EAAA;KAAA;;oSAAA;;CAAA,CA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ADF;MAAA,IAAA;CAAA;UADF;CAAA;uBAjCS;CA1FX,IA0FW;;CA1FX,EAiIa,MAAA,EAAb;CACE,SAAA,4BAAA;CAAA;CAAA;YAAA,gCAAA;0BAAA;CACE,EAAG,CAAA,CAAA,CAAH,EAAA,OAAG;CACD,EAAuB,CAAtB,IAAS,CAAA,GAAa;MADzB,IAAA;CAAA;UADF;CAAA;uBADW;CAjIb,IAiIa;;CAjIb,EAwIc,MAAC,GAAf;CACE,EAAA,OAAA;CAAA,EAAA,CAAM,EAAN,MAAS;CAAT,EACA,CAAM,CAAA,CAAN;CADA,CAEgB,CAAb,CAAH,CAAA,CAAA;CACA,EAAA,UAAO;CA5IT,IAwIc;;CAxId;;CAFsC,QAAS;CAAjD"}
\ No newline at end of file
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.6-dev-f85315e
** Annotator 1.2.6-dev-f58a5f3
** 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-08-28 02:11:19Z
** Built at: 2013-09-04 16:14:18Z
*/
/*
//
*/
// Generated by CoffeeScript 1.6.3
(function() {
var $, Annotator, Delegator, LinkParser, Range, Util, findChild, fn, functions, g, getNodeName, getNodePosition, gettext, simpleXPathJQuery, simpleXPathPure, util, _Annotator, _gettext, _i, _j, _len, _len1, _ref, _ref1, _t,
__slice = [].slice,
......@@ -2116,3 +2123,6 @@
});
}).call(this);
//
//@ sourceMappingURL=annotator.map
\ No newline at end of file
This diff is collapsed.
// Generated by CoffeeScript 1.6.3
/*
** Annotator 1.2.7-dev-9612762
** Annotator 1.2.6-dev-f58a5f3
** 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-09-04 16:14:25Z
*/
......@@ -221,8 +221,5 @@
}).call(this);
/*
//
*/
//@ sourceMappingURL=annotator.permissions.map
\ No newline at end of file
{"version":3,"file":"annotator.permissions.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/permissions.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACcA;CAAA,KAAA;;oSAAA;;CAAA,CAAM,IAAgB,GAAP;CAIb;;CAAA,EACE,GADF;CACE,CAA2B,IAA3B,iBAAA,EAAA;CADF,KAAA;;CAAA,EAOE,IAHF;CAGE,CAA6B,EAA7B,EAAA,qBAAA;CAAA,CAG6B,EAH7B,EAGA,qBAAA;CAHA,CAYQ,CAAA,CAAA,EAAR,GAAS;CAAD,cAAU;CAZlB,MAYQ;CAZR,CAqBY,CAAA,CAAA,EAAZ,GAAa,CAAb;CAAY,cAAU;CArBtB,MAqBY;CArBZ,CAqEe,CAAA,CAAA,EAAf,GAAgB,CAAD,GAAf;CAEE,WAAA,WAAA;CAAA,GAAG,IAAH,EAAa,CAAb;CACE,CAAA,CAAS,CAAkC,EAA3C,IAAA,CAAgC;CAEhC,GAAG,CAAiB,CAAX,IAAT;CAEE,GAAA,eAAO;YAJT;AAMA,CAAA,cAAA,8BAAA;gCAAA;CACE,GAAG,CAAqB,CAArB,MAAH;CACE,GAAA,iBAAO;cAFX;CAAA,UANA;CAWA,IAAA,YAAO;CAGU,GAAX,EAfR,IAAA;CAgBE,GAAG,MAAH;CACE,GAAW,CAAiB,CAArB,IAA2C,SAA3C;MADT,MAAA;CAGE,IAAA,cAAO;YAnBX;UAAA;CAFa,cAwBb;CA7FF,MAqEe;CArEf,CAgGM,EAAN,EAAA;CAhGA,CAoGa,IAAb,KAAA;CAAa,CACD,IAAV,EAAA;CADW,CAED,MAAV;CAFW,CAGD,MAAV;CAHW,CAID,KAAV,CAAA;QAxGF;CAPF,KAAA;;CAyHa,CAAU,CAAV,CAAA,GAAA,cAAC;CACZ,4DA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1OxB,CAiQoC,CAAP,CAAA,CAAA,IAAC,CAAD,iBAA7B;CACE,MAAA,GAAA;AAAqD,CAArD,GAAA,EAAA,IAA+D,CAA/D;CAAA,EAAyB,CAAC,GAAO,CAAjC,EAAU,CAAV;QAAA;CAAA,EAEU,CAAA,EAAV,CAAA,OAFA;CAIA,CAAG,EAAA,CAAA,CAAH,CAAG,GAAA;CACU,EAAoB,CAAR,MAAb,CAAa,IAAvB;MADF,EAAA;CAOa,EAAoB,CAAR,MAAb,CAAa,IAAvB;QAZyB;CAjQ7B,IAiQ6B;;CAjQ7B,CAuRsB,CAAR,EAAA,GAAA,CAAC,CAAD,EAAd;CACE,SAAA,IAAA;CAAA,EAAQ,EAAR,CAAA;CAAA,EAEW,CAAC,EAAZ,CAAmB,CAAnB,EAAW;AACyB,CAApC,GAAG,CAAoD,CAAvD,EAAG,EAAU;CACX,EAAO,CAAP,EAAO,CAA8B,CAArC,CAAgB,CAAa;CAA7B,GACA,CAAK,GAAL,QAAA;MAFF,EAAA;CAIE,IAAK,CAAL,EAAA;QAPF;CASA,GAAG,EAAH,EAAA;AAC+B,CAA7B,CAAsD,EAAtD,IAAA,CAA6B,CAAA;CAA7B,OAAQ,EAAR;UAAA;AAC6B,CAA7B,CAAsD,EAAtD,IAAA,CAA6B,CAAA;CAApB,OAAD,EAAR,OAAA;UAFF;QAVY;CAvRd,IAuRc;;CAvRd,EA0SmB,EAAA,IAAC,QAApB;CACO,GAAD,CAAc,CAAlB,CAAA,MAAA;CA3SF,IA0SmB;;CA1SnB;;CAJyC,QAAS;CAApD"}
\ No newline at end of file
This diff is collapsed.
{"version":3,"file":"annotator.store.js","sources":["_preamble.coffee","_annotator_mapsrc/src/plugin/store.coffee"],"names":[],"mappings":";AAAA;;;;;;;;;;CAAA;CAAA;;;;;;;ACiBA;CAAA,KAAA;;;0JAAA;;CAAA,CAAM,IAAgB,GAAP;CAKb;;CAAA,EACE,GADF;CACE,CAAqB,IAArB,aAAA;CAAA,CACqB,IA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AEA,CAFA,KAEA,IAAiB;CAFjB,CAKqB,EAAC,EAAtB,CAA6B,GAA7B,IAAA;CALA,EAMO,CAAP,EAAA,GAAO,CAAA;CAGP,GAAsC,EAAtC,IAAA;CAAA,EAAwB,KAAxB,EAAU;QATV;CAHQ,YAcR;CApcF,IAsbU;;CAtbV,EA4cU,KAAV,CAAW;CACT,SAAA,KAAA;CAAA,EAAU,GAAV,CAAA;CAAA,CACU,CAAA,GAAV,CAAA,EAAmB,SAAsC,GAA/C;CAEV,EAAM,CAAH,CAAe,CAAlB,CAAG,CAAH;CACE,CAAU,CAAA,IAAV,CAAA,CAAmB,4CAAT;AACsB,CAAtB,EAAD,CAAH,CAAe,CAFvB,CAEQ,CAFR;CAGE,CAAU,CAAA,GAAA,CAAV,CAAA,CAAmB,YAAT,YAA+C;QAN3D;CAQA,EAAU,GAAV,QAAO;CAAP,EAAA,UACO;CAAS,CAAU,CAAA,GAAA,CAAV,EAAmB,CAAnB,QAAmE,aAAzD;CAAnB;CADP,EAAA,UAEO;CAAS,CAAU,CAAA,IAAV,EAAmB,CAAnB,2CAAU;CAAnB;CAFP,EAAA,UAGO;CAAS,CAAU,CAAA,IAAV,EAAmB,CAAnB,4CAAU;CAH1B,MARA;CAAA,CAaoC,GAApC,CAAA,CAAA,EAAS,GAAiD,IAA1D;CAEQ,CAAM,CAAsC,CAAC,CAArD,CAAqD,CAA9C,EAAgB,IAAvB,QAAc;CA5dhB,IA4cU;;CA5cV;;CALmC,QAAS;CAA9C"}
\ 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