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
export default (routes) => { | |
return { | |
fire (func,funcname, args){ | |
funcname = (funcname === undefined) ? 'init' : funcname; | |
if (func !== '' && routes[func] && typeof routes[func][funcname] == 'function'){ | |
routes[func][funcname](args); | |
} | |
}, | |
load() { | |
var bodyId = document.body.id; |
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
function throttle(set, limit, threshold, callback) { | |
let timer = 0; | |
window.setInterval(() => { | |
timer++; | |
}, threshold); | |
let i = 0; | |
let requestChunk = timer; | |
let requestsSent = 0; | |
while (i < set.length) { | |
// requests within limit |
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 prepend = concatStrings('prependWith-'), | |
append = concatStrings('-appendWith', true); | |
console.log(prepend('baseString')); // outputs prependWith-baseString | |
console.log(append('baseString')); // outputs baseString-appendWith | |
function concatStrings (classFragmentA, reverse) { | |
return function (classFragmentB) { | |
var fragments = [classFragmentA, classFragmentB]; | |
return (reverse) ? fragments.reverse().join('') : fragments.join(''); |
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
/* | |
* Author: Nathanael Smith | |
* Description: This module stores functions in a run queue until they're needed to be executed. | |
*/ | |
var ExeQue = (function(){ | |
function store (location, func) { | |
var queue = getQueue(location).concat(func); | |
if (location instanceof jQuery) { |
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 { | |
// extends | |
// includes | |
// element styles | |
// media queries | |
// element states |
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
(function(){ | |
var autoTab = { | |
keysPressed : 0, | |
init : function () { | |
this.keyEvents(); | |
}, | |
keyEvents : function () { | |
var self = this; self.keyEvents.validKey = false; | |
$('input[maxlength]').on('keypress', function(e){ | |
self.keyEvents.validKey = 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
// Normalize & Layout | |
article, aside, details, figcaption, figure, footer, | |
header, hgroup, nav, section, summary { display: block; } | |
audio, canvas, video { | |
display: inline-block; | |
*display: inline; | |
*zoom: 1; | |
} | |
audio:not([controls]) { display: none; } | |
[hidden] { display: none; } |
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
$(function(){ | |
$('.block-grid').each(function(index){ | |
var blocks = $.makeArray($(this).find('.block')).sort(sortByHeight)[0]; | |
$(this).find('.block').height($(blocks).height()); | |
}); | |
}); | |
function sortByHeight(a,b) { | |
return ($(b).height() - $(a).height()); | |
} |
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
// external link speedbump | |
$.expr[":"].external = function (a) { | |
// DO NOT INCLUDE THE FOLLOWING MATCHES: EMAIL LINKS, TELEPHONE LINKS, HOSTNAME | |
return !a.href.match(/^mailto\:/) && !a.href.match(/^tel\:/) && a.hostname != location.hostname | |
}; | |
$('a:external').click(function(e){ | |
e.preventDefault(); | |
href = $(this).attr('href'); | |
$.colorbox({ | |
href: '/_diffs/templates/portal_pop_up-speedbump.html', |
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
<span class="custom-upload"> | |
<i class="icomoon-upload"></i> | |
<input type="file" name="receipt" id="receipt" class="in-lrg"> | |
<input type="text" name="file-name" id="file-name" class="in-lrg" disabled> | |
</span> |
NewerOlder