Mercurial > hg > documentViewer
annotate zpt/layer_text_annotator.zpt @ 549:7bff5a6b0be5
enabled Annotator Tags plugin.
author | casties |
---|---|
date | Tue, 04 Sep 2012 20:05:19 +0200 |
parents | 7c6fdc31bd35 |
children | a35ec08c782d |
rev | line source |
---|---|
525 | 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> | |
526 | 5 <metal:block metal:define-macro="html_head" tal:condition="python:'annotator' in viewLayers"> |
525 | 6 <!-- annotator --> |
7 <link rel="stylesheet" type="text/css" | |
8 tal:attributes="href string:$rootUrl/template/annotator_files/css/annotator.css" /> | |
9 | |
10 <script | |
11 tal:attributes="src string:$rootUrl/template/annotator_files/lib/vendor/json2.js"></script> | |
12 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/extensions.js"></script> | |
13 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/console.js"></script> | |
14 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/class.js"></script> | |
15 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/range.js"></script> | |
16 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/annotator.js"></script> | |
17 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/widget.js"></script> | |
18 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/editor.js"></script> | |
19 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/viewer.js"></script> | |
20 <script | |
21 tal:attributes="src string:$rootUrl/template/annotator_files/lib/notification.js"></script> | |
22 <script | |
23 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/store.js"></script> | |
24 <script | |
25 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/permissions.js"></script> | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
26 <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/annotateitpermissions.js"></script> --> |
525 | 27 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/auth.js"></script> |
549 | 28 <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/tags.js"></script> |
525 | 29 <script |
30 tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/unsupported.js"></script> | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
31 <!-- <script tal:attributes="src string:$rootUrl/template/annotator_files/lib/plugin/filter.js"></script> --> |
528 | 32 |
33 <script type="text/javascript" | |
547
7c6fdc31bd35
use normalized uri (e.g. http://echo.mpiwg-berlin.mpg.de/documents/permanent/library/163127KK?pn=9)
casties
parents:
546
diff
changeset
|
34 tal:define="annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']); |
546 | 35 global annUser python:here.getAuthenticatedUser(anon='anonymous'); |
36 global annGroup python:request.get('annotator_group', None); | |
37 permUser python:test(annGroup, 'group:%s'%annGroup, annUser);" | |
38 tal:content="structure string:var annotatorPageUrl='$annUrl'; var annotatorUser='$annUser'; var permissionUser='$permUser';"></script> | |
525 | 39 |
40 <script type="text/javascript"> | |
41 // <!-- | |
42 $(document).ready(function() { | |
43 // annotator | |
44 var elem = $('div.pageContent').get(0); | |
528 | 45 var uri = annotatorPageUrl; |
525 | 46 var devAnnotator = new Annotator(elem).addPlugin('Auth', { |
528 | 47 tokenUrl : 'template/token?user='+annotatorUser |
525 | 48 }).addPlugin('Permissions', { |
546 | 49 user : permissionUser, |
525 | 50 userString : function(user) { |
51 if (user && user.name) { | |
52 return user.name; | |
53 } | |
54 return user; | |
55 }, | |
56 userId : function(user) { | |
57 if (user && user.id) { | |
58 return user.id; | |
59 } | |
60 return user; | |
61 } | |
62 }).addPlugin('Store', { | |
549 | 63 prefix: 'http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager/annotator', |
64 //prefix: 'http://r583-1.mpiwg-berlin.mpg.de:18080/AnnotationManager/annotator', | |
525 | 65 annotationData : { |
66 'uri' : uri | |
67 }, | |
68 loadFromSearch : { | |
69 'limit' : 20, | |
70 'uri' : uri | |
71 } | |
549 | 72 }).addPlugin('Tags' |
73 ); | |
525 | 74 }); |
75 // --> | |
76 </script> | |
77 | |
78 </metal:block> | |
79 </head> | |
80 <body> | |
81 <!-- right-side options --> | |
82 <div class="col buttons"> | |
83 <!-- LAYER DISPLAY OPTION --> | |
84 <ul> | |
85 <li metal:define-macro="layer_select_li"> | |
86 <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator" | |
87 tal:attributes="checked python:'annotator' in viewLayers" /> Annotations | |
88 </li> | |
89 </ul> | |
90 </div> | |
91 | |
526 | 92 <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> |
525 | 93 <!-- BEGIN ANNOTATIONS --> |
546 | 94 <div class="options"> |
525 | 95 <h4>Annotations</h4> |
546 | 96 <p> |
97 User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>. | |
98 </p> | |
99 <!-- TODO: login button --> | |
100 <form class="autosubmit" tal:attributes="action viewerUrl"> | |
101 <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params" | |
102 tal:attributes="name param; value python:params[param]" /> | |
103 <p> | |
104 In group | |
105 <select class="autosubmit" name="annotator_group"> | |
106 <option value="" tal:attributes="selected not:annGroup;"> </option> | |
107 <option | |
108 tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl='http://localhost:18080/AnnotationManager')" | |
109 tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" /> | |
110 </select> <br /> | |
111 <input type="submit" value="Go!" /> | |
112 </p> | |
113 </form> | |
549 | 114 <p tal:define="std modules/Products.PythonScripts.standard"> |
115 <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log in</a> | |
116 <a class="button" tal:attributes="href python:'%s/login/logout?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log out</a> | |
117 </p> | |
525 | 118 </div> |
119 <!-- END ANNOTATIONS --> | |
120 </metal:block> | |
121 | |
122 </body> | |
123 | |
124 </html> |