0byt3m1n1
Path:
/
home
/
mgatv524
/
novabrasil.mgaplay.com.br
/
web
/
dist
/
core
/
[
Home
]
File: xibo-preview-timeline.js
function Preview(e){this.url=$(e).data().previewUrl,this.regionId=$(e).attr("regionid"),this.seq=1,this.regionElement=e,this.width=$(e).width(),this.height=$(e).height(),this.previewElement=$(".preview",e),this.previewContent=$(".previewContent",this.previewElement);var t=this.regionId;Preview.instances[t]=this,$(".previewNav",this.previewElement).append("<div class='prevSeq fa fa-arrow-left'></div>").append("<div class='nextSeq fa fa-arrow-right'></div>").append("<div class='preview-media-information'></div>"),$(".prevSeq",$(this.previewElement)).click((function(){var e=Preview.instances[t],i=$(".preview-media-information",e.previewElement).data("maxSeq"),r=e.seq;--r<=0&&(r=i),e.SetSequence(r)})),$(".nextSeq",$(this.previewElement)).click((function(){var e=Preview.instances[t],i=$(".preview-media-information",e.previewElement).data("maxSeq"),r=e.seq;++r>i&&(r=1),e.SetSequence(r)})),this.SetSequence(1)}Preview.instances={},Preview.prototype.SetSequence=function(e){this.seq=e;var t=this.previewContent,i=this.previewElement;this.width=$(this.regionElement).width(),this.height=$(this.regionElement).height(),$.ajax({type:"get",url:this.url,cache:!1,dataType:"json",data:{seq:e,width:this.width,height:this.height,scale_override:$(this.regionElement).attr("designer_scale")},success:function(e){if(e.success){if(e.extra.empty)return void $(".preview-media-information",i).html(e.extra.text);$(t).html('<div class="regionPreviewOverlay"></div>'+(null==e.html?"":e.html));var r="";0!=e.extra.zIndex&&(r="["+e.extra.zIndex+"] "),r+=e.extra.current_item+" / "+e.extra.number_items+" "+e.extra.moduleName,e.extra.duration>0&&0!=e.extra.useDuration&&(r+=" ("+moment().startOf("day").seconds(e.extra.duration).format("H:mm:ss")+" / "+moment().startOf("day").seconds(e.extra.regionDuration).format("H:mm:ss")+")"),$(".preview-media-information",i).html(r).data("maxSeq",e.extra.number_items)}else{if(e.login)return LoginBox(e.message),!1;$(t).html('<div class="regionPreviewOverlay"></div>'+e.html)}return!1}})};