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
{"lastUpload":"2018-05-01T14:49:08.468Z","extensionVersion":"v2.9.1"} |
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
//assuming 'listItems' is non-alphabetical unordered list (response from server, etc.) | |
var finalArr = []; | |
var idx; | |
_.each(listItems, function(el, i) { | |
// _.sortedIndex magic here... binary compare; | |
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
//removes the need for 'this' | |
function constructor(spec) { | |
let {member} = spec, | |
{other} = other_constructor(spec), | |
method = function() { | |
//member, other, method | |
}; | |
return Object.freeze({ | |
method, |
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 monobindCSSAnimationListener(element, type, bind, callback) { | |
var pfx = ["webkit", "moz", "MS", "o", ""], | |
i = 0, | |
j = pfx.length; | |
element = $(element); | |
for (; i < j; i++) { | |
if (!pfx[i]) { | |
type = type.toLowerCase(); | |
} | |
if (bind) { |
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 getStringsFromJson(json) { | |
var values = []; | |
for (var prop in json) { | |
(function findStr(obj) { | |
if (typeof obj == 'string') { | |
values.push(obj); | |
} else if (obj instanceof Array) { | |
for (var i = obj.length - 1; i > -1; i--) { | |
var val = obj[i]; | |
findStr(val); |
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
//jquery | |
var a_s = $('a'); | |
a_s.each(function(i, e) { | |
(function(a, num) { | |
a.on('click', function(e) { | |
e.preventDefault(); | |
console.log('I\'m number ' + num); | |
}); | |
})($(e), i); |
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
$.fn.numbersOnlyField = function() { | |
var element = this, | |
validKeys = [48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 8, 9], | |
currentValue; | |
function onkeydown_field(e) { | |
currentValue = element.val(); | |
} | |
function onkeyup_field(e) { | |
var value = element.val(); | |
if (/[\d]+$/g.test(value)) { |
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
$.fn.phoneNumberFormatter = function(format) { | |
/*supported formats: | |
* '(xxx)-xxx-xxxx', | |
* 'xxx-xxxx', | |
* '(xxx)xxx-xxxx', | |
* '+x(xxx)xxx-xxxx', | |
* '+x-(xxx)-xxx-xxxx' | |
* */ | |
var element = this, | |
avoidKeyCodes = [8, 39, 37]; |
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
/*Smaller than standard 960 (devices and browsers)*/ | |
@media only screen and (max-width: 959px) {} | |
/*Tablet Portrait size to standard 960 (devices and browsers)*/ | |
@media only screen and (min-wdth: 768px) and (max-width: 959px) {} | |
/*All Mobile Sizes (devices and browsers)*/ | |
@media only screen and (max-width:767px) {} | |
/*Mobile Landscape Size to Tablet Portrait (devices and browsers)*/ |
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
dust.helpers.formatDate = function(chunk, context, bodies, params) { | |
var value = dust.helpers.tap(params.value, chunk, context), | |
timestamp, | |
month, | |
date, | |
year; | |
timestamp = new Date(value); | |
month = timestamp.getMonth() + 1; | |
date = timestamp.getDate(); | |
year = timestamp.getFullYear(); |
NewerOlder