This file contains 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
/** | |
* Created by abaulch on 02/12/15. | |
*/ | |
Handlebars.registerHelper('json', function(obj) { | |
return JSON.stringify(obj); | |
}); |
This file contains 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
events.subscribe('button-clicked', function(data) { | |
alert(data.text); | |
}); | |
$('button').on('click', function(e) { | |
e.preventDefault(); | |
events.publish('button-clicked', { | |
text: $(this).text() | |
}); |
This file contains 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
@mixin bp($point) { | |
@media (max-width: ($point)) { | |
@content; | |
} | |
} |
This file contains 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
define(function() { | |
'use strict'; | |
var pubSub = function pubSubFn() { | |
var topics = {}; | |
function subscribe(topic, listener) { | |
// Create the topic's object if not yet created | |
if (!topics[topic]) { | |
topics[topic] = { |
This file contains 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
// stuff to do before the page un loads | |
if ( $('[data-page-name="contact"]').length ) { | |
var count = 0; | |
window.onbeforeunload = function(e) { | |
var contactUsForm = $('[data-page-name="contact"]').find('.contact-us-form'); | |
var requiredFields = contactUsForm.find('[data-val-required]'); | |
var completedFields = []; | |
var missedFields = []; | |
This file contains 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
@mixin placeholder { | |
::-webkit-input-placeholder {@content} | |
:-moz-placeholder {@content} | |
::-moz-placeholder {@content} | |
:-ms-input-placeholder {@content} | |
} |
This file contains 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
<!--[if gte IE 9]><!--> | |
<svg>Goes here</svg> | |
<!--<![endif]--> | |
<!--[if lte IE 8]> | |
Fallback image goes here for IE8 | |
<img src="http://placehold.it/300x300" alt="Fallback image" /> | |
<![endif]--> |
This file contains 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
<!--[if lt IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="lt-ie10 lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="lt-ie10 lt-ie9" lang="en"> <![endif]--> | |
<!--[if IE 9]> <html class="lt-ie10" lang="en"> <![endif]--> | |
<!--[if gt IE 9]><!--> | |
<html class="" lang="en"> | |
<!--<![endif]--> |
This file contains 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
module.exports = function(variable) { | |
//get query params and remove the beginning '?' | |
var query = window.location.search.substring(1); | |
//split on ampersand | |
var vars = query.split('&'); | |
//loop through 'vars' array | |
for (var i = 0; i < vars.length; i++) { | |
// split on '=' to give key value pairs |
NewerOlder