This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function validatePhoneNumber(phonenumber) { | |
var pattern = /^(?:(?:\(\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\s*\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\s*(?:[.-]\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\s*(?:[.-]\s*)?([0-9]{4})(?:\s*(?:\s+|#|x\.?|ext\.?|extension)\s*(\d+))?$/i; | |
var matches = []; | |
var validnumber = []; | |
validnumber.unformatted = ''; | |
if (phonenumber.length > 0) { | |
if (pattern.test(phonenumber)) { | |
matches = phonenumber.match(pattern); | |
// split phone number input into phone number format array |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Detect IE and iOS and add browser class to document | |
var tag = document.getElementsByTagName('html')[0]; | |
var ua = navigator.userAgent; | |
var version = ''; | |
if (/msie (\d+)/i.test(ua)) { | |
version = 'IE IE-' + /msie (\d+)/i.exec(ua)[1]; | |
if (tag.className.length > 0) { | |
tag.className = tag.className + ' ' + version; | |
} else { | |
tag.className = version; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function contentOffset() { | |
var droppx = /\d+/; | |
var navheight = $('header > .navbar').css('height'); | |
var subnavheight = $('header > .navbar + .sub-nav').css('height'); | |
var breadcrumbheight = $('.breadcrumb').css('height'); | |
var offset = 0; | |
if ($('.page-header').length > 0) { | |
var pageheaderheight = $('.page-header').css('height'); | |
offset = parseInt(navheight.match(droppx)) + parseInt(subnavheight.match(droppx)) + parseInt(breadcrumbheight.match(droppx)) + parseInt(pageheaderheight.match(droppx)) + 1; | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable link clicks to prevent page scrolling | |
$('a[href="#fakelink"]').on('click', function (e) { | |
e.preventDefault(); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove no-js class | |
var tag = document.getElementsByTagName('html')[0]; | |
if (tag.className.length > 0 && /no-js/i.test(tag.className)) { | |
tag.className = tag.className.replace(/\s?no-js\s?/i, ''); | |
} else { | |
tag.className = ''; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Play very small videos in modal box | |
if ($(window).width() > 750) { | |
var allvideos = $('video'); | |
// Hide controls for very small videos | |
for (var i = 0; i < allvideos.length; i++) { | |
if ($(allvideos[i]).width() < 470) { | |
$(allvideos[i]).removeAttr('controls'); | |
// Insert poster image for IE 9 | |
if ($('html').hasClass('IE-9')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="modal-trigger"> | |
<canvas></canvas> | |
<video preload="auto" controls="controls" poster="img/why-autologel-poster.png"> | |
<source src="media/why-autologel.mp4" type='video/mp4'> | |
<source src="media/why-autologel.webm" type='video/webm'> | |
</video> | |
</div> | |
<!-- Modal Window --> | |
<div class="modal fade" id="modal-window" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> | |
<div class="modal-dialog"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure focused elements aren't hidden by fixed positioned header or footer | |
function unhideInput(formelement) { | |
formelement.onfocus = function () { | |
var paddingheight = 30; | |
var headerheight = document.getElementsByTagName('header')[0].offsetHeight; | |
var footerheight = document.getElementsByTagName('footer')[document.getElementsByTagName('footer').length - 1].offsetHeight; | |
var viewportheight = window.innerHeight; | |
var elementpos = this.getBoundingClientRect(); | |
if ((elementpos.top <= (headerheight + paddingheight)) || (elementpos.bottom >= (viewportheight - footerheight))) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> |
OlderNewer