teste

372 views
332 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
372
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

teste

  1. 1. (function($,setTimeout){function noop(){}function genericCallback(data){lastValue=[data];}function appendScript(node){head.insertBefore(node,head.firstChild);}function callIfDefined(method,object,parameters){returnmethod&&method.apply(object.context||object,parameters);}function qMarkOrAmp(url){return(/?/).test(url)?"&":"?";}varSTR_ASYNC="async",STR_CHARSET="charset",STR_EMPTY="",STR_ERROR="error",STR_JQUERY_JSONP="_jqjsp",STR_ON="on",STR_ONCLICK=STR_ON+"click",STR_ONERROR=STR_ON+STR_ERROR,STR_ONLOAD=STR_ON+"load",STR_ONREADYSTATECHANGE=STR_ON+"readystatechange",STR_REMOVE_CHILD="removeChild",STR_SCRIPT_TAG="<script/>",STR_SUCCESS="success",STR_TIMEOUT="timeout",browser=$.browser,head=$("head")[0]||document.documentElement,pageCache={},count=0,lastValue,xOptionsDefaults={callback:STR_JQUERY_JSONP,url:location.href};function jsonp(xOptions){xOptions=$.extend({},xOptionsDefaults,xOptions);varcompleteCallback=xOptions.complete,dataFilter=xOptions.dataFilter,callbackParameter=xOptions.callbackParameter,successCallbackName=xOptions.callback,cacheFlag=xOptions.cache,pageCacheFlag=xOptions.pageCache,charset=xOptions.charset,url=xOptions.url,data=xOptions.data,timeout=xOptions.timeout,pageCached,done=0,cleanUp=noop;xOptions.abort=function(){!done++&&cleanUp();};if(callIfDefined(xOptions.beforeSend,xOptions,[xOptions])===false||done){return xOptions;}url=url||STR_EMPTY;data=data?((typeof data)=="string"?data:$.param(data,xOptions.traditional)):STR_EMPTY;url+=data?(qMarkOrAmp(url)+data):STR_EMPTY;callbackParameter&&(url+=qMarkOrAmp(url)+encodeURIComponent(callbackParameter)+"=?");!cacheFlag&&!pageCacheFlag&&(url+=qMarkOrAmp(url)+"_"+(new Date()).getTime()+"=");url=url.replace(/=?(&|$)/,"="+successCallbackName+"$1");functionnotifySuccess(json){!done++&&setTimeout(function(){cleanUp();pageCacheFlag&&(pageCache[url]={s:[json]});dataFilter&&(json=dataFilter.apply(xOptions,[json]));callIfDefined(xOptions.success,xOptions,[json,STR_SUCCESS]);callIfDefined(completeCallback,xOptions,[xOptions,STR_SUCCESS]);},0);}function notifyError(type){!done++&&setTimeout(function(){cleanUp();pageCacheFlag&&type!=STR_TIMEOUT&&(pageCache[url]=type);callIfDefined(xOptions.error,xOptions,[xOptions,type]);callIfDefined(completeCallback,xOptions,[xOptions,type]);},0);}pageCacheFlag&&(pageCached=pageCache[url])?(pageCached.s?notifySuccess(pageCached.s[0]):notifyError(pageCached)):setTimeout(function(script,scriptAfter,timeoutTimer){if(!done){timeoutTimer=timeout>0&&setTimeout(function(){notifyError(STR_TIMEOUT);},timeout);cleanUp=function(){timeoutTimer&&clearTimeout(timeoutTimer);script[STR_ONREADYSTATECHANGE]=script[STR_ONCLICK]=script[STR_ONLOAD]=script[STR_ONERROR]=null;head[STR_REMOVE_CHILD](script);scriptAfter&&head[STR_REMOVE_CHILD](scriptAfter);};window[successCallbackName]=genericCallback;script=$(STR_SCRIPT_TAG)[0];script.id=STR_JQUERY_JSONP+count++;if(charset){script[STR_CHARSET]=charset;}function callback(result){(script[STR_ONCLICK]||noop)();result=lastValue;lastValue=undefined;result?notifySuccess(result[0]):notifyError(STR_ERROR);}if(browser.msie){script.event=STR_ONCLICK;script.htmlFor=script.id;script[STR_ONREADYSTATECHANGE]=function(){/loaded|complete/.test(script.readyState)&&callback();};}else{script[STR_ONERROR]=script[STR_ONLOAD]=callback;browser.opera?((scriptAfter=$(STR_SCRIPT_TAG)[0]).text="jQuery(#"+script.id+")[0]."+STR_ONERROR+"()"):script[STR_ASYNC]=STR_ASYNC;;}script.src=url;appendScript(script);scriptAfter&&appendScript(scriptAfter);}},0);return xOptions;}jsonp.setup=function(xOptions){$.extend(xOptionsDefaults,xOptions);};$.jsonp=jsonp;})(jQuery,setTimeout);function SSBandInteraction(config)
  2. 2. {this.config=config;this._init();}SSBandInteraction.prototype._init=function(){var that=this;varcontainer=this.config.container;varlinksDisabled=this.config.linksDisabled;container.bind(mousedown,function(e){if(e.which!==1){return;}var offset=$(this).offset();that.startX=e.pageX-offset.left;container.bind(mouseup,function(e){var targetNode;vartarget=e.target;var targetTagName=target.tagName.toUpperCase();if(linksDisabled){targetNode=false;}elseif(targetTagName===SPAN&&target.parentNode.tagName.toUpperCase()===A){targetNode=target.parentNode;}else if(targetTagName===A||targetTagName===AREA){targetNode=target;}if(targetNode){varhrefValue=parseInt(targetNode.attributes.href.value,10);if(isNaN(hrefValue)){window.open(targetNode.href);}}else if(targetTagName!==INPUT){var offset=$(this).offset();var endX=e.pageX-offset.left;if(Math.abs(that.startX-endX)<20){$(that).trigger({type:bandclick,ssData:{x:endX}});}}container.unbind(mouseup);});});$(container).bind(click,function(e){e.preventDefault();});$(this).bind(bandclick,function(e){e.preventDefault();var x=e.ssData.x;varbandSize=that.config.width/3;if(x<bandSize){$(that).trigger(bandprevious);}else if(x>(bandSize*2)){$(that).trigger(bandnext);}});};SSBandInteraction.prototype.activate=function(){var that=this;$(this).bind(bandprevious,function(){$.slideshareEventManager.trigger(previous);$.slideshareEventManager.trackEvent(band_prev);});$(this).bind(bandnext,function(){$.slideshareEventManager.trigger(next);$.slideshareEventManager.trackEvent(band_next);});};SSBandInteraction.prototype.deactivate=function(){$(this).unbind(bandprevious);$(this).unbind(bandnext);};SSBandInteraction.prototype.destroy=function(){};if($.slideshareEventManager===undefined){$.extend({slideshareEventManager:{SHOUTEVENTS:{next:true,previous:true,gotoslide:true,slidechanged:true},functions:{showlastscreen:function(){varcontroller=this.controller;controller.displayLastScreen();},gotofirstslide:function(){varcontroller=this.controller;controller.play(1);controller.config.has_audio&&this.trigger(slidecastseekslide,{index:1});},next:function(){varcontroller=this.controller;var currentPosition=controller.currentPosition;varlastPosition=controller.slideCount;varcurrentSlide=controller.slides[currentPosition];varnextSlide=controller.slides[currentPosition+1];if(currentSlide.config.slideMode===ytube_video){currentSlide._pauseVideo();}if(currentPosition===lastPosition){this.trigger(showlastscreen);}else{varposition=currentPosition+1;controller.play(position);controller.config.has_audio&&this.trigger(slidecastseekslide,{index:position});}},previous:function(){var controller=this.controller;varcurrentPosition=controller.currentPosition;controller.slides[currentPosition].stop();controller.play(currentPosition-1);controller.config.has_audio&&this.trigger(slidecastseekslide,{index:currentPosition-1});},gotolastslide:function(){varcontroller=this.controller;varlastPosition=controller.slideCount;controller.play(lastPosition);},document_touch_scroll:function(data){this.controller.currentComponentSet.slidedisplayer.manualScroll(data.delta);},toggleaudio:function(){varcontroller=this.controller;if(controller.audioResource){controller.audioResource.togglePlay();}},audioplayed:function(){varcontroller=this.controller;controller.currentComponentSet.toolbar.updateAudioInteraction({audioPlaying:true});},audiopaused:function(){varcontroller=this.controller;controller.currentComponentSet.toolbar.updateAudioInteraction({audioPlaying:false});},gotoslide:function(data){varcontroller=this.controller;controller.play(data.index);$.slideshareEventManager.trackEvent(jumptoslide);},viewonss:function(e){var
  3. 3. controller=this.controller;window.open(controller.config.slideview_url,viewer);},viewfullscreen:function(e){varcontroller=this.controller;controller.audioResource&&controller.audioResource.pause();if(controller.config.inpage_full_screen){controller.switchView(fullscreen);}else{window.open(controller.getFullScreenUrl(),viewer,width=+screen.width+,height=+screen.height);}},leavefullscreen:function(e){varcontroller=this.controller;if(controller.config.inpage_full_screen){controller.switchView(normal);}else{try{window.close();}catch(exception){}}},zoomin:function(e){varcontroller=this.controller;controller.currentComponentSet.slidedisplayer.zoomin();},zoomout:function(e){varcontroller=this.controller;controller.currentComponentSet.slidedisplayer.zoomout();},playersearch:function(e){},playershare:function(e){if(this.hostedIn===slideview){try{share_form_click();}catch(ex){}}else{this.controller.displayShareScreen();}},metadataloaded:function(data){var controller=this.controller;var metaDataType=data.type;varhandlers=controller._metaDataHandlers()[metaDataType];handlers.success.call(controller,data.json);},metadataloadfailed:function(data){var controller=this.controller;var metaDataType=data.type;varhandlers=controller._metaDataHandlers()[metaDataType];handlers.failure.call(controller);this.trackRawEvent(jsplayer_debug,metaDataType+_metadataloadfailed);},width_adjusted:function(data){varcontroller=this.controller;if(this.hostedIn===slideview&&controller.mode===image){this.trackRawEvent(jsplayer_debug,width_adjusted,+controller.config.id);}},width_not_adjusted:function(data){varcontroller=this.controller;if(this.hostedIn===slideview&&controller.mode===image){this.trackRawEvent(jsplayer_debug,width_not_adjusted,+controller.config.id);}},slidechanged:function(data){var slideIndex=data.index;varcontroller=this.controller;varcurrentPosition=controller.currentPosition;if(currentPosition===slideIndex&&!data.force){return;}controller.updateCurrentPosition(slideIndex);controller._load(slideIndex);controller.currentComponentSet.slidedisplayer._scrollTo(slideIndex);if(slideIndex===2){$.slideshareEventManager.trackEvent(slidechange_2);}elseif(slideIndex===controller.slideCount){$.slideshareEventManager.trackEvent(slidechange_last);}if(controller.has_lead&&(slideIndex===controller.config.form_after_slide_no+1)){this.trigger(showleadform);}},showleadform:function(){if(this.controller.audioResource){this.controller.audioResource.pause();}if(!this.controller.leadCreated){this.controller.currentComponentSet.leadForm.toggle();}},showleadcta:function(){if(this.controller.config.show_lead_cta){this.controller.currentComponentSet.leadcta.show();}},leadformloaded:function(data){this.trigger(showleadcta);if(data){this.controller.config.leadFormHtml=data.leadFormHtml;}},leadcreated:function(){this.controller.leadCreated=true;if(this.controller.currentComponentSet.leadcta){this.controller.currentComponentSet.leadcta.hide();}},currentversionloaded:function(data){var slide=this.controller.slides[data.index];varresourceKey=data.resourceKey;slide.updateRenderedResourceVersion(resourceKey);},resourceloaded:function(data){var slide=this.controller.slides[data.index];varresourceKey=data.resourceKey;slide.updateResource(resourceKey,{status:cached});if(slide.status===failed){return;}var resources=slide.resources,key;for(key in resources){if(resources[key].cacheable===true&&resources[key].status!==cached){return;}}slide.status=cached;this.trigger(slideloaded,{index:data.index});},resourceloadfailed:function(data){varslide=this.controller.slides[data.index];varresourceKey=data.resourceKey;slide.updateResource(resourceKey,{status:failed});if(slide.resources[resourceKey].isCritical===true)
  4. 4. {slide.status=failed;this.trigger(slideloadfailed,{index:data.index});}this.trackRawEvent(jsplayer_debug,resourceKey+_resourceloadfailed);},fontresourceloaded:function(data){varcontroller=this.controller;if(controller.config.use_ssl){if(data.style.indexOf(".eot")!==-1){data.style=data.style.replace(/http:///g,https://);}}var styleData=<style>+data.style+</style>;$(styleData).appendTo(controller.componentSets.normal.container);},slideloaded:function(data){var controller=this.controller;var slideIndex=data.index;varslide=controller.slides[slideIndex];if(slide.currentViewMode.rendered){slide.paint();}if(controller.startSlide===slideIndex&&window._jspl&&_jspl.pageInitTime){varslide_info=this.controller.config.id+_slide_+slideIndex;this.trackValueEvent("jsperf_"+this.hostedIn,slide_info,,(new Date()).getTime()-_jspl.pageInitTime);}controller.preloadMoreIfIdle(slideIndex);},slideloadfailed:function(data){controller=this.controller;varslide=controller.slides[data.index];if(slide.currentViewMode.rendered){varwidth=slide.currentViewMode.width;varheight=slide.currentViewMode.height;slide.displayError(controller.generateErrorDom(slide_error_template,{width:width,height:height}));}controller.preloadMoreIfIdle(data.index);varslide_info=this.controller.config.id+_slide_+data.index;this.trackRawEvent(jsplayer_debug,slideloadfailed,slide_info);},videoloadfailed:function(){this.trackRawEvent(jsplayer_debug,videoloadfailed);},slideloading:function(data){var controller=this.controller;varslide=controller.slides[data.index];varloadingSlides=controller.loadingSlides;if(loadingSlides.indexOf(data.index)===-1){controller.loadingSlides.push(data.index);}if(slide.currentViewMode.rendered){slide.displayLoading();}if(controller.currentPosition===data.index){this.trackRawEvent(jsplayer_debug,current_slide_loading);}},audioloaded:function(data){var controller=this.controller;varaudioResource=controller.audioResource;audioResource&&audioResource.triggerPlayProgress();audioResource.soundLoadHandler=function(){};controller.currentComponentSet.toolbar.updateAudioInteraction({audioReady:true});},audiometaloaded:function(data){var controller=this.controller;varaudioResource=controller.audioResource;audioResource.slidePositions=data.transitions||{};audioResource.metaDataReady=true;audioResource._trySoundCreation();controller.currentComponentSet.toolbar.updateAudioInteraction({audioMetaReady:true});varaudiobar=controller.currentComponentSet.audiobar;audiobar&&(audiobar.resource=audioResource)&&audiobar.renderMarkers();(controller.currentPosition>0)&&audiobar.updateCurrentPosition(controller.currentPosition);},audioloadfailed:function(data){this.trackRawEvent(jsplayer_debug,audioloadfailed);},audiometaloadfailed:function(data){this.trackRawEvent(jsplayer_debug,audiometaloadfailed);},updateaudioprogress:function(data){varaudiobar=this.controller.currentComponentSet.audiobar;audiobar&&audiobar.updateProgress(data.milliseconds);},updateaudiobuffer:function(data){varaudiobar=this.controller.currentComponentSet.audiobar;audiobar&&audiobar.updateBuffer(data.milliseconds);},updateaudiomarker:function(data){varaudiobar=this.controller.currentComponentSet.audiobar;audiobar&&audiobar.updateCurrentPosition(data.index);},slidecastseekslide:function(data){varpos=data.index||1;varaudioResource=this.controller.audioResource;if(audioResource){varslidePositions=audioResource.slidePositions||{};varaudioPos=(slidePositions[pos]||0)*1000;audioResource.setPosition(audioPos);audioResource.triggerPlayProgress();}this.trigger(gotoslide,{index:pos});},showvolumecontrol:function(data){vartoolbar=this.controller.currentComponentSet.toolbar;vartriggerLeftOffset=data&&data.currentTarget&&(data.currentTarget.offsetLeft-
  5. 5. 4);toolbar&&toolbar.volumeControl&&toolbar.volumeControl.show(triggerLeftOffset);},hidevolumecontrol:function(data){vartoolbar=this.controller.currentComponentSet.toolbar;toolbar&&toolbar.volumeControl&&toolbar.volumeControl.hide();},changevolume:function(data){varaudioResource=this.controller.audioResource;audioResource&&audioResource.changeVolume(data.volume);},volumechanged:function(data){vartoolbar=this.controller.currentComponentSet.toolbar;toolbar&&toolbar.volumeControl&&toolbar.volumeControl.setVolume(data.volume);},repaint:function(data){this.controller.repaint();}},registerController:function(controller){this.controller=controller;},registerPlayer:function(player){this.player=$(player);},registerEnvironment:function(hostedIn){hostedIn=hostedIn||slideshare;this.hostedIn=hostedIn;},trigger:function(eventname,data){var that=this;if(this.functions[eventname]!==undefined){this.functions[eventname].call(this,data);}if(this.SHOUTEVENTS[eventname]){this.player.trigger({type:eventname,ssData:data});}},trackEvent:function(label){if(window._gaq!==undefined){window._gaq.push([_trackEvent,jsplayer,this.hostedIn,label]);}},trackRawEvent:function(category,action,label){if(window._gaq!==undefined){window._gaq.push([_trackEvent,category,action,label]);}},trackValueEvent:function(category,action,optional_label,optional_value){if(window._gaq!==undefined){window._gaq.push([_trackEvent,category,action,optional_label,optional_value]);}}}});}function SSLastScreen(config){this.config=config;this.html=config.settings.html;this.related=this.config.settings.related;this.relatedPerScreen=2;this.relatedScreenIndex=0;this._init();}SSLastScreen.prototype._init=function(){};SSLastScreen.prototype.show=function(dimensions){if(this.overlay!==undefined){return;}this.overlay=$(<div/>).css({width:100%,height:100%,background-color:black,opacity:0.75,position:absolute,top:0,left:0}).appendTo(this.config.renderTo);this.lastScreen=$(<div/>).addClass(lastScreenContainer).html(this.html).appendTo(this.config.renderTo);this.setDimensions(dimensions);this.populateTemplate();this.bindEvents();};SSLastScreen.prototype.populateTemplate=function(){this.lastScreen.find(.lastScreenEmbedCode).val(this.config.embed_code);this.lastScreen.find(.lastScreenSSUrl).val(this.config.settings.url);this.populateRelated(0,this.lastScreen.find(.relatedPresentationul>li.relatedContent));};SSLastScreen.prototype.populateRelated=function(index,elements){var i,j,start,end;var template,relatedItem;vartrackRelatedClick=function(){$.slideshareEventManager.trackEvent(lastscreen_relatedclick);};start=this.relatedPerScreen*index;if(start>this.related.length){return;}end=start+this.relatedPerScreen-1;this.relatedScreenIndex=index;for(i=start,j=0;i<=end;i++,j++){relatedItem=this.related[i];template=$(elements[j]);if(typeofrelatedItem===undefined){template.hide();}else{template.show();template.find(.relatedThumbimg).attr(src,relatedItem.thumbnail);template.find(.relatedThumb).attr(href,relatedItem.url);template.find(.relatedTitle).text(relatedItem.title).attr(href,relatedItem.url);template.find(.relatedAuthor).text(relatedItem.author).attr(href,/+relatedItem.author_login);template.find(.relatedViews).text(relatedItem.views);template.unbind(click);template.bind(click,trackRelatedClick);}}this.rebindRotateTimeout();};SSLastScreen.prototype.rotateRelated=function(direction){var relatedElems=this.lastScreen.find(.relatedPresentationul>li.relatedContent);var newIndex;if(direction===back){newIndex=this.relatedScreenIndex-1;if(newIndex<0){newIndex=(parseInt((this.related.length-1)/this.relatedPerScreen,10));}}else{newIndex=this.relatedScreenIndex+1;if(newIndex>(parseInt((this.related.length-1)/this.relatedPerScreen,10))){newIndex=0;}}this.populateRelated(newIndex,relatedElems);};SSLastScreen.prototype.rebindRotateTimeout=function(){var that=this;if(this.rotateIntervalId){clearTimeout(this.rotateIntervalId);}
  6. 6. this.rotateIntervalId=setTimeout(function(){that.rotateRelated(front);},3000);};SSLastScreen.prototype.destroy=function(){if(this.rotateIntervalId){clearTimeout(this.rotateIntervalId);}if(this.overlay){this.overlay.remove();delete(this.overlay);}if(this.lastScreen){this.lastScreen.remove();delete(this.lastScreen);}};SSLastScreen.prototype.bindEvents=function(){varthat=this;this.lastScreen.find(.close).bind(click,function(e){e.preventDefault();that.destroy();});this.lastScreen.find(input[type=text]).bind(focus,function(){if($(this).hasClass(lastScreenEmbedCode)){$.slideshareEventManager.trackEvent(lastscreen_embedclick);}});this.lastScreen.find(.lastScreenEmailShare).bind(click,function(e){e.preventDefault();that.destroy();$.slideshareEventManager.trigger(playershare);$.slideshareEventManager.trackEvent(lastscreen_share);});this.lastScreen.find(.lastScreenReplay).bind(click,function(e){e.preventDefault();that.destroy();$.slideshareEventManager.trigger(gotofirstslide);$.slideshareEventManager.trackEvent(lastscreen_replay);});this.lastScreen.find(.lastScreenNext).bind(click,function(e){e.preventDefault();that.rotateRelated(front);});this.lastScreen.find(.lastScreenPrev).bind(click,function(e){e.preventDefault();that.rotateRelated(back);});this.lastScreen.find(input[type=text]).bind(click,function(e){this.select();});};SSLastScreen.prototype.setDimensions=function(dimensions){if(this.lastScreen===undefined){return;}this.lastScreen.css({height:dimensions.height,width:dimensions.width});};function SSLeadCTA(config){this.config=config;this.image_width=103;this._init();}SSLeadCTA.prototype._init=function(){this.lead_cta_div=$(<div/>).addClass(lead_cta_div).css({left:(this.config.renderTo.width()/2)-this.image_width/2}).html(this.config.html).appendTo(this.config.renderTo);if(this.config.has_audio){this.lead_cta_div.css({bottom:54});}this.cta_link=$(#lead_cta,this.lead_cta_div);this.deactivate();};SSLeadCTA.prototype._bindEvents=function(){this.cta_link.unbind(click).bind(click,function(e){e.preventDefault();e.stopPropagation();$.slideshareEventManager.trigger(showleadform);});};SSLeadCTA.prototype._unbindEvents=function(){this.cta_link.unbind(click).bind(click,function(e){e.preventDefault();e.stopPropagation();});};SSLeadCTA.prototype.deactivate=function(){this._unbindEvents();};SSLeadCTA.prototype.activate=function(){this._bindEvents();};SSLeadCTA.prototype.hide=function(){$(.lead_cta_div).hide();};SSLeadCTA.prototype.show=function(){this.lead_cta_div.show();};SSLeadCTA.prototype.destroy=function(){this._unbindEvents();this.lead_cta_div.remove();};function SSLeadForm(config){this.config=config;this.config.showLeadForm=true;this._init();}SSLeadForm.prototype._init=function(){varthat=this;if(this.config.leadFormHtml===){$.ajax({url:this.config.lead_form_url,data:{},dataType:html,cache:false,type:POST,success:function(data){that.config.leadFormHtml=data;$.slideshareEventManager.trigger(leadformloaded,{leadFormHtml:data});},failure:function(){}});}else{$.slideshareEventManager.trigger(leadformloaded);}};SSLeadForm.prototype.toggle=function(){if(document.getElementById(leadsform-placeholder-new)===null){$(this.config.leadFormHtml).insertBefore(this.config.renderTo);if(!this.config.show_skip_button){$(.j-lead-cancel).remove();}}this.setDimensions(this.config);$(.lead-overlay).fadeToggle(1000,"linear");};SSLeadForm.prototype._bindEvents=function(){var validate=null;$(form,.lead-overlay).live(submit,function(evt){evt.preventDefault();evt.stopPropagation();var placeholder=$(.lead-overlay#leadsform-placeholder-new);var progress=$(.lead-overlay .progress);varprogress_done=$(.lead-overlay .progress_done);var progress_error=$(.lead-overlay .progress_error);placeholder.form=$
  7. 7. (form,placeholder);try{if(placeholder.form[0].validate_formfields()){placeholder.css({height:120px});progress.show();placeholder.form.hide();$.slideshareEventManager.trackEvent(bigfoot_leadsform,sent);varmech="mechanism=Sidebar&";$.ajax({url:placeholder.form[0].action,data:(mech)+placeholder.form.serialize(),type:"POST",cache:false,success:function(resp){progress_done.show();progress.hide();$(.lead-overlay).fadeOut(3000,"linear");$.slideshareEventManager.trigger(leadcreated);placeholder.html(<divclass="progress_done">+progress_done.html()+</div>);},error:function(resp){progress.hide();progress_error.show();$(.lead-overlay).fadeOut(2000,"linear");setTimeout(function(){progress_error.hide();placeholder.form.show();},2000);}});}}catch(e){}});if(this.config.show_skip_button){var that=this;$(.j-lead-cancel).live(click,function(e){e.preventDefault();e.stopPropagation();that.hide();});}else{$(.j-lead-cancel).remove();}};SSLeadForm.prototype._unbindEvents=function(){$(.j-lead-cancel).die();$(form,.lead-overlay).die();};SSLeadForm.prototype.deactivate=function(){this._unbindEvents();$(.lead-overlay).remove();};SSLeadForm.prototype.activate=function(){this._unbindEvents();this._bindEvents();};SSLeadForm.prototype.hide=function(){$(.lead-overlay).hide();};SSLeadForm.prototype.show=function(){$(.lead-overlay).show();};SSLeadForm.prototype.isVisible=function(){return $(.lead-overlay).is(:visible);};SSLeadForm.prototype.destroy=function(){$(.lead-overlay).remove();};SSLeadForm.prototype.setDimensions=function(dimensions){$(.lead-overlay).css({height:dimensions.height});$(.j-leadsform-placeholder).css({height:66/100*(dimensions.height)});};functionSSReplayScreen(config){this.config=config;this.html=config.settings.html;this._init();}SSReplayScreen.prototype._init=function(){};SSReplayScreen.prototype.show=function(dimensions){if(this.overlay!==undefined){return;}this.overlay=$(<div/>).css({width:100%,height:100%,background-color:black,opacity:0.75,position:absolute,top:0,left:0}).appendTo(this.config.renderTo);this.lastScreen=$(<div/>).css({position:absolute}).html(this.html).appendTo(this.config.renderTo);this.setDimensions(dimensions);this.bindEvents();};SSReplayScreen.prototype.destroy=function(){if(this.overlay){this.overlay.remove();delete(this.overlay);}if(this.lastScreen){this.lastScreen.remove();delete(this.lastScreen);}};SSReplayScreen.prototype.bindEvents=function(){varthat=this;this.lastScreen.find(.replayScreenReplay).bind(click,function(e){e.preventDefault();that.destroy();$.slideshareEventManager.trigger(gotofirstslide);$.slideshareEventManager.trackEvent(lastscreen_replay);});};SSReplayScreen.prototype.setDimensions=function(dimensions){if(this.lastScreen===undefined){return;}var layerWidth=93;var layerHeight=25;var top,left;top=(dimensions.height-layerHeight)/2;left=(dimensions.width-layerWidth)/2;if(top<0){top=0;}else{top=parseInt(top,10);}if(left<0){left=0;}else{left=parseInt(left,10);}this.lastScreen.css({top:top,left:left});};function SSResource(config){if(typeofconfig===undefined){return;}this.TIMEOUT_LIMIT=100000;this.config=config;this.resourceKey=config.resourceKey;this._init();}SSResource.prototype._init=function(){this._initResourceConfig();this.status=initialized;};SSResource.prototype.reset=function(){this.status=initialized;this.retries=0;if(this.suffixes){varsuffixKey,suffix;for(suffixKey in this.suffixes){suffix=this.suffixes[suffixKey];suffix.status=initialized;delete(suffix.startTime);suffix.retries=2;}}};SSResource.prototype.load=function(){this.status=loading;if(this.loadBlocked){return;}this.startTime=(newDate()).getTime();this._tryLoad();};SSResource.prototype.update=function(values)
  8. 8. {var key,value;for(key in values){value=values[key];if(this.resourceKey===image&&key===sizes){this.delayedInitialize&&this.delayedInitialize(value);}elseif(this.resourceKey===image&&key===linkData){this.addLinks(value);}else{this[key]=value;}}};SSResource.prototype.resourceErrorInternalHandler=function(){var that=this;return function(data){varstartTime=that.startTime;var elapsedTime=(new Date()).getTime()-startTime;varretries=that.retries;if(retries>0&&elapsedTime<that.TIMEOUT_LIMIT){retries=retries-1;that.update({retries:retries});setTimeout(function(){that._tryLoad();},3000);}else{$.slideshareEventManager.trigger(resourceloadfailed,{index:that.config.slideIndex,resourceKey:that.resourceKey});}};};functionSSShareScreen(config){this.config=config;this.html=config.settings.html;this._init();}SSShareScreen.prototype._init=function(){};SSShareScreen.prototype.show=function(dimensions){if(this.overlay!==undefined){return;}this.overlay=$(<div/>).css({width:100%,height:100%,background-color:black,opacity:0.75,position:absolute,top:0,left:0}).appendTo(this.config.renderTo);this.shareScreen=$(<div/>).css({position:absolute}).html(this.html).appendTo(this.config.renderTo);this.setDimensions(dimensions);this.populateTemplate();this.bindEvents();};SSShareScreen.prototype.populateTemplate=function(){this.shareScreen.find(.shareScreenEmbedCode).val(this.config.embed_code);this.shareScreen.find(.shareScreenSSUrl).val(this.config.settings.url);this.shareScreen.find(.shareScreenFromName).val(this.config.settings.user_name);};SSShareScreen.prototype.destroy=function(){this.overlay.remove();delete(this.overlay);this.shareScreen.remove();delete(this.shareScreen);};SSShareScreen.prototype.bindEvents=function(){varthat=this;this.shareScreen.find(.close).bind(click,function(e){e.preventDefault();that.destroy();});this.shareScreen.find(input[type=text]).bind(click,function(){this.select();});varemailSubmit=this.shareScreen.find(input[type=submit]);this.shareScreen.find(form).bind(submit,function(e){e.preventDefault();});emailSubmit.bind(click,function(e){e.preventDefault();varfrom=that.shareScreen.find(.shareScreenFromName).val();varto=that.shareScreen.find(.shareScreenMailID).val();varmessage=that.shareScreen.find(.shareDefaultMessage).val();if(from.length===0||to.length===0){return;}if(typeof that.emailProgress!==undefined){that.emailProgress.remove();}that.emailProgress=$(<span/>).text(sending...);emailSubmit.parent().prepend(that.emailProgress);$.ajax({url:/share/contacts/+that.config.settings.slideshow_id,type:POST,data:{message[body]:message,message[from]:from,message[to]:to},dataType:json,success:function(data){if(data.success===true){that.emailProgress.text(Sent);}else{that.emailProgress.text(Sendingfailed);}},error:function(){that.emailProgress.text(Sending failed);}});});$.each({.thirdPartySharea.Twitter:this.config.settings.twitter_share,.thirdPartySharea.Linkedin:this.config.settings.linkedin_share},function(selector,url){that.shareScreen.find(selector).bind(click,function(e){e.preventDefault();window.open(url,ss_share,width=660,height=490,toolbar=no,resizable=fixed,status=no,scrollbars=no,+menubar=no,screenX=0,screenY=0).focus();});});};SSShareScreen.prototype.setDimensions=function(dimensions){if(this.shareScreen===undefined){return;}this.config.shareScreenClass&&this.shareScreen.find(.shareScreen).addClass(this.config.shareScreenClass);var layerWidth=$(this.shareScreen).width();varlayerHeight=$(this.shareScreen).height();var top,left;top=(dimensions.height-layerHeight)/2;left=(dimensions.width-layerWidth)/2;if(top<0){top=0;}else{top=parseInt(top,10);}if(left<0){left=0;}else{left=parseInt(left,10);}this.shareScreen.css({top:top,left:left});};function SSSlide(config){if(typeofconfig==="undefined"){return;}
  9. 9. this.index=config.index;this.realIndex=config.realIndex;this.setContentDimensions(config.contentWidth,config.contentHeight);delete(config.contentWidth);delete(config.contentHeight);this.config=config;this._init();}SSSlide.prototype.setContentDimensions=function(width,height){this.contentWidth=width;this.contentHeight=height;};SSSlide.prototype._init=function(){this.status=initialized;this.viewModes={};this.resources={};this._createResources();this._bindEvents();};SSSlide.prototype.stop=function(){};SSSlide.prototype._createResources=function(){if(typeofthis.config.timestamp===undefined){this.config.timestamp=(newDate()).getTime();}switch(this.config.slideMode){caseimage:varsignature_hash={};this.resources.image=newSSFallbackImageResource({baseUrl:this.config.bucketLocation,timestamp:this.config.timestamp,resourceKey:image,indexGenerator:this.config.indexGenerator,playerWidth:this.config.playerWidth,slideIndex:this.index,realIndex:this.realIndex,is_private:this.config.is_private,signatures:signature_hash,availableSizes:this.config.availableSizes,contentWidth:this.contentWidth,privateImageSignatures:this.config.privateImageSignatures,conversionVersion:this.config.conversionVersion});break;casehtml:this.resources.image=newSSBgImageResource({baseUrl:this.config.bucketLocation,availableSizes:this.config.availableSizes,timestamp:this.config.timestamp,resourceKey:image,indexGenerator:this.config.indexGenerator,playerWidth:this.config.playerWidth,slideIndex:this.index,realIndex:this.realIndex,is_private:this.config.is_private,contentWidth:this.contentWidth,conversionVersion:this.config.conversionVersion,privateImageSignatures:this.config.privateImageSignatures});this.resources.html=newSSHtmlResource({baseUrl:this.config.bucketLocation,timestamp:this.config.timestamp,resourceKey:html,indexGenerator:this.config.indexGenerator,slideIndex:this.index,realIndex:this.realIndex,is_private:this.config.is_private,conversionVersion:this.config.conversionVersion,signature:this.config.htmlResourceSignature});break;}delete(this.config.availableSizes);};SSSlide.prototype.reset=function(){this.status=initialized;var reskey;for(reskey in this.resources){resource=this.resources[reskey].reset();}};SSSlide.prototype.load=function(){if(this.status===cached){this._getNewResourceVersions(this.currentViewMode.wrapperWidth);$.slideshareEventManager.trigger(slideloaded,{index:this.index});return;}if(this.status===loading){$.slideshareEventManager.trigger(slideloading,{index:this.index});return;}if(this.status===failed){$.slideshareEventManager.trigger(slideloadfailed,{index:this.index});return;}this.status=loading;$.slideshareEventManager.trigger(slideloading,{index:this.index});var that=this;var reskey;for(reskey in this.resources){resource=this.resources[reskey];resource.status=loading;resource.load();}};SSSlide.prototype.updateResource=function(reskey,values){if(typeofthis.resources[reskey]===undefined){return;}this.resources[reskey].update(values);};SSSlide.prototype.displayError=function(jQueryDomObject,noRetry){this.empty();jQueryDomObject.appendTo(this.currentViewMode.wrapper);varthat=this;var button=jQueryDomObject.find(input);if(noRetry){button.hide();}else{button.bind(click,function(e){e.preventDefault();e.stopPropagation();that.reset();that.load();});}};SSSlide.prototype.paint=function(){if(typeofthis.currentViewMode.imageElement===undefined){this.render();}this.currentViewMode.imageElement.css({width:this.currentViewMode.width,height:this.currentViewMode.height});if(this.config.slideMode===html){varzoomStyles;if(Modernizr.csstransforms){zoomStyles={-moz-transform:scale(+this.currentViewMode.contentScale+),-webkit-transform:scale(+this.currentViewMode.contentScale+),-o-transform:scale(+this.currentViewMode.contentScale+),msTransform:scale(+this.currentViewMode.contentScale+),-moz-transform-origin:0 0,-webkit-transform-origin:0 0,-o-transform-origin:0 0,msTransformOrigin:00};}else{zoomStyles={zoom:this.currentViewMode.contentScale};}this.currentViewMode.contentElement.css({width:this.currentViewMode.width,height
  10. 10. :this.currentViewMode.height});this.currentViewMode.contentElement.children(.ssml_div).css(zoomStyles);}else if(this.config.slideMode===image){this._updateLinks();}};SSSlide.prototype.render=function(){this.empty();this.currentViewMode.imageElement=$(<img/>).css({position:absolute,top:this.PADDING,left:0,margin:0,padding:0}).attr({src:this.resources.image.getContent()}).appendTo(this.currentViewMode.wrapper);if(this.config.slideMode===html){varstyleData=<style>+this.resources.html.getContent().style+</style>;$(styleData).appendTo(this.currentViewMode.wrapper);this.currentViewMode.contentElement=$(<div/>).css({position:absolute,overflow:hidden}).html(this.resources.html.getContent().html);this.currentViewMode.contentElement.appendTo(this.currentViewMode.wrapper);}};SSSlide.prototype._updateLinks=function(){if(this.currentViewMode.imageMapId!==undefined){$(#+this.currentViewMode.imageMapId).remove();}this._renderLinks();};SSSlide.prototype._renderLinks=function(){varlinks=this.resources.image.links;if(links===undefined){return;}var width=this.currentViewMode.width;var height=this.currentViewMode.height;varlinkCount=links.length,i,j,linkObj,coords;varmapId=image_map_+this.currentMode+_+this.index+parseInt(Math.random()*2500,10);var mapContent=<map id="+mapId+" name="+mapId+">;for(i=0;i<linkCount;i++){linkObj=links[i];coords=[parseInt((linkObj.box[0]||0)*width/100,10),parseInt((linkObj.box[3]||0)*height/100,10),parseInt((linkObj.box[2]||0)*width/100,10),parseInt((linkObj.box[1]||0)*height/100,10)];coords=coords.join(,);mapContent=mapContent+<areashape="rect" coords="+coords+" href="+linkObj.url+" rel="nofollow" />;}mapContent=mapContent+</map>;$(mapContent).appendTo(this.currentViewMode.wrapper);this.currentViewMode.imageElement.attr(usemap,#+mapId);this.currentViewMode.imageMapId=mapId;};SSSlide.prototype._getNewResourceVersions=function(){this.resources.image._tryLoad(this.currentViewMode.wrapperWidth);};SSSlide.prototype.updateRenderedResourceVersion=function(resourceKey){if(!this.currentViewMode.rendered){return;}if(resourceKey===image&&this.currentViewMode.imageElement!==undefined){this.currentViewMode.imageElement.attr({src:this.resources.image.getContent()});}};SSSlide.prototype._bindEvents=function(){};function SSSlideDisplayer(config){if(typeof config==="undefined"){return;}this.config=config;this.slideOffsets=[];this.playerBgColor=config.playerBgColor||"#ccc";this.state=initialized;this.zoomIndex=0;this._init();}SSSlideDisplayer.prototype._init=function(){var that=this;this.container=$(<div/>).attr({class:slideDisplayer}).css({position:relative,overflow:hidden,height:100%,width:100%,text-align:left,background-color:this.playerBgColor}).appendTo(this.config.renderTo);this.showInitializer();};SSSlideDisplayer.prototype.hideInitializer=function(){this.container.empty();};SSSlideDisplayer.prototype.error=function(jQueryDomObject){this.hideInitializer();jQueryDomObject.appendTo(this.container);};SSSlideDisplayer.prototype.zoomin=function(){varnewZoomIndex=this.zoomIndex+1;if(newZoomIndex===this.zoomLevels.length){return;}this.zoomIndex=newZoomIndex;this.setZoom(newZoomIndex);$(this).trigger(zoomchanged);};SSSlideDisplayer.prototype.zoomout=function(){if(this.zoomIndex===0){return;}this.zoomIndex-=1;this.setZoom(this.zoomIndex);$(this).trigger(zoomchanged);};SSSlideDisplayer.prototype.activate=function(){};SSSlideDisplayer.prototype.deactivate=function(){};SSSlideDisplayer.prototype.destroy=function(){this.container.remove();};function SSTouchInteraction(config){this.config=config;this._init();}SSTouchInteraction.prototype._init=function(){this.touch={active:false};this._bindEvents();};SSTouchInteraction.prototype.activate=function(){var that=this;$(this).bind(touchprevious,function(){$.slideshareEventManager.trigger(previous);$.slideshareEventManager.trackEvent(swipe_prev);});$
  11. 11. (this).bind(touchnext,function(){$.slideshareEventManager.trigger(next);$.slideshareEventManager.trackEvent(swipe_next);});};SSTouchInteraction.prototype.deactivate=function(){$(this).unbind(touchprevious);$(this).unbind(touchnext);};SSTouchInteraction.prototype.destroy=function(){};SSTouchInteraction.prototype._bindEvents=function(){varthat=this;if(this.config.playerType===document){this.touchMove=function(e){varevt=e.originalEvent;$.slideshareEventManager.trigger(document_touch_scroll,{delta:that.touch.start.coords[1]-evt.touches[0].pageY});that.touch.start={coords:[evt.touches[0].pageX,evt.touches[0].pageY]};e.preventDefault();};this.config.container.bind(touchstart,function(e){varevt=e.originalEvent;that.touch.start={coords:[evt.touches[0].pageX,evt.touches[0].pageY]};$(that.config.container).bind(touchmove,that.touchMove);});}else{this.touchMove=function(e){var evt=e.originalEvent;if(evt.touches.length>1){that.touch.active=false;}that.touch.stop={coords:[evt.touches[0].pageX,evt.touches[0].pageY]};if(Math.abs(that.touch.start.coords[0]-that.touch.stop.coords[0])>10){e.preventDefault();}};this.config.container.bind(touchstart,function(e){varevt=e.originalEvent;if(evt.touches.length===1){that.touch.active=true;that.touch.start={coords:[evt.touches[0].pageX,evt.touches[0].pageY]};$(that.config.container).bind(touchmove,that.touchMove);}});this.config.container.bind(touchend,function(e){var evt=e.originalEvent;$(document).unbind(touchmove);if(!that.touch.active){return;}var delta=that.touch.stop.coords[0]-that.touch.start.coords[0];if(Math.abs(delta)<50){return;}if(delta<0){$(that).trigger(touchnext);}else{$(that).trigger(touchprevious);}});}};function SSFontResource(config){this.resourceTemplate={prefix:config.baseUrl,cacheable:true,retries:2,isCritical:false};SSResource.call(this,config);}SSFontResource.prototype=newSSResource();SSFontResource.prototype._initResourceConfig=function(){varresourceTemplate=this.resourceTemplate;this.url=resourceTemplate.prefix+meta-+this.config.indexString+this.config.suffix+?+this.config.timestamp;this.cacheable=resourceTemplate.cacheable;this.retries=resourceTemplate.retries||0;this.isCritical=resourceTemplate.isCritical;};SSFontResource.prototype._tryLoad=function(){$.jsonp({url:this.url,callback:slideshare_jsonp_font_hook_trigger,success:this.resourceLoadedInternalHandler(),error:this.resourceErrorInternalHandler(),cache:true,timeout:10000});};SSFontResource.prototype.resourceLoadedInternalHandler=function(){var that=this;return function foo(data){that.status=cached;$.slideshareEventManager.trigger(fontresourceloaded,{style:data.style});};};SSFontResource.prototype.resourceErrorInternalHandler=function(){var that=this;return function(data){var startTime=that.startTime;varelapsedTime=(new Date()).getTime()-startTime;varretries=that.retries;if(retries>0&&elapsedTime<that.TIMEOUT_LIMIT){retries=retries-1;that.update({retries:retries});setTimeout(function(){that._tryLoad();},1000);}else{$.slideshareEventManager.trigger(fontloadfailed,{});}};};function SSHtmlResource(config){this.resourceTemplate={prefix:config.baseUrl,key:page_,suffix:.js?+config.timestamp,digitLength:4,cacheable:true,retries:2,isCritical:true};if(config.is_private&&config.signature===undefined){this.loadBlocked=true;}SSResource.call(this,config);}SSHtmlResource.prototype=newSSResource();SSHtmlResource.prototype.ready=function(){this._initResourceConfig();this.loadBlocked=false;if(this.status===loading){this.load();}};SSHtmlResource.prototype._initResourceConfig=function(){if(this.config.is_private&&this.config.signature===undefined){return;}var resourceTemplate=this.resourceTemplate;varindexString=this.config.indexGenerator(this.config.realIndex,resourceTemplate.digitLength);if(this.config.is_private){this.url=resourceTemplate.prefix+
  12. 12. resourceTemplate.key+indexString+.js+this.config.signature;}else{this.url=resourceTemplate.prefix+resourceTemplate.key+indexString+resourceTemplate.suffix;}this.cacheable=resourceTemplate.cacheable;this.retries=resourceTemplate.retries||0;this.isCritical=resourceTemplate.isCritical;};SSHtmlResource.prototype.updateSignature=function(signature){this.config.signature=signature;};SSHtmlResource.prototype._tryLoad=function(){$.jsonp({url:this.url,callback:slideshare_jsonp_hook_trigger,success:this.resourceLoadedInternalHandler(),error:this.resourceErrorInternalHandler(),cache:true,timeout:10000});};SSHtmlResource.prototype.resourceLoadedInternalHandler=function(){var that=this;return function(data){varreplacedStyle=data.style.replace(/a.ssml_a {.*?}/,).replace(/.ssml_divspan {.*?}/,).replace(/.ps([sS]*?){[sS]*?}/g,).replace(/@font-face[sS]*?{[sS]*?}/g,);that.html=data.html;that.style=replacedStyle;$.slideshareEventManager.trigger(resourceloaded,{index:that.config.slideIndex,resourceKey:that.resourceKey});};};SSHtmlResource.prototype.getContent=function(){return{html:this.html,style:this.style};};function SSImageResource(config){if(typeof config===undefined){return;}if(config.availableSizes){this.imageVersions=this._mapSizesToVersions(config.availableSizes);delete(config.availableSizes);this._setUrlGenerator(config.conversionVersion,config.is_private);}else{this.loadBlocked=true;}this.contentWidth=config.contentWidth;delete(config.contentWidth);SSResource.call(this,config);delete(this.imageVersions);}SSImageResource.prototype=newSSResource();SSImageResource.prototype._initResourceConfig=function(){if(this.imageVersions===undefined){return;}varresourceTemplate=this.resourceTemplate;this.indexString=this.config.indexGenerator(this.config.realIndex,resourceTemplate.digitLength);this.suffixes=this._getSuffixes();this.cacheable=resourceTemplate.cacheable;this.retries=resourceTemplate.retries||0;this.isCritical=resourceTemplate.isCritical;this.privateUrls={};};SSImageResource.prototype._getUrl=function(versions){return versions[versions.length-1].url;};SSImageResource.prototype._mapSizesToVersions=function(sizes){varimageVersions=[];for(var width in sizes){if(!sizes.hasOwnProperty(width)){continue;}imageVersions[parseInt(width,10)]=sizes[width];}returnimageVersions;};SSImageResource.prototype._setUrlGenerator=function(version,is_private){switch(version){case 2:if(is_private){this.useTimeStamp=false;this._generateUrl=this._generatePrivateUrlV2;}else{this._generateUrl=this._generateUrlV2;}break;case 1:if(is_private){this.useTimeStamp=false;}this._generateUrl=this._generateUrlV1;}};SSImageResource.prototype.delayedInitialize=function(config){this.imageVersions=this._mapSizesToVersions(config.availableSizes);this.contentWidth=config.contentWidth;this._setUrlGenerator(config.conversionVersion,config.is_private);if(!config.is_private){this.ready();}};SSImageResource.prototype.ready=function(){this._initResourceConfig();delete(this.imageVersions);this.loadBlocked=false;if(this.status===loading){this.load();}};SSImageResource.prototype._tryLoad=function(containerWidth){containerWidth=containerWidth||this.config.playerWidth;varwidth=this._getAppropriateWidth(containerWidth);varsuffix=this.suffixes[width];varurl;url=this._getUrl(suffix);if(width===this.currentWidth&&suffix.status!==initialized){return;}if(suffix.status===failed){(this.versionErrorInternalHandler(width,url))();return;}this.currentWidth=width;if(suffix.status===loading){return;}if(suffix.status===loaded){(this.versionLoadedInternalHandler(width,url))
  13. 13. ();return;}suffix.status=loading;if(suffix.startTime===undefined){suffix.startTime=(newDate()).getTime();}var img=new Image();$(img).bind(load,this.versionLoadedInternalHandler(width,url)).bind(error,this.versionErrorInternalHandler(width));img.src=url;};SSImageResource.prototype.versionLoadedInternalHandler=function(width,url){var that=this;returnfunction(data){that.suffixes[width].status=loaded;if(that.status===loading){that.url=url;(that.resourceLoadedInternalHandler())();}elseif(that.status===cached&&width===that.currentWidth){that.url=url;$.slideshareEventManager.trigger(currentversionloaded,{index:that.config.slideIndex,resourceKey:that.resourceKey});}};};SSImageResource.prototype.versionErrorInternalHandler=function(width){var that=this;returnfunction(data){var suffix=that.suffixes[width];varstartTime=suffix.startTime;var elapsedTime=(new Date()).getTime()-startTime;varretries=suffix.retries;if(retries>0&&elapsedTime<that.TIMEOUT_LIMIT){retries=retries-1;suffix.retries=retries;suffix.status=initialized;setTimeout(function(){that._tryLoad();},1000);}else{suffix.status=failed;if(that.status===loading&&width===that.currentWidth){var alternateResourceAvailable=false;varresWidth;for(resWidth in that.suffixes){varalternateSuffix=that.suffixes[width];if(alternateSuffix.status===loading||alternateSuffix.status==loaded){alternateResourceAvailable=true;}}if(!alternateResourceAvailable){(that.resourceErrorInternalHandler())();}}}};};SSImageResource.prototype.resourceLoadedInternalHandler=function(){varthat=this;return function(data){$.slideshareEventManager.trigger(resourceloaded,{index:that.config.slideIndex,resourceKey:that.resourceKey});};};SSImageResource.prototype.getContent=function(){varsuffix=this.suffixes[this.currentWidth];if(suffix.status===loaded){returnthis.url;}var width;for(width in this.suffixes){suffix=this.suffixes[width];if(suffix.status===loaded){url=this._getUrl(suffix);return url;}}returnthis.url;};SSImageResource.prototype._getAppropriateWidth=function(playerWidth){var i,width,prevWidth;var suffixes=this.suffixes;var sortedWidths=[];for(widthin suffixes){width=parseInt(width,10);if(!suffixes.hasOwnProperty(width)){continue;}sortedWidths.push(width);}sortedWidths.sort(function(a,b){return a-b;});for(i=0;i<sortedWidths.length;i++){width=sortedWidths[i];prevWidth=width;if(playerWidth<=width){return width;}}return prevWidth;};function SSMetaResource(config){this.resourceTemplate={url:config.url,cacheable:true,retries:2,isCritical:true};SSResource.call(this,config);}SSMetaResource.prototype=newSSResource();SSMetaResource.prototype._initResourceConfig=function(){varresourceTemplate=this.resourceTemplate;this.url=resourceTemplate.url+?+this.config.timestamp;this.cacheable=resourceTemplate.cacheable;this.retries=resourceTemplate.retries||0;this.isCritical=resourceTemplate.isCritical;};SSMetaResource.prototype._tryLoad=function(){$.jsonp({url:this.url,callback:slideshare_jsonp_meta_hook_trigger,success:this.resourceLoadedInternalHandler(),error:this.resourceErrorInternalHandler(),cache:true,timeout:10000});};SSMetaResource.prototype.resourceLoadedInternalHandler=function(){var that=this;return function(data){that.status=loaded;$.slideshareEventManager.trigger(metadataloaded,{type:that.config.type,json:data});};};SSMetaResource.prototype.resourceErrorInternalHandler=function(){var that=this;return function(data){varstartTime=that.startTime;var elapsedTime=(new Date()).getTime()-startTime;varretries=that.retries;if(retries>0&&elapsedTime<that.TIMEOUT_LIMIT){retries=retries-1;that.update({retries:retries});setTimeout(function(){that._tryLoad();},1000);}else{$.slideshareEventManager.trigger(metadataloadfailed,{type:that.config.type});}};};function SSBgImageResource(config)
  14. 14. {this.resourceTemplate={prefix:config.baseUrl,digitLength:3,cacheable:true,retries:0,isCritical:true};this.useTimeStamp=true;varimageVersions=config.availableSizes;this.imageVersions=[];for(var width inimageVersions){this.imageVersions[parseInt(width,10)]=imageVersions[width];}switch(config.conversionVersion){case 2:if(config.is_private){this.useTimeStamp=false;this._generateUrl=this._generatePrivateUrlV2;}else{this._generateUrl=this._generateUrlV2;}break;case 1:this._generateUrl=this._generateUrlV1;if(config.is_private){this.useTimeStamp=false;}}SSImageResource.call(this,config);}SSBgImageResource.prototype=newSSImageResource();SSBgImageResource.prototype._generateUrlV2=function(index,size,quality){returnthis.config.baseUrl+images/+parseInt(quality,10)+/slide-+index+-+size+.jpg?+this.config.timestamp;};SSBgImageResource.prototype._generateUrlV1=function(index,size,extension){if(this.useTimeStamp){returnthis.config.baseUrl+output+index+(size===this.contentWidth?:(-+size))+.+extension+?+this.config.timestamp;}else{returnthis.config.baseUrl+output+index+(size===this.contentWidth?:(-+size))+.+extension+this.config.privateImageSignatures[size][75].url;}};SSBgImageResource.prototype._generatePrivateUrlV2=function(index,size,quality){return this.config.baseUrl+images%2F+parseInt(quality,10)+%2Fslide-+index+-+size+.jpg+this.config.privateImageSignatures[size][quality].url;};SSBgImageResource.prototype._getSuffixes=function(){varsuffixes={};var imageVersions=this.imageVersions;varurlSuffix=this.config.timestamp;vari,width,qualities_or_extensions,versionLen,quality,suffix;for(width inimageVersions){if(!imageVersions.hasOwnProperty(width)){continue;}width=parseInt(width,10);qualities_or_extensions=imageVersions[width];suffixes[width]=[];versionLen=qualities_or_extensions.length;for(i=0;i<versionLen;i++){quality=parseInt(qualities_or_extensions[i],10);suffix={url:this._generateUrl(this.indexString,width,qualities_or_extensions[i]),status:initialized,retries:2};suffixes[width][(isNaN(quality)?75:quality)]=suffix;}}return suffixes;};function SSFallbackImageResource(config){this.resourceTemplate={prefix:config.baseUrl,digitLength:1,cacheable:true,retries:0,isCritical:true};this.useTimeStamp=true;SSImageResource.call(this,config);}SSFallbackImageResource.prototype=newSSImageResource();SSFallbackImageResource.prototype._generateUrlV2=function(index,size,quality){returnthis.config.baseUrl+/+quality+/slide-+index+-+size+.jpg?+this.config.timestamp;};SSFallbackImageResource.prototype._generateUrlV1=function(index,size,quality){if(this.useTimeStamp){return this.config.baseUrl+-slide-+index+(size===this.contentWidth?:(-+size))+.jpg?+this.config.timestamp;}else{return this.config.baseUrl+-slide-+index+(size===this.contentWidth?:(-+size))+.jpg+this.config.privateImageSignatures[size][75].url;}};SSFallbackImageResource.prototype._generatePrivateUrlV2=function(index,size,quality){returnthis.config.baseUrl+%2F+quality+%2Fslide-+index+-+size+.jpg+this.config.privateImageSignatures[size][quality].url;};SSFallbackImageResource.prototype._getSuffixes=function(){varsuffixes=[];var imageVersions=this.imageVersions;vari,width,suffix,qualities,quality,qualityLen;for(width in imageVersions){if(!imageVersions.hasOwnProperty(width)){continue;}width=parseInt(width,10);qualities=imageVersions[width];suffixes[width]=[];qualityLen=qualities.length;for(i=0;i<qualityLen;i++){quality=parseInt(qualities[i],10);suffix={url:this._generateUrl(this.indexString,width,quality),status:initialized,retries:2};suffixes[width][quality]=suffix;}}return suffixes;};SSFallbackImageResource.prototype.addLinks=function(values){this.links=values.links||
  15. 15. [];};SSFallbackImageResource.prototype.addSignature=function(signatures){this.config.privateImageSignatures=signatures;};functionSSDocumentDisplayer(config){SSSlideDisplayer.call(this,config);this.zoomLevels=[1,1.2,1.5,1.75,2,2.5,3,4];this.prerenderedSlides=[];}SSDocumentDisplayer.prototype=newSSSlideDisplayer();SSDocumentDisplayer.prototype._bindEvents=function(){varthat=this;var i,slide;var container=this.container;varlinksDisabled=this.config.linksDisabled;container.unbind(scroll);container.bind(scroll,function(e){var currentSlide=that.detectCurrentSlide();$.slideshareEventManager.trigger(slidechanged,{index:currentSlide});});container.unbind(click);container.bind(click,function(e){var target=e.target;var targetTagName=target.tagName.toUpperCase();vartargetNode;if(linksDisabled){targetNode=false;}elseif(targetTagName===SPAN&&target.parentNode.tagName.toUpperCase()===A){targetNode=target.parentNode;}else if(targetTagName===A||targetTagName===AREA){targetNode=target;}if(targetNode){varhrefValue=parseInt(targetNode.attributes.href.value,10);if(isNaN(hrefValue)){window.open(targetNode.href);}}});$(container).bind(click,function(e){e.preventDefault();});};SSDocumentDisplayer.prototype._scrollTo=function(index){if(this.slides){vartopOffset=this.slides[index].currentViewMode.container.position().top;this.container.scrollTop(topOffset);}};SSDocumentDisplayer.prototype.start=function(config){var i,slide;var slideContainers=[];if(this.slides===undefined){this.slides=config.slides;this.state=playing;this.hideInitializer();this.slidesContainer=$(<div/>).attr({class:slidesContainer}).css({position:relative,background-color:this.playerBgColor}).appendTo(this.container);for(i=1;i<=this.config.slideCount;i++){slideContainers[i]=$(<div/>).appendTo(this.slidesContainer);}}for(i=1;i<=this.config.slideCount;i++){slide=this.slides[i];slide.setContainer({mode:config.mode,bgColor:this.playerBgColor,container:slideContainers[i]});}this.setZoom(0);};SSDocumentDisplayer.prototype.showInitializer=function(){$(<div/>).css({width:this.container.width()-10,height:this.container.height()-20,padding:5,margin:0,top:0,left:0,background-color:#fff}).html(Loading...).appendTo(this.container);};SSDocumentDisplayer.prototype.detectCurrentSlide=function(){var that=this;varviewHeight=this.height;var viewEdge1=this.container.scrollTop();varcurrentSlide=(function(){var i;for(i=1;i<that.config.slideCount;i++){varslideEdge1=that.slideOffsets[i];varslideEdge2=that.slideOffsets[i+1];if(viewEdge1>=slideEdge1&&viewEdge1<slideEdge2){return i;}}return that.config.slideCount;})();returncurrentSlide;};SSDocumentDisplayer.prototype.setZoom=function(index){this.zoomIndex=index;varcurrentZoom=this.zoomLevels[this.zoomIndex];if(currentZoom===1){this.container.css({overflow-y:scroll,overflow-x:hidden});this.slidesContainer.width(100%);this.width=this.slidesContainer.width();}else{this.container.css({overflow-y:scroll,overflow-x:scroll});varzoomWidth=this.config.width*currentZoom;this.slidesContainer.width(zoomWidth);this.width=zoomWidth;}};SSDocumentDisplayer.prototype.getZoomDimensions=function(){varcurrentZoom=this.zoomLevels[this.zoomIndex];return{width:this.config.width*currentZoom,height:this.config.height*currentZoom,displayerWidth:this.width};};SSDocumentDisplayer.prototype.setDimensions=function(dimensions){varthat=this;if(typeof dimensions===object){this.config.width=dimensions.width;this.config.height=dimensions.height;}var partialUpdate=dimensions&&dimensions.partial;if(!partialUpdate&&this.state===playing){this.setZoom(this.zoomIndex);}var zoomDimensions=this.getZoomDimensions();varzoomWidth=zoomDimensions.width;var zoomHeight=zoomDimensions.height;var
  16. 16. slidesContainerWidth=zoomDimensions.displayerWidth;this.container.css({height:this.config.height,width:this.config.width});if(!partialUpdate&&this.state===playing){this.panelHeight=0;vari,slide,offset;offset=0;for(i=1;i<=this.config.slideCount;i++){slide=this.slides[i];slide.setDimensions({parentWidth:slidesContainerWidth,parentHeight:zoomHeight});this.slideOffsets[i]=offset;offset+=slide.wrapperOffset();}this.height=offset;}};SSDocumentDisplayer.prototype.setPrerenderedSlides=function(config){var i;for(i=config.start;i<=config.end;i++){if($.inArray(i,this.prerenderedSlides)===-1){this.prerenderedSlides.push(i);}}};SSDocumentDisplayer.prototype.manualScroll=function(delta){this.container&&this.container.scrollTop(this.container.scrollTop()+delta);};function SSDocumentSlide(config){SSSlide.call(this,config);this.PADDING=5;}SSDocumentSlide.prototype=newSSSlide();SSDocumentSlide.prototype.wrapperOffset=function(){returnthis.currentViewMode.wrapperHeight;};SSDocumentSlide.prototype.empty=function(){this.currentViewMode.wrapper.empty();};SSDocumentSlide.prototype.displayLoading=function(){this.empty();$(<div/>).css({width:this.currentViewMode.width,height:this.currentViewMode.height-10,padding:5,top:0,left:0,background-color:#fff}).html(Loading...).appendTo(this.currentViewMode.wrapper);};SSDocumentSlide.prototype.setDimensions=function(dimensions){varviewWidth=dimensions.parentWidth;var viewHeight=dimensions.parentHeight-(this.PADDING*2);var viewAspect=viewWidth/viewHeight;varorigwidth,origheight,contentAspect;if(this.contentWidth===undefined||this.contentHeight===undefined){origwidth=viewWidth;origheight=viewWidth*1.33;contentAspect=origwidth/origheight;}else{origwidth=this.contentWidth;origheight=this.contentHeight;contentAspect=origwidth/origheight;}var scale,contentScale,fontscale,width,height;vartop,left;contentScale=viewWidth/origwidth;fontscale=contentScale*16;width=viewWidth;scale=viewAspect/contentAspect;top=this.PADDING;height=scale*viewHeight;width=parseInt(width,10);height=parseInt(height,10);this.currentViewMode.container.css({width:width+(this.PADDING*2),height:height+(this.PADDING*2)});this.currentViewMode.wrapper.css({width:width,height:height,position:absolute,background-color:this.currentViewMode.bgColor,padding:this.PADDING+px0});this.currentViewMode.wrapperWidth=width;this.currentViewMode.wrapperHeight=height;this.currentViewMode.top=top;this.currentViewMode.left=0;this.currentViewMode.contentScale=contentScale;this.currentViewMode.fontscale=fontscale;this.currentViewMode.width=width;this.currentViewMode.height=height;};SSDocumentSlide.prototype.hide=function(){if(!this.currentViewMode.rendered){return;}this.empty();delete(this.currentViewMode.contentElement);delete(this.currentViewMode.imageElement);this.currentViewMode.rendered=false;};SSDocumentSlide.prototype.show=function(force){if(this.currentViewMode.rendered&&!force){return;}this.currentViewMode.rendered=true;this.load();};SSDocumentSlide.prototype.play=function(){$.slideshareEventManager.trigger(slidechanged,{index:this.index});this.show();};SSDocumentSlide.prototype.setContainer=function(config){var mode=config.mode;if(this.viewModes[mode]===undefined){this.viewModes[mode]={rendered:false,bgColor:config.bgColor||#ccc,container:config.container,wrapper:$(<div/>).appendTo(config.container)};this.viewModes[mode].container.css({position:relative});}this.currentViewMode=this.viewModes[mode];this.currentMode=config.mode;};function SSToolbar(config){this.config=config;this.GA_EVENTS={previous:toolbar_prev,next:toolbar_next,viewonss:toolbar_viewonss,zoomin:toolbar_zoomin,zoomout:toolbar_zoomout,viewfullscreen:toolbar_fullscreen,leavefullscreen:toolbar_leavefullscreen};this._init();this._ELEMENTS=this.getElements();this._ELEMENT_PRIORITIES={1:[nav],5:[viewOnSS],2:[fullScreen,leaveFullScreen],3:[share],4:[goToSlide],6:[zoomButtons]};this._ELEMENT_VISIBILITY={share:!this.config.disableShare,fullScreen:!
  17. 17. this.config.isFullScreen,leaveFullScreen:this.config.isFullScreen,viewOnSS:this.config.enableViewSS,zoomButtons:(this.config.playerType==document),nav:true,goToSlide:true};this._ELEMENT_SECTION={nav:one,share:two,fullScreen:two,leaveFullScreen:two,goToSlide:two,viewOnSS:one,zoomButtons:two};varviewOnSSbuttonWidth={small:29,normal:88};if(this.config.playerType==document){this._ELEMENT_WIDTHS={nav:30,share:72,fullScreen:24,leaveFullScreen:24,goToSlide:57,viewOnSS:viewOnSSbuttonWidth[this.config.toolbarClass],zoomButtons:56};this._ELEMENT_SECTION.share=one;}else{this._ELEMENT_WIDTHS={nav:57,share:35,fullScreen:24,leaveFullScreen:24,goToSlide:57,viewOnSS:viewOnSSbuttonWidth[this.config.toolbarClass]};}this.config.toolbarPadding=6;}SSToolbar.prototype._init=function(){var container=this.container=$(<div/>).attr({class:toolbar}).css({height:this.config.height}).html(this.config.html).appendTo(this.config.renderTo);this.config.toolbarClass=this._getToolbarClass();this.container.addClass(this.config.toolbarClass);if(this.config.disableShare){container.find(.btnShare).hide();}if(this.config.enableViewSS){container.find(.btnViewOnSS).show();}if(this.config.isFullScreen){container.find(.btnFullScreen).hide();container.find(.btnLeaveFullScreen).show();}if(this.config.hasAudio){this.volumeControl=newSSVolumeControl({container:container.find(.jspl_volume_control),renderTo:container,trigger:container.find(.btnVolume)});this.audioActive=true;}varthat=this;container.find(.goToSlideLabel>span).html(/+this.config.totalSlideCount);this.deactivate();};SSToolbar.prototype._getToolbarClass=function(){vartoolbarClass="";if(this.config.width<400){toolbarClass="small";}else{toolbarClass="normal";}return toolbarClass;};SSToolbar.prototype.getElements=function(){varcontainer=this.container;varelementCodes={nav:.nav,share:.btnShare,fullScreen:.btnFullScreen,leaveFullScreen:.btnLeaveFullScreen,viewOnSS:.btnViewOnSS,goToSlide:.goToSlideLabel,zoomButtons:.docActions};var elements={};$.each(elementCodes,function(code,selector){elements[code]=container.find(selector);});returnelements;};SSToolbar.prototype.deactivate=function(){var buttons=.btnFirst,.btnPrevious, .btnNext, .btnLast, .btnSS, .btnViewOnSS, .btnFullScreen,+.btnZoomOut, .btnZoomIn, .btnFind,.btnShare;this.container.find(buttons).unbind(click);this._unbindButtonHandler(buttons);this.container.find(.goToSlideLabel>input[type=text]).attr(disabled,true);this.active=false;this.config.hasAudio&&this.updateAudioInteraction();};SSToolbar.prototype.activate=function(){var that=this;varcontainer=this.container;var buttons=.btnFirst, .btnPrevious, .btnNext,.btnLast, .btnSS, .btnViewOnSS, .btnFullScreen, +.btnZoomOut, .btnZoomIn,.btnFind, .btnShare;this._bindButtonHandler(buttons,{.btnViewOnSS:viewonss,.btnFirst:gotofirstslide,.btnSS:viewonss,.btnPrevious:previous,.btnNext:next,.btnLast:gotolastslide,.btnFullScreen:viewfullscreen,.btnLeaveFullScreen:leavefullscreen,.btnZoomOut:zoomout,.btnZoomIn:zoomin,.btnFind:playersearch,.btnShare:playershare});vargotoslideInput=this.container.find(.goToSlideLabel>input[type=text]);gotoslideInput.attr(disabled,false);gotoslideInput.bind(keyup,function(e){e.stopPropagation();if(e.keyCode===13){var input=$(e.target);varval=input.val();if(isNaN(val)){return;}else{var slidenumber=parseInt(val,10);$.slideshareEventManager.trigger(gotoslide,{index:slidenumber});}}});gotoslideInput.bind(focus,function(e){$(e.target).select();});this.active=true;this.config.hasAudio&&this.updateAudioInteraction();};SSToolbar.prototype.updateAudioInteraction=function(values){varkey;for(key in values){this[key]=values[key];}if(this.active&&this.audioReady&&this.audioMetaReady){!this.audioActive&&this._activateAudio();this._updateAudioDisplay();}else{this.audioActive&&this._deactivateAudio();}};SSToolbar.prototype._activateAudio=functio
  18. 18. n(){this.container.find(.btnAudio,.btnVolume).removeClass(disabled);this._bindButtonHandler(.btnAudio,.btnVolume,{.btnAudio:toggleaudio,.btnVolume:showvolumecontrol});this.audioActive=true;};SSToolbar.prototype._deactivateAudio=function(){this.container.find(.btnAudio,.btnVolume).addClass(disabled);this._unbindButtonHandler(.btnAudio,.btnVolume);this.audioActive=false;};SSToolbar.prototype._updateAudioDisplay=function(playing){if(this.audioPlaying){this.container.find(.btnAudio).removeClass(btnAudioPlay).addClass(btnAudioPause).attr(title,Pause);}else{this.container.find(.btnAudio).removeClass(btnAudioPause).addClass(btnAudioPlay).attr(title,Play);}};SSToolbar.prototype._bindButtonHandler=function(resetButtons,config){varcontainer=this.container;varthat=this;this.container.find(resetButtons).unbind();$.each(config,function(selector,eventname){container.find(selector).bind(click,function(e){$.slideshareEventManager.trigger(eventname,e);e.preventDefault();e.stopPropagation();var gaEvent=that.GA_EVENTS[eventname];if(gaEvent){$.slideshareEventManager.trackEvent(gaEvent);}});});};SSToolbar.prototype._unbindButtonHandler=function(buttons){this.container.find(buttons).unbind();this.container.find(buttons).bind(click,function(e){e.preventDefault();e.stopPropagation();});};SSToolbar.prototype.setDimensions=function(dimensions){var that=this;varfirstElementWidth=that._ELEMENT_WIDTHS[that._ELEMENT_PRIORITIES[1][0]];varsectionWidth=(dimensions.width/2)-that.config.toolbarPadding-firstElementWidth;var availableWidth={one:sectionWidth,two:sectionWidth};varpriorityLength=this._ELEMENT_PRIORITIES.length;varpriorityElement,priorityElementLength;varelementCode,elementWidth,elementVisibility,elementShowable;$.each(this._ELEMENT_PRIORITIES,function(priority,priorityElement){priorityElementLength=priorityElement.length;for(varj=0;j<priorityElementLength;j++){elementCode=priorityElement[j];varsection=that._ELEMENT_SECTION[elementCode];elementWidth=that._ELEMENT_WIDTHS[elementCode];elementShowable=(that._ELEMENT_VISIBILITY[elementCode]&&availableWidth[section]>elementWidth);if(priority==1||elementShowable){that._ELEMENTS[elementCode].show();if(priority!=1){availableWidth[section]-=elementWidth;}}else{that._ELEMENTS[elementCode].hide();}}});};SSToolbar.prototype.updateCurrentPosition=function(position){this.container.find(.goToSlideLabel>input[type=text]).val(position);};SSToolbar.prototype.destroy=function(){this.container.remove();};functionSSPlayerController(config){this.config=config;this.realSlideCount=this.config.slide_count;this.slideCount=this.realSlideCount;if(this.config.has_video){this.slideCount+=this.config.video_slides_count;}delete(this.config.slide_count);this.mode=this.config.mode;delete(this.config.mode);this.currentPosition=0;this.loadingSlides=[];this.loadedSlides=[];this.slideModes={};this.availableBgSizes={};this.availableFallbackSizes={};if(this.config.has_lead){this.has_lead=true;this.leadCreated=false;if(this.config.form_after_slide_no===this.slideCount){this.config.form_after_slide_no=this.slideCount-1;}}this.PRELOAD_PRE_LIMIT=2;this.PRELOAD_POST_LIMIT=5;this.FONT_BATCH_COUNT=10;this.DEFAULT_ERROR_SCORE=0;this.AUTOVERIFICATION_ERROR_THRESHOLD=0.001;this.AUTOVERIFICATION_THRESHOLDS={bad v1.0:0.001,bad v1.1:0.0001,badv2.0:0.0001};this.MAX_PERCENTAGE_FAILING={bad v1.0:100,bad v1.1:20,badv2.0:20};this.TOOLBAR_HEIGHT=30;this.TOOLBAR_PADDING=8;this.AUDIOBAR_HEIGHT=16;this.initialized=false;this.PRERENDER_COUNT=1;this._init();this.startSlide=parseInt(this.config.page||1,10);this.play(this.startSlide);}SSPlayerController.prototype._init=function(){var that=this;$.slideshareEventManager.registerController(this);$.slideshareEventManager.registerEnvironment(this.config.hosted_in);this.cachedDomElements={};this.componentSets={};this._createComponentSet(normal);this._bindEvents();this.exitFullScreenHandler=this.exitFullScreenHandlerFactory();if(this.mode!==video)
  19. 19. {this._initMetadata();this._loadMetadata();this.config.has_audio&&!this.config.touch&&this._loadAudioMetadata();}else{this._loadVideoMeta();}$.slideshareEventManager.trackEvent(player_initialized);$.slideshareEventManager.trackEvent(this.mode+_mode);};SSPlayerController.prototype._loadVideoMeta=function(){if(this.config.is_private){this._getHtmlSignatures();}this.initialized=true;};SSPlayerController.prototype._initMetadata=function(){if(this.mode===html){if(this.config.is_private){this._getHtmlSignatures();}this._initFontResources();this._initHtmlMetadata();this.config.image_ready&&this._initImageMetadata(true);}else if(this.mode===image){this._initImageMetadata();}else{if(window._gaq){_gaq.push([_trackEvent,jsplayer,invalidplayermode,this.config.id]);}throw"Unknown playermode";}};SSPlayerController.prototype._loadMetadata=function(){if(this.mode===html){this.metaResource.load();this.config.image_ready&&this.imageMetaResource.load();}else if(this.mode===image){this.imageMetaResource.load();}else{throw"Unknown playermode";}};SSPlayerController.prototype._initHtmlMetadata=function(signature){this.metaResource=newSSMetaResource({url:this.config.bucket_location+meta.js,timestamp:this.config.timestamp,type:html,is_private:this.config.is_private,signature:signature});};SSPlayerController.prototype._initImageMetadata=function(isFallback,signature){this.imageMetaResource=newSSMetaResource({url:this.config.image_bucket_location+.js,timestamp:this.config.timestamp,type:isFallback?imagefallback:imageprimary});};SSPlayerController.prototype._initFontResources=function(signatures,fontBatchCount){if(fontBatchCount){fontBatchNum=Math.ceil(this.slideCount/fontBatchCount);}else{fontBatchNum=Math.ceil(this.slideCount/this.FONT_BATCH_COUNT);}var urlSuffix;if($.browser.msie){urlSuffix=this.config.html_eotfont_url_suffix;}else{urlSuffix=this.config.html_ttffont_url_suffix;}var i;this.fontResources=[];for(i=1;i<=fontBatchNum;i++){this.fontResources[i]=newSSFontResource({baseUrl:this.config.bucket_location,indexString:this._getIndexString(i,0),timestamp:this.config.timestamp,suffix:urlSuffix});}};SSPlayerController.prototype._loadAudioMetadata=function(){this.audioResource=newSSAudioResource({url:this.config.audio_bucket_location+.js,timestamp:this.config.audio_timestamp,slideCount:this.slideCount,audioDuration:this.config.audio_duration,audioUrl:this.config.audio_url,flashRoot:this.config.sound_manager_flash_component_root,assetId:this.config.sound_manager_asset_id});this.audioResource.load();};SSPlayerController.prototype.getImagePrivateSignatures=function(imageSizes,mode){var that=this;(function(mode){$.ajax({url:that.config.images_signature_request_route,data:{id:that.config.id,key:that.config.secret_key,mode:mode,images_sizes:imageSizes,version:that.conversionVersion,password_hash:that.config.password_hash,slidetracking_hash:that.config.slidetracking_hash},dataType:json,cache:false,type:POST,success:function(data){if(mode===html){that.privateImageSignatures=data;}else if(mode===image){that.privateFallBackImageSignatures=data;}if(mode===html||mode===image){that.postInitialize();}else{if(that.slidesCreated){varimageCount=that.slideModes.image.length;varslide,slideIndex;for(i=0;i<imageCount;i++){slideIndex=that.slideModes.image[i];slide=that.slides[that.realIndexToIndex[slideIndex]];slide.resources.image.addSignature(data[slideIndex]);slide.resources.image.ready();}}else{that.privateFallBackImageSignatures=data;}}}});})(mode);};SSPlayerController.prototype._getHtmlSignatures=function(){varpolicyUrl=this.config.signature_request_route;var that=this;$.ajax({url:policyUrl,data:{id:this.config.id,key:this.config.secret_key},dataType:json,cache:false,type:POST,success:function(data){var dataLength=data.length;vardataObj;if(dataLength!==0){for(var i=0;i<dataLength;i++)
  20. 20. {dataObj=data[i];that.htmlResourceSignatures=data[i].info;}for(i=0;i<that.slideCount;i++){if(that.slides&&that.slides[i]){slide=that.slides[i];slide.resources.html.updateSignature(that.htmlResourceSignatures[i].url);slide.resources.html.ready();}}}},failure:function(){$.slideshareEventManager.trigger(metadataloadfailed,{type:that.config.type});}});};SSPlayerController.prototype._metaDataHandlers=function(){var criticalFailureHandler=function(){var height,width;varslidedisplayer=this.currentComponentSet.slidedisplayer;height=slidedisplayer.container.height();width=slidedisplayer.container.width();slidedisplayer.error(this.generateErrorDom(meta_error_template,{width:width,height:height}));};return{html:{success:function(data){this.conversionVersion=parseInt(data.version||1,10);this.slideSizes=data.sizes||{};varavailableSizes={};switch(this.conversionVersion){case2:availableSizes=data.available_sizes||{};break;case 1:varimageFormats=data.image_formats;var i,slideFormats,slideSizes,width,fullSize;varslideCount=this.realSlideCount;for(i=1;i<=slideCount;i++){slideFormats=imageFormats[i]||{};slideSizes={};for(width in slideFormats){slideSizes[width]=[slideFormats[width]];}slideSizes[400]=[jpg];try{fullSize=this.slideSizes[i].width;}catch(ex){fullSize=slideSizes.length-1+100;}slideSizes[fullSize]=[png];availableSizes[i]=slideSizes;}}this.availableBgSizes=availableSizes;var errorScores=data.error_scores||{};this.algo=errorScores.algo||bad v1.0;this.errorScores=errorScores.webkit||{};var commonStyle="n.ssml_div span {line-height:normal;} "+"n.ssml_div div{line-height:normal;}n.ssml_div{font-size:16px;}";if(this.config.disable_links){commonStyle=commonStyle+"n.ssml_div a{cursor:default;}";}var defaultPresentationStyle="a.ssml_a {text-decoration:none;color:inherit;vertical-align:top;} "+"n.ssml_div span{position:absolute; white-space:pre; vertical-align:top;} "+"n.ssml_div div{position:absolute;}";var finalResetStyleTag=<style>+(data.global_styles_css||defaultPresentationStyle)+commonStyle+</style>;$(finalResetStyleTag).appendTo(this.currentComponentSet.container);if(data.pages_per_fontfile){this.FONT_BATCH_COUNT=data.pages_per_fontfile;this._initFontResources();}if(this.config.is_private){this.getImagePrivateSignatures(this.availableBgSizes,"html");}else{this.postInitialize();}},failure:criticalFailureHandler},imagefallback:{success:function(data){if(this.config.disable_links){data.links={};}if(this.slidesCreated){this.fallbackMetaHandler(data);}else{this.fallbackMetaData=data;}},failure:function(){var imageCount=this.slideModes.image.length;vari,width,height,slideIndex,slide;for(i=0;i<imageCount;i++){slideIndex=this.slideModes.image[i];slide=this.slides[slideIndex];width=slide.currentViewMode.width;height=slide.currentViewMode.height;slide.displayError(this.generateErrorDom(slide_error_template,{width:width,height:height}),true);}}},imageprimary:{success:function(data){this.conversionVersion=parseInt(data.version||1,10);this.slideSizes=data.sizes||{};if(this.config.disable_links){data.links={};}this.slideLinks=data.links||{};var slideCount=this.realSlideCount;vari,slideAvailableSizes,dimensions;switch(this.conversionVersion){case2:this.availableFallbackSizes=data.available_sizes;break;case1:this.availableFallbackSizes={};for(i=1;i<=slideCount;i++){slideAvailableSizes={320:[75],768:[75]};dimensions=this.slideSizes[i]||{};if(dimensions.width){slideAvailableSizes[dimensions.width]=[75];}this.availableFallbackSizes[i]=slideAvailableSizes;}}if(this.config.is_private){this.getImagePrivateSignatures(this.availableFallbackSizes,"image");}else{this.postInitialize();}},failure:criticalFailureHandler}};};SSPlayerController.prototype.fallbackMetaHandler=function(data){varconversionVersion=parseInt(data.version||1,10);var imageSizes=data.sizes||{};varavailableSizes=data.available_sizes||{};var imageLinks=data.links||{};varimageCount=this.slideModes.image.length;var
  21. 21. slideAvailableSizes,dimensions,slide;for(i=0;i<imageCount;i++){slideIndex=this.slideModes.image[i];dimensions=imageSizes[slideIndex]||{};slideAvailableSizes=availableSizes[slideIndex];if(slideAvailableSizes===undefined){slideAvailableSizes={320:[75],768:[75]};slideAvailableSizes[dimensions.width]=[75];}slide=this.slides[this.realIndexToIndex[slideIndex]];slide.setContentDimensions(dimensions.width||0,dimensions.height||0);slide.updateResource(image,{sizes:{contentWidth:dimensions.width||0,availableSizes:slideAvailableSizes,conversionVersion:conversionVersion,is_private:this.config.is_private},linkData:imageLinks[slideIndex]||[]});}if(this.config.is_private){this.getImagePrivateSignatures(availableSizes,imagefb);}};SSPlayerController.prototype.postInitialize=function(){this._initSlides();this._activateComponentSet(normal);this._setModeForSlides(normal);this.setDimensions();$(this).trigger(playerinitialized);};SSPlayerController.prototype._bindEvents=function(){var that=this;$(this).bind(playerinitialized,function(){this.initialized=true;that.play();});if(!(this.config.touch||this.config.player_type===document||this.config.player_type===video)){$(document).bind(keyup,function(e){if(e.target.nodeName!==INPUT&&e.target.nodeName!==TEXTAREA){varleadForm=that.currentComponentSet.leadForm;if(e.keyCode===37&&!(leadForm&&leadForm.isVisible())){if(that.currentComponentSet.lastScreen){that.currentComponentSet.lastScreen.destroy();}$.slideshareEventManager.trigger(previous);}if(e.keyCode===39&&!(leadForm&&leadForm.isVisible())){$.slideshareEventManager.trigger(next);}}});}};SSPlayerController.prototype._bindComponentSetEvents=function(){var that=this;varcomponentSet=this.currentComponentSet;$(componentSet.slidedisplayer).bind(zoomchanged,function(e){that.repaint();});};SSPlayerController.prototype._createComponentSet=function(mode){varthat=this;this.componentSets[mode]={};this.currentComponentSet=this.componentSets[mode];this.currentViewMode=mode;varcomponentSet=this.currentComponentSet;if(mode===normal){componentSet.container=$(#+this.config.container);if(componentSet.container.length!==1){throwUnableto find container for player;}componentSet.container.css({overflow:hidden});}else if(mode===fullscreen){this.normalModeScrollPosition=$(window).scrollTop();componentSet.container=$(<div/>).css({height:100%,left:0,position:absolute,top:0,width:100%,overflow:hidden,z-index:10050}).appendTo($(body));$(body,html).css({overflow:hidden});}var isFullScreen=(mode===fullscreen)||this.config.is_fullscreen;varcomponentBackgroundColor=#ccc;if(isFullScreen){componentBackgroundColor=this.config.fullscreen_bgcolor;}else{componentBackgroundColor=this.config.player_bgcolor;}componentSet.navigators=[];vardisplayerConfig={renderTo:componentSet.container,spinnerUrl:this.config.spinner_url,errorImageUrl:this.config.error_image_url,mode:this.mode,slideCount:this.slideCount,playerType:this.config.player_type,playerBgColor:componentBackgroundColor};if(mode===fullscreen){displayerConfig.spinnerUrl=this.config.spinner_url_fullscreen;}if(this.config.player_type===document){componentSet.slidedisplayer=newSSDocumentDisplayer(displayerConfig);}else if(this.config.player_type===video){displayerConfig.videoBucket=this.config.video_bucket;displayerConfig.fileExtension=this.config.file_extension;displayerConfig.pptLocation=this.config.ppt_location;componentSet.slidedisplayer=newSSVideoDisplayer(displayerConfig);}else{componentSet.slidedisplayer=newSSPresentationDisplayer(displayerConfig);}componentSet.navigators.push(componentSet.slidedisplayer);this.hasToolbar=!this.config.touch&&this.mode!==video;this.setDimensions();if(this.config.hosted_in!=="mobile_slideview"&&this.currentComponentSet.width<510&&this.currentComponentS
  22. 22. et.height<426){this.config.disable_lastscreen=true;}if(this.config.hosted_in=="embed"){this.config.shareScreenClass=this._getShareScreenClass(this.currentComponentSet.width,this.currentComponentSet.height);if(!this.config.shareScreenClass){this.config.disable_share=true;}}else{this.config.shareScreenClass="";}if(this.config.touch){componentSet.touchInteraction=newSSTouchInteraction({container:componentSet.slidedisplayer.container,playerType:this.config.player_type});componentSet.navigators.push(componentSet.touchInteraction);}else if(this.config.player_type!==document&&this.config.player_type!==video){componentSet.bandInteraction=newSSBandInteraction({container:componentSet.slidedisplayer.container,width:componentSet.width,linksDisabled:this.config.disable_links});componentSet.navigators.push(componentSet.bandInteraction);}if(this.config.has_lead&&!this.leadCreated){if(this.config.show_lead_cta){componentSet.leadcta=newSSLeadCTA({renderTo:componentSet.container,html:this.config.lead_form_cta_html,has_audio:this.config.has_audio});componentSet.navigators.push(componentSet.leadcta);}componentSet.leadForm=newSSLeadForm({leadFormHtml:this.config.leadFormHtml||,renderTo:componentSet.slidedisplayer.container,lead_form_url:this.config.lead_form_url,show_skip_button:this.config.show_skip_button,width:this.currentComponentSet.width,height:this.currentComponentSet.height});componentSet.navigators.push(componentSet.leadForm);}if(this.hasToolbar){componentSet.toolbar=newSSToolbar({width:componentSet.width,height:this.TOOLBAR_HEIGHT,html:this.config.toolbar_html,renderTo:componentSet.container,totalSlideCount:this.slideCount,primaryResourceType:this.config.primaryResourceType,disableShare:this.config.disable_share,enableViewSS:this.config.enable_viewSS,isFullScreen:isFullScreen,playerType:this.config.player_type,hasAudio:this.config.has_audio});componentSet.navigators.push(componentSet.toolbar);}if(this.config.has_audio&&!this.config.touch){componentSet.audiobar=newSSAudioBar({renderTo:componentSet.container,slideCount:this.slideCount,height:this.AUDIOBAR_HEIGHT,html:this.config.audiobar_html,resource:this.audioResource,css2ConfettiUrl:this.config.css2_confetti_url});componentSet.navigators.push(componentSet.audiobar);}if(this.config.has_video){componentSet.videoConfetti=$(<img/>).attr({src:this.config.confetti_url}).css({position:absolute,top:-1px,left:-1px}).appendTo(componentSet.container);}if(this.mode!==video){this._bindComponentSetEvents();}};SSPlayerController.prototype._getShareScreenClass=function(componentSetWidth,componentSetHeight){varshareScreenClass=null;if(componentSetWidth>360&&componentSetHeight>260){shareScreenClass="normal";}else if(componentSetWidth>320&&componentSetHeight>250){shareScreenClass="small";}else if(componentSetWidth>290&&componentSetHeight>280){shareScreenClass="tiny";}returnshareScreenClass;};SSPlayerController.prototype._destroyComponentSet=function(mode){var componentSet=this.componentSets[mode];$.each(componentSet.navigators,function(i,navigatorItem){navigatorItem.destroy();});delete(this.componentSets[mode].navigators);delete(this.componentSets[mode].slidedisplayer);if(mode===fullscreen){componentSet.container.remove();$(body, html).css({overflow:auto});}var slide;for(var i=1;i<=this.slideCount;i++){slide=this.slides[i];slide.viewModes[mode].container.remove();delete(slide.viewModes[mode]);}delete(this.componentSets[mode].container);delete(this.componentSets[mode]);};SSPlayerController.prototype._mapIndexes=function(){varvideoSlidesHash=this.config.video_hash;var realSlidePosition=1;vartotalSlides=this.slideCount;varslideToRealIndexMap={},realIndexToIndexMap={};for(var i=1;i<=totalSlides;i++){if(videoSlidesHash&&videoSlidesHash[i]){slideToRealIndexMap[i]=null;}else{slideToRealIndexMap[i]=realSlidePosition;realIndexToIndexMap[realSlidePosition]=i;realSlidePosition++;}}
  23. 23. if(this.config.has_video){var tag=document.createElement(script);varprotocol=(this.config.use_ssl?https://:http://);tag.src=protocol+"www.youtube.com/player_api";var firstScriptTag=document.getElementsByTagName(script)[0];firstScriptTag.parentNode.insertBefore(tag,firstScriptTag);}this.indexToRealIndex=slideToRealIndexMap;this.realIndexToIndex=realIndexToIndexMap;};SSPlayerController.prototype._percentageFailing=function(errorThreshold){var slidesFailing=0;for(var i in this.errorScores){if(this.errorScores[i]>errorThreshold){slidesFailing++;}}if(this.slideCount===0){return 0;}returnparseInt(100*(slidesFailing/this.slideCount),10);};SSPlayerController.prototype._initSlides=function(){this.slides=[];this.slideModes.image=[];this.slideModes.html=[];var count=0;vari,slide,size,slideConfig,errorScore,slideMode;var imageMetaRequired=false;varrealIndex,videoCount=0;varvideoSlidesHash=this.config.video_hash;this._mapIndexes();varindexMap=this.indexToRealIndex;varerrorThreshold=this.AUTOVERIFICATION_ERROR_THRESHOLD;var percentageFailing=0;varmaxPercentageFailing=100;if(this.conversionVersion===2&&typeofthis.AUTOVERIFICATION_THRESHOLDS[this.algo]!==undefined){errorThreshold=this.AUTOVERIFICATION_THRESHOLDS[this.algo];percentageFailing=this._percentageFailing(errorThreshold);}if(this.conversionVersion===2&&typeof this.MAX_PERCENTAGE_FAILING[this.algo]!==undefined){maxPercentageFailing=this.MAX_PERCENTAGE_FAILING[this.algo];}for(i in indexMap){if(indexMap.hasOwnProperty(i)){i=parseInt(i,10);realIndex=indexMap[i];if(indexMap[i]===null){slideMode=ytube_video;}else if(this.mode===html&&!this.config.image_ready){slideMode=html;}else if(this.mode===image){slideMode=image;}else{if(this.conversionVersion===2&&percentageFailing>maxPercentageFailing){slideMode=image;imageMetaRequired=true;}else{errorScore=parseFloat(this.errorScores[i]);if(isNaN(errorScore)){errorScore=this.DEFAULT_ERROR_SCORE;}if(errorScore>errorThreshold){slideMode=image;imageMetaRequired=true;}else{slideMode=html;}}}if(realIndex===null){realIndex=videoSlidesHash[i].parent;}size=this.slideSizes[realIndex]||{};if(slideMode===html){this.slideModes.html.push(realIndex);}else if(slideMode===image){this.slideModes.image.push(realIndex);}slideConfig={realIndex:realIndex,index:i,type:this.mode,slideMode:slideMode,indexGenerator:this._getIndexString,contentWidth:parseInt(size.width,10),contentHeight:parseInt(size.height,10),playerWidth:this.currentComponentSet.width,errorImageUrl:this.config.error_image_url,spinnerUrl:this.config.spinner_url,spinnerUrlFullscreen:this.config.spinner_url_fullscreen,playerType:this.config.player_type,stripped_title:this.config.stripped_title,timestamp:this.config.timestamp,ppt_location:this.config.ppt_location,is_private:this.config.is_private,conversionVersion:this.conversionVersion||1};if(slideMode===html){slideConfig.bucketLocation=this.config.bucket_location;slideConfig.availableSizes=this.availableBgSizes[realIndex];}else if(slideMode===image){slideConfig.bucketLocation=this.config.image_bucket_location;slideConfig.availableSizes=this.availableFallbackSizes[realIndex];}if(this.config.is_private){if(slideMode==html){if(this.htmlResourceSignatures&&this.htmlResourceSignatures[realIndex]){slideConfig.htmlResourceSignature=this.htmlResourceSignatures[realIndex].url;}slideConfig.privateImageSignatures=this.privateImageSignatures[realIndex];}elseif(slideMode==image){if(this.privateFallBackImageSignatures){slideConfig.privateImageSignatures=this.privateFallBackImageSignatures[realIndex];}}}if(this.config.player_type===document){slide=newSSDocumentSlide(slideConfig);}else{if(slideMode!==ytube_video){slide=newSSPresentationSlide(slideConfig);}else{videoCount++;slideConfig.video_id=videoSlidesHash[i].video_id;slideConfig.current_video_count=videoCount;slideConfig.loading_message_partial=this.config.loading_message_partial;if(i===1){slideConfig.contentWidth=728;slideConfig.contentHeight=542;}
  24. 24. slide=new SSVideoEmbedSlide(slideConfig);}}if(this.mode===image&&this.slideLinks[realIndex]!==undefined){slide.updateResource(image,{linkData:this.slideLinks[realIndex]||{}});}this.slides[i]=slide;delete(this.availableFallbackSizes[realIndex]);}}if(imageMetaRequired===true){this.slidesCreated=true;this.fallbackMetaData&&this.fallbackMetaHandler(this.fallbackMetaData);}};SSPlayerController.prototype._getIndexString=function(number,length){var s=+number;var numberlen=s.length;var i;for(i=0;i<(length-numberlen);i++){s=0+s;}return s;};SSPlayerController.prototype._getContainerSize=function(){this.currentComponentSet.width=this.currentComponentSet.container.width();this.currentComponentSet.height=this.currentComponentSet.container.height();};SSPlayerController.prototype.setDimensions=function(partial){varcomponentSet=this.currentComponentSet;this._getContainerSize();partial=partial||false;componentSet.viewHeight=componentSet.height;if(this.hasToolbar){componentSet.viewHeight=componentSet.viewHeight-this.TOOLBAR_HEIGHT-this.TOOLBAR_PADDING;}if(this.config.has_audio){componentSet.viewHeight=componentSet.viewHeight-this.AUDIOBAR_HEIGHT;}componentSet.slidedisplayer.setDimensions({width:componentSet.width,height:componentSet.viewHeight,partial:partial});if(!partial){vardimensions={height:componentSet.height,width:componentSet.width};this.currentComponentSet.toolbar&&this.currentComponentSet.toolbar.setDimensions(dimensions);this.currentComponentSet.audiobar&&this.currentComponentSet.audiobar.setDimensions(dimensions);this.currentComponentSet.shareScreen&&this.currentComponentSet.shareScreen.setDimensions(dimensions);this.currentComponentSet.lastScreen&&this.currentComponentSet.lastScreen.setDimensions(dimensions);}};SSPlayerController.prototype.repaint=function(){if(this.currentComponentSet.slidedisplayer===undefined){return;}this.setDimensions(true);this.setDimensions();this._repaintPrerenderedSlides();this.currentComponentSet.slidedisplayer._scrollTo(this.currentPosition);};SSPlayerController.prototype._repaintPrerenderedSlides=function(){varprerenderedSlides=this.currentComponentSet.slidedisplayer.prerenderedSlides;varslideIndex;if(prerenderedSlides.length>0){vari;for(i=0;i<prerenderedSlides.length;i++){slideIndex=prerenderedSlides[i];this.slides[slideIndex].show(true);}}};SSPlayerController.prototype.updateCurrentPosition=function(position){vartoolbar=this.currentComponentSet.toolbar;varaudiobar=this.currentComponentSet.audiobar;toolbar&&toolbar.updateCurrentPosition(position);audiobar&&audiobar.updateCurrentPosition(position);varaudioResource=this.audioResource;if(toolbar&&this.config.has_audio&&audioResource){toolbar.updateAudioInteraction({audioReady:audioResource.audioReady,audioMetaReady:audioResource.metaDataReady,audioPlaying:audioResource.playing});toolbar.volumeControl.setVolume(this.audioResource.volume);}this.currentPosition=position;this.slides[position].painted=true;};SSPlayerController.prototype.displayLastScreen=function(){var that=this;if(typeofthis.currentComponentSet.lastScreen===undefined){if(this.config.disable_lastscreen){this.currentComponentSet.lastScreen=newSSReplayScreen({renderTo:this.currentComponentSet.container,settings:this.config.replayscreen});}else{this.currentComponentSet.lastScreen=newSSLastScreen({renderTo:this.currentComponentSet.container,settings:this.config.lastscreen,embed_code:this.config.embed_code});}$(this.currentComponentSet.lastScreen).bind(gotofirstslide,function(){$(that).trigger(gotofirstslide);});$(this.currentComponentSet.lastScreen).bind(showshareoptions,function(){that.displayShareScreen();});}this.currentComponentSet.lastScreen.show({width:this.currentComponentSet.width,height:this.currentComponentSet.height});$.slideshareEventManager.trackEvent(lastscreen_shown);};SSPlayerController.prototype.displayShareScreen=function(){var that=this;if(typeofthis.currentComponentSet.shareScreen===undefined){this.currentComponentSet.shareScreen=newSSShareScreen({renderTo:this.currentComponentSet.container,settings:this.config.

×