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
# DocPad Configuration File | |
# http://docpad.org/docs/config | |
# Define the DocPad Configuration | |
docpadConfig = { | |
events: | |
generateAfter: (opts, next) -> | |
if 'static' in @docpad.getEnvironments() | |
@docpad.log('info', 'generateAfter: starting grunt task generateAfter') |
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
{ | |
"requireCurlyBraces" : [ | |
"catch", | |
"do", | |
"else", | |
"for", | |
"if", | |
"try", | |
"while" | |
], |
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
{ | |
// Enforcing options | |
"bitwise" : true, // Warn when using bitwise operators, most of the time it is a typo | |
"camelcase" : true, // Force all variable names to use either camelCase style or UPPER_CASE with underscores. | |
"curly" : true, // Always put curly braces around blocks in loops and conditionals | |
"eqeqeq" : true, // Always compare using === and !== | |
"forin" : true, // Force the use of hasOwnProperty() checks when iterating object properties | |
"freeze" : true, // Prohibit overwriting prototypes of native objects like Array | |
"immed" : true, // Prohibits the use of immediate function invocations without wrapping them in parentheses | |
"indent" : 4, // Tab width for the code |
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
/* | |
* Robert Penner's algorithm for an cubic ease out function | |
* @param {Number} currentIteration The current iteration of the animation, on each subsequent | |
* call this should be increased by 1 | |
* @param {Number} startValue The start value, this should be a constant throughout the | |
* animation. | |
* @param {Number} changeInValue The difference between the start value and the desired end value | |
* @param {Number} totalIterations The number of iterations over which we want to go from start | |
* to end | |
* @return {Number} The value for the current step in the animation |
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 NO_TRANSITIONS = 'no-transitions'; | |
/** | |
* This method tries to determine the name of the transitionend event, it | |
* could be the user's browser is using a prefixed version | |
*/ | |
function getTransitionEndEventName () { | |
// 1: The variable we use to keep track of the current key when | |
// iterating over the transitions object | |
// 2: An element we can use to test if a CSS property if known to the | |
// browser |
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
/** | |
* Iterates over the properties of an object and calls a callback function when the | |
* key belongs to the object itself and not to its prototype chain. | |
* | |
* The iterate method will iterate over all properties but can be stopped by | |
* returning true from the callback method. | |
* | |
* @param {Object} source The object whose properties should be iterated over | |
* @param {Function} callback The function to be called for each property defined | |
* on the source object itself and not its prototype |
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
/** | |
* This method is used to scroll a bit closer to the top of the window. As long as the top | |
* hasn't been reached the method will call itself at the next animation frame. | |
*/ | |
_animationLoop: function() { | |
var self = this; | |
// Perform a step of the animation to go to the top of the window | |
window.scrollTo(0, this._easeOutCubic(this._iteration, this._scrollPosition, -this._scrollPosition, this._maxIterations)); | |
// Increase the iteration counter |
NewerOlder