Changeset 3576
- Timestamp:
- 09/13/13 14:37:45 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
r3405 r3576 2 2 return { 3 3 getAnnotations: function(url) { 4 this.log('getAnnotations for: '+url); 5 annotationFramework.getAnnotations({link:url,access:read}, function(result){ 6 this.log('annotations from backend: '+annotations); 7 8 var annotations = $(result); 9 10 var aids = []; 11 12 annotations.find('annotations annotation').each(function() { 13 aids.push($(this).attr('ref').substr($(this).attr('ref').lastIndexOf('/') + 1)); 14 }); 15 //bitsObjectMng.Database.addObject 16 17 //loop trough annnotations and get each annotation 18 19 }); 4 annotationProxy.log('getAnnotations for: ' + url); 5 6 var tmp = { 7 oid: "193205378", 8 pdif: "4", 9 doc_title: "Background - Sagrada FamÃlia - Wikipedia, the free encyclopedia", 10 doc_url: "http://en.wikipedia.org/wiki/Sagrada_FamÃÂlia", 11 con_url: "http://en.wikipedia.org/wiki/Sagrada_FamÃÂlia", 12 bgn_dom: "//span[@id=\"Background\"]/text()[1](0)(3)", 13 end_dom: "//span[@id=\"Background\"]/text()[1](10)(3)", 14 oid_title: "http://localhost/annotation/test/test-service.html", 15 oid_property: "<PROPERTY><HYPER_ANCHOR>http://en.wikipedia.org/wiki/Sagrada_FamÃÂlia#hyperanchor1.3://span[@id=\"Background\"]/text()[1](0)(3)&//span[@id=\"Background\"]/text()[1](10)(3)&background-color:rgb(0,0,153);color:rgb(255,255,255);border: thick solid rgb(0, 0, 153);</HYPER_ANCHOR><NOTE>Some background information on Sagrada FamÃlia.</NOTE></PROPERTY>", 16 oid_mode: "0", 17 oid_type: "text", 18 oid_txt: "Some background information on Sagrada FamÃlia.", 19 oid_img: null, 20 oid_date: "8/8/2013 11:46:6", 21 pfid_order: 4 22 }; 23 24 25 //if (bitsObjectMng.Database.existsObject(tmp, undefined)) { 26 // this.log("annotationProxy annotation exists in the database"); 27 //} else { 28 // this.log("annotationProxy inserting annotation in the database"); 29 //bitsObjectMng.Database.addObject(tmp, undefined, undefined); 30 //} 31 /* 32 annotationFramework.getAnnotations({link: url, access: read}, function(result) { 33 var annotations = $(result); 34 35 annotations.find('annotation').each(function() { 36 var aid = $(this).attr('ref').substr($(this).attr('ref').lastIndexOf('/') + 1); 37 38 annotationFramework.getAnnotation(aid, function(annotation){ 39 annotation.find('annotation').each(function() { 40 var om_object = annotation2om_object(this); 41 42 //bitsObjectMng.Database.addObject 43 }); 44 }); 45 }); 46 }); 47 */ 20 48 }, 21 49 putAnnotation: function(om_object) { 22 50 var annotation = om_object2annotation(om_object); 23 51 annotationFramework.putAnnotation(annotation); 24 this.log('putAnnotation : ' +annotation);52 this.log('putAnnotation : ' + annotation); 25 53 }, 26 54 updateAnnotation: function(annotation) { 27 this.log('updateAnnotation : ' +JSON.stringify(annotation));55 this.log('updateAnnotation : ' + JSON.stringify(annotation)); 28 56 }, 29 log: function(message) {57 log: function(message) { 30 58 //log to console 31 Firebug.Console.log(message); 59 if (window.console && window.console.firebug) { 60 Firebug.Console.log(message); 61 } 32 62 //log this to the local proxy 33 63 $.ajax({ 34 64 type: "POST", 35 65 url: 'http://localhost/annotations/annotator-service/test/proxy.php', 36 data: {log: 'true',message:message}66 data: {log: 'true', message: message} 37 67 }); 38 68 }
Note: See TracChangeset
for help on using the changeset viewer.