src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 759 4dc3240f2c56
parent 722 ed12570ebd64
child 762 5497895a3ddb
equal deleted inserted replaced
758:7fdb2d92da58 759:4dc3240f2c56
   133           continue;
   133           continue;
   134       }
   134       }
   135       
   135       
   136       code = {start: annotation.begin / 1000, end: annotation.end / 1000,
   136       code = {start: annotation.begin / 1000, end: annotation.end / 1000,
   137               onStart: function(annotation) { return function() {
   137               onStart: function(annotation) { return function() {
   138                       console.log("runned ?", annotation);
       
   139                       if (typeof(annotation.content) !== "undefined")
   138                       if (typeof(annotation.content) !== "undefined")
   140                         _this.selector.find(".Ldt-createAnnotation-Title").html(annotation.content.title);
   139                         _this.selector.find(".Ldt-createAnnotation-Title").html(annotation.content.title);
   141 
   140 
   142                       _this._currentAnnotation = annotation;
   141                       _this._currentAnnotation = annotation;
   143                       var beginTime = IriSP.msToTime(annotation.begin);
   142                       var beginTime = IriSP.msToTime(annotation.begin);
   364   annotation["type_title"] = "Contributions";
   363   annotation["type_title"] = "Contributions";
   365   annotation.content = {};
   364   annotation.content = {};
   366   annotation.content["data"] = contents;
   365   annotation.content["data"] = contents;
   367   
   366   
   368   var meta = apiJson["meta"];
   367   var meta = apiJson["meta"];
   369   meta.creator = "An User";    
   368   if (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.name))
       
   369     meta.creator = IriSP.user.name;    
       
   370   else 
       
   371     meta.creator = "An User";
       
   372   
   370   meta.created = Date().toString();
   373   meta.created = Date().toString();
   371   
   374   
   372   annotation["tags"] = [];
   375   annotation["tags"] = [];
   373   
   376   
   374   for (var i = 0; i < this.keywords.length; i++) {
   377   for (var i = 0; i < this.keywords.length; i++) {