Changeset 3576


Ignore:
Timestamp:
09/13/13 14:37:45 (11 years ago)
Author:
olof
Message:

added check for firebug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/annotations.wired.marker.js

    r3405 r3576  
    22    return {
    33        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             */
    2048        },
    2149        putAnnotation: function(om_object) {
    2250            var annotation = om_object2annotation(om_object);
    2351            annotationFramework.putAnnotation(annotation);
    24             this.log('putAnnotation : '+annotation);
     52            this.log('putAnnotation : ' + annotation);
    2553        },
    2654        updateAnnotation: function(annotation) {
    27             this.log('updateAnnotation : '+JSON.stringify(annotation));
     55            this.log('updateAnnotation : ' + JSON.stringify(annotation));
    2856        },
    29         log: function(message){
     57        log: function(message) {
    3058            //log to console
    31             Firebug.Console.log(message);
     59            if (window.console && window.console.firebug) {
     60                Firebug.Console.log(message);
     61            }
    3262            //log this to the local proxy
    3363            $.ajax({
    3464                type: "POST",
    3565                url: 'http://localhost/annotations/annotator-service/test/proxy.php',
    36                 data: {log:'true',message:message}
     66                data: {log: 'true', message: message}
    3767            });
    3868        }
Note: See TracChangeset for help on using the changeset viewer.