golden hour
/var/www/html/wp-content/plugins/video-conferencing-with-zoom-api/assets/admin/js
⬆️ Go Up
Upload
File/Folder
Size
Actions
script.js
16.99 KB
Del
OK
script.min.js
9.29 KB
Del
OK
Edit: script.min.js
"use strict";!function(c){var a={},e={onReady:function(){this.setupDOM(),this.eventListeners(),this.initializeDependencies()},setupDOM:function(){a.changeSelectType=c(".zvc-hacking-select"),a.dateTimePicker=c("#datetimepicker"),a.reportsDatePicker=c("#reports_date"),a.zoomAccountDatepicker=c(".zoom_account_datepicker"),a.meetingListDTable=c("#zvc_users_list_table, #zvc_meetings_list_table"),a.meetingListTableCheck=c("#zvc_meetings_list_table"),a.usersListTable=c("#vczapi-get-host-users-wp"),a.meetingListTbl=a.meetingListTableCheck.find("input[type=checkbox]"),a.cover=c("#zvc-cover"),a.togglePwd=c(".toggle-api"),a.toggleSecret=c(".toggle-secret"),a.changeMeetingState=c(".vczapi-meeting-state-change"),a.show_on_meeting_delete_error=c(".show_on_meeting_delete_error"),this.$manualHostID=c(".vczapi-admin-hostID-manually-add")},eventListeners:function(){a.meetingListTableCheck.find("#checkall").on("click",this.meetingListTableCheck),c("#bulk_delete_meeting_listings").on("click",this.bulkDeleteMeetings),c(".zvc-meetings-form").find('input[name="password"]').on("keypress",this.meetingPassword),c(".delete-meeting").on("click",this.deleteMetting),a.togglePwd.on("click",this.toggleAPISettings.bind(this)),a.toggleSecret.on("click",this.toggleSecretSettings.bind(this)),c(".zvc-dismiss-message").on("click",this.dismissNotice.bind(this)),c(".check-api-connection").on("click",this.checkConnection.bind(this)),c(a.changeMeetingState).on("click",this.meetingStateChange.bind(this)),this.$manualHostID.on("click",this.showManualHostIDField.bind(this))},showManualHostIDField:function(e){e.preventDefault(),c(".vczapi-admin-post-type-host-selector").select2("destroy").remove(),c(".vczapi-manually-hostid-wrap").before('<input type="text" placeholder="'+zvc_ajax.lang.host_id_search+'" class="regular-text vczapi-search-host-id" name="userId" required>').remove()},datePickers:function(){var e,t,i,n;0<a.dateTimePicker.length&&(t=(e=new Date).getMonth()+1,i=e.getDate(),n=e.getHours()+":"+e.getMinutes()+":"+e.getSeconds(),i=e.getFullYear()+"-"+(t<10?"0":"")+t+"-"+(i<10?"0":"")+i+" "+n,(n=a.dateTimePicker.data("existingdate"))&&(i=n),a.dateTimePicker.datetimepicker({value:i,step:15,minDate:0,format:"Y-m-d H:i"})),0<a.reportsDatePicker.length&&a.reportsDatePicker.datepicker({changeMonth:!0,changeYear:!1,showButtonPanel:!0,dateFormat:"MM yy"}).focus(function(){var i=c(this);c(".ui-datepicker-calendar").detach(),c(".ui-datepicker-close").click(function(){var e=c("#ui-datepicker-div .ui-datepicker-month :selected").val(),t=c("#ui-datepicker-div .ui-datepicker-year").html();i.datepicker("setDate",new Date(t,e,1))})}),0<c("#vczapi-check-recording-date").length&&c("#vczapi-check-recording-date").datepicker({changeMonth:!0,changeYear:!0,showButtonPanel:!0,dateFormat:"MM yy",beforeShow:function(e,t){setTimeout(function(){t.dpDiv.css({top:c("#vczapi-check-recording-date").offset().top+35,left:c("#vczapi-check-recording-date").offset().left})},0)}}).focus(function(){var i=c(this);c(".ui-datepicker-calendar").detach(),c(".ui-datepicker-close").click(function(){var e=c("#ui-datepicker-div .ui-datepicker-month :selected").val(),t=c("#ui-datepicker-div .ui-datepicker-year :selected").val();i.datepicker("setDate",new Date(t,e,1))})}),0<a.zoomAccountDatepicker.length&&a.zoomAccountDatepicker.datepicker({dateFormat:"yy-mm-dd"})},initializeDependencies:function(){0<a.changeSelectType.length&&a.changeSelectType.select2(),this.datePickers(),0<a.meetingListDTable.length&&a.meetingListDTable.dataTable({pageLength:25,columnDefs:[{targets:0,orderable:!1}]}),0<a.usersListTable.length&&a.usersListTable.dataTable({pageLength:25,columnDefs:[{targets:0,orderable:!0}],ajax:{url:ajaxurl+"?action=get_assign_host_id"},columns:[{data:"id"},{data:"email"},{data:"name"},{data:"host_id"}]}),0<c("#vczapi-select-wp-user-for-host").length&&c("#vczapi-select-wp-user-for-host").select2({ajax:{url:ajaxurl+"?action=vczapi_get_wp_users",type:"GET",dataType:"json"},placeholder:"Select a WordPress User",width:"300px"})},meetingListTableCheck:function(){c(this).is(":checked")?a.meetingListTbl.each(function(){c(this).prop("checked",!0)}):a.meetingListTbl.each(function(){c(this).prop("checked",!1)})},bulkDeleteMeetings:function(){if(1!=confirm("Confirm bulk delete these Meeting?"))return!1;var e=[];a.meetingListTableCheck.find("input.checkthis").each(function(){c(this).is(":checked")&&e.push(c(this).val())});var t=c(this).data("type");e&&(t={meetings_id:e,type:t,action:"zvc_bulk_meetings_delete",security:zvc_ajax.zvc_security},a.cover.show(),c.post(zvc_ajax.ajaxurl,t).done(function(e){a.cover.fadeOut("slow"),1==e.error?a.show_on_meeting_delete_error.show().html("<p>"+e.msg+"</p>"):(a.show_on_meeting_delete_error.show().html("<p>"+e.msg+"</p>"),location.reload())}))},meetingPassword:function(e){if(!/([a-zA-Z0-9])+/.test(String.fromCharCode(e.which)))return!1;var t=c(this).val(),e=c(this).data("maxlength");0<e&&c(this).val(t.substr(0,e))},deleteMetting:function(){var e=c(this).data("meetingid"),t=c(this).data("type");if(1!=confirm("Confirm Delete this Meeting?"))return!1;t={meeting_id:e,type:t,action:"zvc_delete_meeting",security:zvc_ajax.zvc_security};a.cover.show(),c.post(zvc_ajax.ajaxurl,t).done(function(e){a.cover.fadeOut("slow"),1==e.error?a.show_on_meeting_delete_error.show().html("<p>"+e.msg+"</p>"):(a.show_on_meeting_delete_error.show().html("<p>"+e.msg+"</p>"),location.reload())})},toggleAPISettings:function(){var e=c("#zoom_api_key");"Show"===a.togglePwd.html()?(a.togglePwd.html("Hide"),e.attr("type","text")):(a.togglePwd.html("Show"),e.attr("type","password"))},toggleSecretSettings:function(){var e=c("#zoom_api_secret");"Show"===a.toggleSecret.html()?(a.toggleSecret.html("Hide"),e.attr("type","text")):(a.toggleSecret.html("Show"),e.attr("type","password"))},dismissNotice:function(e){e.preventDefault(),c(e.currentTarget).closest(".notice-success").hide(),c.post(zvc_ajax.ajaxurl,{action:"zoom_dimiss_notice"}).done(function(e){console.log(e)})},checkConnection:function(e){e.preventDefault(),a.cover.show(),c.post(zvc_ajax.ajaxurl,{action:"check_connection",security:zvc_ajax.zvc_security}).done(function(e){a.cover.hide(),alert(e)})},meetingStateChange:function(e){e.preventDefault();var t=c(e.currentTarget).data("state"),i=c(e.currentTarget).data("postid"),i={id:c(e.currentTarget).data("id"),state:t,type:c(e.currentTarget).data("type"),post_id:i||!1,action:"state_change",accss:zvc_ajax.zvc_security};("resume"===t||"end"===t&&confirm(zvc_ajax.lang.confirm_end))&&this.changeState(i)},changeState:function(e){c.post(zvc_ajax.ajaxurl,e).done(function(e){location.reload()})}},s={init:function(){this.cacheDOM(),this.evntHandlers()},cacheDOM:function(){this.notificationWrapper=c(".vczapi-status-notification"),this.syncUserId=c(".vczapi-sync-user-id")},evntHandlers:function(){this.syncUserId.on("change",this.fetchMeetingsByUser.bind(this))},fetchMeetingsByUser:function(e){e.preventDefault();var t=this,n=c(this.syncUserId).val(),e={user_id:n,action:"vczapi_sync_user",type:"check"},a=c(".results");a.html("<p>"+vczapi_sync_i10n.before_sync+"</p>"),c.post(ajaxurl,e).done(function(e){var i;e.success?(i='<div class="vczapi-sync-details">',i+="<p><strong>"+vczapi_sync_i10n.total_records_found+":</strong> "+e.data.total_records+"</p>",i+="<p><strong>"+vczapi_sync_i10n.total_not_synced_records+":</strong> "+_.size(e.data.meetings)+" (Only listing Scheduled Meetings)</p>",i+='<select class="vczapi-choose-meetings-to-sync-select2" name="sync-meeting-ids[]" multiple="multiple">',c(e.data.meetings).each(function(e,t){i+='<option value="'+t.id+'">'+t.topic+"</option>"}),i+="</select>",setTimeout(function(){c(".vczapi-choose-meetings-to-sync-select2").select2({maximumSelectionLength:10,placeholder:vczapi_sync_i10n.select2_placeholder})},100),i+='<p><a href="javascript:void(0);" class="vczapi-sync-meeting button button-primary" data-userid="'+n+'">'+vczapi_sync_i10n.sync_btn+"</a></p>",i+="</div>",a.html(i),c(".vczapi-sync-meeting").on("click",t.syncMeeting.bind(t))):a.html("<p>"+e.data+"</p>")})},syncMeeting:function(e){e.preventDefault(),c(e.currentTarget).attr("disabled","disabled");var t=c(".vczapi-choose-meetings-to-sync-select2").val();0<_.size(t)?(this.notificationWrapper.show().html("<p>"+vczapi_sync_i10n.sync_start+"</p>").removeClass("vczapi-error"),this.doSync(0,t)):(this.notificationWrapper.show().html("<p>"+vczapi_sync_i10n.sync_error+"</p>").addClass("vczapi-error"),c(e.currentTarget).removeAttr("disabled"))},doSync:function(t,i){var n=this,e={action:"vczapi_sync_user",type:"sync",meeting_id:i[t]};c.post(ajaxurl,e).done(function(e){t++,n.notificationWrapper.show().append("<p> "+e.data.msg+"</p>"),t<_.size(i)?s.doSync(t,i):(e.success?n.notificationWrapper.show().append("<p>"+vczapi_sync_i10n.sync_completed+"</p>"):n.notificationWrapper.show().append("<p>"+e.data.msg+"</p>"),c(".vczapi-sync-meeting").removeAttr("disabled"))})}},t={init:function(){this.cacheDOM(),this.evntHandlers()},cacheDOM:function(){this.meetingSelector=c("#vczapi-admin-meeting-ype"),this.hideOnWebinarSelector=c(".vczapi-admin-hide-on-webinar"),this.showOnWebinarSelector=c(".vczapi-admin-show-on-webinar")},evntHandlers:function(){this.meetingSelector.on("change",this.webinarElementsShow.bind(this))},webinarElementsShow:function(e){"2"===c(e.currentTarget).val()?(this.hideOnWebinarSelector.hide(),this.showOnWebinarSelector.show()):(this.hideOnWebinarSelector.show(),this.showOnWebinarSelector.hide())}};c(function(){e.onReady(),s.init(),t.init()})}(jQuery);
Save