File Editor
Directories:
.. (Back)
admin
app
commerce
v2
Files:
accordion.js
accordion.min.js
move-tickets-dialog.js
move-tickets-dialog.min.js
rsvp-block.js
rsvp-block.min.js
rsvp.js
rsvp.min.js
ticket-details.js
ticket-details.min.js
tickets-attendees.js
tickets-attendees.min.js
tickets-block.js
tickets-block.min.js
tickets-provider.js
tickets-provider.min.js
tickets-registration-page.js
tickets-registration-page.min.js
tickets.js
tickets.min.js
tpp-admin.js
tpp-admin.min.js
Create New File
Create
Edit File: tpp-admin.min.js
/** * This JS file was auto-generated via Terser. * * Contributors should avoid editing this file, but instead edit the associated * non minified file file. For more information, check out our engineering docs * on how we handle JS minification in our engineering docs. * * @see: https://evnt.is/dev-docs-minification */ var tribe_tickets_tpp_admin={l10n:window.tribe_tickets_tpp_admin_strings||!1};!function($,my,strings){"use strict";my.checkmarkValidationMap=function(){return{email:function(email){return/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(email)},radio:function(val){return["yes","1",1,!0,"true","on","complete","completed"].includes(val.toLowerCase())}}},my.castStatusToBool=function(status){return(0,my.checkmarkValidationMap().radio)(status)},my.castBoolToStatus=function(val){return!0===val?"complete":"incomplete"},my.updatePayPalIpnStatus=function(){var $find=$("#paypal-ipn-config-status"),$dependsOn=$(".ipn-required");if($dependsOn){var newStatus=_.reduce($dependsOn,(function(currentStatusBool,el){return currentStatusBool&&!$(el).hasClass("no-checkmark")}),!0),newStatusSlug=my.castBoolToStatus(newStatus);$find.text(my.l10n[newStatusSlug]).attr("data-status",newStatusSlug)}},my.isOkInput=function(input){var $parent=$(input).closest(".checkmark");if($parent){var ok=!1,map=my.checkmarkValidationMap();if($parent.hasClass("tribe-field-email"))ok=map.email(input.value);else if($parent.hasClass("tribe-field-radio")){var value=$(input).closest(".tribe-field-wrap").find("input:checked").val();ok=map.radio(value)}else ok=!0;return ok}},my.toggleCheckmark=function(){var ok=my.isOkInput(this),$parent=$(this).closest(".checkmark");ok?$parent.removeClass("no-checkmark"):$parent.addClass("no-checkmark"),my.updatePayPalIpnStatus()},my.setupValidationOnPanel=function(event,data){if(data.panel&&data.panel instanceof jQuery){var $panel=data.panel,paypalIsDefaultProvider="Tribe__Tickets__Commerce__PayPal__Main"===$panel.data("default-provider"),isNew=!$("#ticket_id").val();paypalIsDefaultProvider&&isNew&&$("#ticket_price, #ticket_sale_price").prop("data-required",!0).attr("data-validation-is-greater-than","0"),$panel.find(".tribe-validation").validation()}},my.init=function(){$(".checkmark input").each((function(){$(this).on("change",my.toggleCheckmark).each(my.toggleCheckmark)})),$("#event_tickets").on("after_panel_swap.tickets",my.setupValidationOnPanel)},$((function(){my.l10n&&my.init()}))}(jQuery,tribe_tickets_tpp_admin,tribe_tickets_tpp_admin_strings);
Save Changes
Rename File
Rename