Changeset 2812
- Timestamp:
- 04/12/13 15:21:24 (11 years ago)
- Location:
- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotation-service.js
r2716 r2812 14 14 $xml.find('annotation').each(function(){ 15 15 var annotation = $.xml2json(this); 16 annotation.type = $(this).find('body').attr('type');17 annotation.URI = unescape(annotation.URI);16 //annotation.type = $(this).find('body').attr('type'); 17 //annotation.URI = unescape(annotation.URI); 18 18 annotations.push(annotation); 19 19 }); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
r2780 r2812 3 3 getAnnotations: function(url) { 4 4 this.log('getAnnotations for: '+url); 5 annotationFramework.getAnnotations({url:url}, function(){}); 5 annotationFramework.getAnnotations({url:url}, function(annotations){ 6 this.log('annotations from backend: '+JSON.stringify(annotations)); 7 }); 6 8 7 9 }, -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js
r2781 r2812 21 21 }; 22 22 23 //start xpath in xpointer: (?<=start-point\(string-range\()(.*\n?)(?=\,'') 24 //end xpath in xpointer: (?<=range-to\(string-range\()(.*\n?)(?=\,'') 25 26 23 27 om_object.oid = hashCode(annotation['xml:id']); 24 28 console.log(annotation.targetSources.targetSource); … … 35 39 } 36 40 41 /** 42 * converts wired marker annotations to dassish annotations 43 * @param {object} om_object contains wired marker object for annotation 44 * @returns {String} annotation in xml 45 */ 37 46 function om_object2annotation(om_object){ 38 47 var note = om_object.oid_property.match(/<NOTE>(.+?)<\/NOTE>/)[1]; 39 var d= new Date(om_object.oid_date);48 var timestamp = new Date(om_object.oid_date); 40 49 41 50 var path = {}; … … 57 66 58 67 var annotation = '<?xml version="1.0"?>\n\ 59 <annotation xmlns="http://dasish.eu/ns/addit" timeStamp="'+ d.toISOString()+'">\n\68 <annotation xmlns="http://dasish.eu/ns/addit" timeStamp="'+timestamp.toISOString()+'">\n\ 60 69 <targetSources>\n\ 61 70 <targetSource xml:id="" source="'+om_object.doc_url+xpointer+'"/>\n\ … … 75 84 } 76 85 return hash; 77 }78 79 function createXpointer(url, bgn_dom, end_dom){80 81 86 } 82 87
Note: See TracChangeset
for help on using the changeset viewer.