// show-hide logic for waveiii starter site - replaces the .js version so cf variables can be passed to the datepickers $(function() { // login form $('a.showsignin').click(function() { $('#signin').slideToggle(); $('.navbar-collapse').slideToggle(); }); $('a.hidesignin').click(function() { $('#signin').slideToggle(); $('.navbar-collapse').slideToggle(); }); // cookies message $('a.shownocookiesmsg').click(function() { $('#nocookiesmsg').show(); $('#cookieselect').hide(); }); $('a.hidenocookiesmsg').click(function() { $('#nocookiesmsg').hide(); $('#cookieselect').hide(); $('#cookiesdisclaimer').hide(); }); // standings tables $('a.showstats_cities').click(function() { $('#fullstats_cities').fadeIn('fast'); $('#fullstats_countries').hide(); $('#fullstats_athletes').hide(); }); $('a.hidestats_cities').click(function() { $('#fullstats_cities').hide(); }); $('a.showstats_countries').click(function() { $('#fullstats_countries').fadeIn('fast'); $('#fullstats_cities').hide(); $('#fullstats_athletes').hide(); }); $('a.hidestats_countries').click(function() { $('#fullstats_countries').hide(); }); $('a.showstats_athletes').click(function() { $('#fullstats_athletes').fadeIn('fast'); $('#fullstats_cities').hide(); $('#fullstats_countries').hide(); }); $('a.hidestats_athletes').click(function() { $('#fullstats_athletes').hide(); }); //badges standings $('a.showbadgeLevel1').click(function() { $('#badgeLevel1').fadeIn('fast'); $('#badgeLevel2').hide(); $('#badgeLevel3').hide(); $('#badgeLevel4').hide(); $('#badgeLevel5').hide(); $('#badgeLevel6').hide(); }); $('a.showbadgeLevel2').click(function() { $('#badgeLevel2').fadeIn('fast'); $('#badgeLevel1').hide(); $('#badgeLevel3').hide(); $('#badgeLevel4').hide(); $('#badgeLevel5').hide(); $('#badgeLevel6').hide(); }); $('a.showbadgeLevel3').click(function() { $('#badgeLevel3').fadeIn('fast'); $('#badgeLevel1').hide(); $('#badgeLevel2').hide(); $('#badgeLevel4').hide(); $('#badgeLevel5').hide(); $('#badgeLevel6').hide(); }); $('a.showbadgeLevel4').click(function() { $('#badgeLevel4').fadeIn('fast'); $('#badgeLevel1').hide(); $('#badgeLevel2').hide(); $('#badgeLevel3').hide(); $('#badgeLevel5').hide(); $('#badgeLevel6').hide(); }); $('a.showbadgeLevel5').click(function() { $('#badgeLevel5').fadeIn('fast'); $('#badgeLevel1').hide(); $('#badgeLevel2').hide(); $('#badgeLevel3').hide(); $('#badgeLevel4').hide(); $('#badgeLevel6').hide(); }); $('a.showbadgeLevel6').click(function() { $('#badgeLevel6').fadeIn('fast'); $('#badgeLevel1').hide(); $('#badgeLevel2').hide(); $('#badgeLevel3').hide(); $('#badgeLevel4').hide(); $('#badgeLevel5').hide(); }); //daily top 10 tables on the home page // $('a.showdailySwim').click(function() { // $('#dailySwim').fadeIn('fast'); // $('#dailyBike').hide(); // $('#dailyRun').hide(); // $('#dailyOther').hide(); // }); // $('a.showdailyBike').click(function() { // $('#dailyBike').fadeIn('fast'); // $('#dailySwim').hide(); // $('#dailyRun').hide(); // $('#dailyOther').hide(); // }); // $('a.showdailyRun').click(function() { // $('#dailyRun').fadeIn('fast'); // $('#dailySwim').hide(); // $('#dailyBike').hide(); // $('#dailyOther').hide(); // }); // $('a.showdailyOther').click(function() { // $('#dailyOther').fadeIn('fast'); // $('#dailySwim').hide(); // $('#dailyRun').hide(); // $('#dailyBike').hide(); // }); //daily top 10 tables on the home page //2020 version - top activities by query $('a.showdaily1').click(function() { $('#daily1').fadeIn('fast'); $('#daily2').hide(); $('#daily3').hide(); $('#daily4').hide(); }); $('a.showdaily2').click(function() { $('#daily2').fadeIn('fast'); $('#daily1').hide(); $('#daily3').hide(); $('#daily4').hide(); }); $('a.showdaily3').click(function() { $('#daily3').fadeIn('fast'); $('#daily2').hide(); $('#daily1').hide(); $('#daily4').hide(); }); $('a.showdaily4').click(function() { $('#daily4').fadeIn('fast'); $('#daily2').hide(); $('#daily3').hide(); $('#daily1').hide(); }); // show-hide the signup form when the blue button is clicked $('a.showsignup').click(function() { $('#signup').slideToggle(); $('#homepagestats').toggle(); }); // show the next button only if a city is selected (loblaws-specific, canada only) $('#cityid').change(function() { $('#signupnext').show(); $('#signup3').slideToggle(); }); // show part 2 of the signup form $('a.signup2').click(function() { $('#signup').show(); $('#signup2').slideToggle(); //$('#signup1').hide(); }); // show the step 2 button when the event radio is selected $('#module_d').click(function() { $('#signupnext1').show(); }); $('#module_w').click(function() { $('#signupnext1').show(); }); $('#module_s').click(function() { $('#signupnext1').show(); }); // show part 3 of the signup form and the waiver $('a.signup3').click(function() { $('#signup').show(); $('#signup3').slideToggle(); $('#waiver').show(); //$('#signup2').hide(); }); // final sign up button - show only if waiver is agreed to $('#waiver_check').change(function() { $('#signupfinal').toggle(); $('#waiver').slideToggle(); }); // keep the signup area visible once the form is submitted $('button.signup-btn').click(function() { $('#signup').show(); }); // show-hide the about the event block for 2014 $('a.showaboutevent').click(function() { $('#aboutevent').slideToggle(); }); // show the 'i want to join your team' form $('a.showjoinrequest').click(function() { $('#joinrequestform').slideToggle(); }); // mute the default join request text $("#usemsg2").change(function() { $('p.jointext').addClass('muted'); }); // unmute the default join request text $("#usemsg1").change(function() { $('p.jointext').removeClass('muted'); }); // personal section of the athlete profile page $('a.personal1').click(function() { $('#profile_personal1').hide(); $('#profile_personal2').show(); }); // location section of the athlete profile page $('a.location1').click(function() { $('#profile_location1').hide(); $('#profile_location2').show(); }); // business section of the athlete profile page $('a.business1').click(function() { $('#profile_business1').hide(); $('#profile_business2').show(); }); // category section of site admin $('a.category1').click(function() { $('#category1').hide(); $('#category1form').show(); }); $('a.category2').click(function() { $('#category2').hide(); $('#category2form').show(); }); $('a.categoryval1').click(function() { $('#categoryval1form').slideToggle(); }); $('a.categoryval2').click(function() { $('#categoryval2form').slideToggle(); }); // alternate activities form $('a.addtimedactivitiesform').click(function() { $('#addresultsform').hide(); $('#addtimedactivitiesform').show(); $('#addfitbitresultsform').hide(); $('#addstravaresultsform').hide(); }); $('a.addresultsform').click(function() { $('#addresultsform').show(); $('#addtimedactivitiesform').hide(); $('#addfitbitresultsform').hide(); $('#addstravaresultsform').hide(); }); $('a.addfitbitform').click(function() { $('#addfitbitresultsform').show(); $('#addtimedactivitiesform').hide(); $('#addresultsform').hide(); $('#addstravaresultsform').hide(); }); $('a.addstravaform').click(function() { $('#addstravaresultsform').show(); $('#addfitbitresultsform').hide(); $('#addtimedactivitiesform').hide(); $('#addresultsform').hide(); }); // alternate activities distance vs timed $('select.activity_d').click(function() { $('#activityform_t').hide(); $('#activityform_d').show(); $('#acttype').val('distance'); // set the activity type in a hidden field $('#hours').val('0'); $('#minutes').val('0'); $('#activity_t').val('0'); $('#datepicker5').val(''); // remove any values in the time date field }); $('select.activity_t').click(function() { $('#activityform_d').hide(); $('#activityform_t').show(); $('#acttype').val('time'); // set the activity type in a hidden field $('#activity_d_d').val('0'); $('#activity_d').val('0'); $('#datepicker4').val(''); // remove any values in the distance date field }); // activity details on the player results page $('a.activitydetails').click(function() { $('#activitydetails').slideToggle(); }); // mindate sets the earliest selectable date. $( "#datepicker" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); $( "#datepicker2" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); $( "#datepicker3" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); // other activities $( "#datepicker4" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); $( "#datepicker5" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); $( "#datepicker6" ).datepicker({ dateFormat: "d MM yy", minDate: "1 June 2024", maxDate: "30 June 2024", }); // weight loss calendar $( "#datepicker_w" ).datepicker({ dateFormat: "d MM yy", //minDate: new Date(2013, 9 - 1, 1), //minDate: "1", maxDate: "30 June 2024", }); // start and end config calendars $( "#datepicker_open" ).datepicker({ dateFormat: "yy-mm-dd", }); $( "#datepicker_start" ).datepicker({ dateFormat: "yy-mm-dd", }); $( "#datepicker_end" ).datepicker({ dateFormat: "yy-mm-dd", }); $( "#datepicker_final" ).datepicker({ dateFormat: "yy-mm-dd", }); // choose a name for a virtual team $('a.vtcreate').click(function() { $('#vtcreateform').show(); }); // show the contact form fields $(".iama-btn2").change(function() { $('#contactsubmit').show(); }); $(".iama-btn1").change(function() { $('#contactsubmit').hide(); }); $(".iama-btn3").change(function() { $('#contactsubmit').hide(); }); // flare $('a.showSendFlare').click(function() { $('#SendFlare').slideToggle(); }); $('a.hideSendFlare').click(function() { $('#SendFlare').slideToggle(); }); // show hide the weighting explanation $('a.weightingdetails').click(function() { $('#weighting').slideToggle(); }); // show hide player photos features $('a.addphotos').click(function() { $('#addphotos').show(); $('#viewphotos').hide(); }); $('a.viewphotos').click(function() { $('#addphotos').hide(); $('#viewphotos').show(); }); // upload photo button > show only if consent given $('#photoconsent').change(function() { $('#photoUploadButton').toggle(); }); // photogallery $('.photosNext2').click(function() { $('#photosNext2').show(); }); $('.photosNext3').click(function() { $('#photosNext3').show(); }); $('.photosNext4').click(function() { $('#photosNext4').show(); }); $('.photosNext5').click(function() { $('#photosNext5').show(); }); // photos on player page $('a.showPlayerPhotos').click(function() { $('#playerphotos').slideToggle('slow'); }); // inappropriate photo email in admin $('#notify').change(function() { $('#PhotoEmail').slideToggle('slow'); }); });