--- a/src/js/widgets/createAnnotationWidget.js Wed Jan 18 10:21:23 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Wed Jan 18 10:21: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);
@@ -271,10 +272,10 @@
}
} else {
var duration = +this._serializer.currentMedia().meta["dc:duration"];
- annotation["begin"] = +((duration * (this.sliceLeft / this.selector.width())).toFixed(0));
- annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / this.selector.width())).toFixed(0));
+ annotation["begin"] = +((duration * (this.sliceLeft / 100)).toFixed(0));
+ annotation["end"] = +((duration * ((this.sliceWidth + this.sliceLeft) / 100)).toFixed(0));
}
-
+
annotation["type"] = this._serializer.getContributions();
if (typeof(annotation["type"]) === "undefined")
annotation["type"] = "";
@@ -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) {