芝麻web文件管理V1.00
编辑当前文件:/home/mgatv524/novabrasil.mgaplay.com.br/web/dist/core/xibo-forms.js
var text_callback=function(e,a){var t=a;null==a&&(t=$(".bootbox").data().extra);var s=$c.complement($("#layout").data().backgroundColor),n=$("#layout"),i=n.attr("designer_scale"),o=$("#region_"+n.data().currentRegionId).attr("width"),r=$("#region_"+n.data().currentRegionId).attr("height"),d=function(e){$("#cke_"+e+" iframe").contents().find("head").append("")},l=function(e,a){if(!$("#overrideTemplate").is(":checked")){var t=$("#templateId").val();$.each(a,(function(a,n){n.id==t&&(e=n.template.replace(/#Color#/g,s),$("#ta_css").val(n.css),$.each(n,(function(e,a){"template"!=e&&"css"!=e&&$("#"+e).val(a)})))}))}return e},c=function(e){return e.replace(/\[[0-9]+]/gi,(function(e){var a=e.replace("]","").replace("[","");return CKEDITOR_DEFAULT_CONFIG.imageDownloadUrl.replace(":id",a)}))};CKEDITOR.replace("ta_text",CKEDITOR_DEFAULT_CONFIG),CKEDITOR.instances.ta_text.on("instanceReady",(function(){d("ta_text"),CKEDITOR.instances.ta_text.on("contentDom",(function(){d("ta_text")}));var e=CKEDITOR.instances.ta_text.getData();""!=e||$("#overrideTemplate").is(":checked")||(e='
'+translations.enterText+"
"),e=l(e,t),e=c(e),CKEDITOR.instances.ta_text.setData(e)})),$("#templateId").on("change",(function(){CKEDITOR.instances.ta_text.setData(l(CKEDITOR.instances.ta_text.getData(),t))})),$("#noDataMessage").length>0&&(CKEDITOR.replace("noDataMessage",CKEDITOR_DEFAULT_CONFIG),CKEDITOR.instances.noDataMessage.on("instanceReady",(function(){d("noDataMessage"),CKEDITOR.instances.noDataMessage.on("contentDom",(function(){d("noDataMessage")}));var e=CKEDITOR.instances.noDataMessage.getData();""===e&&(e='
'+translations.noDataMessage+"
"),e=c(e),CKEDITOR.instances.noDataMessage.setData(e)}))),e.on("hide.bs.modal",(function(e){if("bs.modal"===e.namespace){try{void 0!==CKEDITOR.instances.ta_text&&CKEDITOR.instances.ta_text.destroy(),void 0!==CKEDITOR.instances.noDataMessage&&CKEDITOR.instances.noDataMessage.destroy()}catch(e){console.log("Unable to remove CKEditor instance. "+e)}destroyColorPicker("#backgroundColor")}})),$(".ckeditor_snippits",e).dblclick((function(){var e,a=$(this).attr("linkedto");return null!=CKEDITOR.instances[a]&&(e=null!=$(this).attr("datasetcolumnid")?"["+$(this).html()+"|"+$(this).attr("datasetcolumnid")+"]":"["+$(this).html()+"]",CKEDITOR.instances[a].insertText(e)),!1}));var u=$(".ckeditor_library_select");return u.length>0&&u.select2({ajax:{url:u.data().searchUrl,dataType:"json",data:function(e){var a=e.term,t="";if(null!=e.term){var s=e.term.match(/\[([^}]+)\]/);null!=s&&(t=s[1],a=e.term.replace(s[0],"")),a=a.replace(" ",""),t=t.replace(" ","")}var n={media:a,tags:t,type:"image",retired:0,assignable:1,start:0,length:10};return null!=e.page&&(n.start=10*(e.page-1)),void 0!==e.term&&(localStorage.liveSearchPlaceholder=e.term),n},processResults:function(e,a){var t=[];$.each(e.data,(function(e,a){t.push({id:a.mediaId,text:a.name,imageUrl:u.data().imageUrl.replace(":id",a.mediaId),disabled:!1})}));var s=a.page||1;return{results:t,pagination:{more:10*(s=s>1?s-1:s)
')})),createColorPicker("#backgroundColor"),!1};function switchLists(e){$($(e.currentTarget).parent().sortable("option","connectWith")).not($(e.currentTarget).parent()).append(e.currentTarget)}function GroupSecurityCallBack(e){$("#groupsIn, #groupsOut").sortable({connectWith:".connectedSortable",dropOnEmpty:!0}).disableSelection(),$(".li-sortable",e).dblclick(switchLists)}function GroupSecuritySubmit(){var e=$("#groupsIn").attr("href")+"&ajax=true";serializedData=$("#groupsIn").sortable("serialize"),$.ajax({type:"post",url:e,cache:!1,dataType:"json",data:serializedData,success:XiboSubmitResponse})}function DisplayGroupManageMembersCallBack(e){$("#displaysIn, #displaysOut").sortable({connectWith:".connectedSortable",dropOnEmpty:!0}).disableSelection(),$(".li-sortable",e).dblclick(switchLists)}function DisplayGroupMembersSubmit(){var e=$("#displaysIn").attr("href")+"&ajax=true";serializedData=$("#displaysIn").sortable("serialize"),$.ajax({type:"post",url:e,cache:!1,dataType:"json",data:serializedData,success:XiboSubmitResponse})}var FileAssociationsCallback=function(){$("#FileAssociationsTable .library_assign_list_select").click((function(){var e=$(this).parent().parent(),a=$("
",{text:e.attr("litext"),id:e.attr("rowid"),class:"li-sortable",dblclick:function(){$(this).remove()}});a.appendTo("#FileAssociationsSortable"),$("
",{class:"fa fa-minus",click:function(){$(this).parent().remove(),$(".modal-body .XiboGrid").each((function(){var e=$(this).attr("id");XiboGridRender(e)}))}}).appendTo(a),e.remove()})),$("#FileAssociationsSortable li .fa-minus").click((function(){$(this).parent().remove()})),$("#FileAssociationsSortable").sortable().disableSelection()},FileAssociationsSubmit=function(e){var a=$("#FileAssociationsSortable").sortable("serialize");$.ajax({type:"post",url:"index.php?p=displaygroup&q=SetFileAssociations&displaygroupid="+e+"&ajax=true",cache:!1,dataType:"json",data:a,success:XiboSubmitResponse})},settingsUpdated=function(e){e.success||SystemMessage(""==e.message?translation.failure:e.message,!0)};function permissionsFormOpen(e){var a=$("#permissionsTable").closest(".XiboGrid");a.data().permissions.length<=0&&(a.data().permissions={});var t=$("#permissionsTable").DataTable({language:dataTablesLanguage,serverSide:!0,stateSave:!0,filter:!1,searchDelay:3e3,order:[[0,"asc"]],ajax:{url:a.data().url,data:function(e){$.extend(e,a.find(".permissionsTableFilter form").serializeObject())}},columns:[{data:"group",render:function(e,a,t,s){return"display"!=a||1==t.isUser?e:"
"+e+"
"}},{data:"view",render:function(e,t,s,n){if("display"!=t)return e;var i;if(s.groupId in a.data().permissions){var o=a.data().permissions[s.groupId];i=void 0!==o.view&&1===o.view?1:0}else i=e;return'
"}},{data:"edit",render:function(e,t,s,n){if("display"!=t)return e;var i;if(s.groupId in a.data().permissions){var o=a.data().permissions[s.groupId];i=void 0!==o.edit&&1===o.edit?1:0}else i=e;return'
"}},{data:"delete",render:function(e,t,s,n){if("display"!=t)return e;var i;if(s.groupId in a.data().permissions){var o=a.data().permissions[s.groupId];i=void 0!==o.delete&&1===o.delete?1:0}else i=e;return'
"}}]});t.on("draw",(function(e,t){dataTableDraw(e,t),$("#"+e.target.id).find("input[type=checkbox]").change((function(){var e=$(this).data().groupId,t=$(this).data().permission,s=$(this).is(":checked");void 0===a.data().permissions[e]&&(a.data().permissions[e]={}),a.data().permissions[e][t]=s?1:0}))})),t.on("processing.dt",dataTableProcessing),a.find(".permissionsTableFilter form input, .permissionsTableFilter form select").change((function(){t.ajax.reload()}))}function permissionsFormSubmit(e){var a=$("#"+e),t=a.closest(".permissions-form"),s={groupIds:$(a).data().permissions,ownerId:t.find("select[name=ownerId]").val()},n=$.param(s);$.ajax({type:"POST",url:a.data().url,cache:!1,dataType:"json",data:n,success:function(e,t,s){XiboSubmitResponse(e,a)},error:function(e,a,t){SystemMessage(e.responseText,!1)}})}function permissionsMultiFormOpen(e){var a=$(e).find("#permissionsMultiTable"),t=a.closest(".XiboGrid"),s=a.DataTable({language:dataTablesLanguage,serverSide:!0,stateSave:!0,filter:!1,searchDelay:3e3,order:[[0,"asc"]],ajax:{url:t.data().url,data:function(e){$.extend(e,t.find(".permissionsMultiTableFilter form").serializeObject()),$.extend(e,{ids:t.data().targetIds})},dataSrc:function(e){var a=e.data;for(var s in a)if(a.hasOwnProperty(s)){var n={view:null,edit:null,delete:null};for(var i in a[s].permissions)if(a[s].permissions.hasOwnProperty(i)){var o=a[s].permissions[i];o.view!=n.view&&(null!=n.view?n.view=2:n.view=o.view),o.edit!=n.edit&&(null!=n.edit?n.edit=2:n.edit=o.edit),o.delete!=n.delete&&(null!=n.delete?n.delete=2:n.delete=o.delete)}a[s]=Object.assign(n,a[s]),delete a[s].permissions}return t.data().permissions=Object.assign({},t.data().permissions,a),t.data().startPermissions=Object.assign({},t.data().startPermissions,JSON.parse(JSON.stringify(a))),null==t.data().savePermissions&&(t.data().savePermissions={}),Object.values(a)}},columns:[{data:"group",render:function(e,a,t,s){return"display"!=a||1==t.isUser?e:"
"+e+"
"}},{data:"view",render:function(e,a,s,n){if("display"!=a)return e;var i;if(s.groupId in t.data().permissions){var o=t.data().permissions[s.groupId];i=void 0!==o.view&&0!==o.view?o.view:0}else i=e;return'
"}},{data:"edit",render:function(e,a,s,n){if("display"!=a)return e;var i;if(s.groupId in t.data().permissions){var o=t.data().permissions[s.groupId];i=void 0!==o.edit&&0!==o.edit?o.edit:0}else i=e;return'
"}},{data:"delete",render:function(e,a,s,n){if("display"!=a)return e;var i;if(s.groupId in t.data().permissions){var o=t.data().permissions[s.groupId];i=void 0!==o.delete&&0!==o.delete?o.delete:0}else i=e;return'
"}}]});s.on("draw",(function(a,s){dataTableDraw(a,s);var n=$("#"+a.target.id);n.find("input[type=checkbox]").change((function(){var a=$(this).data().groupId,s=$(this).data().permission,n=$(this).is(":checked")?1:0;void 0===t.data().permissions[a]&&(t.data().permissions[a]={}),t.data().permissions[a][s]=n,void 0===t.data().savePermissions[a]?(t.data().savePermissions[a]={},t.data().savePermissions[a][s]=n):t.data().startPermissions[a][s]===n?(delete t.data().savePermissions[a][s],$.isEmptyObject(t.data().savePermissions[a])&&delete t.data().savePermissions[a]):t.data().savePermissions[a][s]=n,$(e).find(".save-button").toggleClass("disabled",$.isEmptyObject(t.data().savePermissions))})),n.find("input[type=checkbox].indeterminate").prop("indeterminate",!0).prop("title",translations.indeterminate)})),$(e).find(".save-button").addClass("disabled"),s.on("processing.dt",dataTableProcessing),t.find(".permissionsMultiTableFilter form input, .permissionsMultiTableFilter form select").change((function(){s.ajax.reload()}))}function permissionsMultiFormSubmit(e){var a=$("#"+e),t=$(a).data().savePermissions,s=$(a).data().targetIds,n=$.param({groupIds:t,ids:s});$.ajax({type:"POST",url:a.data().url,cache:!1,dataType:"json",data:n,success:function(e,t,s){XiboSubmitResponse(e,a)},error:function(e,a,t){SystemMessage(e.responseText,!1)}})}function membersFormOpen(e){var a=$(e).find(".membersTable");null==a.data().members&&(a.data().members={}),a.find("input[type=checkbox]").change((function(){var e=$(this).data().memberId,t=$(this).is(":checked");a.data().members[e]=t?1:0}))}function membersFormSubmit(e){var a=$("#"+e),t=a.find(".membersTable").data().members;if(null!=t){var s=[],n=[];$.each(t,(function(e,a){1==a?s.push(e):n.push(e)}));var i={};i[a.data().param]=s,i[a.data().paramUnassign]=n,$.ajax({type:"POST",url:a.data().url,cache:!1,dataType:"json",data:$.param(i),success:function(e,t,s){XiboSubmitResponse(e,a)},error:function(e,a,t){SystemMessage(e.responseText,!1)}})}else XiboDialogClose()}function mediaDisplayGroupFormCallBack(){var e=$("#FileAssociationsAssign");null==e.data().media&&(e.data().media={});var a=$("#mediaAssignments").DataTable({language:dataTablesLanguage,serverSide:!0,stateSave:!0,searchDelay:3e3,order:[[0,"asc"]],filter:!1,ajax:{url:$("#mediaAssignments").data().url,data:function(e){$.extend(e,$("#mediaAssignments").closest(".XiboGrid").find(".FilterDiv form").serializeObject())}},columns:[{data:"name"},{data:"mediaType"},{sortable:!1,data:function(e,a,t,s){return"display"!=a?"":'
'}}]});a.on("draw",(function(t,s){dataTableDraw(t,s),$(".assignItem","#mediaAssignments").click((function(){var t=a.row($(this).closest("tr")).data();e.data().media[t.mediaId]=1;var s=$("
",{text:t.name,"data-media-id":t.mediaId,class:"btn btn-sm btn-white"});s.appendTo("#FileAssociationsSortable"),$("
",{class:"fa fa-minus",click:function(){e.data().media[$(this).parent().data().mediaId]=0,$(this).parent().remove()}}).appendTo(s)}))})),a.on("processing.dt",dataTableProcessing),$("#FileAssociationsSortable").sortable(),$("#FileAssociationsSortable").find("li span").click((function(){e.data().media[$(this).parent().data().mediaId]=0,$(this).parent().remove()})),$("#mediaAssignments").closest(".XiboGrid").find(".FilterDiv input, .FilterDiv select").change((function(){a.ajax.reload()}))}function mediaAssignSubmit(){var e=$("#FileAssociationsAssign"),a=[],t=[];$.each(e.data().media,(function(e,s){1==s?a.push(e):t.push(e)})),assignMediaToCampaign(e.data().url,a,t)}var assignMediaToCampaign=function(e,a,t){toastr.info("Assign Media",a),$.ajax({type:"post",url:e,cache:!1,dataType:"json",data:{mediaId:a,unassignMediaId:t},success:XiboSubmitResponse})};function layoutFormCallBack(){var e=$("#FileAssociationsAssign");null==e.data().layout&&(e.data().layout={});var a=$("#layoutAssignments").DataTable({language:dataTablesLanguage,serverSide:!0,stateSave:!0,searchDelay:3e3,order:[[0,"asc"]],filter:!1,ajax:{url:$("#layoutAssignments").data().url,data:function(e){$.extend(e,$("#layoutAssignments").closest(".XiboGrid").find(".FilterDiv form").serializeObject())}},columns:[{data:"layout"},{sortable:!1,data:function(e,a,t,s){return"display"!=a?"":'
'}}]});a.on("draw",(function(t,s){dataTableDraw(t,s),$(".assignItem","#layoutAssignments").click((function(){var t=a.row($(this).closest("tr")).data();e.data().layout[t.layoutId]=1;var s=$("
",{text:t.layout,"data-layout-id":t.layoutId,class:"btn btn-sm btn-white"});s.appendTo("#FileAssociationsSortable"),$("
",{class:"fa fa-minus",click:function(){e.data().layout[$(this).parent().data().layoutId]=0,$(this).parent().remove()}}).appendTo(s)}))})),a.on("processing.dt",dataTableProcessing),$("#FileAssociationsSortable").sortable(),$("#FileAssociationsSortable").find("li span").click((function(){e.data().layout[$(this).parent().data().layoutId]=0,$(this).parent().remove()})),$("#layoutAssignments").closest(".XiboGrid").find(".FilterDiv input, .FilterDiv select").change((function(){a.ajax.reload()}))}function layoutAssignSubmit(){var e=$("#FileAssociationsAssign"),a=[],t=[];$.each(e.data().layout,(function(e,s){1==s?a.push(e):t.push(e)})),assignLayoutToCampaign(e.data().url,a,t)}var assignLayoutToCampaign=function(e,a,t){toastr.info("Assign Layout",a),$.ajax({type:"post",url:e,cache:!1,dataType:"json",data:{layoutId:a,unassignLayoutId:t},success:XiboSubmitResponse})};function regionEditFormSubmit(){XiboFormSubmit($("#regionEditForm"),null,(function(e,a){e.success&&window.location.reload()}))}function userProfileEditFormOpen(){$("#qRCode").addClass("d-none"),$("#recoveryButtons").addClass("d-none"),$("#recoveryCodes").addClass("d-none"),$("#twoFactorTypeId").on("change",(function(e){e.preventDefault(),2==$("#twoFactorTypeId").val()&&2!=$("#userEditProfileForm").data().currentuser?($.ajax({url:$("#userEditProfileForm").data().setup,type:"GET",beforeSend:function(){$("#qr").addClass("fa fa-spinner fa-spin loading-icon")},success:function(e){let a=e.data.qRUrl;$("#qrImage").attr("src",a)},complete:function(){$("#qr").removeClass("fa fa-spinner fa-spin loading-icon")}}),$("#qRCode").removeClass("d-none")):$("#qRCode").addClass("d-none"),0==$("#twoFactorTypeId").val()&&($("#recoveryButtons").addClass("d-none"),$("#recoveryCodes").addClass("d-none")),0!=$("#userEditProfileForm").data().currentuser&&0!=$("#twoFactorTypeId").val()&&$("#recoveryButtons").removeClass("d-none")})),0!=$("#userEditProfileForm").data().currentuser&&$("#recoveryButtons").removeClass("d-none");let e="";$("#generateCodesBtn").on("click",(function(a){$("#codesList").html(""),$("#recoveryCodes").removeClass("d-none"),$(".recBtn").attr("disabled",!0).addClass("disabled"),e="",$.ajax({url:$("#userEditProfileForm").data().generate,async:!1,type:"GET",beforeSend:function(){$("#codesList").removeClass("card").addClass("fa fa-spinner fa-spin loading-icon")},success:function(a){e=JSON.parse(a.data.codes),$("#recoveryCodes").addClass("d-none"),$(".recBtn").attr("disabled",!1).removeClass("disabled"),$("#showCodesBtn").click()},complete:function(){$("#codesList").removeClass("fa fa-spinner fa-spin loading-icon")}})})),$("#showCodesBtn").on("click",(function(a){$(".recBtn").attr("disabled",!0).addClass("disabled"),$("#codesList").html(""),$("#recoveryCodes").toggleClass("d-none");let t=[];$.ajax({url:$("#userEditProfileForm").data().show,type:"GET",data:{generatedCodes:e},success:function(a){t=""!=e?e:a.data.codes,$("#twoFactorRecoveryCodes").val(JSON.stringify(t)),$.each(t,(function(e,a){$("#codesList").append(a+"
")})),$("#codesList").addClass("card"),$(".recBtn").attr("disabled",!1).removeClass("disabled")}})}))}function tagsWithValues(e){let a;$('#tagValue, label[for="tagValue"], #tagValueRequired').addClass("d-none"),$("#tagValueContainer").hide();let t="",s="",n="",i=[],o=0,r="#"+e+" input#tags, #"+e+" input#tagsToAdd";$(r).on("beforeItemAdd",(function(t){if($("#tagValue").html(""),$("#tagValueInput").val(""),a=t.item,i=[],o=0,s=a.split("|")[0],n=a.split("|")[1],$(r).val().indexOf(s)>=0){let e=$(r).tagsinput("items").filter((e=>e.split("|")[0].toLowerCase()===s.toLowerCase()));$(r).tagsinput("remove",e.toString())}-1===$(r).val().indexOf(s)&&void 0===n&&$.ajax({url:$("form#"+e).data().gettag,type:"GET",data:{name:s},beforeSend:function(){$("#loadingValues").addClass("fa fa-spinner fa-spin loading-icon")},success:function(e){e.success&&(null!=e.data.tag?(i=JSON.parse(e.data.tag.options),o=e.data.tag.isRequired,null!=i&&i!=[]?($('#tagValue, label[for="tagValue"]').removeClass("d-none"),$('#tagValue option[value=""]').length<=0&&$("#tagValue").append($("
").attr("value","").text("")),$.each(i,(function(e,a){$("#tagValue option[value="+a+"]").length<=0&&$("#tagValue").append($("
").attr("value",a).text(a))})),$("#tagValue").focus()):($("#tagValueContainer").show(),0===o?$("#tagValueInput").parent().find("span.help-block").text(translations.tagInputValueHelpText):$("#tagValueInput").parent().find("span.help-block").text(translations.tagInputValueRequiredHelpText),$("#tagValueInput").focus())):($("#tagValueContainer").show(),$("#tagValueInput").focus(),$("#tagValueInput").parent().find("span.help-block").text(translations.tagInputValueHelpText)))},complete:function(){$("#loadingValues").removeClass("fa fa-spinner fa-spin loading-icon")},error:function(e,a,t){console.error(e,a,t)}})})),$(r).on("itemAdded",(function(e){null!=i&&i!==[]&&$("#tagValue").focus()})),$(r).on("itemRemoved",(function(e){s===e.item?($('#tagValueRequired, label[for="tagValue"]').addClass("d-none"),$(".save-button").prop("disabled",!1),$("#tagValue").html("").addClass("d-none"),$("#tagValueInput").val(""),$("#tagValueContainer").hide(),s=""):$(".save-button").is(":disabled")||($("#tagValue").html("").addClass("d-none"),$("#tagValueInput").val(""),$("#tagValueContainer").hide(),$('label[for="tagValue"]').addClass("d-none"))})),$("#tagValue").on("change",(function(e){e.preventDefault(),t=s+"|"+$(this).val(),""!=s&&(0===o||1===o&&""!==$(this).val()?($(r).tagsinput("add",t),$(r).tagsinput("remove",s),$("#tagValue").html("").addClass("d-none"),$('#tagValueRequired, label[for="tagValue"]').addClass("d-none"),$(".save-button").prop("disabled",!1)):($("#tagValueRequired").removeClass("d-none"),$("#tagValue").focus()))})),$("#tagValue").blur((function(){""===$(this).val()&&1===o?($("#tagValueRequired").removeClass("d-none"),$("#tagValue").focus(),$(".save-button").prop("disabled",!0)):($("#tagValue").html("").addClass("d-none"),$('label[for="tagValue"]').addClass("d-none"))})),$("#tagValueInput").on("keypress focusout",(function(e){if((13===e.keyCode||"focusout"===e.type)&&""!=s){e.preventDefault();let a=$(this).val();t=""!==a?s+"|"+a:s,0===o||1===o&&""!==a?($(r).tagsinput("add",t),""!==a&&$(r).tagsinput("remove",s),$("#tagValueInput").val(""),$("#tagValueContainer").hide(),$("#tagValueRequired").addClass("d-none"),$(".save-button").prop("disabled",!1)):($("#tagValueContainer").show(),$("#tagValueRequired").removeClass("d-none"),$("#tagValueInput").focus())}}))}function featureAclFormOpen(e){$(e).find("tr.feature-row").hide(),$(e).find("td.feature-group-header-cell").on("click",(function(){var e=$(this);e.hasClass("open")?(e.find(".feature-group-description").show(),e.find("i.fa").removeClass("fa-arrow-circle-up").addClass("fa fa-arrow-circle-down"),e.closest("tbody.feature-group").find("tr.feature-row").hide(),e.removeClass("open").addClass("closed")):(e.find(".feature-group-description").hide(),e.find("i.fa").removeClass("fa-arrow-circle-down").addClass("fa fa-arrow-circle-up"),e.closest("tbody.feature-group").find("tr.feature-row").show(),e.removeClass("closed").addClass("open"))})).each((function(e,a){setFeatureGroupCheckboxState($(this))})),$(e).find("input[name='features[]']").on("click",(function(){setFeatureGroupCheckboxState($(this))})),$(e).find("input.feature-select-all").on("click",(function(){$(this).closest("tbody.feature-group").find("input[name='features[]']").prop("checked",$(this).is(":checked"))}))}function setFeatureGroupCheckboxState(e){var a=e.closest("tbody.feature-group");setCheckboxState(a.find("input[name='features[]']:checked").length,a.find("input[name='features[]']").length,a,".feature-select-all"),setCheckboxState(a.find("input.inherit-group:checked").length,a.find("input.inherit-group").length,a,".inherit-group-all")}function setCheckboxState(e,a,t,s){e<=0?t.find(s).prop("checked",!1).prop("indeterminate",!1):e===a?t.find(s).prop("checked",!0).prop("indeterminate",!1):t.find(s).prop("checked",!1).prop("indeterminate",!0)}function userApprovedApplicationsFormOpen(e){$(".revokeAccess").on("click",(function(e){var a=$(this),t=a.data("applicationKey"),s=a.data("applicationUser");$.ajax({url:revokeApplicationAccess.replace(":id",t).replace(":userId",s),type:"DELETE",success:function(e){e.success?(a.closest("tr").remove(),toastr.success(e.message)):toastr.error(e.message)}})}))}function folderMoveSubmit(){XiboFormSubmit($("#moveFolderForm"),null,(function(e,a){e.success&&$("#container-folder-tree").jstree(!0).refresh()}))}