%PDF- %PDF-
Direktori : /var/www/html/higroup/wp-content/plugins/event-tickets/src/resources/js/ |
Current File : /var/www/html/higroup/wp-content/plugins/event-tickets/src/resources/js/tickets-attendees.min.js |
var tribe_event_tickets_attendees=tribe_event_tickets_attendees||{};!function(t,e){e.count_columns=function(e){var n=0,i=e.find("td, th");return i.length?(i.each(function(){var e=parseInt(t(this).attr("colspan"),10);n+=1+(e=e>1?e-1:0)}),n):0},e.remove_tickets=function(e){t("#the-list").find("tr").each(function(){var n=t(this),i=n.find(".check-column").find("input").val();if("string"==typeof i){var a=i.match(/^[0-9]+/);a.length&&-1!==e.indexOf(parseInt(a[0],10))&&n.remove()}})},t(function(){"undefined"!=typeof AttendeesPointer&&AttendeesPointer.length&&(options=t.extend(AttendeesPointer.options,{close:function(){t.post(Attendees.ajaxurl,{pointer:AttendeesPointer.pointer_id,action:"dismiss-wp-pointer"})},open:function(t,e){e.pointer.css({top:parseInt(e.pointer.css("top").replace("px",""),10)+5}).find(".wp-pointer-arrow").css({right:"50px",left:"auto"}),e.element.on({click:function(){e.element.pointer("close")}})}}),t(AttendeesPointer.target).pointer(options).pointer("open").pointer("widget"));function n(e){t.isArray(e)||(e=[e]);var n=parseInt(.7*t(window).width(),10);n=n>800?800:n;var i=parseInt(.9*t(window).height(),10);i=i>800?800:i;var a="&ticket_ids="+e.join("|")+"&width="+n+"&height="+i,o=Attendees.move_url.replace("&TB_",a+"&TB_");tb_show(null,o,!1)}var i,a;t("input.print").on("click",function(){t(window).trigger("attendees-report-before-print.tribe-tickets");var e=t("table.wp-list-table.attendees"),n=e.find("thead th:visible").length,i=e.find("th,td");i.css({width:100/(n-2)+"%"}),window.print(),i.css({width:""}),t(window).trigger("attendees-report-after-print.tribe-tickets")}),t(".tribe-attendees-email").on({submit:function(e){t(".tribe-attendees-email").hide(),t(document.getElementById("tribe-loading")).show()}}),t("span.trash a").on("click",function(t){return confirm(Attendees.confirmation)}),t(".event-tickets__attendees-admin-form").on("submit",function(e){if("delete_attendee"===t("#bulk-action-selector-top").val()&&t(this).serialize().includes("&attendee"))return confirm(Attendees.bulk_confirmation)}),t(".tickets_checkin").on("click",function(e){var n=jQuery(this);n.prop("disabled",!0);var i={action:"tribe-ticket-checkin",provider:n.attr("data-provider"),attendee_id:n.attr("data-attendee-id"),nonce:Attendees.checkin_nonce};n.attr("data-event-id")&&(i.event_ID=n.attr("data-event-id")),t.post(Attendees.ajaxurl,i,function(e){e.success&&(n.closest("tr").addClass("tickets_checked"),t("#total_checkedin").text(parseInt(t("#total_checkedin").text())+1)),n.prop("disabled",!1)},"json"),e.preventDefault()}),t(".tickets_uncheckin").on("click",function(e){var n=jQuery(this);n.prop("disabled",!0);var i={action:"tribe-ticket-uncheckin",provider:n.attr("data-provider"),attendee_id:n.attr("data-attendee-id"),nonce:Attendees.uncheckin_nonce};n.attr("data-event-id")&&(i.event_ID=n.attr("data-event-id")),t.post(Attendees.ajaxurl,i,function(e){e.success&&(n.closest("tr").removeClass("tickets_checked"),t("#total_checkedin").text(parseInt(t("#total_checkedin").text())-1)),n.prop("disabled",!1)},"json"),e.preventDefault()}),t("table.wp-list-table").on("click",".row-actions .move-ticket",function(e){var i=t(this).parents("tr").find('input[name="attendee[]"]').val().match(/^[0-9]+/);return i&&n(i),e.stopPropagation(),!1}),t("#doaction, #doaction2").on("click",function(e){var i;switch(t(e.currentTarget).attr("id")){case"doaction":i="action";break;case"doaction2":i="action2"}if(void 0!==i&&"move"===t('select[name="'+i+'"]').val()){var a=jQuery('input[name="attendee[]"]:checked');if(a.length){var o=[];a.each(function(){var e=t(this).val().match(/^[0-9]+/);e&&o.push(e.toString())}),n(o)}else alert(Attendees.cannot_move);return e.stopPropagation(),!1}}),i=t(".ticket-history"),(a=t(".hide-ticket-history")).hide(),i.on("click",function(n){var i=t(this),a=i.siblings(".hide-ticket-history"),o=parseInt(i.data("ticket-id"),10),r=i.data("check");if(o&&r){var c,s=t(document.getElementById("ticket-history-"+o));return s.length?(s.show(),i.hide(),a.show()):(c={action:"get_ticket_history",check:r,ticket_id:o},t.post(Attendees.ajaxurl,c,function(n){if(void 0!==n.data&&"string"==typeof n.data.html){var r=i.parents("tr"),c=e.count_columns(r),s=t('<tr id="ticket-history-'+o+'"> <td colspan="'+c+'">'+n.data.html+"</td></tr>");s.hide().insertAfter(r).slideDown(),i.hide(),a.show()}})),n.stopPropagation(),!1}}),a.on("click",function(e){var n=t(this),i=n.siblings(".ticket-history"),a=parseInt(i.data("ticket-id"),10);t(document.getElementById("ticket-history-"+a)).hide(),i.show(),n.hide()})})}(jQuery,tribe_event_tickets_attendees);