;(function() { var $; var base = 'https://gymdesk.com/'; var dmn = window.location.hostname; if(dmn == 'localhost' || dmn == 'www.maondev.com') { var base = 'https://www.maondev.com/'; } else if (dmn === 'gymdesk.lndo.site') { // Cal Evans var base = 'https://gymdesk.lndo.site/'; } var loadScript = function(script,callback) { var script_tag = document.createElement('script'); script_tag.setAttribute("type","text/javascript"); script_tag.setAttribute("src",script); if (script_tag.readyState) { script_tag.onreadystatechange = function () { // For old versions of IE if (this.readyState == 'complete' || this.readyState == 'loaded') { callback(); } }; } else { script_tag.onload = callback; } (document.getElementsByTagName("head")[0] || document.documentElement).appendChild(script_tag); }; function inIframe () { try { return window.self !== window.top; } catch (e) { return true; } } var widgets = { loadedForms: false, loadingForms:false, queue:[], started:false, init: function($) { var self = this; this.loadCss('min/?b=styles&f=widgets-iframe.css,academy/forms.css,widgets/ui.css'); this.initSchedule(); this.initForms(); this.initBooking(); window.addEventListener('message', function(e) { jQuery('.gymdesk-frame-container iframe').each(function(){ if(this.contentWindow === e.source) { var eventName = e.data[0]; var data = e.data[1]; switch(eventName) { case 'setHeight': jQuery(this).height(data); break; case 'maonrails-popup': jQuery(this).parent().remove(); self.initPopup(data); break; case 'scroll': var scroll = data; var top = jQuery(this).offset().top; if(top + scroll > jQuery(window).height() / 2) { var off = jQuery(window).height() / 2 - e.data[2]; jQuery('html,body').scrollTop(top + scroll - off); } break; } } }); }, false); }, initSchedule: function() { $('.maonrails-schedule').each(function(){ if($(this).find('iframe').length > 0) { return false; } $(this).addClass('gymdesk-frame-container'); if(inIframe()) { $(this).css('width','100%'); } var gymId = $(this).attr('attr-gym'); var template = $(this).attr('attr-theme'); var params = ''; var schedule = $(this).attr('attr-schedule'); var program = $(this).attr('attr-program'); if(typeof(template) == 'string') { params += ((params.length ?? 0) > 0 ? '&' : '') + 'theme=' + template; } if(typeof(schedule) == 'string') { params += ((params.length ?? 0) > 0 ? '&' : '') + 'schedule=' + schedule; } if (typeof (program) == 'string') { params += ((params.length??0)>0?'&':'') + 'program=' + program; } var frame = $('').appendTo(this); frame.on('load',function(){ this.contentWindow.postMessage(["setHeight",$(window).height()],'*'); }); $(window).resize(function(){ frame[0].contentWindow.postMessage(["setHeight",$(window).height()],'*'); }); }); }, initForms: function() { $('.maonrails-form').each(function(){ if($(this).find('iframe').length > 0) { return false; } var isPopup = typeof($(this).attr('popup')) != 'undefined'; $(this).addClass('gymdesk-frame-container'); if(inIframe()) { $(this).css('width','100%'); } var ref = $(this).attr('attr-ref'); var template = $(this).attr('attr-theme'); var params = ''; if(typeof(template) == 'string') { params += 'template=' + template; } var frame = $('').appendTo(this); frame.on('load',function(){ this.contentWindow.postMessage(["setHeight",$(window).height()],'*'); }); }); }, initPopup: function(data) { var self = this; var setPopup = function() { var els = $('
' + data.html + '
').appendTo('body'); var button = els.find('.maonrails-lead-form-button'); var startPopup = function(context) { MARforms.formSubmit(context); MARforms.initPopup(context); }; if(typeof(data.has_captcha) != 'undefined' && data.has_captcha == 1) { $.getScript('//www.google.com/recaptcha/api.js'); } if(self.loadedForms) { startPopup(els); } else if(self.loadingForms) { self.queue.push(els); } else { $.getScript(base + 'min/?b=js&f=widgets/main.js,academy/forms.js',function(){ self.loadedForms = true; self.loadingForms = false; if(self.queue.length > 0) { for(var i in self.queue) { startPopup(self.queue[i]); } } }); self.loadingForms = true; } }; if(data.has_datepicker == 1) { var link = $("", { rel: "stylesheet", type: "text/css", href: '//code.jquery.com/ui/1.12.1/themes/ui-lightness/jquery-ui.css' }); link.appendTo('head'); loadScript("//code.jquery.com/ui/1.12.1/jquery-ui.min.js",setPopup); } else { setPopup(); } }, initBooking: function() { $('.maonrails-booking,.gymdesk-booking').each(function(){ if($(this).find('iframe').length > 0) { return false; } $(this).addClass('gymdesk-frame-container'); var gymId = $(this).attr('attr-gym'); var template = $(this).attr('attr-theme'); var schedule = $(this).attr('attr-schedule'); var params = {}; if(typeof(template) == 'string') { params['theme'] = template; } if(typeof(schedule) == 'string') { params['schedules'] = schedule; } var qp = window.location.href.split('?')[1]; if(typeof(qp) != 'undefined') { var qp = new URLSearchParams(qp); for(var param of qp) { if(param[0] == 'date' && param[1] != '') { params['date'] = param[1]; } if(param[0] == 's' && param[1] != '') { params['s'] = param[1]; } } } var pString = new URLSearchParams(params).toString(); var frame = $('').appendTo(this); frame.on('load',function(){ this.contentWindow.postMessage(["setHeight",$(window).height()],'*'); }); $(window).resize(function(){ frame[0].contentWindow.postMessage(["setHeight",$(window).height()],'*'); }); }); }, loadCss: function(css) { var link = $("", { rel: "stylesheet", type: "text/css", href: base + css }); link.appendTo('head'); } }; function jqueryHandler() { jQuery = window.jQuery.noConflict(true); main(widgets); } if (window.jQuery === undefined) { loadScript("//code.jquery.com/jquery-3.6.0.js",jqueryHandler); } else { $ = jQuery = window.jQuery; main(widgets); } function main(widgets) { window.gdWidgets = widgets; jQuery(document).ready(function(jq) { if(typeof(gdWidgets) != 'undefined') { $ = jq; gdWidgets.init(); } }); } })();

Give your fitness a boost with our new gym challenge

Qui tenetur doloribus laudantium. Expedita aut impedit in illum. Soluta id autem dolorem aliquid consequatur laudantium enim. Aliquam illo impedit omnis aut magnam sint consequatur.

Ratione nihil a quam qui voluptates accusantium. Rerum cum est repudiandae sit non quis eos. Deserunt iusto occaecati laboriosam.

Nam sed ea eos similique debitis. Quia id reiciendis sint. Tempora omnis quia et nobis repudiandae sunt officiis.

Impedit odit et itaque sequi assumenda. Aliquam excepturi tenetur eveniet. Sed et eveniet quisquam est consequatur. Ut ut fuga nobis rerum nobis voluptatem voluptas.

Officiis aut dicta aut animi dolores excepturi. Velit numquam voluptatum ut id cupiditate deserunt natus. Necessitatibus consequatur voluptas quaerat ducimus aperiam eligendi. Et maiores rerum ad veritatis nostrum voluptas.

Veritatis tempore deserunt ex. Est id non sint nam. Aut dolorem ut aut velit. Ut qui nesciunt consequuntur id numquam recusandae at qui.

Leave a Reply

Your email address will not be published. Required fields are marked *

X