Commit 4037fad2 authored by Aron Carroll's avatar Aron Carroll Committed by Randall Leeds

Add citation to the annotation cards

parent 076fbaa6
......@@ -8,6 +8,7 @@ imports = [
'h.searchfilters'
]
class App
this.$inject = [
'$element', '$location', '$q', '$rootScope', '$route', '$scope', '$timeout',
......@@ -455,7 +456,6 @@ class App
$scope.socialView = annotator.socialView
class Editor
this.$inject = [
'$location', '$routeParams', '$sce', '$scope',
......
......@@ -5,6 +5,14 @@ imports = [
]
# Use an anchor tag to extract the
extractURIComponent = (uri, component) ->
unless extractURIComponent.a
extractURIComponent.a = document.createElement('a')
extractURIComponent.a.href = uri
extractURIComponent.a[component]
class Annotation
this.$inject = [
'$element', '$location', '$rootScope', '$sce', '$scope', '$timeout',
......@@ -16,10 +24,19 @@ class Annotation
$window,
annotator, baseURI, drafts
) ->
model = $scope.model
{plugins, threading} = annotator
$scope.action = 'create'
$scope.editing = false
if model.document and model.target.length
domain = extractURIComponent(model.uri, 'hostname')
$scope.document =
uri: model.uri
domain: domain
title: model.document.title or domain
$scope.cancel = ($event) ->
$event?.stopPropagation()
$scope.editing = false
......
......@@ -108,3 +108,8 @@ $threadexp-width: .6em;
}
}
}
.annotation-citation-domain {
color: $gray-light;
font-style: italic;
}
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