diff -r 94fea76c883e -r 445631dffdf8 test/integration/allocine_dossier_independant/js/LdtPlayer-release.js --- a/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js Fri May 11 16:04:53 2012 +0200 +++ b/test/integration/allocine_dossier_independant/js/LdtPlayer-release.js Fri May 11 16:07:52 2012 +0200 @@ -1115,7 +1115,7 @@ IriSP.search_template = "{{! template for the search container }}
"; IriSP.share_template = "{{! social network sharing template }}       "; IriSP.sliceWidget_template = "{{! template for the slice widget }}
{{! the whole bar }}
{{! the zone which represents our slice }}
"; -IriSP.slideShareWidget_template = "{{! template for the slideShare widget of the other }}
"; +IriSP.slideShareWidget_template = "{{! template for the slideShare widget of the other }}
"; IriSP.sliderWidget_template = "{{! template for the slider widget - it's composed of two divs we one overlayed on top of the other }}
"; IriSP.tooltip_template = "{{! template used by the jquery ui tooltip }}
{{title}}
{{begin}} : {{end}}
{{description}}
"; IriSP.tooltipWidget_template = "{{! template for the tooltip widget }}
"; @@ -4892,6 +4892,15 @@ /** A widget to display slide show from embed slide share */ IriSP.SlideShareWidget = function(Popcorn, config, Serializer) { IriSP.Widget.call(this, Popcorn, config, Serializer); + // Default flash embed size + this.embed_width = 425; + this.embed_height = 355; + if(this._config.embed_width){ + this.embed_width = this._config.embed_width; + } + if(this._config.embed_height){ + this.embed_height = this._config.embed_height; + } }; IriSP.SlideShareWidget.prototype = new IriSP.Widget(); @@ -4905,12 +4914,7 @@ return; } var templ = Mustache.to_html(IriSP.slideShareWidget_template); - this.selector.html(templ); - - // Synchro management - this._disableUpdate = false; - this.selector.find('.sync_on').click(function(event) { self.syncHandler.call(self, event); }); - this.selector.find('.sync_off').click(function(event) { self.unSyncHandler.call(self, event); }); + this.selector.append(templ); // global variables used to keep the position and width of the zone. this.zoneLeft = 0; @@ -4921,6 +4925,16 @@ this.lastSSId = ""; this.containerDiv = this.selector.find('.SlideShareContainer'); + // Synchro management + this._disableUpdate = false; + this.buttonsDiv = this.selector.find('.SlideShareButtons'); + this.buttonsDiv.width(this.embed_width - 2); // -2 because of css borders 328 -> 235px + this.buttonsDiv.find('.left_icon').css("margin-left",(this.embed_width-96)+"px"); + this.buttonsDiv.find('.ss_sync_on').click(function(event) { self.unSyncHandler.call(self, event); }); + this.buttonsDiv.find('.ss_sync_off').click(function(event) { self.syncHandler.call(self, event); }); + this.buttonsDiv.find('.ss_sync_off').hide(); + this.buttonsDiv.hide(); + // Update the slide from timeupdate event this._Popcorn.listen("timeupdate", IriSP.wrap(this, this.slideShareUpdater)); @@ -4931,7 +4945,8 @@ var annotations = this._serializer._data.annotations; var view_type = this._serializer.getSlideShareType(); if(typeof(view_type) === "undefined") { - if(console){ if(console.log){ console.log("No annotation-type for slideshare widget, this widget is canceled."); } } + if(console){ if(console.log){ console.log("No annotation-type for slideshare widget, this widget is canceled and the container is visible hidden."); } } + this.selector.hide(); return; } var i = 0; @@ -4959,72 +4974,100 @@ // We search if a segments_slides is in the current timecode var time = this._Popcorn.currentTime() * 1000; var nb_slides = this.segments_slides.length; - var found = false; + var forceEmpty = false; for (i = 0; i < nb_slides; i++) { var segment_slide = this.segments_slides[i]; if(segment_slide.begin
'; + this.containerDiv.html(embed_code); + } + else{ + // If the presentation was already loaded, we only use the ss js api to load the wanted slide number + var embed = null; + if(this.lastSSId!=""){ + // If the presentation was loaded from a public url, we get the div from its id. + embed = document.getElementsByName("__sse" + this.lastSSId)[0]; + } + else if(this.lastSSUrl.substring(0,7)!="http://"){ + // If the presentation was loaded from a private id, we get the div from dom tree. + embed = this.containerDiv.children()[0].children[0]; + } + if(embed){ + embed.jumpTo(parseInt(slideNb)); + } + } + return; } - return; } } } - if(found==false){ + if(forceEmpty==true){ this.lastSSFullUrl = ""; this.lastSSUrl = ""; this.lastSSId = ""; this.containerDiv.html(""); + this.buttonsDiv.hide(); } }; // Functions to stop or trigger sync between timeupdate event and slides -IriSP.SlideShareWidget.prototype.unSyncHandler = function(params) { +IriSP.SlideShareWidget.prototype.unSyncHandler = function() { //console.log("slideShare NO SYNC !"); this._disableUpdate = true; -}; -IriSP.SlideShareWidget.prototype.syncHandler = function(params) { + this.buttonsDiv.find('.ss_sync_on').hide(); + this.buttonsDiv.find('.ss_sync_off').show(); +}; +IriSP.SlideShareWidget.prototype.syncHandler = function() { //console.log("slideShare SYNC PLEASE !"); this._disableUpdate = false; + this.buttonsDiv.find('.ss_sync_on').show(); + this.buttonsDiv.find('.ss_sync_off').hide(); }; @@ -5746,7 +5789,6 @@ })); this.tracer = IriSP.TraceManager(IriSP.jQuery).init_trace("test", this._config); - this.tracer.set_default_subject("default_subject"); this.tracer.trace("StartTracing", { "hello": "world" }); }