(function($) { //safe way to use console.log $.log = function(logvar) { if ((window.console !== 'undefined')) { console.log(logvar); } }; //DOM ready body class var DOMready = (function() { $(function() { $('body').addClass('dom-ready ehome'); }); }()); $(function() { // Remove Prototype $('script[src="/include/scripts/prototype.js"]').remove(); }); /* ================================================================================================== */ /* Preloader */ /* ================================================================================================== */ $(window).load(function() { if (!$('.custom-speakers').length > 0 && !$('.custom-speakers-promo').length > 0) { $('.loader').fadeOut(); $('.page-loader').delay(350).fadeOut('slow'); } }); /* ================================================================================================== */ /* HELP Module */ /* ================================================================================================== */ var HELP = (function() { var pub = {}, ua = navigator.userAgent, msie = ua.indexOf("MSIE "); pub.isTouchDevice = ('ontouchstart' in document.documentElement); pub.isiPad = (ua.match(/iPad/i) !== null); pub.isiPhone = (navigator.platform.indexOf('iPhone') !== -1) || (navigator.platform.indexOf('iPod') !== -1); pub.isAndroid = (ua.indexOf('Android') !== -1); pub.isAndroidVersion = ((pub.isAndroid) ? parseFloat(ua.match(/Android\s+([\d\.]+)/)[1]) : false); pub.isIE = (ua.indexOf('MSIE ') !== -1 || ua.match(/Trident/)); //Trident is for IE11 pub.ieVersion = (parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)))) || false; return pub }()); /* ================================================================================================== */ /* Inject Class Module */ /* ================================================================================================== */ var injectClass = (function() { $(function() { $('.ehtm, #inner_content, .linkSnippetVersion, #orig-nav').addClass('container'); }); }()); /* ================================================================================================== */ /* Modify eHome Module */ /* ================================================================================================== */ var modifyEhome = (function() { $(function() { $('.ehtm .register').closest('li').addClass('last-nav'); }); }()); /* ================================================================================================== */ /* eHome Page Helper Class Module */ /* ================================================================================================== */ var ehomePageHelperClass = (function() { $(function() { var customClass = $("meta[property='og:title']").attr("content", document.title); customClass = customClass[0].content.toLowerCase(); $('body').addClass('eh-custom-' + customClass); }); }()); /* ================================================================================================== */ /* Mobile Toggle Module */ /* ================================================================================================== */ var mobileToggle = (function() { $(function() { var $mobileToggle = $('.mobile-toggle'); // Toggle mobile nav $mobileToggle.on('click', function() { $('body').toggleClass('show-nav'); $mobileToggle.toggleClass('active'); }); }); }()); /* ================================================================================================== */ /* Content Type Class Module */ /* ================================================================================================== */ var contentTypeClass = (function() { // Settings var gridSystem = true; // Turn grid system usage on/off $(function() { init(); }); var init = function() { getClasses(); }; // Get classes from each content block header var getClasses = function() { $('#main_section > div').each(function() { var $this = $(this), $header = $this.find('.header:first'), classes = $header.text(); // Add classes and remove childrens inline styles $this.addClass(classes).children().removeAttr('style'); // Hide header $header.hide(); }); // If using for grid system wrap relevant HTML if (gridSystem) { wrapContentBlocks(); } else { // If not using for a grid system inject any HTML class wrappers here. For example: $('#main_section').wrapInner('
'); // Change if required } }; var wrapContentBlocks = function() { var current = $(), sectionClasses = [], newItems; // Find start and end points for each row $('.row-start, .row-end, .row-mid').each(function() { var $this = $(this); // If starting new row call wrap function and reset variables if ($this.hasClass('row-start')) { doTheWrap(current, sectionClasses); current = $(); sectionClasses = []; } current = current.add(this); newItems = $this.attr('class').match(/\S*-section\w*/g); // Get section classes from content block and add to sectionClasses array if (newItems !== null && newItems !== undefined) { sectionClasses = addToArray(sectionClasses, newItems); } // Remove section classes from content blocks once they've $this.attr('class', function(i, c) { return c.replace(/\S*-section\w*/g, ''); }); }); doTheWrap(current, sectionClasses); }; var doTheWrap = function(d, sectionClasses) { var sectionId = ''; // If sectionClasses contains a hashed class then make it the id for this section and remove from main class list for (var i = 0; i < sectionClasses.length; i++) { if (sectionClasses[i].match(/#\w*-section\w*/g)) { sectionId = 'id="' + sectionClasses[i].replace('#', '') + '"'; sectionClasses.splice(i, 1); } } // If classes exist convert array to string and remove commas else set to an empty string if (sectionClasses !== null && sectionClasses !== undefined) { sectionClasses = sectionClasses.join(' '); } else { sectionClasses = ''; } // Wrap content block with the required HTML and classes d.wrapAll(''; } // If the session times are different include into agendaDate string if (differentTime && endtime === null) { agendaData += convertTime(starttime); } else if (differentTime) { agendaData += convertTime(starttime) + ' - ' + convertTime(endtime); } if (descriptions.length > 0) { agendaData += '
' + name.replace(",", "") + ', ' + title.replace(",", "") + ', ' + company.replace(",", "") + '
' + bios + '