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
// Plugin Idea | |
onScroll : function() { // disable hover events on scroll | |
clearTimeout(_.scrollTimer); // clear timer which checks when user stops scrolling | |
if(!_.timerSet){ // if we haven't started our first fire, fire it | |
_.timerSet = true; // tell us we've fired so we only fire once | |
_.scrollEnableTimer = setTimeout(function(){ | |
if(_.timerSet){ | |
$('body').addClass('disable-hover'); |
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
/** | |
* Unit | |
*/ | |
Site.Unit = function() { | |
var Data = { | |
setCache : function(){ | |
} | |
}; |
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
var s, Self = { | |
_data : { | |
}, | |
init : function(){ | |
Self.loadPosts(); | |
}, |
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
parseInt(new Date()/1000); |
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
/** | |
* Functionality: | |
* - adds breakpoint attributes to body & fires callbacks | |
* | |
* todo: callback params, height, matchMedia? | |
*/ | |
var extend = require('extend'); | |
var _data = { | |
currentBreakpoints : [], |
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
var gulp = require('gulp'); | |
var browserify = require('browserify'); | |
var uglify = require('gulp-uglify'); | |
var source = require('vinyl-source-stream'); | |
var buffer = require('vinyl-buffer'); | |
var less = require('gulp-less'); | |
var autoprefixer = require('gulp-autoprefixer'); | |
var rename = require('gulp-rename'); | |
var browserSync = require('browser-sync'); |
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
/** | |
* Functionality: | |
* - scrolls to an element using Velocity | |
* | |
* Assumes: | |
* - window.jQuery = window.$ = require('jquery'); | |
*/ | |
var velocity = require('velocity-animate'); | |
// Public |
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
/** | |
* Functionality: | |
* - returns auto height value in pixels of an element | |
* | |
* Pass in element, and optional class for dummy wrapper | |
*/ | |
module.exports = function(element, uniqueClass){ | |
var wrapper = document.createElement('div'); | |
var clone = element.cloneNode(true); |
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
// thanks John Resig (http://ejohn.org/projects/flexible-javascript-events/) | |
function addEvent( obj, type, fn ) { | |
if ( obj.attachEvent ) { | |
obj['e'+type+fn] = fn; | |
obj[type+fn] = function(){obj['e'+type+fn]( window.event );} | |
obj.attachEvent( 'on'+type, obj[type+fn] ); | |
} else | |
obj.addEventListener( type, fn, false ); | |
} |
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
/** | |
* @param target is any DOM Element or EventTarget | |
* @param type Event type (i.e. 'click') | |
*/ | |
module.exports = function(target, type) { | |
var doc = document; | |
if (doc.createEvent) { | |
var event = new Event(type); | |
target.dispatchEvent(event); | |
} else { |