1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
---|
2 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
---|
3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
---|
4 | <head> |
---|
5 | <metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers"> |
---|
6 | <!-- annotator --> |
---|
7 | <link rel="stylesheet" type="text/css" |
---|
8 | tal:attributes="href string:$rootUrl/template/annotator_files/css/style.css" /> |
---|
9 | |
---|
10 | <link rel="stylesheet" type="text/css" |
---|
11 | tal:attributes="href string:$rootUrl/template/annotator_files/css/annotator.css" /> |
---|
12 | |
---|
13 | |
---|
14 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/vendor/json2.js"></script> |
---|
15 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/vendor/showdown.js"></script> |
---|
16 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/extensions.js"></script> |
---|
17 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/console.js"></script> |
---|
18 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/class.js"></script> |
---|
19 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/range.js"></script> |
---|
20 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/annotator.js"></script> |
---|
21 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/locale/en/annotator.js"></script> |
---|
22 | |
---|
23 | |
---|
24 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/widget.js"></script> |
---|
25 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/editor.js"></script> |
---|
26 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/viewer.js"></script> |
---|
27 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/notification.js"></script> |
---|
28 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/store.js"></script> |
---|
29 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/permissions.js"></script> |
---|
30 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/auth.js"></script> |
---|
31 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script> |
---|
32 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/markdown.js"></script> |
---|
33 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/unsupported.js"></script> |
---|
34 | |
---|
35 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/jquery.dateFormat.js"></script> |
---|
36 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/jquery.slimscroll.js"></script> |
---|
37 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/jquery-i18n-master/jquery.i18n.min.js"></script> |
---|
38 | <script type="text/javascript" tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/view_annotator.js"></script> |
---|
39 | |
---|
40 | |
---|
41 | <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> --> |
---|
42 | |
---|
43 | <script type="text/javascript" |
---|
44 | tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager; |
---|
45 | annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']); |
---|
46 | resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']); |
---|
47 | global annUser python:here.getAuthenticatedUser(anon='anonymous'); |
---|
48 | global annGroup python:request.get('annotator_group', None); |
---|
49 | permUser python:test(annGroup, 'group:%s'%annGroup, annUser);" |
---|
50 | tal:content="structure string: |
---|
51 | var annotatorServerUrl='$annServerUrl'; |
---|
52 | var annotatorPageUrl='$annUrl'; |
---|
53 | var annotatorResourceUrl='$resUrl'; |
---|
54 | var annotatorUser='$annUser'; |
---|
55 | var permissionUser='$permUser';"></script> |
---|
56 | |
---|
57 | <script type="text/javascript"> |
---|
58 | // <!-- |
---|
59 | $(document).ready(function() { |
---|
60 | // annotator |
---|
61 | |
---|
62 | |
---|
63 | jQuery.i18n.load(i18n_dict); |
---|
64 | var elem = $('div.pageContent').get(0); |
---|
65 | var uri = annotatorPageUrl; |
---|
66 | var devAnnotator = new Annotator(elem).addPlugin('Auth', { |
---|
67 | tokenUrl : 'template/token?user='+annotatorUser |
---|
68 | }).addPlugin('Permissions', { |
---|
69 | permissions: { |
---|
70 | 'read': [], |
---|
71 | 'update': [permissionUser], |
---|
72 | 'delete': [permissionUser], |
---|
73 | 'admin': [permissionUser] |
---|
74 | }, |
---|
75 | user : permissionUser, |
---|
76 | userString : function(user) { |
---|
77 | if (user && user.name) { |
---|
78 | return user.name; |
---|
79 | } |
---|
80 | return user; |
---|
81 | }, |
---|
82 | userId : function(user) { |
---|
83 | if (user && user.id) { |
---|
84 | return user.id; |
---|
85 | } |
---|
86 | return user; |
---|
87 | } |
---|
88 | }).addPlugin('Store', { |
---|
89 | prefix: annotatorServerUrl+'/annotator', |
---|
90 | annotationData : { |
---|
91 | 'uri' : uri, |
---|
92 | 'resource' : annotatorResourceUrl |
---|
93 | }, |
---|
94 | loadFromSearch : { |
---|
95 | 'limit' : 20, |
---|
96 | 'uri' : uri |
---|
97 | } |
---|
98 | }).addPlugin('Tags').addPlugin('Markdown').addPlugin('AnnotatorViewer'); |
---|
99 | |
---|
100 | $('#anotacions-uoc-panel').slimscroll({height: '100%'}); |
---|
101 | }); |
---|
102 | // --> |
---|
103 | </script> |
---|
104 | |
---|
105 | </metal:block> |
---|
106 | </head> |
---|
107 | <body> |
---|
108 | <!-- right-side options --> |
---|
109 | <div class="col buttons"> |
---|
110 | <!-- LAYER DISPLAY OPTION --> |
---|
111 | <ul> |
---|
112 | <li metal:define-macro="layer_select_li"> |
---|
113 | <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator" |
---|
114 | tal:attributes="checked python:'annotator' in viewLayers" /> Annotator |
---|
115 | </li> |
---|
116 | </ul> |
---|
117 | </div> |
---|
118 | |
---|
119 | <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> |
---|
120 | <!-- BEGIN ANNOTATIONS --> |
---|
121 | <div class="options"> |
---|
122 | <h4>Annotator</h4> |
---|
123 | <p> |
---|
124 | User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>. |
---|
125 | </p> |
---|
126 | <!-- TODO: login button --> |
---|
127 | <form class="autosubmit" tal:attributes="action viewerUrl"> |
---|
128 | <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params" |
---|
129 | tal:attributes="name param; value python:params[param]" /> |
---|
130 | <p> |
---|
131 | In group |
---|
132 | <select class="autosubmit" name="annotator_group"> |
---|
133 | <option value="" tal:attributes="selected not:annGroup;"> </option> |
---|
134 | <option |
---|
135 | tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)" |
---|
136 | tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" /> |
---|
137 | </select> <br /> |
---|
138 | <input type="submit" value="Go!" /> |
---|
139 | </p> |
---|
140 | </form> |
---|
141 | <p tal:define="std modules/Products.PythonScripts.standard"> |
---|
142 | <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">Log in</a> |
---|
143 | </p> |
---|
144 | </div> |
---|
145 | <!-- END ANNOTATIONS --> |
---|
146 | </metal:block> |
---|
147 | |
---|
148 | </body> |
---|
149 | |
---|
150 | </html> |
---|