# HG changeset patch
# User hamidouk
# Date 1328281324 -3600
# Node ID 668a7f75b256be31c9d60ffc7831d9c45327f5c0
# Parent 7d6630fd287eb1f79d8bbddeeda93fc9b4687ba5
new player version
diff -r 7d6630fd287e -r 668a7f75b256 src/ldt/ldt/static/ldt/js/LdtPlayer-release.js
--- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Fri Feb 03 12:13:24 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Fri Feb 03 16:02:04 2012 +0100
@@ -1092,12 +1092,12 @@
IriSP.annotation_loading_template = "{{! template shown while the annotation widget is loading }}
{{^cinecast_version}}
{{/cinecast_version}}
{{^user_avatar}}

{{/user_avatar}} {{#user_avatar}}

{{/user_avatar}}
Add keywords :
{{#polemic_mode}}
Add polemic keywords
{{/polemic_mode}}

Please wait while your request is being processed...
An error happened while contacting the server. Your annotation has not been saved.
Thank you, your annotation has been saved.
Would you like to share it on social networks ?
";
+IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}
";
IriSP.createAnnotationWidget_festivalCinecast_template = "{{! template for the annotation creation widget specific for the cinecast festival}}
";
IriSP.createAnnotation_errorMessage_template = "
You must enter text to submit an annotation
";
IriSP.overlay_marker_template = "{{! the template for the small bars which is z-indexed over our segment widget }}
";
IriSP.player_template = "{{! template for the radio player }}
";
-IriSP.search_template = "{{! template for the search container }}
";
+IriSP.search_template = "{{! template for the search container }}
";
IriSP.share_template = "{{! social network sharing template }}
";
IriSP.sliceWidget_template = "{{! template for the slice widget }}
";
IriSP.sliderWidget_template = "{{! template for the slider widget - it's composed of two divs we one overlayed on top of the other }}
";
@@ -1920,6 +1920,12 @@
var pop;
var ret = layoutManager.createDiv();
var containerDiv = ret[0];
+ var spacerDiv = ret[1];
+
+ /* insert one pixel of margin between the video and the first widget, using the
+ spacer.
+ */
+ IriSP.jQuery("#" + spacerDiv).css("height", "1px");
switch(options.type) {
/*
@@ -2035,8 +2041,8 @@
for (index = 0; index < guiOptions.widgets.length; index++) {
var widgetConfig = guiOptions.widgets[index];
var widget = IriSP.instantiateWidget(popcornInstance, serialFactory, layoutManager, widgetConfig);
- ret_widgets.push(widget);
-
+
+ ret_widgets.push(widget);
};
return ret_widgets;
@@ -2731,6 +2737,7 @@
if (!this.cinecast_version)
this.selector.hide();
+ // add the keywords.
for (var i = 0; i < this.keywords.length; i++) {
var keyword = this.keywords[i];
var id = IriSP.guid("button_");
@@ -2950,7 +2957,7 @@
IriSP.createAnnotationWidget.prototype.showStartScreen = function() {
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
this.selector.find(".Ldt-createAnnotation-startScreen").show();
- this.selector.find("Ldt-createAnnotation-Description").val("Type your annotation here.");
+ this.selector.find(".Ldt-createAnnotation-Description").val("Type your annotation here.");
};
IriSP.createAnnotationWidget.prototype.showWaitScreen = function() {
@@ -2963,6 +2970,7 @@
this.selector.find(".Ldt-createAnnotation-errorScreen").show();
};
+/** update show the final screen with links to share the created annotation */
IriSP.createAnnotationWidget.prototype.showEndScreen = function(annotation) {
this.selector.find(".Ldt-createAnnotation-DoubleBorder").children().hide();
@@ -2993,7 +3001,7 @@
this.selector.find(".Ldt-createAnnotation-Container")
.after(IriSP.templToHTML(IriSP.createAnnotation_errorMessage_template));
textfield.css("background-color", "#d93c71");
- } else {
+ } else {
this.selector.find(".Ldt-createAnnotation-errorMessage").show();
}
@@ -3121,7 +3129,8 @@
error:
function(jqXHR, textStatus, errorThrown) {
console.log("an error occured while contacting "
- + url + " and sending " + jsonString + textStatus ); _this.showErrorScreen(); } });
+ + url + " and sending " + jsonString + textStatus );
+ _this.showErrorScreen(); } });
};IriSP.HelloWorldWidget = function(Popcorn, config, Serializer) {
IriSP.Widget.call(this, Popcorn, config, Serializer);
}
@@ -3878,7 +3887,7 @@
this.positionMarker = this.selector.children(":first");
this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.positionUpdater));
-
+
var i = 0;
@@ -3973,10 +3982,33 @@
self.TooltipWidget.hide();
});
+ // react to mediafragment messages.
+ this._Popcorn.listen("IriSP.Mediafragment.showAnnotation",
+ function(id, divTitle) {
+ return function(annotation_id) {
+ if (annotation_id !== id)
+ return;
+
+ var divObject = IriSP.jQuery("#" + id);
+ divObject.animate({opacity: 0.6}, 5);
+ var offset = divObject.offset();
+ var correction = divObject.outerWidth() / 2;
+
+ var offset_x = offset.left + correction - 106;
+ if (offset_x < 0)
+ offset_x = 0;
+
+ var offset_y = offset.top;
+
+ self.TooltipWidget.show(divTitle, color, offset_x, offset_y - 160);
+ IriSP.jQuery(document).one("mousemove", function() { divObject.animate({opacity: 0.3}, 5);
+ self.TooltipWidget.hide(); });
+ }; }(id, divTitle));
+
IriSP.jQuery("#" + id).click(function(_this, annotation) {
return function() { _this.clickHandler(annotation)};
}(this, annotation));
- }
+ }
};
/* restores the view after a search */
@@ -4033,6 +4065,10 @@
this.positionMarker.css("left", position + "%");
};
+
+IriSP.SegmentsWidget.prototype.showAnnotation = function() {
+
+};
/** A widget to create a new segment */
IriSP.SliceWidget = function(Popcorn, config, Serializer) {
IriSP.Widget.call(this, Popcorn, config, Serializer);
@@ -4056,14 +4092,27 @@
this.leftHandle = this.selector.find(".Ldt-sliceLeftHandle");
this.rightHandle = this.selector.find(".Ldt-sliceRightHandle");
+ var left = this.selector.offset().left;
+ var top = this.selector.offset().top;
+ console.log("width %d, offset : %d", this.selector.width(), this.selector.offset().left);
+ // contain the handles correctly - we cannot set
+ // containment: parent because it wouldn't allow to select the
+ // whole slice, so we have to compute a box in which the slice is
+ // allowed to move.
+ var containment = [left - 8, top, this.selector.width() + left, top];
+ console.log(containment);
+ //if (browser.
+ // var containment = [left - 16, top, this.selector.width() + left - 8, top];
this.leftHandle.draggable({axis: "x",
drag: IriSP.wrap(this, this.leftHandleDragged),
- containment: "parent"
+ containment: containment
});
+ containment = [left, top, this.selector.width() + left, top];
+ // containment = [left, top, this.selector.width() + left - 8, top];
this.rightHandle.draggable({axis: "x",
drag: IriSP.wrap(this, this.rightHandleDragged),
- containment: "parent"
+ containment: containment
});
this.leftHandle.css("position", "absolute");
@@ -4103,9 +4152,11 @@
is the handle being dragged
*/
- var currentX = this.leftHandle.position()["left"];
+ var currentX = this.leftHandle.offset().left;
var rightHandleX = Math.floor(this.rightHandle.position()["left"]);
+ var container_offset = this.selector.offset().left;
+
if (Math.floor(ui.position.left) >= rightHandleX - 7) {
/* prevent the handle from moving past the right handle */
ui.position.left = rightHandleX - 7;
@@ -4116,7 +4167,8 @@
this.sliceZone.css("width", this.zoneWidth);
this.sliceZone.css("left", this.zoneLeft + "px");
- this._leftHandleOldLeft = Math.floor(this._leftHandleOldLeft);
+
+ this._leftHandleOldLeft = ui.position.left;
this.broadcastChanges();
};
@@ -4130,9 +4182,11 @@
var currentX = this.leftHandle.position()["left"];
var leftHandleX = Math.floor(this.leftHandle.position()["left"]);
+
+ var container_offset = this.selector.offset().left + this.selector.width();
if (Math.floor(ui.position.left) < leftHandleX + 7) {
- /* prevent the handle from moving past the right handle */
+ /* prevent the handle from moving past the left handle */
ui.position.left = leftHandleX + 7;
}
@@ -4150,7 +4204,7 @@
IriSP.SliceWidget.prototype.broadcastChanges = function() {
var leftPercent = (this.zoneLeft / this.selector.width()) * 100;
var zonePercent = (this.zoneWidth / this.selector.width()) * 100;
-
+
this._Popcorn.trigger("IriSP.SliceWidget.zoneChange", [leftPercent, zonePercent]);
};