fixed update bug.
--- a/src/js/widgets/createAnnotationWidget.js Mon Jan 16 17:27:23 2012 +0100
+++ b/src/js/widgets/createAnnotationWidget.js Tue Jan 17 11:00:33 2012 +0100
@@ -271,10 +271,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"] = "";
--- a/src/js/widgets/sparklineWidget.js Mon Jan 16 17:27:23 2012 +0100
+++ b/src/js/widgets/sparklineWidget.js Tue Jan 17 11:00:33 2012 +0100
@@ -101,7 +101,7 @@
IriSP.SparklineWidget.prototype.handleNewAnnotation = function(annotation) {
var num_columns = (this.selector.width()) / IriSP.widgetsDefaults["SparklineWidget"].column_width;
var duration = +this._serializer.currentMedia().meta["dc:duration"];
- var time_step = duration / num_columns; /* the time interval between two columns */
+ var time_step = Math.round(duration / num_columns); /* the time interval between two columns */
var begin = +annotation.begin;
var index = Math.floor(begin / time_step);