Changeset 2780
- Timestamp:
- 04/05/13 14:30:13 (11 years ago)
- Location:
- DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js
r2769 r2780 1 var annotation Service= (function() {1 var annotationProxy = (function() { 2 2 return { 3 getAnnotations: function(url, callback) { 3 getAnnotations: function(url) { 4 this.log('getAnnotations for: '+url); 5 annotationFramework.getAnnotations({url:url}, function(){}); 4 6 5 7 }, 6 8 putAnnotation: function(annotation) { 7 9 var a = om_object2annotation(annotation); 10 this.log('putAnnotation : '+a); 11 }, 12 updateAnnotation: function(annotation) { 13 this.log('updateAnnotation : '+JSON.stringify(annotation)); 14 }, 15 log: function(message){ 16 //log this to the local proxy 17 $.ajax({ 18 type: "POST", 19 url: 'http://localhost/annotations/annotator-service/test/proxy.php', 20 data: {log:'true',message:message} 21 }); 8 22 } 9 23 } -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js
r2716 r2780 36 36 37 37 function om_object2annotation(om_object){ 38 var annotation = {}; 38 var note = om_object.oid_property.match(/<NOTE>(.+?)<\/NOTE>/)[1]; 39 var d = new Date(om_object.oid_date); 39 40 41 var annotation = '<?xml version="1.0"?>\n\ 42 <annotation xmlns="http://dasish.eu/ns/addit" timeStamp="'+d.toISOString()+'">\n\ 43 <body type="Note">'+note+'</body>\n\ 44 </annotation>'; 40 45 return annotation; 41 }42 43 function annotation2xml(annotation){44 45 46 } 46 47 … … 56 57 } 57 58 59 function createXpointer(url, bgn_dom, end_dom){ 60 61 } 58 62 59 60 63 if (!Date.prototype.toISOString) { 64 Date.prototype.toISOString = function() { 65 function pad(n) { return n < 10 ? '0' + n : n } 66 return this.getUTCFullYear() + '-' 67 + pad(this.getUTCMonth() + 1) + '-' 68 + pad(this.getUTCDate()) + 'T' 69 + pad(this.getUTCHours()) + ':' 70 + pad(this.getUTCMinutes()) + ':' 71 + pad(this.getUTCSeconds()) + 'Z'; 72 }; 73 } 61 74 62 75 /* -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/test/proxy.php
r2716 r2780 8 8 } 9 9 } 10 11 if($_REQUEST['log']){ 12 file_put_contents('log.txt', date("c")."\t".$_REQUEST['message']."\n", FILE_APPEND); 13 } 10 14 11 15 $response = file_get_contents($_GET['url'].'?'.$params); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/markingcollection.js
r2769 r2780 327 327 }, 328 328 onLocationChange : function(webProgress, aRequest, aURI){ 329 //alert('get all from this url: '+webProgress.DOMWindow.document.URL);329 annotationProxy.getAnnotations(webProgress.DOMWindow.document.URL);//Get alla remote annotations 330 330 if(webProgress.isLoadingDocument) return; 331 331 bitsMarkingCollection.marking(webProgress.DOMWindow.document); -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/objectmng.js
r2769 r2780 3626 3626 var aSql2 = "insert into om_object ("+ columns.join(",") +") values ("+ values.join(",") +")"; 3627 3627 //alert("INSERT "+aObject.note); 3628 3629 annotationProxy.putAnnotation(aObject); 3628 3630 sqlArr.push(aSql1); 3629 3631 sqlArr.push(aSql2); … … 4928 4930 var aSql = 'update om_object set '+ values.join(",") +' where oid="'+ aObject.oid +'"'; 4929 4931 //alert("UPDATE oid: "+aObject.oid); 4932 annotationProxy.updateAnnotation(aObject); 4930 4933 rtn = this.cmdB(aMode,aSql,para); 4931 4934 } -
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/overlay.xul
r2769 r2780 48 48 <script type="application/x-javascript" src="chrome://markingcollection/content/annotator-service/lib/jquery.xml2json.js"/> 49 49 <script type="application/x-javascript" src="chrome://markingcollection/content/annotator-service/annotation-service.js"/> 50 <script type="application/x-javascript" src="chrome://markingcollection/content/annotator-service/annotations.wired.marker.js"/> 51 <script type="application/x-javascript" src="chrome://markingcollection/content/annotator-service/conversion.utils.js"/> 50 52 <!-- end --> 51 53 <script type="application/x-javascript">
Note: See TracChangeset
for help on using the changeset viewer.