src/js/widgets/createAnnotationWidget.js
branchpopcorn-port
changeset 651 c43441822b1b
parent 645 0c8ca890c9f1
child 678 45385e19022a
--- a/src/js/widgets/createAnnotationWidget.js	Tue Jan 17 16:00:42 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js	Tue Jan 17 16:04:53 2012 +0100
@@ -196,16 +196,17 @@
   this.selector.find(".Ldt-createAnnotation-waitScreen").show();  
 };
 
-IriSP.createAnnotationWidget.prototype.showEndScreen = function() {
+IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
   this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
   
   if (this.cinecast_version) {
     this.selector.find(".Ldt-createAnnotation-Title").parent().show();      
   }
 
-  var twStatus = IriSP.mkTweetUrl(document.location.href);
-  var gpStatus = IriSP.mkGplusUrl(document.location.href);
-  var fbStatus = IriSP.mkFbUrl(document.location.href);
+  var url = document.location.href + "id=" + annotation.id;
+  var twStatus = IriSP.mkTweetUrl(url);
+  var gpStatus = IriSP.mkGplusUrl(url);
+  var fbStatus = IriSP.mkFbUrl(url);
   
   this.selector.find(".Ldt-createAnnotation-endScreen-TweetLink").attr("href", twStatus);
   this.selector.find(".Ldt-createAnnotation-endScreen-FbLink").attr("href", fbStatus);
@@ -315,7 +316,7 @@
                       /* set up a basic view */
                       var tmp_view = {"dc:contributor": "perso", "dc:creator": "perso", "dc:title": "Contributions",
                                       "id": json.annotations[0].type}
-                      console.log(tmp_view);
+
                       this._serializer._data["annotation-types"].push(tmp_view);
                     }
                     
@@ -330,9 +331,9 @@
                     
                     // everything is shared so there's no need to propagate the change
                     _this._serializer._data.annotations.push(annotation);
-                    console.log(_this._serializer._data);
+ 
                     _this._Popcorn.trigger("IriSP.createAnnotationWidget.addedAnnotation", annotation);
-                    callback();
+                    callback(annotation);
       }), 
       error: 
               function(jqXHR, textStatus, errorThrown) {