Mercurial > hg > documentViewer
annotate zpt/layer_text_annotator.zpt @ 571:f1906951be2a
nicer batching of tocs
author | casties |
---|---|
date | Fri, 12 Oct 2012 17:02:40 +0200 |
parents | abcb67f5cab4 |
children | 6000c7e24d8a |
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" | |
557 | 34 tal:define="global annServerUrl string:http://tuxserve03.mpiwg-berlin.mpg.de/AnnotationManager; |
35 annUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s?pn=%s'%(docinfo['documentPath'],pageinfo['pn']); | |
36 resUrl python:'http://echo.mpiwg-berlin.mpg.de/documents%s'%(docinfo['documentPath']); | |
555 | 37 global annUser python:here.getAuthenticatedUser(anon='anonymous'); |
38 global annGroup python:request.get('annotator_group', None); | |
39 permUser python:test(annGroup, 'group:%s'%annGroup, annUser);" | |
557 | 40 tal:content="structure string: |
41 var annotatorServerUrl='$annServerUrl'; | |
42 var annotatorPageUrl='$annUrl'; | |
43 var annotatorResourceUrl='$resUrl'; | |
44 var annotatorUser='$annUser'; | |
45 var permissionUser='$permUser';"></script> | |
525 | 46 |
47 <script type="text/javascript"> | |
48 // <!-- | |
49 $(document).ready(function() { | |
50 // annotator | |
51 var elem = $('div.pageContent').get(0); | |
528 | 52 var uri = annotatorPageUrl; |
525 | 53 var devAnnotator = new Annotator(elem).addPlugin('Auth', { |
528 | 54 tokenUrl : 'template/token?user='+annotatorUser |
525 | 55 }).addPlugin('Permissions', { |
550 | 56 permissions: { |
57 'read': [], | |
58 'update': [permissionUser], | |
59 'delete': [permissionUser], | |
60 'admin': [permissionUser] | |
61 }, | |
546 | 62 user : permissionUser, |
525 | 63 userString : function(user) { |
64 if (user && user.name) { | |
65 return user.name; | |
66 } | |
67 return user; | |
68 }, | |
69 userId : function(user) { | |
70 if (user && user.id) { | |
71 return user.id; | |
72 } | |
73 return user; | |
74 } | |
75 }).addPlugin('Store', { | |
557 | 76 prefix: annotatorServerUrl+'/annotator', |
525 | 77 annotationData : { |
555 | 78 'uri' : uri, |
79 'resource' : annotatorResourceUrl | |
525 | 80 }, |
81 loadFromSearch : { | |
82 'limit' : 20, | |
83 'uri' : uri | |
84 } | |
549 | 85 }).addPlugin('Tags' |
86 ); | |
525 | 87 }); |
88 // --> | |
89 </script> | |
90 | |
91 </metal:block> | |
92 </head> | |
93 <body> | |
94 <!-- right-side options --> | |
95 <div class="col buttons"> | |
96 <!-- LAYER DISPLAY OPTION --> | |
97 <ul> | |
98 <li metal:define-macro="layer_select_li"> | |
99 <input type="checkbox" class="autosubmit" name="viewLayer" value="annotator" | |
552 | 100 tal:attributes="checked python:'annotator' in viewLayers" /> Annotator |
525 | 101 </li> |
102 </ul> | |
103 </div> | |
104 | |
526 | 105 <metal:block metal:define-macro="options_box" tal:condition="python:'annotator' in viewLayers"> |
525 | 106 <!-- BEGIN ANNOTATIONS --> |
546 | 107 <div class="options"> |
552 | 108 <h4>Annotator</h4> |
546 | 109 <p> |
110 User "<span tal:replace="annUser" />"<span tal:condition="annGroup" tal:content="string: ($annGroup)"/>. | |
111 </p> | |
112 <!-- TODO: login button --> | |
113 <form class="autosubmit" tal:attributes="action viewerUrl"> | |
114 <input type="hidden" tal:define="params python:here.getParams(params={'annotator_group':None});" tal:repeat="param params" | |
115 tal:attributes="name param; value python:params[param]" /> | |
116 <p> | |
117 In group | |
118 <select class="autosubmit" name="annotator_group"> | |
119 <option value="" tal:attributes="selected not:annGroup;"> </option> | |
120 <option | |
557 | 121 tal:repeat="group python:here.getAnnotatorGroupsForUser(user=annUser,annotationServerUrl=annServerUrl)" |
546 | 122 tal:attributes="value group/id; selected python:group['id']==annGroup;" tal:content="group/name" /> |
123 </select> <br /> | |
124 <input type="submit" value="Go!" /> | |
125 </p> | |
126 </form> | |
549 | 127 <p tal:define="std modules/Products.PythonScripts.standard"> |
128 <a class="button" tal:attributes="href python:'%s/login/login?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log in</a> | |
550 | 129 <!-- <a class="button" tal:attributes="href python:'%s/login/logout?came_from=%s'%(viewerUrl,std.url_quote(here.getLink()))">log out</a> --> |
549 | 130 </p> |
525 | 131 </div> |
132 <!-- END ANNOTATIONS --> | |
133 </metal:block> | |
134 | |
135 </body> | |
136 | |
137 </html> |