Mercurial > hg > digilib-old
comparison webapp/src/main/webapp/jquery/jquery.digilib.annotations.js @ 1105:ccdac39eb3da
use preliminary username for annotations (we should use the annotation returned by the server).
author | robcast |
---|---|
date | Fri, 26 Oct 2012 17:55:13 +0200 |
parents | 34f893492adb |
children | 121d3aadfa1e |
comparison
equal
deleted
inserted
replaced
1104:415da4e4b76b | 1105:ccdac39eb3da |
---|---|
92 setAnnotationMark : function (data, mpos, text) { | 92 setAnnotationMark : function (data, mpos, text) { |
93 if (mpos == null) { | 93 if (mpos == null) { |
94 // interactive | 94 // interactive |
95 setAnnotationMark(data); | 95 setAnnotationMark(data); |
96 } else { | 96 } else { |
97 // use position and text | 97 // use position and text (and user-id) |
98 var annotation = newAnnotation(data, mpos, text); | 98 var annotation = newAnnotation(data, mpos, text, null, null, data.settings.annotationUser); |
99 storeAnnotation(data, annotation); | 99 storeAnnotation(data, annotation); |
100 // TODO: replace with annotation returned by server | |
100 data.annotations.push(annotation); | 101 data.annotations.push(annotation); |
101 digilib.fn.redisplay(data); | 102 digilib.fn.redisplay(data); |
102 } | 103 } |
103 }, | 104 }, |
104 }; | 105 }; |
144 var mpos = geom.position(evt); | 145 var mpos = geom.position(evt); |
145 var pos = data.imgTrafo.invtransform(mpos); | 146 var pos = data.imgTrafo.invtransform(mpos); |
146 // Annotation text entered in JS-prompt | 147 // Annotation text entered in JS-prompt |
147 var text = window.prompt("Annotation text:"); | 148 var text = window.prompt("Annotation text:"); |
148 if (text == null) return false; | 149 if (text == null) return false; |
149 var annotation = newAnnotation(data, pos, text); | 150 var annotation = newAnnotation(data, pos, text, null, null, data.settings.annotationUser); |
150 storeAnnotation(data, annotation); | 151 storeAnnotation(data, annotation); |
151 data.annotations.push(annotation); | 152 data.annotations.push(annotation); |
152 digilib.fn.redisplay(data); | 153 digilib.fn.redisplay(data); |
153 return false; | 154 return false; |
154 }); | 155 }); |