Register for Centennial Youth Baseball-Softball Association (2024)

Register for Centennial Youth Baseball-Softball Association (1)

Spring/Summer Baseball 2024 Coach Registration

Restricted Form

This form is restricted. You must enter the code provided to you to access this form.

Questions?Contact Centennial Youth Baseball-Softball Association

Preview Mode

You are currently in preview mode. This allows you to view and use the registration form before activating and making it publicly available. You will get a different link to share publicly after activating.

Want to view this form on your phone?

87% of people register from a mobile device!

Incomplete Hockey Canada Profile

Your Hockey Canada profile appears to be incomplete. You may be asked to provide some missing information for Hockey Canada's records, and to sign some waivers before you can continue registering. The information provided to Hockey Canada will not be stored in Teamlinkt.

Add Merchandise

`;});$("#merch_attributes_div").html(merch_attr_html);let primary_config_available = true;//Step: add the available item attribute options to an array, and show the proper imagesselected_merch_item_conf.forEach(function(item_configuration, key) {if (!available_item_configuration_ids.includes(item_configuration.id)) {if (item_configuration.is_primary == 1) {primary_config_available = false;}return;}merch_item_conf_by_id[item_configuration.id] = {};merch_item_conf_entire_arr_by_id[item_configuration.id] = item_configuration;item_configuration.MerchandiseItemConfigurationOption?.forEach(function(vv, kk) {merch_item_conf_by_id[item_configuration.id][vv.merchandise_item_attribute_id] = vv.merchandise_item_attribute_option_id;if (vv.merchandise_item_attribute_id == first_item_attribute.id && !available_item_attribute_option_ids.includes(vv.merchandise_item_attribute_option_id)) {available_item_attribute_option_ids.push(vv.merchandise_item_attribute_option_id);return;}});//if it's primary, we need to add the active class to the appropriate buttons, and show the original primary imagesif (item_configuration.is_primary == 1 && primary_merch_item_conf.length == 0) {createMerchImageCarousel(item_configuration);}});if (!primary_config_available) {createMerchImageCarousel(merch_item_conf_entire_arr_by_id[Object.keys(merch_item_conf_entire_arr_by_id)[0]]);}$("#merchandise_item_details").html(``);populateAttributeRowHTML(first_item_attribute.MerchandiseItemAttributeOption, available_item_attribute_option_ids, first_item_attribute);selectAttributeValue(first_item_attribute, null);$("#add_merchandise_item_mdl").modal('show');}function createMerchImageCarousel(item_configuration) {original_merch_images = [];let image_html = ``;let added_active_class = false;primary_merch_item_conf = item_configuration;for (let kk in item_configuration.MerchandiseItemConfigurationOption) {let vv = item_configuration.MerchandiseItemConfigurationOption[kk];original_item_conf_options[vv.merchandise_item_attribute_id] = vv.merchandise_item_attribute_option_id;}if (!isEmpty(merchandise_items[selected_merch_item_id].AssociationRegistrationMerchandiseItem.custom_image_url)) {image_html += `

Register for Centennial Youth Baseball-Softball Association (2)

`;added_active_class = true;}if(item_configuration.MerchandiseItemConfigurationMedia.length <= 1) {$(".carousel-control-prev").hide();$(".carousel-control-next").hide();}else {$(".carousel-control-prev").show();$(".carousel-control-next").show();}item_configuration.MerchandiseItemConfigurationMedia?.forEach(function(vv, kk) {image_html += `

Register for Centennial Youth Baseball-Softball Association (3)

