Changeset 2812


Ignore:
Timestamp:
04/12/13 15:21:24 (11 years ago)
Author:
olof
Message:
 
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  
    1414                    $xml.find('annotation').each(function(){             
    1515                        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);
    1818                        annotations.push(annotation);
    1919                    });
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js

    r2780 r2812  
    33        getAnnotations: function(url) {
    44           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           });
    68           
    79        },
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js

    r2781 r2812  
    2121                    };
    2222   
     23    //start xpath in xpointer: (?<=start-point\(string-range\()(.*\n?)(?=\,'')
     24    //end xpath in xpointer: (?<=range-to\(string-range\()(.*\n?)(?=\,'')
     25   
     26   
    2327    om_object.oid = hashCode(annotation['xml:id']);
    2428    console.log(annotation.targetSources.targetSource);
     
    3539}
    3640
     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 */
    3746function om_object2annotation(om_object){
    3847    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);
    4049   
    4150    var path = {};
     
    5766   
    5867    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\
    6069                        <targetSources>\n\
    6170                            <targetSource xml:id="" source="'+om_object.doc_url+xpointer+'"/>\n\
     
    7584      }
    7685      return hash;
    77 }
    78 
    79 function createXpointer(url, bgn_dom, end_dom){
    80    
    8186}
    8287
Note: See TracChangeset for help on using the changeset viewer.