Version Description
Download this release
Release Info
Developer | bordoni |
Plugin | Event Tickets |
Version | 4.3.2 |
Comparing to | |
See all releases |
Code changes from version 4.3.1.1 to 4.3.2
- common/src/Tribe/Log/File_Logger.php +8 -1
- event-tickets.php +1 -1
- readme.txt +5 -1
- src/Tribe/Main.php +1 -1
- src/resources/css/tickets-attendees.min.css +1 -1
- src/resources/js/frontend-ticket-form.min.js +1 -1
- src/resources/js/tickets-attendees.min.js +1 -1
- src/resources/js/tickets.js +1 -1
- src/resources/js/tickets.min.js +1 -1
common/src/Tribe/Log/File_Logger.php
CHANGED
@@ -212,8 +212,15 @@ class Tribe__Log__File_Logger implements Tribe__Log__Logger {
|
|
212 |
foreach ( new DirectoryIterator( $this->log_dir ) as $node ) {
|
213 |
$name = $node->getFilename();
|
214 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
// Skip unless it is a .log file with the expected prefix
|
216 |
-
if ( 'log' !== $
|
217 |
continue;
|
218 |
}
|
219 |
|
212 |
foreach ( new DirectoryIterator( $this->log_dir ) as $node ) {
|
213 |
$name = $node->getFilename();
|
214 |
|
215 |
+
// DirectoryIterator::getExtension() is only available on 5.3.6
|
216 |
+
if ( version_compare( phpversion(), '5.3.6', '>=' ) ) {
|
217 |
+
$ext = $node->getExtension();
|
218 |
+
} else {
|
219 |
+
$ext = pathinfo( $name, PATHINFO_EXTENSION );
|
220 |
+
}
|
221 |
+
|
222 |
// Skip unless it is a .log file with the expected prefix
|
223 |
+
if ( 'log' !== $ext || 0 !== strpos( $name, $basename ) ) {
|
224 |
continue;
|
225 |
}
|
226 |
|
event-tickets.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
/*
|
3 |
Plugin Name: Event Tickets
|
4 |
Description: Event Tickets allows your guests to RSVP from any post, page, or event.
|
5 |
-
Version: 4.3.
|
6 |
Author: Modern Tribe, Inc.
|
7 |
Author URI: http://m.tri.be/28
|
8 |
License: GPLv2 or later
|
2 |
/*
|
3 |
Plugin Name: Event Tickets
|
4 |
Description: Event Tickets allows your guests to RSVP from any post, page, or event.
|
5 |
+
Version: 4.3.2
|
6 |
Author: Modern Tribe, Inc.
|
7 |
Author URI: http://m.tri.be/28
|
8 |
License: GPLv2 or later
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Contributors: ModernTribe, borkweb, zbtirrell, barry.hughes, bordoni, brianjesse
|
|
4 |
Tags: events, add-on, ticket sales, tickets, calendar, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, The Events Calendar, Events Calendar PRO, ticket integration, event ticketing, RSVP, Event Tickets, Event Tickets Plus
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.6.1
|
7 |
-
Stable tag: 4.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -207,6 +207,10 @@ Our Premium Plugins:
|
|
207 |
|
208 |
== Changelog ==
|
209 |
|
|
|
|
|
|
|
|
|
210 |
= [4.3.1.1] 2016-10-20 =
|
211 |
|
212 |
* Fix - Corrected a packaging issue from the 4.3.1 release [67936]
|
4 |
Tags: events, add-on, ticket sales, tickets, calendar, community, registration, api, dates, date, posts, workshop, conference, meeting, seminar, concert, summit, The Events Calendar, Events Calendar PRO, ticket integration, event ticketing, RSVP, Event Tickets, Event Tickets Plus
|
5 |
Requires at least: 3.9
|
6 |
Tested up to: 4.6.1
|
7 |
+
Stable tag: 4.3.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
207 |
|
208 |
== Changelog ==
|
209 |
|
210 |
+
= [4.3.2] 2016-11-02 =
|
211 |
+
|
212 |
+
* Tweak - Include more Edited data on the `edit-ticket.tribe` action on JavaScript [68557]
|
213 |
+
|
214 |
= [4.3.1.1] 2016-10-20 =
|
215 |
|
216 |
* Fix - Corrected a packaging issue from the 4.3.1 release [67936]
|
src/Tribe/Main.php
CHANGED
@@ -9,7 +9,7 @@ class Tribe__Tickets__Main {
|
|
9 |
/**
|
10 |
* Current version of this plugin
|
11 |
*/
|
12 |
-
const VERSION = '4.3.
|
13 |
|
14 |
/**
|
15 |
* Min required The Events Calendar version
|
9 |
/**
|
10 |
* Current version of this plugin
|
11 |
*/
|
12 |
+
const VERSION = '4.3.2';
|
13 |
|
14 |
/**
|
15 |
* Min required The Events Calendar version
|
src/resources/css/tickets-attendees.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
#tribe-attendees-summary{padding:0;position:relative}#tribe-attendees-summary .about-description,#tribe-attendees-summary h3{width:66%}#tribe-attendees-summary .about-description a{color:inherit}#tribe-attendees-summary .welcome-panel-column-container{position:static}#tribe-attendees-summary .welcome-panel-column{padding:20px 10px}#tribe-attendees-summary .welcome-panel-column li{line-height:1.4em;margin-bottom:2px}#tribe-attendees-summary .welcome-panel-last{border-left:1px solid #eee;float:right;padding:10px 20px 5px;width:200px}#tribe-attendees-summary .welcome-panel-last h4{font-size:1.5em;text-align:center}#tribe-attendees-summary .welcome-panel-last li{font-size:1.2em}.tribe-attendees-page .welcome-panel-content h3{margin-top:0}.tribe-attendees-page a.tickets_uncheckin{display:none}.tribe-attendees-page h4.tickets-summary{margin:0}.tribe-attendees-page .tickets_checked td{opacity:.7;text-decoration:line-through}.tribe-attendees-page .tickets_checked td.has-row-actions{text-decoration:none}.tribe-attendees-page .tickets_checked td.has-row-actions>div:nth-child(1){text-decoration:line-through}.tribe-attendees-page .tickets_checked a.tickets_checkin{display:none}.tribe-attendees-page .tickets_checked td.column-check_in{text-decoration:none!important}.tribe-attendees-page .tickets_checked a.tickets_uncheckin{display:block}.tribe-attendees-page .column-attendee_id,.tribe-attendees-page .column-order_id{width:70px}.tribe-attendees-page .email,.tribe-attendees-page .export,.tribe-attendees-page .print{margin:1px 8px 0 0}.tribe-attendees-email .tribe-attendees-email-message{float:left;margin:0}.tribe-attendees-email .button-primary{margin-top:3px}.tribe-attendees-email-message ul{font-size:13px;line-height:1.5;margin:.5em 0;padding:2px}.tribe-attendees-email-message ul li:last-child{margin-bottom:0}#attendees_email_wrapper{margin-top:10px;overflow:hidden;padding:20px}#attendees_email_wrapper label{display:block}#attendees_email_wrapper label span{display:inline-block;width:105px}#attendees_email_wrapper input[type=text],#attendees_email_wrapper select{width:285px}#attendees_email_wrapper .attendees_or{display:block;font-size:20px;margin:20px 0;text-align:center}@media screen and (max-width:870px){#tribe-attendees-summary .about-description,#tribe-attendees-summary h3{width:100%}#tribe-attendees-summary .welcome-panel-column-container{margin-bottom:115px}#tribe-attendees-summary .welcome-panel-column li{display:list-item}#tribe-attendees-summary .welcome-panel-last{border-left:0;border-top:1px solid #eee;bottom:0;left:0;right:0;top:auto;width:100%}#tribe-attendees-summary .welcome-panel-last ul{float:left;width:50%}}@media screen and (min-width:870px){#tribe-attendees-summary .welcome-panel-last ul:first-child{margin-bottom:0}#tribe-attendees-summary .welcome-panel-last ul:last-child{margin-top:0}}@media screen and (max-width:782px){.tribe-attendees-email-message .notice-dismiss{padding:9px}}
|
1 |
+
#tribe-attendees-summary{padding:0;position:relative}#tribe-attendees-summary .about-description,#tribe-attendees-summary h3{width:66%}#tribe-attendees-summary .about-description a{color:inherit}#tribe-attendees-summary .welcome-panel-column-container{position:static;position:initial}#tribe-attendees-summary .welcome-panel-column{padding:20px 10px}#tribe-attendees-summary .welcome-panel-column li{line-height:1.4em;margin-bottom:2px}#tribe-attendees-summary .welcome-panel-last{border-left:1px solid #eee;float:right;padding:10px 20px 5px;width:200px}#tribe-attendees-summary .welcome-panel-last h4{font-size:1.5em;text-align:center}#tribe-attendees-summary .welcome-panel-last li{font-size:1.2em}.tribe-attendees-page .welcome-panel-content h3{margin-top:0}.tribe-attendees-page a.tickets_uncheckin{display:none}.tribe-attendees-page h4.tickets-summary{margin:0}.tribe-attendees-page .tickets_checked td{opacity:.7;text-decoration:line-through}.tribe-attendees-page .tickets_checked td.has-row-actions{text-decoration:none}.tribe-attendees-page .tickets_checked td.has-row-actions>div:nth-child(1){text-decoration:line-through}.tribe-attendees-page .tickets_checked a.tickets_checkin{display:none}.tribe-attendees-page .tickets_checked td.column-check_in{text-decoration:none!important}.tribe-attendees-page .tickets_checked a.tickets_uncheckin{display:block}.tribe-attendees-page .column-attendee_id,.tribe-attendees-page .column-order_id{width:70px}.tribe-attendees-page .email,.tribe-attendees-page .export,.tribe-attendees-page .print{margin:1px 8px 0 0}.tribe-attendees-email .tribe-attendees-email-message{float:left;margin:0}.tribe-attendees-email .button-primary{margin-top:3px}.tribe-attendees-email-message ul{font-size:13px;line-height:1.5;margin:.5em 0;padding:2px}.tribe-attendees-email-message ul li:last-child{margin-bottom:0}#attendees_email_wrapper{margin-top:10px;overflow:hidden;padding:20px}#attendees_email_wrapper label{display:block}#attendees_email_wrapper label span{display:inline-block;width:105px}#attendees_email_wrapper input[type=text],#attendees_email_wrapper select{width:285px}#attendees_email_wrapper .attendees_or{display:block;font-size:20px;margin:20px 0;text-align:center}@media screen and (max-width:870px){#tribe-attendees-summary .about-description,#tribe-attendees-summary h3{width:100%}#tribe-attendees-summary .welcome-panel-column-container{margin-bottom:115px}#tribe-attendees-summary .welcome-panel-column li{display:list-item}#tribe-attendees-summary .welcome-panel-last{border-left:0;border-top:1px solid #eee;bottom:0;left:0;right:0;top:auto;top:initial;width:100%}#tribe-attendees-summary .welcome-panel-last ul{float:left;width:50%}}@media screen and (min-width:870px){#tribe-attendees-summary .welcome-panel-last ul:first-child{margin-bottom:0}#tribe-attendees-summary .welcome-panel-last ul:last-child{margin-top:0}}@media screen and (max-width:782px){.tribe-attendees-email-message .notice-dismiss{padding:9px}}
|
src/resources/js/frontend-ticket-form.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var tribe_tickets_ticket_form={};!function(t,e){var _,c;e.init=function(){_=t(".tribe-events-tickets"),c=_.find(".quantity").find(".qty"),c.on("change",e.on_quantity_change)},e.on_quantity_change=function(){var _=t(this),c=e.get_matching_ticket_id(this);e.ticket_uses_global_stock(c)?e.global_stock_quantity_changed(_,c):e.normal_stock_quantity_changed(_,c)},e.global_stock_quantity_changed=function(t,_){var c=t.val(),i=e.get_event_id(_),a=e.get_cap(_),o=e.get_global_stock(i),n=e.currently_requested_global_event_stock(i);n>o&&(c-=n-o),e.stock_mode_is_capped(_)&&c>a&&(c=a),0>=c&&(c=0),t.val(c),e.update_available_stock_counts(i)},e.normal_stock_quantity_changed=function(t,c){var i,a=t.val(),o=e.get_single_stock(c);a>o&&(a=o),t.val(a),i=o-a,_.find(".available-stock[data-product-id="+c+"]").html(i)},e.update_available_stock_counts=function(c){var i=e.get_tickets_of(c),a=e.get_global_stock(c)-e.currently_requested_global_event_stock(c);for(var o in i)if(i.hasOwnProperty(o)){a
|
1 |
+
var tribe_tickets_ticket_form={};!function(t,e){var _,c;e.init=function(){_=t(".tribe-events-tickets"),c=_.find(".quantity").find(".qty"),c.on("change",e.on_quantity_change)},e.on_quantity_change=function(){var _=t(this),c=e.get_matching_ticket_id(this);e.ticket_uses_global_stock(c)?e.global_stock_quantity_changed(_,c):e.normal_stock_quantity_changed(_,c)},e.global_stock_quantity_changed=function(t,_){var c=t.val(),i=e.get_event_id(_),a=e.get_cap(_),o=e.get_global_stock(i),n=e.currently_requested_global_event_stock(i);n>o&&(c-=n-o),e.stock_mode_is_capped(_)&&c>a&&(c=a),0>=c&&(c=0),t.val(c),e.update_available_stock_counts(i)},e.normal_stock_quantity_changed=function(t,c){var i,a=t.val(),o=e.get_single_stock(c);a>o&&(a=o),t.val(a),i=o-a,_.find(".available-stock[data-product-id="+c+"]").html(i)},e.update_available_stock_counts=function(c){var i=e.get_tickets_of(c),a=e.get_global_stock(c)-e.currently_requested_global_event_stock(c);for(var o in i)if(i.hasOwnProperty(o)){0>a&&(a=0);var n=i[o];if("global"===n.mode&&_.find(".available-stock[data-product-id="+o+"]").html(a),"capped"===n.mode){var r=Math.min(a,n.cap),s=parseInt(t("[data-product-id="+o+"]").find("input").val(),10),d=n.cap-s;0>d?d=0:d>r&&(d=r),_.find(".available-stock[data-product-id="+o+"]").html(d)}}},e.get_matching_ticket_id=function(e){var _=t(e).closest("[data-product-id]");if(_.length)return _.data("product-id")},e.get_ticket_property=function(t,e){if("object"!=typeof tribe_tickets_stock_data)return!1;var _=tribe_tickets_stock_data.tickets[t];return"undefined"===tribe_tickets_stock_data.tickets[t]?!1:_[e]},e.get_tickets_of=function(t){if("object"!=typeof tribe_tickets_stock_data)return!1;var e=[];for(var _ in tribe_tickets_stock_data.tickets){var c=tribe_tickets_stock_data.tickets[_];t===c.event_id&&(e[_]=c)}return e},e.currently_requested_global_event_stock=function(t){var c=0,i=e.get_tickets_of(t);for(var a in i)switch(tribe_tickets_stock_data.tickets[a].mode){case"global":case"capped":c+=parseInt(_.find("[data-product-id="+a+"]").find(".qty").val(),10)}return c},e.get_event_property=function(t,e){if("object"!=typeof tribe_tickets_stock_data)return!1;var _=tribe_tickets_stock_data.events[t];return"undefined"===tribe_tickets_stock_data.events[t]?!1:_[e]},e.stock_mode_is_global=function(t){return"global"===e.get_mode(t)},e.stock_mode_is_capped=function(t){return"capped"===e.get_mode(t)},e.ticket_uses_global_stock=function(t){return e.stock_mode_is_capped(t)||e.stock_mode_is_global(t)},e.get_mode=function(t){return e.get_ticket_property(t,"mode")},e.get_event_id=function(t){return e.get_ticket_property(t,"event_id")},e.get_cap=function(t){return e.get_ticket_property(t,"cap")},e.get_global_stock=function(t){return e.get_event_property(t,"stock")},e.get_single_stock=function(t){return e.get_ticket_property(t,"stock")},t(function(){e.init()})}(jQuery,tribe_tickets_ticket_form);
|
src/resources/js/tickets-attendees.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var tribe_event_tickets_attendees=tribe_event_tickets_attendees||{};!function(t,e){function n(){function n(e){t.isArray(e)||(e=[e]);var n=parseInt(.7*t(window).width());n=n>800?800:n;var i=parseInt(.9*t(window).height());i=i>800?800:i;var a="&ticket_ids="+e.join("|")+"&width="+n+"&height="+i,r=Attendees.move_url.replace("&TB_",a+"&TB_");tb_show(null,r,!1)}if("undefined"!=typeof AttendeesPointer&&null!==AttendeesPointer){options=t.extend(AttendeesPointer.options,{close:function(){t.post(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")}t("input.print").on("click",function(t){window.print()});var i=t(document.getElementById("filter_attendee"));i.on("keydown",function(t){
|
1 |
+
var tribe_event_tickets_attendees=tribe_event_tickets_attendees||{};!function(t,e){function n(){function n(e){t.isArray(e)||(e=[e]);var n=parseInt(.7*t(window).width());n=n>800?800:n;var i=parseInt(.9*t(window).height());i=i>800?800:i;var a="&ticket_ids="+e.join("|")+"&width="+n+"&height="+i,r=Attendees.move_url.replace("&TB_",a+"&TB_");tb_show(null,r,!1)}if("undefined"!=typeof AttendeesPointer&&null!==AttendeesPointer){options=t.extend(AttendeesPointer.options,{close:function(){t.post(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")}t("input.print").on("click",function(t){window.print()});var i=t(document.getElementById("filter_attendee"));i.on("keydown",function(t){return 13===t.keyCode?!1:void 0}),i.on("keyup paste",function(){var e=jQuery(this).val().toLowerCase();t("#the-list").find("tr").each(function(){var n=t(this),i=n.find("td.status");if(t(n).hasClass("event-tickets-meta-row"))return void t(n).removeClass("event-tickets-meta-toggle-open");if(t(n).hasClass("event-tickets-meta-toggle-open")&&t(n).removeClass("event-tickets-meta-toggle-open"),!i.length)return void n.hide();var a=n.children("td.status").text().toLowerCase().trim(),r=n.children("td.ticket").text().toLowerCase().trim(),o=n.children("td.security").text().toLowerCase().trim(),c=0===r.indexOf(e)||0===a.indexOf(e)||0===a.indexOf("#"+e)||0===o.indexOf(e),s=n.children("td.purchaser").text().toLowerCase().trim(),d=0===s.indexOf(e)||s.indexOf(" "+e)>1;c||d?n.show():n.hide()})}),t(".tribe-attendees-email").on({submit:function(e){t(".tribe-attendees-email").hide(),t(document.getElementById("tribe-loading")).show()}}),t(".tickets_checkin").click(function(e){var n=jQuery(this),i={action:"tribe-ticket-checkin-"+n.attr("data-provider"),provider:n.attr("data-provider"),order_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(ajaxurl,i,function(e){e.success&&(n.parent("td").parent("tr").addClass("tickets_checked"),t("#total_checkedin").text(parseInt(t("#total_checkedin").text())+1))},"json"),e.preventDefault()}),t(".tickets_uncheckin").click(function(e){var n=jQuery(this),i={action:"tribe-ticket-uncheckin-"+n.attr("data-provider"),provider:n.attr("data-provider"),order_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(ajaxurl,i,function(e){e.success&&(n.parent("span").parent("td").parent("tr").removeClass("tickets_checked"),t("#total_checkedin").text(parseInt(t("#total_checkedin").text())-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").click(function(e){var i;switch(t(e.currentTarget).attr("id")){case"doaction":i="action";break;case"doaction2":i="action2"}if("undefined"!=typeof i&&"move"===t('select[name="'+i+'"]').val()){var a=jQuery('input[name="attendee[]"]:checked');if(a.length){var r=[];a.each(function(){var e=t(this).val().match(/^[0-9]+/);e&&r.push(e.toString())}),n(r)}else alert(Attendees.cannot_move);return e.stopPropagation(),!1}}),function(){var n=t(".ticket-history"),i=t(".hide-ticket-history");i.hide(),n.click(function(n){function i(){var n={action:"get_ticket_history",check:c,ticket_id:o};t.post(ajaxurl,n,function(n){if("undefined"!=typeof n.data&&"string"==typeof n.data.html){var i=a.parents("tr"),c=e.count_columns(i),s=t('<tr id="ticket-history-'+o+'"> <td colspan="'+c+'">'+n.data.html+"</td></tr>");s.hide().insertAfter(i).slideDown(),a.hide(),r.show()}})}var a=t(this),r=a.siblings(".hide-ticket-history"),o=parseInt(a.data("ticket-id"),10),c=a.data("check");if(o&&c){var s=t(document.getElementById("ticket-history-"+o));return s.length?(s.show(),a.hide(),r.show()):i(),n.stopPropagation(),!1}}),i.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()})}()}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);e=e>1?e-1:0,n+=1+e}),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(document).ready(n)}(jQuery,tribe_event_tickets_attendees);
|
src/resources/js/tickets.js
CHANGED
@@ -612,7 +612,7 @@ var ticketHeaderImage = window.ticketHeaderImage || {};
|
|
612 |
|
613 |
$tribe_tickets
|
614 |
.trigger( 'set-advanced-fields.tribe' )
|
615 |
-
.trigger( 'edit-ticket.tribe' );
|
616 |
|
617 |
},
|
618 |
'json'
|
612 |
|
613 |
$tribe_tickets
|
614 |
.trigger( 'set-advanced-fields.tribe' )
|
615 |
+
.trigger( 'edit-ticket.tribe', response );
|
616 |
|
617 |
},
|
618 |
'json'
|
src/resources/js/tickets.min.js
CHANGED
@@ -1 +1 @@
|
|
1 |
-
var ticketHeaderImage=window.ticketHeaderImage||{};!function(t,e,i){"use strict";ticketHeaderImage={uploader:function(){var t=wp.media({title:HeaderImageData.title,multiple:!1,library:{type:"image"},button:{text:HeaderImageData.button}});return t.on("close",function(){var e=t.state().get("selection").toJSON();e.length&&ticketHeaderImage.render(e[0])}),t.open(),!1},render:function(t){e("#tribe_ticket_header_preview").html(ticketHeaderImage.imgHTML(t)),e("#tribe_ticket_header_image_id").val(t.id),e("#tribe_ticket_header_remove").show()},imgHTML:function(t){var e='<img src="'+t.url+'" ';return e+='width="'+t.width+'" ',e+='height="'+t.height+'" ',e+="/>"}},e(document).ready(function(){function i(){return l.prop("checked")}function a(){g=!0,o.trigger("set-global-stock-fields.tribe")}function r(){e("tr.ticket_advanced").hide(),e("tr.ticket_advanced_"+n()+":not(.sale_price)").show(),o.trigger("set-advanced-fields.tribe"),e(document.getElementById("tribetickets")).trigger("ticket-provider-changed.tribe")}function n(){var t=e('input[name="ticket_provider"]:checked');return t.length>0?t[0].value:""}function c(){var t=o.find("tr.ticket_advanced.history");if(t.length){var e=t.find("a.toggle-history"),i=e.find("span"),a=t.find("ul");t.find("a.toggle-history").click(function(t){return i.toggle(),a.toggle(),t.stopPropagation(),!1})}}var d=e("#tribe-event-datepickers"),o=e("#tribetickets"),s=e("#event_tickets"),l=e("#tribe-tickets-enable-global-stock"),_=e("#tribe-tickets-global-stock-level"),g=!1,k=e("html, body"),p=0;o.on({"spin.tribe":function(t,i){("undefined"==typeof i||e.inArray(i,["start","stop"]))&&(i="stop"),"stop"===i?s.css("opacity","1").find("#tribe-loading").hide():s.css("opacity","0.5").find("#tribe-loading").show()},"clear.tribe":function(){var t=e(this),i=t.find("#ticket_form"),a=i.find("tr:not(.event-wide-settings)");t.find("a#ticket_form_toggle").show(),a.find('input:not(:button):not(:radio):not(:checkbox):not([type="hidden"]), textarea').val(""),a.find("input:checkbox").attr("checked",!1),a.find("#ticket_id").val(""),t.find('#ticket_form input[name="show_attendee_info"]').prop("checked",!1).change(),t.find("input[data-default-value]").each(function(){var t=e(this);t.val(t.data("default-value"))}),t.find("#ticket_start_date").datepicker("option","maxDate",null),t.find("#ticket_end_date").datepicker("option","minDate",null),t.find(".ticket_start_time, .ticket_end_time, .ticket.sale_price").hide(),t.find("#ticket_price").removeProp("disabled").siblings(".no-update-message").html("").hide().end().siblings(".description").show(),e("#tribe-tickets-attendee-sortables").empty(),e(".tribe-tickets-attendee-saved-fields").show(),i.hide()},"focus.tribe":function(){k.animate({scrollTop:s.offset().top-50},500)},"edit-tickets-complete.tribe":function(){c()},"set-advanced-fields.tribe":function(){var t=e(this),i=t.find("#ticket_form"),a=i.find("tr.ticket_advanced:not(.ticket_advanced_meta)").find("input, select, textarea"),r=i.find("#ticket_provider:checked").val();a.each(function(){var t=e(this);t.attr("name")&&t.data("name",t.attr("name")).attr({name:"",id:""}),t.closest("tr").hasClass("ticket_advanced_"+r)&&t.data("name")&&0===t.attr("name").length&&t.attr({name:t.data("name"),id:t.data("name")})}),o.trigger("set-global-stock-fields.tribe"),e("#ticket_global_stock").change(function(){o.trigger("set-global-stock-fields.tribe")})},"set-global-stock-fields.tribe":function(){var t=n(),a=e(this).find("#ticket_form").find(".ticket_advanced_"+t);if(!(a.length<1)){var r=a.filter(".stock"),c=a.filter(".global-stock-mode"),d=c.filter(".sales-cap-field"),o=e("#ticket_global_stock").val(),s=i();if(_.toggle(s),c.toggle(i()),r.toggle(!s),s)switch(o){case"global":d.hide(),r.hide();break;case"capped":d.show(),r.hide();break;case"own":d.hide(),r.show()}}}}),d.length&&(p=d.data("startofweek"));var f={dateFormat:"yy-mm-dd",showAnim:"fadeIn",changeMonth:!0,changeYear:!0,numberOfMonths:3,firstDay:p,showButtonPanel:!0,onChange:function(){},onSelect:function(t,i){var a=e.datepicker.parseDate("yy-mm-dd",t);"ticket_start_date"===i.id?(e("#ticket_end_date").datepicker("option","minDate",a),a?e(".ticket_start_time").show():e(".ticket_start_time").hide()):(e("#ticket_start_date").datepicker("option","maxDate",a),a?e(".ticket_end_time").show():e(".ticket_end_time").hide())}};e("#ticket_start_date").datepicker(f).keyup(function(t){8!==t.keyCode&&46!==t.keyCode||e.datepicker._clearDate(this)}),e("#ticket_end_date").datepicker(f).keyup(function(t){8!==t.keyCode&&46!==t.keyCode||e.datepicker._clearDate(this)}),l.change(a),l.trigger("change"),g=!1,e("input[name=ticket_provider]:radio").change(function(){r()}),e("input[name=ticket_provider]:checked").each(function(){r()}),e("a#ticket_form_toggle").click(function(t){e("h4.ticket_form_title_edit").hide(),e("h4.ticket_form_title_add").show(),e(this).hide(),o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("focus.tribe"),e("#ticket_form").show(),e(document.getElementById("tribetickets")).trigger("ticket-provider-changed.tribe"),t.preventDefault()}),e("#ticket_form_cancel").click(function(){o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("focus.tribe")}),e("#ticket_form_save").click(function(t){var i=e("#ticket_form_table"),a=i.find("#ticket_provider:checked").val(),r=i.find(".ticket, .ticket_advanced_meta, .ticket_advanced_"+a);o.trigger("save-ticket.tribe",t).trigger("spin.tribe","start");var n={action:"tribe-ticket-add-"+e("input[name=ticket_provider]:checked").val(),formdata:r.find(".ticket_field").serialize(),post_ID:e("#post_ID").val(),nonce:TribeTickets.add_ticket_nonce};e.post(ajaxurl,n,function(t){o.trigger("saved-ticket.tribe",t),t.success&&(o.trigger("clear.tribe"),e("td.ticket_list_container").empty().html(t.data.html),e(".ticket_time").hide())},"json").complete(function(){o.trigger("spin.tribe","stop").trigger("focus.tribe")})}),o.on("click",".ticket_delete",function(t){if(!confirm(tribe_ticket_notices.confirm_alert))return!1;t.preventDefault(),o.trigger("delete-ticket.tribe",t).trigger("spin.tribe","start");var i={action:"tribe-ticket-delete-"+e(this).attr("attr-provider"),post_ID:e("#post_ID").val(),ticket_id:e(this).attr("attr-ticket-id"),nonce:TribeTickets.remove_ticket_nonce};e.post(ajaxurl,i,function(t){o.trigger("deleted-ticket.tribe",t),t.success&&(o.trigger("clear.tribe"),e("td.ticket_list_container").empty().html(t.data))},"json").complete(function(){o.trigger("spin.tribe","stop")})}),o.on("click",".ticket_edit",function(t){t.preventDefault(),e("h4.ticket_form_title_edit").show(),e("h4.ticket_form_title_add").hide(),o.trigger("spin.tribe","start");var i={action:"tribe-ticket-edit-"+e(this).attr("attr-provider"),post_ID:e("#post_ID").val(),ticket_id:e(this).attr("attr-ticket-id"),nonce:TribeTickets.edit_ticket_nonce};e.post(ajaxurl,i,function(t){o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("edit-ticket.tribe",t);var i=t.data.price,a=i,r=!1;"undefined"!=typeof t.data.on_sale&&t.data.on_sale&&(r=!0,i=t.data.regular_price),e("#ticket_id").val(t.data.ID),e("#ticket_name").val(t.data.name),e("#ticket_description").val(t.data.description),r&&e(".ticket_advanced_"+t.data.provider_class+".sale_price").show();var n=t.data.start_date.substring(0,10),c=t.data.end_date.substring(0,10);e("#ticket_start_date").val(n),e("#ticket_end_date").val(c);var d=e(document.getElementById("ticket_start_meridian")),s=e(document.getElementById("ticket_end_meridian"));if(t.data.start_date){var l=parseInt(t.data.start_date.substring(11,13)),_="am";l>12&&d.length&&(_="pm",l=parseInt(l)-12,l=("0"+l).slice(-2)),12===l&&(_="pm"),0===l&&"am"===_&&(l=12),l=l.toString(),1===l.length&&(l="0"+l),e("#ticket_start_hour").val(l),e("#ticket_start_meridian").val(_),e(".ticket_start_time").show()}if(t.data.end_date){var g=parseInt(t.data.end_date.substring(11,13)),k="am";g>12&&s.length&&(k="pm",g=parseInt(g)-12,g=("0"+g).slice(-2)),12===g&&(k="pm"),0===g&&"am"===k&&(g=12),g=g.toString(),1===g.length&&(g="0"+g),e("#ticket_end_hour").val(g),e("#ticket_end_meridian").val(k),e("#ticket_start_minute").val(t.data.start_date.substring(14,16)),e("#ticket_end_minute").val(t.data.end_date.substring(14,16)),e(".ticket_end_time").show()}var p=e("tr.ticket_advanced input");p.data("name",p.attr("name")).attr({name:"",id:""}),e("tr.ticket_advanced").remove(),e("tr.ticket.bottom").before(t.data.advanced_fields),e("input:radio[name=ticket_provider]").filter("[value="+t.data.provider_class+"]").click(),e("input[name=ticket_provider]:radio").change();var f=o.find("#ticket_price");f.val(i),"undefined"!=typeof t.data.disallow_update_price_message?f.siblings(".no-update-message").html(t.data.disallow_update_price_message):f.siblings(".no-update-message").html(""),"undefined"==typeof t.data.can_update_price||t.data.can_update_price?(f.removeProp("disabled"),f.siblings(".description").show(),f.siblings(".no-update-message").hide()):(f.prop("disabled","disabled"),f.siblings(".description").hide(),f.siblings(".no-update-message").show());var m=o.find("#ticket_sale_price");r?m.val(a).closest("tr").show():m.closest("tr").hide(),"undefined"!=typeof t.data.purchase_limit&&t.data.purchase_limit&&e("#ticket_purchase_limit").val(t.data.purchase_limit),o.find(".tribe-bumpdown-trigger").bumpdown(),e("a#ticket_form_toggle").hide(),e("#ticket_form").show(),o.trigger("set-advanced-fields.tribe").trigger("edit-ticket.tribe")},"json").complete(function(){o.trigger("spin.tribe","stop").trigger("focus.tribe").trigger("edit-tickets-complete.tribe")})}).on("click","#tribe_ticket_header_image",function(t){t.preventDefault(),ticketHeaderImage.uploader("","")}).on("keyup","#ticket_price",function(t){t.preventDefault(),console.log("changes here");var i,a=price_format.decimal;price_format.decimal_error;i=new RegExp("[^-0-9%\\"+a+"]+","gi");var r=e(this).val(),n=r.replace(i,"");r!==n?(console.log("new value"),e(this).val(n)):console.log("no change")});var m=e("#tribe_ticket_header_remove"),h=e("#tribe_ticket_header_preview");if(h.find("img").length&&m.show(),_.change(function(){g=!0}),e('input[type="submit"]').click(function(){g=!1}),e(t).on("beforeunload",function(){if(g)return tribe_global_stock_admin_ui.nav_away_msg}),e("body").on("click","#tribe_ticket_header_remove",function(t){t.preventDefault(),h.html(""),m.hide(),e("#tribe_ticket_header_image_id").val("")}),e("#tribe_ticket_header_preview img").length){var u=e("#tribe_ticket_header_preview img");u.removeAttr("width").removeAttr("height"),o.width()<u.width()&&u.css("width","95%")}})}(window,jQuery);
|
1 |
+
var ticketHeaderImage=window.ticketHeaderImage||{};!function(t,e,i){"use strict";ticketHeaderImage={uploader:function(){var t=wp.media({title:HeaderImageData.title,multiple:!1,library:{type:"image"},button:{text:HeaderImageData.button}});return t.on("close",function(){var e=t.state().get("selection").toJSON();e.length&&ticketHeaderImage.render(e[0])}),t.open(),!1},render:function(t){e("#tribe_ticket_header_preview").html(ticketHeaderImage.imgHTML(t)),e("#tribe_ticket_header_image_id").val(t.id),e("#tribe_ticket_header_remove").show()},imgHTML:function(t){var e='<img src="'+t.url+'" ';return e+='width="'+t.width+'" ',e+='height="'+t.height+'" ',e+="/>"}},e(document).ready(function(){function i(){return l.prop("checked")}function a(){g=!0,o.trigger("set-global-stock-fields.tribe")}function r(){e("tr.ticket_advanced").hide(),e("tr.ticket_advanced_"+n()+":not(.sale_price)").show(),o.trigger("set-advanced-fields.tribe"),e(document.getElementById("tribetickets")).trigger("ticket-provider-changed.tribe")}function n(){var t=e('input[name="ticket_provider"]:checked');return t.length>0?t[0].value:""}function c(){var t=o.find("tr.ticket_advanced.history");if(t.length){var e=t.find("a.toggle-history"),i=e.find("span"),a=t.find("ul");t.find("a.toggle-history").click(function(t){return i.toggle(),a.toggle(),t.stopPropagation(),!1})}}var d=e("#tribe-event-datepickers"),o=e("#tribetickets"),s=e("#event_tickets"),l=e("#tribe-tickets-enable-global-stock"),_=e("#tribe-tickets-global-stock-level"),g=!1,k=e("html, body"),p=0;o.on({"spin.tribe":function(t,i){("undefined"==typeof i||e.inArray(i,["start","stop"]))&&(i="stop"),"stop"===i?s.css("opacity","1").find("#tribe-loading").hide():s.css("opacity","0.5").find("#tribe-loading").show()},"clear.tribe":function(){var t=e(this),i=t.find("#ticket_form"),a=i.find("tr:not(.event-wide-settings)");t.find("a#ticket_form_toggle").show(),a.find('input:not(:button):not(:radio):not(:checkbox):not([type="hidden"]), textarea').val(""),a.find("input:checkbox").attr("checked",!1),a.find("#ticket_id").val(""),t.find('#ticket_form input[name="show_attendee_info"]').prop("checked",!1).change(),t.find("input[data-default-value]").each(function(){var t=e(this);t.val(t.data("default-value"))}),t.find("#ticket_start_date").datepicker("option","maxDate",null),t.find("#ticket_end_date").datepicker("option","minDate",null),t.find(".ticket_start_time, .ticket_end_time, .ticket.sale_price").hide(),t.find("#ticket_price").removeProp("disabled").siblings(".no-update-message").html("").hide().end().siblings(".description").show(),e("#tribe-tickets-attendee-sortables").empty(),e(".tribe-tickets-attendee-saved-fields").show(),i.hide()},"focus.tribe":function(){k.animate({scrollTop:s.offset().top-50},500)},"edit-tickets-complete.tribe":function(){c()},"set-advanced-fields.tribe":function(){var t=e(this),i=t.find("#ticket_form"),a=i.find("tr.ticket_advanced:not(.ticket_advanced_meta)").find("input, select, textarea"),r=i.find("#ticket_provider:checked").val();a.each(function(){var t=e(this);t.attr("name")&&t.data("name",t.attr("name")).attr({name:"",id:""}),t.closest("tr").hasClass("ticket_advanced_"+r)&&t.data("name")&&0===t.attr("name").length&&t.attr({name:t.data("name"),id:t.data("name")})}),o.trigger("set-global-stock-fields.tribe"),e("#ticket_global_stock").change(function(){o.trigger("set-global-stock-fields.tribe")})},"set-global-stock-fields.tribe":function(){var t=n(),a=e(this).find("#ticket_form").find(".ticket_advanced_"+t);if(!(a.length<1)){var r=a.filter(".stock"),c=a.filter(".global-stock-mode"),d=c.filter(".sales-cap-field"),o=e("#ticket_global_stock").val(),s=i();if(_.toggle(s),c.toggle(i()),r.toggle(!s),s)switch(o){case"global":d.hide(),r.hide();break;case"capped":d.show(),r.hide();break;case"own":d.hide(),r.show()}}}}),d.length&&(p=d.data("startofweek"));var f={dateFormat:"yy-mm-dd",showAnim:"fadeIn",changeMonth:!0,changeYear:!0,numberOfMonths:3,firstDay:p,showButtonPanel:!0,onChange:function(){},onSelect:function(t,i){var a=e.datepicker.parseDate("yy-mm-dd",t);"ticket_start_date"===i.id?(e("#ticket_end_date").datepicker("option","minDate",a),a?e(".ticket_start_time").show():e(".ticket_start_time").hide()):(e("#ticket_start_date").datepicker("option","maxDate",a),a?e(".ticket_end_time").show():e(".ticket_end_time").hide())}};e("#ticket_start_date").datepicker(f).keyup(function(t){8!==t.keyCode&&46!==t.keyCode||e.datepicker._clearDate(this)}),e("#ticket_end_date").datepicker(f).keyup(function(t){8!==t.keyCode&&46!==t.keyCode||e.datepicker._clearDate(this)}),l.change(a),l.trigger("change"),g=!1,e("input[name=ticket_provider]:radio").change(function(){r()}),e("input[name=ticket_provider]:checked").each(function(){r()}),e("a#ticket_form_toggle").click(function(t){e("h4.ticket_form_title_edit").hide(),e("h4.ticket_form_title_add").show(),e(this).hide(),o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("focus.tribe"),e("#ticket_form").show(),e(document.getElementById("tribetickets")).trigger("ticket-provider-changed.tribe"),t.preventDefault()}),e("#ticket_form_cancel").click(function(){o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("focus.tribe")}),e("#ticket_form_save").click(function(t){var i=e("#ticket_form_table"),a=i.find("#ticket_provider:checked").val(),r=i.find(".ticket, .ticket_advanced_meta, .ticket_advanced_"+a);o.trigger("save-ticket.tribe",t).trigger("spin.tribe","start");var n={action:"tribe-ticket-add-"+e("input[name=ticket_provider]:checked").val(),formdata:r.find(".ticket_field").serialize(),post_ID:e("#post_ID").val(),nonce:TribeTickets.add_ticket_nonce};e.post(ajaxurl,n,function(t){o.trigger("saved-ticket.tribe",t),t.success&&(o.trigger("clear.tribe"),e("td.ticket_list_container").empty().html(t.data.html),e(".ticket_time").hide())},"json").complete(function(){o.trigger("spin.tribe","stop").trigger("focus.tribe")})}),o.on("click",".ticket_delete",function(t){if(!confirm(tribe_ticket_notices.confirm_alert))return!1;t.preventDefault(),o.trigger("delete-ticket.tribe",t).trigger("spin.tribe","start");var i={action:"tribe-ticket-delete-"+e(this).attr("attr-provider"),post_ID:e("#post_ID").val(),ticket_id:e(this).attr("attr-ticket-id"),nonce:TribeTickets.remove_ticket_nonce};e.post(ajaxurl,i,function(t){o.trigger("deleted-ticket.tribe",t),t.success&&(o.trigger("clear.tribe"),e("td.ticket_list_container").empty().html(t.data))},"json").complete(function(){o.trigger("spin.tribe","stop")})}),o.on("click",".ticket_edit",function(t){t.preventDefault(),e("h4.ticket_form_title_edit").show(),e("h4.ticket_form_title_add").hide(),o.trigger("spin.tribe","start");var i={action:"tribe-ticket-edit-"+e(this).attr("attr-provider"),post_ID:e("#post_ID").val(),ticket_id:e(this).attr("attr-ticket-id"),nonce:TribeTickets.edit_ticket_nonce};e.post(ajaxurl,i,function(t){o.trigger("clear.tribe").trigger("set-advanced-fields.tribe").trigger("edit-ticket.tribe",t);var i=t.data.price,a=i,r=!1;"undefined"!=typeof t.data.on_sale&&t.data.on_sale&&(r=!0,i=t.data.regular_price),e("#ticket_id").val(t.data.ID),e("#ticket_name").val(t.data.name),e("#ticket_description").val(t.data.description),r&&e(".ticket_advanced_"+t.data.provider_class+".sale_price").show();var n=t.data.start_date.substring(0,10),c=t.data.end_date.substring(0,10);e("#ticket_start_date").val(n),e("#ticket_end_date").val(c);var d=e(document.getElementById("ticket_start_meridian")),s=e(document.getElementById("ticket_end_meridian"));if(t.data.start_date){var l=parseInt(t.data.start_date.substring(11,13)),_="am";l>12&&d.length&&(_="pm",l=parseInt(l)-12,l=("0"+l).slice(-2)),12===l&&(_="pm"),0===l&&"am"===_&&(l=12),l=l.toString(),1===l.length&&(l="0"+l),e("#ticket_start_hour").val(l),e("#ticket_start_meridian").val(_),e(".ticket_start_time").show()}if(t.data.end_date){var g=parseInt(t.data.end_date.substring(11,13)),k="am";g>12&&s.length&&(k="pm",g=parseInt(g)-12,g=("0"+g).slice(-2)),12===g&&(k="pm"),0===g&&"am"===k&&(g=12),g=g.toString(),1===g.length&&(g="0"+g),e("#ticket_end_hour").val(g),e("#ticket_end_meridian").val(k),e("#ticket_start_minute").val(t.data.start_date.substring(14,16)),e("#ticket_end_minute").val(t.data.end_date.substring(14,16)),e(".ticket_end_time").show()}var p=e("tr.ticket_advanced input");p.data("name",p.attr("name")).attr({name:"",id:""}),e("tr.ticket_advanced").remove(),e("tr.ticket.bottom").before(t.data.advanced_fields),e("input:radio[name=ticket_provider]").filter("[value="+t.data.provider_class+"]").click(),e("input[name=ticket_provider]:radio").change();var f=o.find("#ticket_price");f.val(i),"undefined"!=typeof t.data.disallow_update_price_message?f.siblings(".no-update-message").html(t.data.disallow_update_price_message):f.siblings(".no-update-message").html(""),"undefined"==typeof t.data.can_update_price||t.data.can_update_price?(f.removeProp("disabled"),f.siblings(".description").show(),f.siblings(".no-update-message").hide()):(f.prop("disabled","disabled"),f.siblings(".description").hide(),f.siblings(".no-update-message").show());var m=o.find("#ticket_sale_price");r?m.val(a).closest("tr").show():m.closest("tr").hide(),"undefined"!=typeof t.data.purchase_limit&&t.data.purchase_limit&&e("#ticket_purchase_limit").val(t.data.purchase_limit),o.find(".tribe-bumpdown-trigger").bumpdown(),e("a#ticket_form_toggle").hide(),e("#ticket_form").show(),o.trigger("set-advanced-fields.tribe").trigger("edit-ticket.tribe",t)},"json").complete(function(){o.trigger("spin.tribe","stop").trigger("focus.tribe").trigger("edit-tickets-complete.tribe")})}).on("click","#tribe_ticket_header_image",function(t){t.preventDefault(),ticketHeaderImage.uploader("","")}).on("keyup","#ticket_price",function(t){t.preventDefault(),console.log("changes here");var i,a=price_format.decimal;price_format.decimal_error;i=new RegExp("[^-0-9%\\"+a+"]+","gi");var r=e(this).val(),n=r.replace(i,"");r!==n?(console.log("new value"),e(this).val(n)):console.log("no change")});var m=e("#tribe_ticket_header_remove"),h=e("#tribe_ticket_header_preview");if(h.find("img").length&&m.show(),_.change(function(){g=!0}),e('input[type="submit"]').click(function(){g=!1}),e(t).on("beforeunload",function(){return g?tribe_global_stock_admin_ui.nav_away_msg:void 0}),e("body").on("click","#tribe_ticket_header_remove",function(t){t.preventDefault(),h.html(""),m.hide(),e("#tribe_ticket_header_image_id").val("")}),e("#tribe_ticket_header_preview img").length){var u=e("#tribe_ticket_header_preview img");u.removeAttr("width").removeAttr("height"),o.width()<u.width()&&u.css("width","95%")}})}(window,jQuery);
|