`;if (vv.is_primary) {added_active_class = true;}original_merch_images.push(vv);});$("#merch_items_inner_carousel_div").html(image_html);return image_html;}function setMerchItemPrice(item_config_addt_price) {if (!item_config_addt_price || item_config_addt_price < 0) {item_config_addt_price = 0.00;}merch_item_price = ((selected_merch_item.base_price || 0) + (merchandise_items[selected_merch_item_id].AssociationRegistrationMerchandiseItem.mark_up || 0) +item_config_addt_price);$("#merch_item_price_span").text(merch_item_price.toFixed(2));$("#total_merch_items_amount_span").text(merch_item_price.toFixed(2));$("#total_merch_items_amount").val(merch_item_price.toFixed(2));$("#merch_item_price").val(merch_item_price.toFixed(2));updateMerchAmountDue();}function populateAttributeRowHTML(all_item_attribute_options, available_item_attribute_option_ids, item_attribute) {let html = ``;//Step: Loop thru all the item attribute options for the first-ranked item attribute, and create the proper display for the attributeall_item_attribute_options.forEach(function(item_attribute_option, key) {//if the id of this option is in the available item attribute option ids array, then create a button for itif (item_attribute && available_item_attribute_option_ids.includes(item_attribute_option.id)) {html += renderAttributeOptions(item_attribute, item_attribute_option);}});$(`#merch_div_content_${item_attribute.name}`).html(html);$(`#merch_div_${item_attribute.name}`).show();}function renderAttributeOptions(item_attribute, attr_option) {let html = ``;let active_class = '';if (original_item_conf_options[item_attribute.id] == attr_option.id) {active_class = 'active';}switch (item_attribute.name.toLowerCase()) {case 'size':let width = '67px';if(attr_option.value.toLowerCase().includes('youth')){width = '75px';}html += `

`;break;case 'color':let border = 'none';if (attr_option.value.toLowerCase() === 'white') {border = '1px solid #c6c6c6';}html += `

`;if (active_class != '' && attr_option.value.toLowerCase() === 'white') {html += ``;} else if (active_class != '' && attr_option.value.toLowerCase() !== 'white') {html += ``;}html += `

`;break;case 'sleeve_length':html += `

