annot-server/static/js/app.js
changeset 159 f2e4641681f6
parent 116 61d4a6610ba4
equal deleted inserted replaced
158:c7e0e3212b4c 159:f2e4641681f6
    29         })
    29         })
    30         .controller('homeCtrl', function($scope, $location, dataModel, context, $interval){
    30         .controller('homeCtrl', function($scope, $location, dataModel, context, $interval){
    31 
    31 
    32             function getURLParameter(name) {
    32             function getURLParameter(name) {
    33                 return decodeURI(
    33                 return decodeURI(
    34                     (new RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[,null])[1]
    34                     (new RegExp(name + '=' + '(.+?)(&|$)').exec(location.search)||[null,])[1]
    35                 );
    35                 );
    36             }
    36             }
    37 
    37 
    38             function colorToHex(c) {
    38             function colorToHex(c) {
    39                 var m = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(c);
    39                 var m = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(c);
   212                     }
   212                     }
   213 
   213 
   214 
   214 
   215                     var new_annot = {
   215                     var new_annot = {
   216                             category: {code: code, label: label},
   216                             category: {code: code, label: label},
       
   217                             keyword: freeLabel,
   217                             text: freetext,
   218                             text: freetext,
   218                             color: hexc,
   219                             color: hexc,
   219                             user : $scope.username
   220                             user : $scope.username
   220                     };
   221                     };
   221                     sock.send(JSON.stringify(new_annot));
   222                     sock.send(JSON.stringify(new_annot));