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