`;break;default:break;}return html;}function selectAttributeValue(item_attribute, selected_attribute_option_id) {if (!selected_attribute_option_id) {selected_attribute_option_id = original_item_conf_options[item_attribute.id];}if (item_attribute.id != first_item_attribute.id) {let current_attr_opts = getAvailableAttributeOptions(item_attribute);if (current_attr_opts && current_attr_opts.length > 0 && !current_attr_opts.includes(selected_attribute_option_id)) {selected_attribute_option_id = current_attr_opts[0];}}clearFilterKeysAfter(item_attribute.name);setFilterKey(item_attribute, selected_attribute_option_id);let next_item_attribute = getNextItemAttribute(item_attribute.name);//if there's only 1 attribute, then we need to get the options for that one attribute, since it may have additional pricing added to it.if (item_attributes.length == 1) {getAvailableAttributeOptions(item_attribute);}//if there's no next attribute, no point in continuing, so return outta here.if (!next_item_attribute || next_item_attribute.length <= 0) {return;}let all_item_attribute_options = next_item_attribute.MerchandiseItemAttributeOption;let available_item_attribute_option_ids = getAvailableAttributeOptions(next_item_attribute);if (!all_item_attribute_options || all_item_attribute_options.length <= 0 || !available_item_attribute_option_ids || available_item_attribute_option_ids.length <= 0) {return;}populateAttributeRowHTML(all_item_attribute_options, available_item_attribute_option_ids, next_item_attribute);selectAttributeValue(next_item_attribute, null);}function clearFilterKeysAfter(item_attribute_name_param) {let attribute_key = -1;for (let key in item_attributes) {if (item_attributes[key].name == item_attribute_name_param) {attribute_key = key;}if (attribute_key > -1 && key > attribute_key && merch_item_filter[item_attributes[key].id] != undefined) {delete merch_item_filter[item_attributes[key].id];}}}function setFilterKey(item_attribute, attribute_option_id) {setAttributeValueFromButton(item_attribute.name, item_attribute.id, attribute_option_id, true);merch_item_filter[item_attribute.id] = attribute_option_id;for(let key in merch_item_conf_by_id) {if(areObjectsEqual(merch_item_conf_by_id[key], merch_item_filter)) {createMerchImageCarousel(merch_item_conf_entire_arr_by_id[key]);setMerchItemPrice(merch_item_conf_entire_arr_by_id[key].additional_price);break;}}return;}function getNextItemAttribute(item_attribute_name_param) {let current_attribute_index = -1;for (let key in item_attributes) {if (current_attribute_index > -1) {return item_attributes[key];}if (item_attributes[key].name == item_attribute_name_param) {current_attribute_index = key;}}return [];}function getAvailableAttributeOptions(item_attribute_param) {let available_item_config_ids_tmp = [];let available_item_attribute_option_ids = [];for (let key in item_attributes) {let item_attribute = item_attributes[key];for (let kk in selected_merch_item_conf) {let item_configuration = selected_merch_item_conf[kk];for (let k in item_configuration.MerchandiseItemConfigurationOption) {let item_config_option = item_configuration.MerchandiseItemConfigurationOption[k];if (available_item_configuration_ids.includes(item_configuration.id) && item_config_option.merchandise_item_attribute_id == item_attribute.id &&merch_item_filter[item_attribute.id] == item_config_option.merchandise_item_attribute_option_id && !available_item_config_ids_tmp.includes(item_configuration.id)) {available_item_config_ids_tmp.push(item_configuration.id);break;}}}}//check if it's the last attribute or notlet next_item_attribute = getNextItemAttribute(item_attribute_param.name);let changed_images = false;//if it's the last attribute, and it's not the last of the filters//we need to do this, or else selecting of the final silter will not work.if ((!next_item_attribute || next_item_attribute.length <= 0) && Object.keys(merch_item_filter).length != item_attributes.length) {for (let key in available_item_config_ids_tmp) {let item_config_id = available_item_config_ids_tmp[key];let num_matches = 0;//check to see if the filters above match exactly, or else we don't want the bottom filter option to show. the ones above it MUST match.Object.entries(merch_item_filter).forEach(function(vv, kk) {let item_attr_id = parseInt(vv[0]);let item_attr_opt_id = parseInt(vv[1]);if (merch_item_conf_by_id[item_config_id][item_attr_id] == item_attr_opt_id) {num_matches++;} else {num_matches = 0;}});let attr_opt_id = merch_item_conf_by_id[item_config_id][item_attribute_param.id];if (num_matches == Object.keys(merch_item_filter).length && !available_item_attribute_option_ids.includes(attr_opt_id)) {available_item_attribute_option_ids.push(attr_opt_id);}}} else {for (let key in available_item_config_ids_tmp) {let item_config_id = available_item_config_ids_tmp[key];let attr_opt_id = merch_item_conf_by_id[item_config_id][item_attribute_param.id];if (!available_item_attribute_option_ids.includes(attr_opt_id)) {available_item_attribute_option_ids.push(attr_opt_id);}}}return available_item_attribute_option_ids;}function setAttributeValueFromButton(item_attribute_name, item_attribute_id, item_attribute_option_id, dont_select_attr_value) {if ($(`.merch_btn_${item_attribute_name}`).length > 0) {$(`.merch_btn_${item_attribute_name}`).removeClass('active');$(`#merch_btn_${item_attribute_name}_${item_attribute_option_id}`).addClass('active');} else if (item_attribute_name === 'color' && $(`#merch_span_color_${item_attribute_option_id}`).attr('title').toLowerCase() === 'white') {$(".merch_span_color").html('');$(`#merch_span_color_${item_attribute_option_id}`).html(``);} else if (item_attribute_name === 'color' && $(`#merch_span_color_${item_attribute_option_id}`).attr('title').toLowerCase() !== 'white') {$(".merch_span_color").html('');$(`#merch_span_color_${item_attribute_option_id}`).html(``);}if (dont_select_attr_value) {return;}let item_attribute = getItemAttribute(item_attribute_id);if (!item_attribute || item_attribute.length <= 0) {return;}return selectAttributeValue(item_attribute, item_attribute_option_id);}function getItemAttribute(item_attribute_id) {for (let key in item_attributes) {if (item_attributes[key].id != item_attribute_id) {continue;}return item_attributes[key];}return [];}function addMerchandise() {if (add_merchandise_btn != null) {add_merchandise_btn.start();}let selected_merch_item_conf_id = null;let num_matches = 0;for (let item_configuration_id in merch_item_conf_by_id) {if (areObjectsEqual(merch_item_conf_by_id[item_configuration_id], merch_item_filter)) {selected_merch_item_conf_id = item_configuration_id;break;}}//this should never happen; this means we messed up a configif (!selected_merch_item_conf_id) {add_merchandise_btn.stop();return Swal.fire({icon: 'error',title: `Failed to add item to cart`,html: `We could not add this item to your cart. This is likely because this item is unavailable.`,customClass: {confirmButton: 'btn blue',},});}let customizations = [];let quantity = parseInt($("#merch_quantity").val());for (let i = 0; i < quantity; i++) {customizations.push({});}let primary_image = null;let images = merch_item_conf_entire_arr_by_id[selected_merch_item_conf_id].MerchandiseItemConfigurationMedia;for (let key in images) {if (images[key].is_primary == 1) {primary_image = images[key].url;break;}}if (!primary_image && images.length > 0) {primary_image = images[0].url;} else if (!primary_image && images.length <= 0) {primary_image = primary_merch_item_conf.MerchandiseItemConfigurationMedia[0].url;}selected_merch_item_conf_id = parseInt(selected_merch_item_conf_id);let push_to_cart = true;for (let key in merchandise_cart) {let val = merchandise_cart[key];if (val.merchandise_item_configuration_id == selected_merch_item_conf_id) {merchandise_cart[key].quantity += quantity;merchandise_cart[key].customizations_json.push(customizations);merchandise_cart[key].total_price = (merchandise_cart[key].price_per_item * merchandise_cart[key].quantity);push_to_cart = false;break;}}if (push_to_cart) {merchandise_cart.push({association_registration_merchandise_item_id: merchandise_items[selected_merch_item.id]?.AssociationRegistrationMerchandiseItem?.id,merchandise_item_id: selected_merch_item.id,merchandise_item_configuration_id: parseInt(selected_merch_item_conf_id),customizations_json: customizations,merch_item_name: selected_merch_item.name,merch_item_conf_name: merch_item_conf_entire_arr_by_id[selected_merch_item_conf_id].name,quantity: parseInt(quantity),price_per_item: parseFloat($("#merch_item_price").val()),total_price: parseFloat($("#total_merch_items_amount").val()),image: primary_image});}let num_items = 0;merchandise_cart.forEach(function(val, key) {num_items += val.quantity;});$(".my_merch_items_div").show();$(".my_merch_items_text").html(` My Items (${num_items})`);hideAddMerchandiseItemModal();add_merchandise_btn.stop();if(typeof(updateFees) === 'function') {updateFees();}}function changeInputValue(operation) {let current_val = parseInt($(`#merch_quantity`).val());if (operation === 'add') {new_val = current_val + 1;} else {new_val = current_val - 1;}if (new_val <= 0) {new_val = 1;}$(`#merch_quantity`).val(new_val);updateMerchAmountDue();}function updateMerchAmountDue() {let new_total = parseFloat(merch_item_price * $(`#merch_quantity`).val()).toFixed(2);$("#total_merch_items_amount_span").text(new_total);$("#total_merch_items_amount").val(new_total);}function hideAddMerchandiseItemModal() {$("#add_merchandise_item_mdl").modal('hide');}function areObjectsEqual(a, b) {// Create arrays of property namesvar aProps = Object.getOwnPropertyNames(a);var bProps = Object.getOwnPropertyNames(b);// If number of properties is different, objects are not equivalentif (aProps.length != bProps.length) {return false;}for (var i = 0; i < aProps.length; i++) {var propName = aProps[i];// If values of same property are not equal, objects are not equivalentif (a[propName] !== b[propName]) {return false;}}// If we made it this far, objects are considered equivalentreturn true;}

My Merchandise Items

Register for Centennial Youth Baseball-Softball Association (2024)

References

Top Articles
Latest Posts
Article information

Author: Pres. Carey Rath

Last Updated:

Views: 5849

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Pres. Carey Rath

Birthday: 1997-03-06

Address: 14955 Ledner Trail, East Rodrickfort, NE 85127-8369

Phone: +18682428114917

Job: National Technology Representative

Hobby: Sand art, Drama, Web surfing, Cycling, Brazilian jiu-jitsu, Leather crafting, Creative writing

Introduction: My name is Pres. Carey Rath, I am a faithful, funny, vast, joyous, lively, brave, glamorous person who loves writing and wants to share my knowledge and understanding with you.