diff --git a/assets/css/wpclubmanager.css b/assets/css/wpclubmanager.css
index d9576e3..757eea0 100644
--- a/assets/css/wpclubmanager.css
+++ b/assets/css/wpclubmanager.css
@@ -61,7 +61,7 @@ table {
table thead tr td,
table tfoot tr th,
table tfoot tr td {
- padding: 0.5rem 0.625 0.625rem;
+ padding: 0.5rem 0.625rem;
font-weight: bold;
text-align: left;
}
@@ -77,9 +77,9 @@ table {
display: table-cell;
line-height: 1.125rem;
}
- .entry-content td {
+ /* .entry-content td {
padding-left: 0.625rem !important;
- }
+ } */
.wpcm-fixtures-shortcode tbody tr:hover {
cursor: pointer;
}
diff --git a/assets/js/admin/meta-boxes.js b/assets/js/admin/meta-boxes.js
index 7ed6605..cd78f79 100644
--- a/assets/js/admin/meta-boxes.js
+++ b/assets/js/admin/meta-boxes.js
@@ -223,18 +223,16 @@ jQuery( function($){
type: 'POST',
async: true,
cache: false,
- dataType: 'json',
data:{
action: 'item_sort', // Tell WordPress how to handle this ajax request
order: itemList.sortable('toArray').toString() // Passes ID's of list items in 1,3,2 format
- },
+ },
+ dataType: 'JSON',
success: function(response) {
jQuery('#loading-animation').hide(); // Hide the loading animation
return;
},
error: function(xhr,textStatus,e) { // This can be expanded to provide more information
- alert(e);
- alert('There was an error saving the updates');
jQuery('#loading-animation').hide(); // Hide the loading animation
return;
}
diff --git a/assets/js/admin/meta-boxes.min.js b/assets/js/admin/meta-boxes.min.js
index 2c890c7..9f9e161 100644
--- a/assets/js/admin/meta-boxes.min.js
+++ b/assets/js/admin/meta-boxes.min.js
@@ -1 +1 @@
-jQuery(function(e){var t;jQuery("select.chosen_select").chosen({disable_search_threshold:10,width:"220px"}),jQuery("select.chosen_select_outcome").chosen({disable_search_threshold:10,width:"auto",placeholder_text_single:" "}),jQuery("select.chosen_select_dob").chosen({disable_search_threshold:32}),jQuery("select.chosen_select_nostd").chosen({allow_single_deselect:"true"}),jQuery("select.wpcm-chosen-multiple").chosen({width:"100%"}),jQuery("#input-order").length&&(jQuery("select.wpcm-chosen-multiple").on("change",function(e){var t=jQuery(this).get(0);setTimeout(function(){var e=ChosenOrder.getSelectionOrder(t);jQuery("#input-order").val(e).toString().split(",")})}),t=jQuery("select.wpcm-chosen-multiple").get(0),ChosenOrder.setSelectionOrder(t,jQuery("#input-order").val().split(","),!0)),jQuery(".wpcm_stats-tabs a").click(function(){var e=jQuery(this).attr("href");return jQuery(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),jQuery(this).parent().parent().parent().find(".tabs-panel").hide(),jQuery(e).show(),!1}),jQuery(".type_box").appendTo("#wpclubmanager-player-stats .hndle"),jQuery(function(){jQuery("#wpclubmanager-player-stats").find(".hndle").unbind("click.postboxes"),jQuery("#wpclubmanager-player-stats").on("click",".hndle",function(e){jQuery(e.target).filter("input, option, label, select, .chosen-drop").length||jQuery("#wpclubmanager-player-stats").toggleClass("closed")})}),jQuery(document).on("change",".wpcm-player-season-select",function(){var e=jQuery(this).data("target"),t=jQuery("option:selected",this).data("show");jQuery(e).children().addClass("hidden"),jQuery(t).removeClass("hidden")}),jQuery(".wpcm-player-season-select").trigger("change"),jQuery("#wpclubmanager-match-result").on("change","#wpcm_played",function(){played=jQuery(this).prop("checked"),played?(jQuery("#wpclubmanager-match-report").show("fast"),jQuery("#wpclubmanager-match-result #results-table").show("fast")):(jQuery("#wpclubmanager-match-result #results-table").hide("fast"),jQuery("#wpclubmanager-match-report").hide("fast"))}),jQuery("#wpclubmanager-match-result #wpcm_played").change(),jQuery("#wpclubmanager-match-result").on("change","#wpcm_shootout",function(){shootout=jQuery(this).prop("checked"),shootout?jQuery("#wpclubmanager-match-result .wpcm-results-shootout").show("fast"):jQuery("#wpclubmanager-match-result .wpcm-results-shootout").hide("fast")}),jQuery("#wpclubmanager-match-result #wpcm_shootout").change(),jQuery("#wpclubmanager-match-result").on("change","#_wpcm_postponed",function(){postponed_result=jQuery("#_wpcm_postponed").prop("checked"),postponed_result?(jQuery(".wpcm-postponed-result").show("fast"),jQuery("#wpclubmanager-match-result #results-table").hide("fast")):jQuery(".wpcm-postponed-result").hide("fast")}),jQuery("#wpclubmanager-match-result #_wpcm_postponed").change(),jQuery('#wpcm_players table .names input[type="checkbox"]').on("change",function(){player_id=jQuery(this).attr("data-player"),jQuery(this).closest("tr").find('input[type="number"]').prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find('input[data-card="yellow"], input[data-card="red"]').prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find("select").prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find('input[type="radio"]').prop("disabled",!jQuery(this).prop("checked"))}),jQuery('#wpcm_players table td.mvp input[type="radio"]').click(function(){jQuery('td.mvp input[type="radio"]').prop("checked",!1),jQuery(this).prop("checked",!0)}),jQuery('#wpcm_players table td.captain input[type="radio"]').click(function(){jQuery('td.captain input[type="radio"]').prop("checked",!1),jQuery(this).prop("checked",!0)}),updateCounter=function(){var e=jQuery("#wpcm_lineup input.player-select:checked").length,t=jQuery("#wpcm_subs input.player-select:checked").length;0 '+t+' ';jQuery("#wpcm-table-stats table tbody").append(r),jQuery("#wpcm-table-stats table tr.count-row").each(function(e){jQuery("td",this).eq(1).html(e+1)})}),jQuery(".wpcm-table-delete-row").click(function(){jQuery("#wpcm-table-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&(jQuery(this).parents("tr").prev("tr").remove(),jQuery(this).parents("tr").next("tr").remove(),jQuery(this).parents("tr").remove())})}),jQuery("#wpcm-table-stats input").change(function(){index=jQuery(this).attr("data-index"),club=jQuery(this).closest("tr").attr("data-club"),value=0,jQuery(this).closest("table").find("tbody").each(function(){total=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="'+index+'"]').val()),auto=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-auto input[data-index="'+index+'"]').val()),value=total-auto}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-manual input[data-index="'+index+'"]').val(value)}),jQuery('#wpcm-table-stats input[data-index="f"],#wpcm-table-stats input[data-index="a"]').change(function(){club=jQuery(this).closest("tr").attr("data-club"),value=0,jQuery(this).closest("table").find("tbody").each(function(){f=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="f"]').val()),a=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="a"]').val()),value=jQuery("body").hasClass("footy")?f/a*100:f-a}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="gd"]').val(value),jQuery(this).closest("table").find("tbody").each(function(){total=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="gd"]').val()),auto=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-auto input[data-index="gd"]').val()),manual=total-auto}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-manual input[data-index="gd"]').val(manual)});var r=jQuery(".wpcm-sortable");r.sortable({cursor:"move",update:function(e,t){jQuery("#loading-animation").show(),opts={url:ajaxurl,type:"POST",async:!0,cache:!1,dataType:"json",data:{action:"item_sort",order:r.sortable("toArray").toString()},success:function(e){jQuery("#loading-animation").hide()},error:function(e,t,r){alert(r),alert("There was an error saving the updates"),jQuery("#loading-animation").hide()}},jQuery.ajax(opts)}}),jQuery(".wpcm-player-roster-add-row").click(function(){var e=jQuery(".player-id option:selected").text(),t=' '+e+" ";jQuery("#wpcm-player-roster-stats table tbody").append(t),jQuery(".wpcm-player-roster-delete-row").removeClass("hidden-button")}),jQuery(".wpcm-player-roster-delete-row").click(function(){jQuery("#wpcm-player-roster-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&jQuery(this).parents("tr").remove()})}),jQuery(".wpcm-staff-roster-add-row").click(function(){var e=jQuery(".staff-id option:selected").text(),t=' '+e+" ";jQuery("#wpcm-staff-roster-stats table tbody").append(t),jQuery(".wpcm-staff-roster-delete-row").removeClass("hidden-button")}),jQuery(".wpcm-staff-roster-delete-row").click(function(){jQuery("#wpcm-staff-roster-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&jQuery(this).parents("tr").remove()})}),jQuery(".colorpick").iris({change:function(e,t){jQuery(this).parent().find(".colorpickpreview").css({backgroundColor:t.color.toString()})},hide:!0,border:!0}).click(function(){jQuery(".iris-picker").hide(),jQuery(this).closest("p").find(".iris-picker").show()}),jQuery("body").click(function(){jQuery(".iris-picker").hide()}),jQuery(".colorpick").click(function(e){e.stopPropagation()}),jQuery(".wpcm-add-video").click(function(){return jQuery(this).closest("fieldset").hide().siblings(".wpcm-video-field").show(),!1}),jQuery(".wpcm-remove-video").click(function(){return jQuery(this).closest("fieldset").hide().siblings(".wpcm-video-adder").show().siblings(".wpcm-video-field").find("input").val(null),!1}),e(document.body).on("wpcm-init-datepickers",function(){e(".wpcm-date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0}),e(".wpcm-birth-date-picker").datepicker({dateFormat:"yy-mm-dd",changeMonth:!0,changeYear:!0,yearRange:"-90:+0"})}).trigger("wpcm-init-datepickers"),e(".wpcm-time-picker").jquery_timepicker({timeFormat:"H:i",step:"15"}),e(document).ready(function(){e(".combify-input").combify()})});
\ No newline at end of file
+jQuery(function(e){var t;jQuery("select.chosen_select").chosen({disable_search_threshold:10,width:"220px"}),jQuery("select.chosen_select_outcome").chosen({disable_search_threshold:10,width:"auto",placeholder_text_single:" "}),jQuery("select.chosen_select_dob").chosen({disable_search_threshold:32}),jQuery("select.chosen_select_nostd").chosen({allow_single_deselect:"true"}),jQuery("select.wpcm-chosen-multiple").chosen({width:"100%"}),jQuery("#input-order").length&&(jQuery("select.wpcm-chosen-multiple").on("change",function(e){var t=jQuery(this).get(0);setTimeout(function(){var e=ChosenOrder.getSelectionOrder(t);jQuery("#input-order").val(e).toString().split(",")})}),t=jQuery("select.wpcm-chosen-multiple").get(0),ChosenOrder.setSelectionOrder(t,jQuery("#input-order").val().split(","),!0)),jQuery(".wpcm_stats-tabs a").click(function(){var e=jQuery(this).attr("href");return jQuery(this).parent().addClass("tabs").siblings("li").removeClass("tabs"),jQuery(this).parent().parent().parent().find(".tabs-panel").hide(),jQuery(e).show(),!1}),jQuery(".type_box").appendTo("#wpclubmanager-player-stats .hndle"),jQuery(function(){jQuery("#wpclubmanager-player-stats").find(".hndle").unbind("click.postboxes"),jQuery("#wpclubmanager-player-stats").on("click",".hndle",function(e){jQuery(e.target).filter("input, option, label, select, .chosen-drop").length||jQuery("#wpclubmanager-player-stats").toggleClass("closed")})}),jQuery(document).on("change",".wpcm-player-season-select",function(){var e=jQuery(this).data("target"),t=jQuery("option:selected",this).data("show");jQuery(e).children().addClass("hidden"),jQuery(t).removeClass("hidden")}),jQuery(".wpcm-player-season-select").trigger("change"),jQuery("#wpclubmanager-match-result").on("change","#wpcm_played",function(){played=jQuery(this).prop("checked"),played?(jQuery("#wpclubmanager-match-report").show("fast"),jQuery("#wpclubmanager-match-result #results-table").show("fast")):(jQuery("#wpclubmanager-match-result #results-table").hide("fast"),jQuery("#wpclubmanager-match-report").hide("fast"))}),jQuery("#wpclubmanager-match-result #wpcm_played").change(),jQuery("#wpclubmanager-match-result").on("change","#wpcm_shootout",function(){shootout=jQuery(this).prop("checked"),shootout?jQuery("#wpclubmanager-match-result .wpcm-results-shootout").show("fast"):jQuery("#wpclubmanager-match-result .wpcm-results-shootout").hide("fast")}),jQuery("#wpclubmanager-match-result #wpcm_shootout").change(),jQuery("#wpclubmanager-match-result").on("change","#_wpcm_postponed",function(){postponed_result=jQuery("#_wpcm_postponed").prop("checked"),postponed_result?(jQuery(".wpcm-postponed-result").show("fast"),jQuery("#wpclubmanager-match-result #results-table").hide("fast")):jQuery(".wpcm-postponed-result").hide("fast")}),jQuery("#wpclubmanager-match-result #_wpcm_postponed").change(),jQuery('#wpcm_players table .names input[type="checkbox"]').on("change",function(){player_id=jQuery(this).attr("data-player"),jQuery(this).closest("tr").find('input[type="number"]').prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find('input[data-card="yellow"], input[data-card="red"]').prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find("select").prop("disabled",!jQuery(this).prop("checked")),jQuery(this).closest("tr").find('input[type="radio"]').prop("disabled",!jQuery(this).prop("checked"))}),jQuery('#wpcm_players table td.mvp input[type="radio"]').click(function(){jQuery('td.mvp input[type="radio"]').prop("checked",!1),jQuery(this).prop("checked",!0)}),jQuery('#wpcm_players table td.captain input[type="radio"]').click(function(){jQuery('td.captain input[type="radio"]').prop("checked",!1),jQuery(this).prop("checked",!0)}),updateCounter=function(){var e=jQuery("#wpcm_lineup input.player-select:checked").length,t=jQuery("#wpcm_subs input.player-select:checked").length;0 '+t+' ';jQuery("#wpcm-table-stats table tbody").append(r),jQuery("#wpcm-table-stats table tr.count-row").each(function(e){jQuery("td",this).eq(1).html(e+1)})}),jQuery(".wpcm-table-delete-row").click(function(){jQuery("#wpcm-table-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&(jQuery(this).parents("tr").prev("tr").remove(),jQuery(this).parents("tr").next("tr").remove(),jQuery(this).parents("tr").remove())})}),jQuery("#wpcm-table-stats input").change(function(){index=jQuery(this).attr("data-index"),club=jQuery(this).closest("tr").attr("data-club"),value=0,jQuery(this).closest("table").find("tbody").each(function(){total=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="'+index+'"]').val()),auto=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-auto input[data-index="'+index+'"]').val()),value=total-auto}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-manual input[data-index="'+index+'"]').val(value)}),jQuery('#wpcm-table-stats input[data-index="f"],#wpcm-table-stats input[data-index="a"]').change(function(){club=jQuery(this).closest("tr").attr("data-club"),value=0,jQuery(this).closest("table").find("tbody").each(function(){f=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="f"]').val()),a=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="a"]').val()),value=jQuery("body").hasClass("footy")?f/a*100:f-a}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="gd"]').val(value),jQuery(this).closest("table").find("tbody").each(function(){total=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-total input[data-index="gd"]').val()),auto=parseInt(jQuery(this).find('tr[data-club="'+club+'"] td.wpcm-table-stats-auto input[data-index="gd"]').val()),manual=total-auto}),jQuery(this).closest("table").find('tr[data-club="'+club+'"] td.wpcm-table-stats-manual input[data-index="gd"]').val(manual)});var r=jQuery(".wpcm-sortable");r.sortable({cursor:"move",update:function(e,t){jQuery("#loading-animation").show(),opts={url:ajaxurl,type:"POST",async:!0,cache:!1,data:{action:"item_sort",order:r.sortable("toArray").toString()},dataType:"JSON",success:function(e){jQuery("#loading-animation").hide()},error:function(e,t,r){jQuery("#loading-animation").hide()}},jQuery.ajax(opts)}}),jQuery(".wpcm-player-roster-add-row").click(function(){var e=jQuery(".player-id option:selected").text(),t=' '+e+" ";jQuery("#wpcm-player-roster-stats table tbody").append(t),jQuery(".wpcm-player-roster-delete-row").removeClass("hidden-button")}),jQuery(".wpcm-player-roster-delete-row").click(function(){jQuery("#wpcm-player-roster-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&jQuery(this).parents("tr").remove()})}),jQuery(".wpcm-staff-roster-add-row").click(function(){var e=jQuery(".staff-id option:selected").text(),t=' '+e+" ";jQuery("#wpcm-staff-roster-stats table tbody").append(t),jQuery(".wpcm-staff-roster-delete-row").removeClass("hidden-button")}),jQuery(".wpcm-staff-roster-delete-row").click(function(){jQuery("#wpcm-staff-roster-stats table tbody").find('input[name="record"]').each(function(){jQuery(this).is(":checked")&&jQuery(this).parents("tr").remove()})}),jQuery(".colorpick").iris({change:function(e,t){jQuery(this).parent().find(".colorpickpreview").css({backgroundColor:t.color.toString()})},hide:!0,border:!0}).click(function(){jQuery(".iris-picker").hide(),jQuery(this).closest("p").find(".iris-picker").show()}),jQuery("body").click(function(){jQuery(".iris-picker").hide()}),jQuery(".colorpick").click(function(e){e.stopPropagation()}),jQuery(".wpcm-add-video").click(function(){return jQuery(this).closest("fieldset").hide().siblings(".wpcm-video-field").show(),!1}),jQuery(".wpcm-remove-video").click(function(){return jQuery(this).closest("fieldset").hide().siblings(".wpcm-video-adder").show().siblings(".wpcm-video-field").find("input").val(null),!1}),e(document.body).on("wpcm-init-datepickers",function(){e(".wpcm-date-picker").datepicker({dateFormat:"yy-mm-dd",numberOfMonths:1,showButtonPanel:!0}),e(".wpcm-birth-date-picker").datepicker({dateFormat:"yy-mm-dd",changeMonth:!0,changeYear:!0,yearRange:"-90:+0"})}).trigger("wpcm-init-datepickers"),e(".wpcm-time-picker").jquery_timepicker({timeFormat:"H:i",step:"15"}),e(document).ready(function(){e(".combify-input").combify()})});
\ No newline at end of file
diff --git a/assets/js/jquery-chosen/chosen.order.jquery.js b/assets/js/jquery-chosen/chosen.order.jquery.js
new file mode 100644
index 0000000..86050ae
--- /dev/null
+++ b/assets/js/jquery-chosen/chosen.order.jquery.js
@@ -0,0 +1,223 @@
+// Chosen Order v1.2.1
+// This plugin allows you to handle the order of the selection for Chosen multiple dropdowns
+// Full source at https://github.com/tristanjahier/chosen-order
+// Copyright (c) 2013 - Tristan Jahier, http://tristan-jahier.fr
+
+// DISCLAIMER
+// Chosen Order is not associated with Harvest in any way.
+// Chosen is an original software by Patrick Filler for Harvest, http://getharvest.com
+// Full source at https://github.com/harvesthq/chosen
+// Copyright (c) 2011 Harvest http://getharvest.com
+
+// This file is generated by `grunt build`, do not edit it by hand.
+(function() {
+ var $, AbstractChosenOrder, _ref,
+ __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; },
+ __hasProp = {}.hasOwnProperty,
+ __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
+
+ AbstractChosenOrder = (function() {
+ var ERRORS;
+
+ function AbstractChosenOrder() {}
+
+ ERRORS = {
+ invalid_select_element: "ChosenOrder::{{function}}: first argument must be a valid HTML Multiple Select element that has been Chosenified!",
+ invalid_selection_array: "ChosenOrder::{{function}}: second argument must be an Array!",
+ unreachable_chosen_container: "ChosenOrder::{{function}}: could not find the Chosen UI container! To solve the problem, try adding an \"id\" attribute to your element.",
+ ordering_unselected_option: "ChosenOrder::{{function}}: ignoring option '{{option}}' which is not selected. Set optional parameter \"force\" to 'true' to get the ordered selection forced first."
+ };
+
+ AbstractChosenOrder.insertAt = function(node, index, parentNode) {
+ return parentNode.insertBefore(node, parentNode.children[index].nextSibling);
+ };
+
+ AbstractChosenOrder.getFlattenedOptionsAndGroups = function(select) {
+ var flattened_options, opt, options, sub_opt, sub_options, _i, _j, _len, _len1;
+ options = Array.prototype.filter.call(select.childNodes, function(o) {
+ var _ref;
+ return (_ref = o.nodeName.toUpperCase()) === 'OPTION' || _ref === 'OPTGROUP';
+ });
+ flattened_options = [];
+ for (_i = 0, _len = options.length; _i < _len; _i++) {
+ opt = options[_i];
+ flattened_options.push(opt);
+ if (opt.nodeName.toUpperCase() === 'OPTGROUP') {
+ sub_options = Array.prototype.filter.call(opt.childNodes, function(o) {
+ return o.nodeName.toUpperCase() === 'OPTION';
+ });
+ for (_j = 0, _len1 = sub_options.length; _j < _len1; _j++) {
+ sub_opt = sub_options[_j];
+ flattened_options.push(sub_opt);
+ }
+ }
+ }
+ return flattened_options;
+ };
+
+ AbstractChosenOrder.isValidMultipleSelectElement = function(element) {
+ return element !== null && typeof element !== "undefined" && element.nodeName === "SELECT" && element.multiple;
+ };
+
+ AbstractChosenOrder.getChosenUIContainer = function(select) {
+ if (select.id !== "") {
+ return document.getElementById(select.id.replace(/-/g, "_") + "_chosen");
+ } else {
+ return this.searchChosenUIContainer(select);
+ }
+ };
+
+ AbstractChosenOrder.isChosenified = function(select) {
+ return this.getChosenUIContainer(select) != null;
+ };
+
+ AbstractChosenOrder.forceSelection = function(select, selection) {
+ var i, opt, options, _ref;
+ options = this.getFlattenedOptionsAndGroups(select);
+ i = 0;
+ while (i < options.length) {
+ opt = options[i];
+ if (_ref = opt.getAttribute("value"), __indexOf.call(selection, _ref) >= 0) {
+ opt.selected = true;
+ opt.setAttribute("selected", "");
+ } else {
+ opt.selected = false;
+ opt.removeAttribute("selected");
+ }
+ i++;
+ }
+ return this.triggerEvent(select, "chosen:updated");
+ };
+
+ AbstractChosenOrder.getSelectionOrder = function(select) {
+ var chosen_options, chosen_ui, close_btn, opt, option, options, order, rel, _i, _len;
+ if (this.getDOMElement != null) {
+ select = this.getDOMElement(select);
+ }
+ order = [];
+ if (!this.isValidMultipleSelectElement(select)) {
+ console.error(ERRORS.invalid_select_element.replace('{{function}}', 'getSelectionOrder'));
+ return order;
+ }
+ chosen_ui = this.getChosenUIContainer(select);
+ if (chosen_ui == null) {
+ console.error(ERRORS.unreachable_chosen_container.replace('{{function}}', 'getSelectionOrder'));
+ return order;
+ }
+ chosen_options = chosen_ui.querySelectorAll('.search-choice');
+ options = this.getFlattenedOptionsAndGroups(select);
+ for (_i = 0, _len = chosen_options.length; _i < _len; _i++) {
+ opt = chosen_options[_i];
+ close_btn = opt.querySelectorAll('.search-choice-close')[0];
+ if (close_btn != null) {
+ rel = close_btn.getAttribute(this.relAttributeName);
+ }
+ option = options[rel];
+ order.push(option.value);
+ }
+ return order;
+ };
+
+ AbstractChosenOrder.setSelectionOrder = function(select, order, force) {
+ var chosen_choices, chosen_options, chosen_ui, i, j, opt, opt_val, option, options, rel, relAttributeName, _i, _j, _len, _len1, _results;
+ if (this.getDOMElement != null) {
+ select = this.getDOMElement(select);
+ }
+ if (!this.isValidMultipleSelectElement(select)) {
+ console.error(ERRORS.invalid_select_element.replace('{{function}}', 'setSelectionOrder'));
+ return;
+ }
+ chosen_ui = this.getChosenUIContainer(select);
+ if (chosen_ui == null) {
+ console.error(ERRORS.unreachable_chosen_container.replace('{{function}}', 'setSelectionOrder'));
+ return;
+ }
+ if (order instanceof Array) {
+ order = order.map(Function.prototype.call, String.prototype.trim);
+ options = this.getFlattenedOptionsAndGroups(select);
+ if ((force != null) && force === true) {
+ this.forceSelection(select, order);
+ }
+ _results = [];
+ for (i = _i = 0, _len = order.length; _i < _len; i = ++_i) {
+ opt_val = order[i];
+ rel = null;
+ for (j = _j = 0, _len1 = options.length; _j < _len1; j = ++_j) {
+ opt = options[j];
+ if (opt.value === opt_val) {
+ rel = j;
+ }
+ }
+ chosen_options = chosen_ui.querySelectorAll('.search-choice');
+ relAttributeName = this.relAttributeName;
+ option = Array.prototype.filter.call(chosen_options, function(o) {
+ return o.querySelector("a.search-choice-close[" + relAttributeName + "=\"" + rel + "\"]") != null;
+ })[0];
+ if (option == null) {
+ console.warn(ERRORS.ordering_unselected_option.replace('{{function}}', 'setSelectionOrder').replace('{{option}}', opt_val));
+ continue;
+ }
+ chosen_choices = chosen_ui.querySelector("ul.chosen-choices");
+ _results.push(this.insertAt(option, i, chosen_ui.querySelector('ul.chosen-choices')));
+ }
+ return _results;
+ } else {
+ return console.error(ERRORS.invalid_selection_array.replace('{{function}}', 'setSelectionOrder'));
+ }
+ };
+
+ return AbstractChosenOrder;
+
+ })();
+
+ $ = jQuery;
+
+ $.fn.extend({
+ getSelectionOrder: function() {
+ return ChosenOrder.getSelectionOrder(this);
+ },
+ setSelectionOrder: function(order, force) {
+ return ChosenOrder.setSelectionOrder(this, order, force);
+ }
+ });
+
+ this.ChosenOrder = (function(_super) {
+ __extends(ChosenOrder, _super);
+
+ function ChosenOrder() {
+ _ref = ChosenOrder.__super__.constructor.apply(this, arguments);
+ return _ref;
+ }
+
+ ChosenOrder.relAttributeName = 'data-option-array-index';
+
+ ChosenOrder.isjQueryObject = function(obj) {
+ return (typeof jQuery !== "undefined" && jQuery !== null) && obj instanceof jQuery;
+ };
+
+ ChosenOrder.getDOMElement = function(element) {
+ if (this.isjQueryObject(element)) {
+ return element.get(0);
+ } else {
+ return element;
+ }
+ };
+
+ ChosenOrder.searchChosenUIContainer = function(element) {
+ if ($(element).data("chosen") != null) {
+ return $(element).data("chosen").container[0];
+ } else {
+ return $(element).next(".chosen-container.chosen-container-multi").get(0);
+ }
+ };
+
+ ChosenOrder.triggerEvent = function(target, event_name) {
+ return $(target).trigger(event_name);
+ };
+
+ return ChosenOrder;
+
+ })(AbstractChosenOrder);
+
+ }).call(this);
+
\ No newline at end of file
diff --git a/assets/js/jquery.timepicker.js b/assets/js/jquery.timepicker.js
new file mode 100644
index 0000000..5926852
--- /dev/null
+++ b/assets/js/jquery.timepicker.js
@@ -0,0 +1,1384 @@
+/*!
+ * jquery-timepicker v1.13.4 - A jQuery timepicker plugin inspired by Google Calendar. It supports both mouse and keyboard navigation.
+ * Copyright (c) 2015 Jon Thornton - http://jonthornton.github.com/jquery-timepicker/
+ * License: MIT
+ */
+
+(function(factory) {
+ if (
+ typeof exports === "object" &&
+ exports &&
+ typeof module === "object" &&
+ module &&
+ module.exports === exports
+ ) {
+ // Browserify. Attach to jQuery module.
+ factory(require("jquery"));
+ } else if (typeof define === "function" && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(["jquery"], factory);
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+ })(function($) {
+ var _ONE_DAY = 86400;
+ var _lang = {
+ am: "am",
+ pm: "pm",
+ AM: "AM",
+ PM: "PM",
+ decimal: ".",
+ mins: "mins",
+ hr: "hr",
+ hrs: "hrs"
+ };
+
+ var methods = {
+ init: function(options) {
+ return this.each(function() {
+ var self = $(this);
+
+ // pick up settings from data attributes
+ var attributeOptions = [];
+ for (var key in $.fn.jquery_timepicker.defaults) {
+ if (self.data(key)) {
+ attributeOptions[key] = self.data(key);
+ }
+ }
+
+ var settings = $.extend({}, $.fn.jquery_timepicker.defaults, options, attributeOptions);
+
+ if (settings.lang) {
+ _lang = $.extend(_lang, settings.lang);
+ }
+
+ settings = _parseSettings(settings);
+ self.data("timepicker-settings", settings);
+ self.addClass("ui-timepicker-input");
+
+ if (settings.useSelect) {
+ _render(self);
+ } else {
+ self.prop("autocomplete", "off");
+ if (settings.showOn) {
+ for (var i in settings.showOn) {
+ self.on(settings.showOn[i] + ".timepicker", methods.show);
+ }
+ }
+ self.on("change.timepicker", _formatValue);
+ self.on("keydown.timepicker", _keydownhandler);
+ self.on("keyup.timepicker", _keyuphandler);
+ if (settings.disableTextInput) {
+ self.on("keydown.timepicker", _disableTextInputHandler);
+ }
+ self.on("cut.timepicker", _keyuphandler);
+ self.on("paste.timepicker", _keyuphandler);
+
+ _formatValue.call(self.get(0), null, "initial");
+ }
+ });
+ },
+
+ show: function(e) {
+ var self = $(this);
+ var settings = self.data("timepicker-settings");
+
+ if (e) {
+ e.preventDefault();
+ }
+
+ if (settings.useSelect) {
+ self.data("timepicker-list").focus();
+ return;
+ }
+
+ if (_hideKeyboard(self)) {
+ // block the keyboard on mobile devices
+ self.blur();
+ }
+
+ var list = self.data("timepicker-list");
+
+ // check if input is readonly
+ if (self.prop("readonly")) {
+ return;
+ }
+
+ // check if list needs to be rendered
+ if (
+ !list ||
+ list.length === 0 ||
+ typeof settings.durationTime === "function"
+ ) {
+ _render(self);
+ list = self.data("timepicker-list");
+ }
+
+ if (_isVisible(list)) {
+ return;
+ }
+
+ self.data("ui-timepicker-value", self.val());
+ _setSelected(self, list);
+
+ // make sure other pickers are hidden
+ methods.hide();
+
+ if (typeof settings.listWidth == 'number') {
+ console.log(settings.listWidth)
+ list.width(self.outerWidth() * settings.listWidth);
+ }
+
+ // position the dropdown relative to the input
+ list.show();
+ var listOffset = {};
+
+ if (settings.orientation.match(/r/)) {
+ // right-align the dropdown
+ listOffset.left =
+ self.offset().left +
+ self.outerWidth() -
+ list.outerWidth() +
+ parseInt(list.css("marginLeft").replace("px", ""), 10);
+ } else if (settings.orientation.match(/l/)) {
+ // left-align the dropdown
+ listOffset.left =
+ self.offset().left +
+ parseInt(list.css("marginLeft").replace("px", ""), 10);
+ } else if (settings.orientation.match(/c/)) {
+ // center-align the dropdown
+ listOffset.left =
+ self.offset().left +
+ ((self.outerWidth() - list.outerWidth()) / 2) +
+ parseInt(list.css("marginLeft").replace("px", ""), 10);
+ }
+
+ var verticalOrientation;
+ if (settings.orientation.match(/t/)) {
+ verticalOrientation = "t";
+ } else if (settings.orientation.match(/b/)) {
+ verticalOrientation = "b";
+ } else if (
+ self.offset().top + self.outerHeight(true) + list.outerHeight() >
+ $(window).height() + $(window).scrollTop()
+ ) {
+ verticalOrientation = "t";
+ } else {
+ verticalOrientation = "b";
+ }
+
+ if (verticalOrientation == "t") {
+ // position the dropdown on top
+ list.addClass("ui-timepicker-positioned-top");
+ listOffset.top =
+ self.offset().top -
+ list.outerHeight() +
+ parseInt(list.css("marginTop").replace("px", ""), 10);
+ } else {
+ // put it under the input
+ list.removeClass("ui-timepicker-positioned-top");
+ listOffset.top =
+ self.offset().top +
+ self.outerHeight() +
+ parseInt(list.css("marginTop").replace("px", ""), 10);
+ }
+
+ list.offset(listOffset);
+
+ // position scrolling
+ var selected = list.find(".ui-timepicker-selected");
+
+ if (!selected.length) {
+ var timeInt = _time2int(_getTimeValue(self));
+ if (timeInt !== null) {
+ selected = _findRow(self, list, timeInt);
+ } else if (settings.scrollDefault) {
+ selected = _findRow(self, list, settings.scrollDefault());
+ }
+ }
+
+ // if not found or disabled, intelligently find first selectable element
+ if (!selected.length || selected.hasClass("ui-timepicker-disabled")) {
+ selected = list.find("li:not(.ui-timepicker-disabled):first");
+ }
+
+ if (selected && selected.length) {
+ var topOffset =
+ list.scrollTop() + selected.position().top - selected.outerHeight();
+ list.scrollTop(topOffset);
+ } else {
+ list.scrollTop(0);
+ }
+
+ // prevent scroll propagation
+ if (settings.stopScrollPropagation) {
+ $(
+ document
+ ).on("wheel.ui-timepicker", ".ui-timepicker-wrapper", function(e) {
+ e.preventDefault();
+ var currentScroll = $(this).scrollTop();
+ $(this).scrollTop(currentScroll + e.originalEvent.deltaY);
+ });
+ }
+
+ // attach close handlers
+ $(document).on(
+ "touchstart.ui-timepicker mousedown.ui-timepicker",
+ _closeHandler
+ );
+ $(window).on("resize.ui-timepicker", _closeHandler);
+ if (settings.closeOnWindowScroll) {
+ $(document).on("scroll.ui-timepicker", _closeHandler);
+ }
+
+ self.trigger("showTimepicker");
+
+ return this;
+ },
+
+ hide: function(e) {
+ var self = $(this);
+ var settings = self.data("timepicker-settings");
+
+ if (settings && settings.useSelect) {
+ self.blur();
+ }
+
+ $(".ui-timepicker-wrapper").each(function() {
+ var list = $(this);
+ if (!_isVisible(list)) {
+ return;
+ }
+
+ var self = list.data("timepicker-input");
+ var settings = self.data("timepicker-settings");
+
+ if (settings && settings.selectOnBlur) {
+ _selectValue(self);
+ }
+
+ list.hide();
+ self.trigger("hideTimepicker");
+ });
+
+ return this;
+ },
+
+ option: function(key, value) {
+ if (typeof key == "string" && typeof value == "undefined") {
+ return $(this).data("timepicker-settings")[key];
+ }
+
+ return this.each(function() {
+ var self = $(this);
+ var settings = self.data("timepicker-settings");
+ var list = self.data("timepicker-list");
+
+ if (typeof key == "object") {
+ settings = $.extend(settings, key);
+ } else if (typeof key == "string") {
+ settings[key] = value;
+ }
+
+ settings = _parseSettings(settings);
+
+ self.data("timepicker-settings", settings);
+
+ _formatValue.call(self.get(0), { type: "change" }, "initial");
+
+ if (list) {
+ list.remove();
+ self.data("timepicker-list", false);
+ }
+
+ if (settings.useSelect) {
+ _render(self);
+ }
+ });
+ },
+
+ getSecondsFromMidnight: function() {
+ return _time2int(_getTimeValue(this));
+ },
+
+ getTime: function(relative_date) {
+ var self = this;
+
+ var time_string = _getTimeValue(self);
+ if (!time_string) {
+ return null;
+ }
+
+ var offset = _time2int(time_string);
+ if (offset === null) {
+ return null;
+ }
+
+ if (!relative_date) {
+ relative_date = new Date();
+ }
+
+ // construct a Date from relative date, and offset's time
+ var time = new Date(relative_date);
+ time.setHours(offset / 3600);
+ time.setMinutes((offset % 3600) / 60);
+ time.setSeconds(offset % 60);
+ time.setMilliseconds(0);
+
+ return time;
+ },
+
+ isVisible: function() {
+ var self = this;
+ var list = self.data("timepicker-list");
+ return !!(list && _isVisible(list));
+ },
+
+ setTime: function(value) {
+ var self = this;
+ var settings = self.data("timepicker-settings");
+
+ if (settings.forceRoundTime) {
+ var prettyTime = _roundAndFormatTime(_time2int(value), settings);
+ } else {
+ var prettyTime = _int2time(_time2int(value), settings);
+ }
+
+ if (value && prettyTime === null && settings.noneOption) {
+ prettyTime = value;
+ }
+
+ _setTimeValue(self, prettyTime, "initial");
+ _formatValue.call(self.get(0), { type: "change" }, "initial");
+
+ if (self.data("timepicker-list")) {
+ _setSelected(self, self.data("timepicker-list"));
+ }
+
+ return this;
+ },
+
+ remove: function() {
+ var self = this;
+
+ // check if this element is a timepicker
+ if (!self.hasClass("ui-timepicker-input")) {
+ return;
+ }
+
+ var settings = self.data("timepicker-settings");
+ self.removeAttr("autocomplete", "off");
+ self.removeClass("ui-timepicker-input");
+ self.removeData("timepicker-settings");
+ self.off(".timepicker");
+
+ // timepicker-list won't be present unless the user has interacted with this timepicker
+ if (self.data("timepicker-list")) {
+ self.data("timepicker-list").remove();
+ }
+
+ if (settings.useSelect) {
+ self.show();
+ }
+
+ self.removeData("timepicker-list");
+
+ return this;
+ }
+ };
+
+ // private methods
+
+ function _isVisible(elem) {
+ var el = elem[0];
+ return el.offsetWidth > 0 && el.offsetHeight > 0;
+ }
+
+ function _parseSettings(settings) {
+ if (settings.minTime) {
+ settings.minTime = _time2int(settings.minTime);
+ }
+
+ if (settings.maxTime) {
+ settings.maxTime = _time2int(settings.maxTime);
+ }
+
+ if (settings.durationTime && typeof settings.durationTime !== "function") {
+ settings.durationTime = _time2int(settings.durationTime);
+ }
+
+ if (settings.scrollDefault == "now") {
+ settings.scrollDefault = function() {
+ return settings.roundingFunction(_time2int(new Date()), settings);
+ };
+ } else if (
+ settings.scrollDefault &&
+ typeof settings.scrollDefault != "function"
+ ) {
+ var val = settings.scrollDefault;
+ settings.scrollDefault = function() {
+ return settings.roundingFunction(_time2int(val), settings);
+ };
+ } else if (settings.minTime) {
+ settings.scrollDefault = function() {
+ return settings.roundingFunction(settings.minTime, settings);
+ };
+ }
+
+ if (
+ $.type(settings.timeFormat) === "string" &&
+ settings.timeFormat.match(/[gh]/)
+ ) {
+ settings._twelveHourTime = true;
+ }
+
+ if (
+ settings.showOnFocus === false &&
+ settings.showOn.indexOf("focus") != -1
+ ) {
+ settings.showOn.splice(settings.showOn.indexOf("focus"), 1);
+ }
+
+ if (settings.disableTimeRanges.length > 0) {
+ // convert string times to integers
+ for (var i in settings.disableTimeRanges) {
+ settings.disableTimeRanges[i] = [
+ _time2int(settings.disableTimeRanges[i][0]),
+ _time2int(settings.disableTimeRanges[i][1])
+ ];
+ }
+
+ // sort by starting time
+ settings.disableTimeRanges = settings.disableTimeRanges.sort(function(
+ a,
+ b
+ ) {
+ return a[0] - b[0];
+ });
+
+ // merge any overlapping ranges
+ for (var i = settings.disableTimeRanges.length - 1; i > 0; i--) {
+ if (
+ settings.disableTimeRanges[i][0] <=
+ settings.disableTimeRanges[i - 1][1]
+ ) {
+ settings.disableTimeRanges[i - 1] = [
+ Math.min(
+ settings.disableTimeRanges[i][0],
+ settings.disableTimeRanges[i - 1][0]
+ ),
+ Math.max(
+ settings.disableTimeRanges[i][1],
+ settings.disableTimeRanges[i - 1][1]
+ )
+ ];
+ settings.disableTimeRanges.splice(i, 1);
+ }
+ }
+ }
+
+ return settings;
+ }
+
+ function _render(self) {
+ var settings = self.data("timepicker-settings");
+ var list = self.data("timepicker-list");
+
+ if (list && list.length) {
+ list.remove();
+ self.data("timepicker-list", false);
+ }
+
+ if (settings.useSelect) {
+ list = $(" ", { class: "ui-timepicker-select" });
+ if (self.attr('name')) {
+ list.attr('name', 'ui-timepicker-' + self.attr('name'));
+ }
+ var wrapped_list = list;
+ } else {
+ list = $("", { class: "ui-timepicker-list" });
+
+ var wrapped_list = $("
", {
+ class: "ui-timepicker-wrapper",
+ tabindex: -1
+ });
+ wrapped_list.css({ display: "none", position: "absolute" }).append(list);
+ }
+
+ if (settings.noneOption) {
+ if (settings.noneOption === true) {
+ settings.noneOption = settings.useSelect ? "Time..." : "None";
+ }
+
+ if ($.isArray(settings.noneOption)) {
+ for (var i in settings.noneOption) {
+ if (parseInt(i, 10) == i) {
+ var noneElement = _generateNoneElement(
+ settings.noneOption[i],
+ settings.useSelect
+ );
+ list.append(noneElement);
+ }
+ }
+ } else {
+ var noneElement = _generateNoneElement(
+ settings.noneOption,
+ settings.useSelect
+ );
+ list.append(noneElement);
+ }
+ }
+
+ if (settings.className) {
+ wrapped_list.addClass(settings.className);
+ }
+
+ if (
+ (settings.minTime !== null || settings.durationTime !== null) &&
+ settings.showDuration
+ ) {
+ var stepval =
+ typeof settings.step == "function" ? "function" : settings.step;
+ wrapped_list.addClass("ui-timepicker-with-duration");
+ wrapped_list.addClass("ui-timepicker-step-" + settings.step);
+ }
+
+ var durStart = settings.minTime;
+ if (typeof settings.durationTime === "function") {
+ durStart = _time2int(settings.durationTime());
+ } else if (settings.durationTime !== null) {
+ durStart = settings.durationTime;
+ }
+ var start = settings.minTime !== null ? settings.minTime : 0;
+ var end =
+ settings.maxTime !== null ? settings.maxTime : start + _ONE_DAY - 1;
+
+ if (end < start) {
+ // make sure the end time is greater than start time, otherwise there will be no list to show
+ end += _ONE_DAY;
+ }
+
+ if (
+ end === _ONE_DAY - 1 &&
+ $.type(settings.timeFormat) === "string" &&
+ settings.show2400
+ ) {
+ // show a 24:00 option when using military time
+ end = _ONE_DAY;
+ }
+
+ var dr = settings.disableTimeRanges;
+ var drCur = 0;
+ var drLen = dr.length;
+
+ var stepFunc = settings.step;
+ if (typeof stepFunc != "function") {
+ stepFunc = function() {
+ return settings.step;
+ };
+ }
+
+ for (var i = start, j = 0; i <= end; j++, i += stepFunc(j) * 60) {
+ var timeInt = i;
+ var timeString = _int2time(timeInt, settings);
+
+ if (settings.useSelect) {
+ var row = $(" ", { value: timeString });
+ row.text(timeString);
+ } else {
+ var row = $(" ");
+ row.addClass(
+ timeInt % _ONE_DAY < _ONE_DAY / 2
+ ? "ui-timepicker-am"
+ : "ui-timepicker-pm"
+ );
+ row.data("time", _moduloSeconds(timeInt, settings));
+ row.text(timeString);
+ }
+
+ if (
+ (settings.minTime !== null || settings.durationTime !== null) &&
+ settings.showDuration
+ ) {
+ var durationString = _int2duration(i - durStart, settings.step);
+ if (settings.useSelect) {
+ row.text(row.text() + " (" + durationString + ")");
+ } else {
+ var duration = $(" ", { class: "ui-timepicker-duration" });
+ duration.text(" (" + durationString + ")");
+ row.append(duration);
+ }
+ }
+
+ if (drCur < drLen) {
+ if (timeInt >= dr[drCur][1]) {
+ drCur += 1;
+ }
+
+ if (dr[drCur] && timeInt >= dr[drCur][0] && timeInt < dr[drCur][1]) {
+ if (settings.useSelect) {
+ row.prop("disabled", true);
+ } else {
+ row.addClass("ui-timepicker-disabled");
+ }
+ }
+ }
+
+ list.append(row);
+ }
+
+ wrapped_list.data("timepicker-input", self);
+ self.data("timepicker-list", wrapped_list);
+
+ if (settings.useSelect) {
+ if (self.val()) {
+ list.val(_roundAndFormatTime(_time2int(self.val()), settings));
+ }
+
+ list.on("focus", function() {
+ $(this)
+ .data("timepicker-input")
+ .trigger("showTimepicker");
+ });
+ list.on("blur", function() {
+ $(this)
+ .data("timepicker-input")
+ .trigger("hideTimepicker");
+ });
+ list.on("change", function() {
+ _setTimeValue(self, $(this).val(), "select");
+ });
+
+ _setTimeValue(self, list.val(), "initial");
+ self.hide().after(list);
+ } else {
+ var appendTo = settings.appendTo;
+ if (typeof appendTo === "string") {
+ appendTo = $(appendTo);
+ } else if (typeof appendTo === "function") {
+ appendTo = appendTo(self);
+ }
+ appendTo.append(wrapped_list);
+ _setSelected(self, list);
+
+ list.on("mousedown click", "li", function(e) {
+ // hack: temporarily disable the focus handler
+ // to deal with the fact that IE fires 'focus'
+ // events asynchronously
+ self.off("focus.timepicker");
+ self.on("focus.timepicker-ie-hack", function() {
+ self.off("focus.timepicker-ie-hack");
+ self.on("focus.timepicker", methods.show);
+ });
+
+ if (!_hideKeyboard(self)) {
+ self[0].focus();
+ }
+
+ // make sure only the clicked row is selected
+ list.find("li").removeClass("ui-timepicker-selected");
+ $(this).addClass("ui-timepicker-selected");
+
+ if (_selectValue(self)) {
+ self.trigger("hideTimepicker");
+
+ list.on("mouseup.timepicker click.timepicker", "li", function(e) {
+ list.off("mouseup.timepicker click.timepicker");
+ wrapped_list.hide();
+ });
+ }
+ });
+ }
+ }
+
+ function _generateNoneElement(optionValue, useSelect) {
+ var label, className, value;
+
+ if (typeof optionValue == "object") {
+ label = optionValue.label;
+ className = optionValue.className;
+ value = optionValue.value;
+ } else if (typeof optionValue == "string") {
+ label = optionValue;
+ value = '';
+ } else {
+ $.error("Invalid noneOption value");
+ }
+
+ if (useSelect) {
+ return $(" ", {
+ value: value,
+ class: className,
+ text: label
+ });
+ } else {
+ return $(" ", {
+ class: className,
+ text: label
+ }).data("time", String(value));
+ }
+ }
+
+ function _roundAndFormatTime(seconds, settings) {
+ seconds = settings.roundingFunction(seconds, settings);
+ if (seconds !== null) {
+ return _int2time(seconds, settings);
+ }
+ }
+
+ // event handler to decide whether to close timepicker
+ function _closeHandler(e) {
+ if (e.target == window) {
+ // mobile Chrome fires focus events against window for some reason
+ return;
+ }
+
+ var target = $(e.target);
+
+ if (
+ target.closest(".ui-timepicker-input").length ||
+ target.closest(".ui-timepicker-wrapper").length
+ ) {
+ // active timepicker was focused. ignore
+ return;
+ }
+
+ methods.hide();
+ $(document).unbind(".ui-timepicker");
+ $(window).unbind(".ui-timepicker");
+ }
+
+ function _hideKeyboard(self) {
+ var settings = self.data("timepicker-settings");
+ return (
+ (window.navigator.msMaxTouchPoints || "ontouchstart" in document) &&
+ settings.disableTouchKeyboard
+ );
+ }
+
+ function _findRow(self, list, value) {
+ if (!value && value !== 0) {
+ return false;
+ }
+
+ var settings = self.data("timepicker-settings");
+ var out = false;
+ var value = settings.roundingFunction(value, settings);
+
+ // loop through the menu items
+ list.find("li").each(function(i, obj) {
+ var jObj = $(obj);
+ if (typeof jObj.data("time") != "number") {
+ return;
+ }
+
+ if (jObj.data("time") == value) {
+ out = jObj;
+ return false;
+ }
+ });
+
+ return out;
+ }
+
+ function _setSelected(self, list) {
+ list.find("li").removeClass("ui-timepicker-selected");
+
+ var settings = self.data("timepicker-settings");
+ var timeValue = _time2int(_getTimeValue(self), settings);
+ if (timeValue === null) {
+ return;
+ }
+
+ var selected = _findRow(self, list, timeValue);
+ if (selected) {
+ var topDelta = selected.offset().top - list.offset().top;
+
+ if (
+ topDelta + selected.outerHeight() > list.outerHeight() ||
+ topDelta < 0
+ ) {
+ list.scrollTop(
+ list.scrollTop() + selected.position().top - selected.outerHeight()
+ );
+ }
+
+ if (settings.forceRoundTime || selected.data("time") === timeValue) {
+ selected.addClass("ui-timepicker-selected");
+ }
+ }
+ }
+
+ function _formatValue(e, origin) {
+ if (origin == "timepicker") {
+ return;
+ }
+
+ var self = $(this);
+
+ if (this.value === "") {
+ _setTimeValue(self, null, origin);
+ return;
+ }
+
+ if (self.is(":focus") && (!e || e.type != "change")) {
+ return;
+ }
+
+ var settings = self.data("timepicker-settings");
+ var seconds = _time2int(this.value, settings);
+
+ if (seconds === null) {
+ self.trigger("timeFormatError");
+ return;
+ }
+
+ var rangeError = false;
+ // check that the time in within bounds
+ if (
+ settings.minTime !== null &&
+ settings.maxTime !== null &&
+ (seconds < settings.minTime || seconds > settings.maxTime)
+ ) {
+ rangeError = true;
+ }
+
+ // check that time isn't within disabled time ranges
+ $.each(settings.disableTimeRanges, function() {
+ if (seconds >= this[0] && seconds < this[1]) {
+ rangeError = true;
+ return false;
+ }
+ });
+
+ if (settings.forceRoundTime) {
+ var roundSeconds = settings.roundingFunction(seconds, settings);
+ if (roundSeconds != seconds) {
+ seconds = roundSeconds;
+ origin = null;
+ }
+ }
+
+ var prettyTime = _int2time(seconds, settings);
+
+ if (rangeError) {
+ if (
+ _setTimeValue(self, prettyTime, "error") ||
+ (e && e.type == "change")
+ ) {
+ self.trigger("timeRangeError");
+ }
+ } else {
+ _setTimeValue(self, prettyTime, origin);
+ }
+ }
+
+ function _getTimeValue(self) {
+ if (self.is("input")) {
+ return self.val();
+ } else {
+ // use the element's data attributes to store values
+ return self.data("ui-timepicker-value");
+ }
+ }
+
+ function _setTimeValue(self, value, source) {
+ if (self.is("input")) {
+ if (value !== null || self.val() != '') {
+ self.val(value);
+ }
+
+ var settings = self.data("timepicker-settings");
+ if (settings.useSelect && source != "select" && self.data("timepicker-list")) {
+ self
+ .data("timepicker-list")
+ .val(_roundAndFormatTime(_time2int(value), settings));
+ }
+ }
+
+ if (self.data("ui-timepicker-value") != value) {
+ self.data("ui-timepicker-value", value);
+ if (source == "select") {
+ self
+ .trigger("selectTime")
+ .trigger("changeTime")
+ .trigger("change", "timepicker");
+ } else if (["error", "initial"].indexOf(source) == -1) {
+ self.trigger("changeTime");
+ }
+
+ return true;
+ } else {
+ if (["error", "initial"].indexOf(source) == -1) {
+ self.trigger("selectTime");
+ }
+ return false;
+ }
+ }
+
+ /*
+ * Filter freeform input
+ */
+ function _disableTextInputHandler(e) {
+ switch (e.keyCode) {
+ case 13: // return
+ case 9: //tab
+ return;
+
+ default:
+ e.preventDefault();
+ }
+ }
+
+ /*
+ * Keyboard navigation via arrow keys
+ */
+ function _keydownhandler(e) {
+ var self = $(this);
+ var list = self.data("timepicker-list");
+
+ if (!list || !_isVisible(list)) {
+ if (e.keyCode == 40) {
+ // show the list!
+ methods.show.call(self.get(0));
+ list = self.data("timepicker-list");
+ if (!_hideKeyboard(self)) {
+ self.focus();
+ }
+ } else {
+ return true;
+ }
+ }
+
+ switch (e.keyCode) {
+ case 13: // return
+ if (_selectValue(self)) {
+ _formatValue.call(self.get(0), { type: "change" });
+ methods.hide.apply(this);
+ }
+
+ e.preventDefault();
+ return false;
+
+ case 38: // up
+ var selected = list.find(".ui-timepicker-selected");
+
+ if (!selected.length) {
+ list.find("li").each(function(i, obj) {
+ if ($(obj).position().top > 0) {
+ selected = $(obj);
+ return false;
+ }
+ });
+ selected.addClass("ui-timepicker-selected");
+ } else if (!selected.is(":first-child")) {
+ selected.removeClass("ui-timepicker-selected");
+ selected.prev().addClass("ui-timepicker-selected");
+
+ if (selected.prev().position().top < selected.outerHeight()) {
+ list.scrollTop(list.scrollTop() - selected.outerHeight());
+ }
+ }
+
+ return false;
+
+ case 40: // down
+ selected = list.find(".ui-timepicker-selected");
+
+ if (selected.length === 0) {
+ list.find("li").each(function(i, obj) {
+ if ($(obj).position().top > 0) {
+ selected = $(obj);
+ return false;
+ }
+ });
+
+ selected.addClass("ui-timepicker-selected");
+ } else if (!selected.is(":last-child")) {
+ selected.removeClass("ui-timepicker-selected");
+ selected.next().addClass("ui-timepicker-selected");
+
+ if (
+ selected.next().position().top + 2 * selected.outerHeight() >
+ list.outerHeight()
+ ) {
+ list.scrollTop(list.scrollTop() + selected.outerHeight());
+ }
+ }
+
+ return false;
+
+ case 27: // escape
+ list.find("li").removeClass("ui-timepicker-selected");
+ methods.hide();
+ break;
+
+ case 9: //tab
+ methods.hide();
+ break;
+
+ default:
+ return true;
+ }
+ }
+
+ /*
+ * Time typeahead
+ */
+ function _keyuphandler(e) {
+ var self = $(this);
+ var list = self.data("timepicker-list");
+ var settings = self.data("timepicker-settings");
+
+ if (!list || !_isVisible(list) || settings.disableTextInput) {
+ return true;
+ }
+
+ if (e.type === "paste" || e.type === "cut") {
+ setTimeout(function() {
+ if (settings.typeaheadHighlight) {
+ _setSelected(self, list);
+ } else {
+ list.hide();
+ }
+ }, 0);
+ return;
+ }
+
+ switch (e.keyCode) {
+ case 96: // numpad numerals
+ case 97:
+ case 98:
+ case 99:
+ case 100:
+ case 101:
+ case 102:
+ case 103:
+ case 104:
+ case 105:
+ case 48: // numerals
+ case 49:
+ case 50:
+ case 51:
+ case 52:
+ case 53:
+ case 54:
+ case 55:
+ case 56:
+ case 57:
+ case 65: // a
+ case 77: // m
+ case 80: // p
+ case 186: // colon
+ case 8: // backspace
+ case 46: // delete
+ if (settings.typeaheadHighlight) {
+ _setSelected(self, list);
+ } else {
+ list.hide();
+ }
+ break;
+ }
+ }
+
+ function _selectValue(self) {
+ var settings = self.data("timepicker-settings");
+ var list = self.data("timepicker-list");
+ var timeValue = null;
+
+ var cursor = list.find(".ui-timepicker-selected");
+
+ if (cursor.hasClass("ui-timepicker-disabled")) {
+ return false;
+ }
+
+ if (cursor.length) {
+ // selected value found
+ timeValue = cursor.data("time");
+ }
+
+ if (timeValue !== null) {
+ if (typeof timeValue != "string") {
+ timeValue = _int2time(timeValue, settings);
+ }
+
+ _setTimeValue(self, timeValue, "select");
+ }
+
+ return true;
+ }
+
+ function _int2duration(seconds, step) {
+ seconds = Math.abs(seconds);
+ var minutes = Math.round(seconds / 60),
+ duration = [],
+ hours,
+ mins;
+
+ if (minutes < 60) {
+ // Only show (x mins) under 1 hour
+ duration = [minutes, _lang.mins];
+ } else {
+ hours = Math.floor(minutes / 60);
+ mins = minutes % 60;
+
+ // Show decimal notation (eg: 1.5 hrs) for 30 minute steps
+ if (step == 30 && mins == 30) {
+ hours += _lang.decimal + 5;
+ }
+
+ duration.push(hours);
+ duration.push(hours == 1 ? _lang.hr : _lang.hrs);
+
+ // Show remainder minutes notation (eg: 1 hr 15 mins) for non-30 minute steps
+ // and only if there are remainder minutes to show
+ if (step != 30 && mins) {
+ duration.push(mins);
+ duration.push(_lang.mins);
+ }
+ }
+
+ return duration.join(" ");
+ }
+
+ function _int2time(timeInt, settings) {
+ if (typeof timeInt != "number") {
+ return null;
+ }
+
+ var seconds = parseInt(timeInt % 60),
+ minutes = parseInt((timeInt / 60) % 60),
+ hours = parseInt((timeInt / (60 * 60)) % 24);
+
+ var time = new Date(1970, 0, 2, hours, minutes, seconds, 0);
+
+ if (isNaN(time.getTime())) {
+ return null;
+ }
+
+ if ($.type(settings.timeFormat) === "function") {
+ return settings.timeFormat(time);
+ }
+
+ var output = "";
+ var hour, code;
+ for (var i = 0; i < settings.timeFormat.length; i++) {
+ code = settings.timeFormat.charAt(i);
+ switch (code) {
+ case "a":
+ output += time.getHours() > 11 ? _lang.pm : _lang.am;
+ break;
+
+ case "A":
+ output += time.getHours() > 11 ? _lang.PM : _lang.AM;
+ break;
+
+ case "g":
+ hour = time.getHours() % 12;
+ output += hour === 0 ? "12" : hour;
+ break;
+
+ case "G":
+ hour = time.getHours();
+ if (timeInt === _ONE_DAY) hour = settings.show2400 ? 24 : 0;
+ output += hour;
+ break;
+
+ case "h":
+ hour = time.getHours() % 12;
+
+ if (hour !== 0 && hour < 10) {
+ hour = "0" + hour;
+ }
+
+ output += hour === 0 ? "12" : hour;
+ break;
+
+ case "H":
+ hour = time.getHours();
+ if (timeInt === _ONE_DAY) hour = settings.show2400 ? 24 : 0;
+ output += hour > 9 ? hour : "0" + hour;
+ break;
+
+ case "i":
+ var minutes = time.getMinutes();
+ output += minutes > 9 ? minutes : "0" + minutes;
+ break;
+
+ case "s":
+ seconds = time.getSeconds();
+ output += seconds > 9 ? seconds : "0" + seconds;
+ break;
+
+ case "\\":
+ // escape character; add the next character and skip ahead
+ i++;
+ output += settings.timeFormat.charAt(i);
+ break;
+
+ default:
+ output += code;
+ }
+ }
+
+ return output;
+ }
+
+ function _time2int(timeString, settings) {
+ if (timeString === "" || timeString === null) return null;
+ if (typeof timeString == "object") {
+ return (
+ timeString.getHours() * 3600 +
+ timeString.getMinutes() * 60 +
+ timeString.getSeconds()
+ );
+ }
+ if (typeof timeString != "string") {
+ return timeString;
+ }
+
+ timeString = timeString.toLowerCase().replace(/[\s\.]/g, "");
+
+ // if the last character is an "a" or "p", add the "m"
+ if (timeString.slice(-1) == "a" || timeString.slice(-1) == "p") {
+ timeString += "m";
+ }
+
+ var pattern = /^(([^0-9]*))?([0-9]?[0-9])(\W?([0-5][0-9]))?(\W+([0-5][0-9]))?(([^0-9]*))$/;
+ var time = timeString.match(pattern);
+ if (!time) {
+ return null;
+ }
+
+ var hour = parseInt(time[3] * 1, 10);
+ var ampm = time[2] || time[9];
+ var hours = hour;
+ var minutes = time[5] * 1 || 0;
+ var seconds = time[7] * 1 || 0;
+
+ if (hour <= 12 && ampm) {
+ ampm = ampm.trim();
+ var isPm = ampm == _lang.pm || ampm == _lang.PM;
+
+ if (hour == 12) {
+ hours = isPm ? 12 : 0;
+ } else {
+ hours = hour + (isPm ? 12 : 0);
+ }
+ } else if (settings) {
+ var t = hour * 3600 + minutes * 60 + seconds;
+ if (t >= _ONE_DAY + (settings.show2400 ? 1 : 0)) {
+ if (settings.wrapHours === false) {
+ return null;
+ }
+
+ hours = hour % 24;
+ }
+ }
+
+ var timeInt = hours * 3600 + minutes * 60 + seconds;
+
+ // if no am/pm provided, intelligently guess based on the scrollDefault
+ if (
+ hour < 12 &&
+ !ampm &&
+ settings &&
+ settings._twelveHourTime &&
+ settings.scrollDefault
+ ) {
+ var delta = timeInt - settings.scrollDefault();
+ if (delta < 0 && delta >= _ONE_DAY / -2) {
+ timeInt = (timeInt + _ONE_DAY / 2) % _ONE_DAY;
+ }
+ }
+
+ return timeInt;
+ }
+
+ function _pad2(n) {
+ return ("0" + n).slice(-2);
+ }
+
+ function _moduloSeconds(seconds, settings) {
+ if (seconds == _ONE_DAY && settings.show2400) {
+ return seconds;
+ }
+
+ return seconds % _ONE_DAY;
+ }
+
+ // Plugin entry
+ $.fn.jquery_timepicker = function(method) {
+ if (!this.length) return this;
+ if (methods[method]) {
+ // check if this element is a timepicker
+ if (!this.hasClass("ui-timepicker-input")) {
+ return this;
+ }
+ return methods[method].apply(
+ this,
+ Array.prototype.slice.call(arguments, 1)
+ );
+ } else if (typeof method === "object" || !method) {
+ return methods.init.apply(this, arguments);
+ } else {
+ $.error("Method " + method + " does not exist on jQuery.timepicker");
+ }
+ };
+
+ // Default plugin options.
+ $.fn.jquery_timepicker.defaults = {
+ appendTo: "body",
+ className: null,
+ closeOnWindowScroll: false,
+ disableTextInput: false,
+ disableTimeRanges: [],
+ disableTouchKeyboard: false,
+ durationTime: null,
+ forceRoundTime: false,
+ listWidth: null, // Set to 1 to match input width, 2 to double input width, .5 to halve input width, etc
+ maxTime: null,
+ minTime: null,
+ noneOption: false,
+ orientation: "l",
+ roundingFunction: function(seconds, settings) {
+ if (seconds === null) {
+ return null;
+ } else if (typeof settings.step !== "number") {
+ // TODO: nearest fit irregular steps
+ return seconds;
+ } else {
+ var offset = seconds % (settings.step * 60); // step is in minutes
+
+ var start = settings.minTime || 0;
+
+ // adjust offset by start mod step so that the offset is aligned not to 00:00 but to the start
+ offset -= start % (settings.step * 60);
+
+ if (offset >= settings.step * 30) {
+ // if offset is larger than a half step, round up
+ seconds += settings.step * 60 - offset;
+ } else {
+ // round down
+ seconds -= offset;
+ }
+
+ return _moduloSeconds(seconds, settings);
+ }
+ },
+ scrollDefault: null,
+ selectOnBlur: false,
+ show2400: false,
+ showDuration: false,
+ showOn: ["click", "focus"],
+ showOnFocus: true,
+ step: 30,
+ stopScrollPropagation: false,
+ timeFormat: "g:ia",
+ typeaheadHighlight: true,
+ useSelect: false,
+ wrapHours: true
+ };
+ });
+
\ No newline at end of file
diff --git a/includes/admin/class-wpcm-admin-help.php b/includes/admin/class-wpcm-admin-help.php
index 007d5fe..d3ab591 100644
--- a/includes/admin/class-wpcm-admin-help.php
+++ b/includes/admin/class-wpcm-admin-help.php
@@ -5,7 +5,7 @@
* @author WPClubManager
* @category Admin
* @package WPClubManager/Admin
- * @version 2.0.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) {
@@ -43,7 +43,7 @@ public function add_tabs() {
'' . __( 'Help & Support', 'wp-club-manager' ) . ' ' .
'' . sprintf(
__( 'Should you need help understanding, using, or extending WP Club Manager, %splease read our documentation%s. You will find all kinds of resources including snippets, tutorials and much more.' , 'wp-club-manager' ),
- '',
+ ' ',
' '
) . '
' .
'' . sprintf(
diff --git a/includes/admin/class-wpcm-admin-setup-wizard.php b/includes/admin/class-wpcm-admin-setup-wizard.php
index 1196585..eaaf758 100644
--- a/includes/admin/class-wpcm-admin-setup-wizard.php
+++ b/includes/admin/class-wpcm-admin-setup-wizard.php
@@ -7,7 +7,7 @@
* @author ClubPress
* @category Admin
* @package WPClubManager/Admin
- * @version 2.2.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
@@ -562,8 +562,8 @@ public function wpcm_setup_ready() { ?>
diff --git a/includes/admin/views/html-notice-install.php b/includes/admin/views/html-notice-install.php
index ced80c8..63fd014 100644
--- a/includes/admin/views/html-notice-install.php
+++ b/includes/admin/views/html-notice-install.php
@@ -17,7 +17,7 @@
-
+
diff --git a/includes/admin/views/html-notice-theme-support.php b/includes/admin/views/html-notice-theme-support.php
index 7129df7..71ccda7 100644
--- a/includes/admin/views/html-notice-theme-support.php
+++ b/includes/admin/views/html-notice-theme-support.php
@@ -16,7 +16,7 @@
-
+
diff --git a/includes/admin/views/html-notice-version-update.php b/includes/admin/views/html-notice-version-update.php
index 581aee6..b4236f4 100644
--- a/includes/admin/views/html-notice-version-update.php
+++ b/includes/admin/views/html-notice-version-update.php
@@ -24,7 +24,7 @@
-
+
ID );
- if ( has_post_thumbnail( $player->ID ) ) {
- $thumb = get_the_post_thumbnail( $player->ID, 'player-medium' );
- } else {
- $thumb = wpcm_placeholder_img( $size = 'full' );
- }
+ $thumb = wpcm_get_player_thumbnail( $player->ID, 'player_full' );
+ $url = get_permalink( $player->ID );
+ $title = get_player_title( $player->ID, $name_format );
- $player_details[$player->ID]['image'] = '' . $thumb . ' ';
+ $player_details[$player->ID]['image'] = apply_filters( 'wpclubmanager_player_gallery_image', '' . $thumb . ' ', $url, $thumb );
- $player_details[$player->ID]['title'] = '' . get_player_title( $player->ID, $name_format ) . ' ';
+ $player_details[$player->ID]['title'] = apply_filters( 'wpclubmanager_player_gallery_title', '' . $title . ' ', $url, $title );
if ( array_key_exists( $orderby, $player_stats_labels ) ) {
if ( $team ) {
diff --git a/languages/wp-club-manager-en_GB.po b/languages/wp-club-manager-en_GB.po
index d6e88a0..f252d83 100644
--- a/languages/wp-club-manager-en_GB.po
+++ b/languages/wp-club-manager-en_GB.po
@@ -7328,11 +7328,11 @@ msgstr "Support"
#~ msgid ""
#~ "If you need more help setting up WP Club Manager, using the shortcodes "
#~ "and widgets or customizing the plugin templates then visit our documentation ."
+#~ "\"https://wpclubmanager.com/documentation/\">documentation."
#~ msgstr ""
#~ "If you need more help setting up WP Club Manager, using the shortcodes "
#~ "and widgets or customising the plugin templates then visit our documentation ."
+#~ "\"https://wpclubmanager.com/documentation/\">documentation."
#~ msgid "Friendly Support"
#~ msgstr "Friendly Support"
diff --git a/readme.txt b/readme.txt
index 687ba81..da1d4b1 100644
--- a/readme.txt
+++ b/readme.txt
@@ -5,14 +5,14 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
Requires at least: 4.9
Tested up to: 5.5
Requires PHP: 5.6
-Stable tag: 2.2.1
+Stable tag: 2.2.2
License: GPLv3
License URI: http://www.gnu.org/licenses/gpl-3.0.html
WP Club Manager is easy to set-up and has everything you need to build and manage an amazing sports club website.
== Description ==
-= Build A Pro Sports Club Website =
+= Build A Pro Sports Club Website With No Hassle =
WP Club Manager is a sports plugin used to create and manage a club website with WordPress. Quick and easy to set-up, you can manage clubs, player profiles and performance data, staff, sponsors, league tables, keep track of your fixtures and results and loads more.
= Endorsed by USA Rugby =
@@ -59,7 +59,7 @@ Find out more about all each feature and more, please visit [our site](https://w
* Rugby Union
* Volleyball
-Find extensive [documentation](http://docs.wpclubmanager.com) and [friendly support](https://wpclubmanager.com/support/) at our [plugin website](https://wpclubmanager.com).
+Find extensive [documentation](https://wpclubmanager.com/documentation/) and [friendly support](https://wpclubmanager.com/support/) at our [plugin website](https://wpclubmanager.com).
= Themes & Extensions =
@@ -141,11 +141,11 @@ If your sport is not supported please [contact us](https://wpclubmanager.com/con
= Where can I find documentation and support for the WP Club Manager plugin? =
-You can find documentation for the plugin at [WP Club Manager documentation](http://docs.wpclubmanager.com) or get [Support](https://wpclubmanager.com/support/)
+You can find documentation for the plugin at [WP Club Manager documentation](https://wpclubmanager.com/documentation/) or get [Support](https://wpclubmanager.com/support/)
= Will WP Club Manager work with my theme? =
-Yes; WP Club Manager will work with any theme, but may require some styling to make it match nicely. Please see our [docs](https://docs.wpclubmanager.com/) for help. If you're looking for a theme with built in WP Club Manager integration we recommend [Victory](https://wpclubmanager.com/products/victory).
+Yes; WP Club Manager will work with any theme, but may require some styling to make it match nicely. Please see our [docs](https://wpclubmanager.com/documentation/) for help. If you're looking for a theme with built in WP Club Manager integration we recommend [Victory](https://wpclubmanager.com/products/victory).
= Where can I report bugs or contribute to the project? =
@@ -167,6 +167,21 @@ You can help improve this plugin by reporting any bugs or contributing to the so
== Changelog ==
+= 2.2.2 09/10/2020
+
+* Fix - Fixed warning message when sorting players in matches
+* Tweak - Fixtures/Results widgets now use date/time format from WP general settings
+* Tweak - Added filters to all plugin date/time functions
+* Tweak - Added some filters to players gallery shortcode
+* Tweak - Removed some conflicting CSS from tables
+* Tweak - Updated documentation links
+* Template - '/shortcodes/match-list.php' - Added date/time filter
+* Template - '/shortcodes/match-opponents.php' - Added date/time filter
+* Template - '/content-widget-fixtures.php' - Added date/time filter
+* Template - '/content-widget-results.php' - Added date/time filter
+* Template - '/content-single-club.php' - Added date/time filter
+* Template - '/single-match/date.php' - Added date/time filter
+
= 2.2.1 07/09/2020
* Fix - Fixed missing function warning in plugin dashboard
diff --git a/templates/content-single-club.php b/templates/content-single-club.php
index 6f6a0b1..39eba9a 100644
--- a/templates/content-single-club.php
+++ b/templates/content-single-club.php
@@ -6,7 +6,7 @@
*
* @author ClubPress
* @package WPClubManager/Templates
- * @version 2.1.5
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -162,14 +162,14 @@
-
+
-
+
diff --git a/templates/content-widget-fixtures.php b/templates/content-widget-fixtures.php
index f5284f1..4b4f5b8 100644
--- a/templates/content-widget-fixtures.php
+++ b/templates/content-widget-fixtures.php
@@ -4,7 +4,7 @@
*
* @author Clubpress
* @package WPClubManager/Templates
- * @version 2.0.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
@@ -39,9 +39,9 @@
diff --git a/templates/content-widget-results.php b/templates/content-widget-results.php
index e7c68d1..d890997 100644
--- a/templates/content-widget-results.php
+++ b/templates/content-widget-results.php
@@ -4,7 +4,7 @@
*
* @author Clubpress
* @package WPClubManager/Templates
- * @version 1.4.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
@@ -39,9 +39,9 @@
diff --git a/templates/shortcodes/match-list.php b/templates/shortcodes/match-list.php
index cdf2a93..3038acf 100644
--- a/templates/shortcodes/match-list.php
+++ b/templates/shortcodes/match-list.php
@@ -4,7 +4,7 @@
*
* @author Clubpress
* @package WPClubManager/Templates
- * @version 2.1.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
@@ -19,8 +19,6 @@
$played = get_post_meta( $match->ID, 'wpcm_played', true );
$timestamp = strtotime( $match->post_date );
- $time_format = get_option( 'time_format' );
- //$class = wpcm_get_match_outcome( $match->ID );
$comp = wpcm_get_match_comp( $match->ID );
if( $show_abbr == true ) {
$sides = wpcm_get_match_clubs( $match->ID, true );
@@ -43,7 +41,7 @@
-
+
@@ -51,7 +49,7 @@
-
+
diff --git a/templates/shortcodes/match-opponents.php b/templates/shortcodes/match-opponents.php
index 0a3e816..ffae17e 100644
--- a/templates/shortcodes/match-opponents.php
+++ b/templates/shortcodes/match-opponents.php
@@ -4,7 +4,7 @@
*
* @author Clubpress
* @package WPClubManager/Templates
- * @version 2.1.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly ?>
@@ -21,8 +21,6 @@
$home_club = get_post_meta( $match->ID, 'wpcm_home_club', true );
$played = get_post_meta( $match->ID, 'wpcm_played', true );
$timestamp = strtotime( $match->post_date );
- $time_format = get_option( 'time_format' );
-
$venue = wpcm_get_match_venue( $match->ID );
$team = wpcm_get_match_team( $match->ID );
$comp = wpcm_get_match_comp( $match->ID );
@@ -45,7 +43,7 @@
- ,
+ ,
diff --git a/templates/single-match/date.php b/templates/single-match/date.php
index 5c82423..edff5ef 100644
--- a/templates/single-match/date.php
+++ b/templates/single-match/date.php
@@ -4,15 +4,15 @@
*
* @author ClubPress
* @package WPClubManager/Templates
- * @version 1.4.0
+ * @version 2.2.2
*/
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
global $post;
-$date = date_i18n( get_option( 'date_format' ), strtotime( $post->post_date ) );
-$time = date_i18n( get_option( 'time_format' ), strtotime( $post->post_date ) ); ?>
+$date = date_i18n( apply_filters( 'wpclubmanager_match_long_date_format', get_option( 'date_format' ) ), strtotime( $post->post_date ) );
+$time = date_i18n( apply_filters( 'wpclubmanager_match_time_format', get_option( 'time_format' ) ), strtotime( $post->post_date ) ); ?>
,
diff --git a/wpclubmanager.php b/wpclubmanager.php
index e501019..cfa6aab 100644
--- a/wpclubmanager.php
+++ b/wpclubmanager.php
@@ -5,7 +5,7 @@
* Description: A plugin to help you run a sports club website easily and quickly.
* Author: Clubpress
* Author URI: https://wpclubmanager.com
- * Version: 2.2.1
+ * Version: 2.2.2
* Text Domain: wp-club-manager
* Domain Path: /languages/
* License: GPLv3
@@ -30,7 +30,7 @@ final class WPClubManager {
/**
* @var string
*/
- public $version = '2.2.1';
+ public $version = '2.2.2';
/**
* @var WPClubManager The single instance of the class
@@ -114,7 +114,7 @@ public function __construct() {
public function plugin_action_links( $links ) {
$action_links = array(
'settings' => '
' . __( 'Settings', 'wp-club-manager' ) . ' ',
- 'docs' => '
' . __( 'Docs', 'wp-club-manager' ) . ' ',
+ 'docs' => '
' . __( 'Docs', 'wp-club-manager' ) . ' ',
'support' => '
' . __( 'Support', 'wp-club-manager' ) . ' ',
);