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
| /* ============================================= | |
| Name: Josh McDonald | |
| Company: CrystalCommerce | |
| Copyright: 2013, All Rights Reserved | |
| Table of Contents: | |
| _General Site Globals |
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
| // Each statement returns true or false based on current viewport | |
| // The EM units are based on html, body { font-size: 100%; } CSS | |
| window.MQ = { | |
| // max-width 640px mobile-only styles | |
| small : (matchMedia('only screen and (max-width: 40em)').matches), | |
| // min-width 641px and max-width 1024px screen only | |
| medium : (matchMedia('only screen and (min-width:40.063em) and (max-width:64em)').matches), |
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
| // Define class to hold all cart drop related items | |
| cartDrop: { | |
| // Initialize the cart bindings, or whatever | |
| init: function() { ... }, | |
| events: { | |
| bind: function() { | |
| // sample: $(cart-trigger).on(click, BERG.cartDrop.events.open); |
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
| /* | |
| Author: Josh McDonald | |
| Twitter: @onestepcreative | |
| Website: joshmcdonald.net | |
| A simple helper to log color coded messages to the | |
| javascript console, using a shorter syntax to console.log | |
| You can leave your dev.log() statements scattered throughout |
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
| .step { | |
| transition: opacity 200ms ease-in-out; | |
| opacity: 0; | |
| visibility: hidden; | |
| z-index: 4; | |
| } | |
| .step.active { visibility: visible; opacity: 1 } |
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 chunkitup(arr, chunks) { | |
| var len = arr.length; | |
| var out = []; | |
| var i = 0; | |
| while (i < len) { | |
| var chunkSize = Math.ceil((len - i) / chunks--); |
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 scopeJacker(name) { | |
| var mapper = function() { | |
| dev.log('mapper called'); | |
| var childmapper = function() { | |
| dev.log('child mapper with param: ' + name); |
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
| var Obj = { | |
| each: function(obj, iterator, context) { | |
| var i, o; | |
| // native forEach on arrays | |
| if ('forEach' in obj) { | |
| obj.forEach(iterator, context); | |
| } | |
| // arrays | |
| else if(obj.length !== undefined) { |
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
| var S = function (selector, context) { | |
| if (typeof selector === 'string') { | |
| if (context) { | |
| var cont; | |
| if (context.jquery) { | |
| cont = context[0]; | |
| if (!cont) return context; | |
| } else { | |
| cont = context; | |
| } |
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
| var isjquery = function(data) { | |
| // If data is already a jQuery object | |
| if(data instanceof jQuery) { | |
| // Do nothing different | |
| data = data; | |
| // Otherwise | |
| } else { |