Changeset 4667


Ignore:
Timestamp:
03/11/14 15:31:21 (10 years ago)
Author:
olof
Message:

some cleanup of log-functions

Location:
DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service
Files:
2 edited

Legend:

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

    r4547 r4667  
    2929                beforeSend: function(xhr){xhr.setRequestHeader('Content-Type', 'application/xml');},
    3030                success: function(xml, textStatus, jqXHR) {
    31                                    
    32                    
    3331                    var annotations = Array();
    3432                   
     
    4038                        annotationProxy.log(this.getAttribute('ref'));
    4139                       
    42                        
    4340                        annotations.push(this.getAttribute('ref'));
    4441                    });
    4542                   
    46 
    4743                    callback.call(undefined, annotations);
    4844                },
    4945                error: function(result){
    5046                    annotationProxy.log('ERROR calling the annotation backend '+result);
    51                     Firebug.Console.log(result);
    5247                }
    5348            });
     
    7469        },
    7570        deleteAnnotationByOid: function(oid) {
    76             Firebug.Console.log('entering DELETE for oid: '+oid);
     71            annotationProxy.log('entering DELETE for oid: '+oid);
    7772            var aid;
    7873            var aSql = 'select dasish_aid from om_object where oid="' + oid + '"';
     
    8782                    error: function(jqXHR, status, thrownError) {
    8883                        // Handle any errors
    89                         if (typeof Firebug !== 'undefined' && Firebug.Console) {
    90                             Firebug.Console.log("+ + + + + + + + + + + + + + + + + + + + + + + +");
    91                             Firebug.Console.log("Status Code (DELETE request): " + jqXHR.status);
    92                             Firebug.Console.log("Error DELETE request: " + thrownError);
    93                         }
     84
     85                        annotationProxy.log("+ + + + + + + + + + + + + + + + + + + + + + + +");
     86                        annotationProxy.log("Status Code (DELETE request): " + jqXHR.status);
     87                        annotationProxy.log("Error DELETE request: " + thrownError);
    9488                    },
    9589                    success: function(result) {
    96                         if (typeof Firebug !== 'undefined' && Firebug.Console) {
    97                             Firebug.Console.log("DELETE request was successful.");
    98                             Firebug.Console.log(result);
    99                         }
     90                       
     91                            annotationProxy.log("DELETE request was successful.");
     92                            annotationProxy.log(result);
    10093                    }
    10194                });
     
    135128                    // insert request to local sqlite database where aid gets inserted
    136129                    var rtn = bitsObjectMng.Database.cmd("", aSql); // aMode = "" defaults to predefined value; aSql contains sql statement
    137                     Firebug.Console.log('UPDATE of AID done');
    138                     Firebug.Console.log(rtn);
     130                    annotationProxy.log('UPDATE of AID done');
     131                    annotationProxy.log(rtn);
    139132                    // Database insert request is true if successful
    140133                    // Firebug.Console.log(rtn);
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/annotator-service/conversion.utils.js

    r4555 r4667  
    11/***
    2  *
     2 * Convert an DWAN XML annotation to a WiredMarker annotation object
    33 * @param {object} annotation annotation object from webservice
    44 * @returns {annotationToOmObject.om_object} an object for Wired Marker
     
    3939    om_object.dasish_aid = URI.split('/annotations/')[1];
    4040
     41    //get xpointer from url
    4142    var urlParts = link.split("#xpointer");
    4243
     
    8586
    8687/**
    87  * converts wired marker annotations to dassish annotations
     88 * Converts WiredMarker annotation object to DWAN XML annotation
    8889 * @param {object} om_object contains wired marker object for annotation
    8990 * @returns {String} annotation in xml
     
    113114    path.endType = RegExp.$3;
    114115
    115     var xpointer = '';
    116 
    117     xpointer += "#xpointer(start-point(string-range(" + path.start + "/text()[1],''," + path.startOffset + "))";
    118     xpointer += "/range-to(string-range(" + path.end + "/text()[1],''," + path.endOffset + ")))";
     116    var xpointer = "#xpointer(start-point(string-range(" + path.start + "/text()[1],''," + path.startOffset + "))";
     117    xpointer    += "/range-to(string-range(" + path.end + "/text()[1],''," + path.endOffset + ")))";
    119118
    120119    var annotation = '<?xml version="1.0" encoding="UTF-8"?>\n\
     
    173172    };
    174173}
    175 
    176 /*
    177  From SQL-lite for wired-marker
    178  <PROPERTY>
    179  <HYPER_ANCHOR>http://localhost/annotation/test/test-service.html#hyperanchor1.3%3A%2Fhtml%5B1%5D%2Fbody%5B1%5D%2Fdiv%5B2%5D%2Fp%5B1%5D(0)(3)(Ane)%26%2Fhtml%5B1%5D%2Fbody%5B1%5D%2Fdiv%5B2%5D%2Fp%5B1%5D(45)(3)(ter)%26background-color%3A%20rgb(%2044%2C%20254%2C%20%2081)%3Bcolor%3Argb(0%2C0%2C0)%3B</HYPER_ANCHOR>
    180  <NOTE>text om en fï¿œrfattare</NOTE>
    181  </PROPERTY>
    182  unescaped: http://localhost/annotation/test/test-service.html#hyperanchor1.3:/html[1]/body[1]/div[2]/p[1](0)(3)(Ane)&/html[1]/body[1]/div[2]/p[1](45)(3)(ter)&background-color: rgb( 44, 254, 81);color:rgb(0,0,0);text om en fï¿œrfattare
    183  */
Note: See TracChangeset for help on using the changeset viewer.