diff --git a/app/getannot.py b/app/getannot.py
index aa23cee..8d3cab2 100644
--- a/app/getannot.py
+++ b/app/getannot.py
@@ -1,17 +1,7 @@
# #https://gist.github.com/mjlavin80/186a6395c5819dbe25a8a0e001d5acfd
-# import requests
-# import json
-
-
-
-# # This script demonstrates how to query annotations for a particular URL using the hypothes.is API. An API key is required.
-# # The end result of this script is a Python dictionary with annotation data in it. Top save to csv or other format, further parsing would be required
-# def get_annotations():
-
-
-
+from flask import request
import requests
import json
@@ -58,16 +48,17 @@ def get_annot_results(annot,name):
def get_annot_book(annot,name):
res=[]
+ server = request.host
for item in annot['rows']:
if 'selector' in item['target'][0]:
if len(item['target'][0]['selector'])>2:
string=item['uri']
- if name==string.replace('http://localhost:8080/uploads/',''):
+ if name==string.replace('http://' + server+'/uploads/',''):
data={'text': item['text'],'extract':item['target'][0]['selector'][2]['exact'],'title':item['document']['title'], 'url':item['uri']}
res.append(data)
else:
string=item['uri']
- if name==string.replace('http://localhost:8080/uploads/',''):
+ if name==string.replace('http://' + server+'/uploads/',''):
data={'text': item['text'],'extract':item['target'][0]['selector'][1]['exact'],'title':item['document']['title'], 'url':item['uri']}
res.append(data)
return res
diff --git a/app/static/css/style.css b/app/static/css/style.css
index a6191f4..06ad59b 100755
--- a/app/static/css/style.css
+++ b/app/static/css/style.css
@@ -176,6 +176,64 @@ background-color:red;
color: #fafafa;
}
+.ui-autocomplete {
+position: absolute;
+top: 100%;
+left: 0;
+z-index: 1000;
+float: left;
+display: none;
+min-width: 160px;
+padding: 4px 0;
+margin: 0 0 10px 25px;
+list-style: none;
+background-color: #ffffff;
+border-color: #ccc;
+border-color: rgba(0, 0, 0, 0.2);
+border-style: solid;
+border-width: 1px;
+-webkit-border-radius: 5px;
+-moz-border-radius: 5px;
+border-radius: 5px;
+-webkit-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+-moz-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+-webkit-background-clip: padding-box;
+-moz-background-clip: padding;
+background-clip: padding-box;
+*border-right-width: 2px;
+*border-bottom-width: 2px;
+}
+
+.ui-menu-item > a.ui-corner-all {
+display: block;
+padding: 3px 15px;
+clear: both;
+font-weight: normal;
+line-height: 18px;
+color: #555555;
+white-space: nowrap;
+text-decoration: none;
+}
+
+.ui-menu-item {
+ margin: 3px 15px;
+}
+
+.ui-state-hover, .ui-state-active {
+color: #ffffff;
+text-decoration: none;
+background-color: #0088cc;
+border-radius: 0px;
+-webkit-border-radius: 0px;
+-moz-border-radius: 0px;
+background-image: none;
+}
+
+.ui-helper-hidden-accessible {
+ display: none;
+}
+
.footer{
@@ -489,4 +547,4 @@ nav { font-size: .7em }
@page { size: A5; margin: 1cm }
@media print {
nav { display: none }
-}
\ No newline at end of file
+}
diff --git a/app/templates/about.html b/app/templates/about.html
index d57fb58..8ed8990 100755
--- a/app/templates/about.html
+++ b/app/templates/about.html
@@ -13,7 +13,7 @@ This digital library gathers all the books and articles floating around on the s
It starts at XPUB, but can go anywhere we want it to.
-Are you interested in how this library works? Have a look at the source code in our git.
+Are you interested in how this library works? Have a look at the source code in our git.
diff --git a/app/templates/base.html b/app/templates/base.html index fb587df..ea3b2b7 100755 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -15,7 +15,6 @@ - {% block css %} {% endblock%}
diff --git a/app/templates/home.html b/app/templates/home.html index 75a9e8d..064ec68 100755 --- a/app/templates/home.html +++ b/app/templates/home.html @@ -26,6 +26,7 @@ Feel free to browse our catalogue, interfaced in many different ways. {%endif%} +{{ chat.message }}Annotations for {{book.title}}:
+Extract
@@ -128,6 +128,8 @@ {% endif %} {% endfor %} +{%else%}