send the correct username if the user is loggedin on the platform. popcorn-port
authorhamidouk
Thu, 02 Feb 2012 10:34:50 +0100
branchpopcorn-port
changeset 759 4dc3240f2c56
parent 758 7fdb2d92da58
child 760 3460bee362db
send the correct username if the user is loggedin on the platform.
src/js/widgets/createAnnotationWidget.js
--- a/src/js/widgets/createAnnotationWidget.js	Wed Feb 01 14:19:32 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js	Thu Feb 02 10:34:50 2012 +0100
@@ -135,7 +135,6 @@
       
       code = {start: annotation.begin / 1000, end: annotation.end / 1000,
               onStart: function(annotation) { return function() {
-                      console.log("runned ?", annotation);
                       if (typeof(annotation.content) !== "undefined")
                         _this.selector.find(".Ldt-createAnnotation-Title").html(annotation.content.title);
 
@@ -366,7 +365,11 @@
   annotation.content["data"] = contents;
   
   var meta = apiJson["meta"];
-  meta.creator = "An User";    
+  if (!IriSP.null_or_undefined(IriSP.user) && !IriSP.null_or_undefined(IriSP.user.name))
+    meta.creator = IriSP.user.name;    
+  else 
+    meta.creator = "An User";
+  
   meta.created = Date().toString();
   
   annotation["tags"] = [];