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 EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,253}[a-zA-Z0-9])?)*$/; | |
var isValidEmailAddress = function(email) { | |
return EMAIL_REGEX.test(email); | |
}; |
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 parseQueryParams = function(params) { | |
if(!params) { return {}; } | |
return _.reduce(params.split('&'), function (hash, param) { | |
var p = param.split('='); | |
hash[p[0]] = p[1]; | |
return hash; | |
}, {}); | |
}; |
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
return _.reduce($el.serializeArray(), function (hash, pair) { | |
hash[pair.name] = pair.value; | |
return hash; | |
}, {}); |
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 (root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
// AMD. Register as an anonymous module. | |
define(['bean', 'underscore'], function (bean, _) { | |
// Also create a global in case some scripts | |
// that are loaded still are looking for | |
// a global even when an AMD loader is in use. | |
return (root.Flotr2 = factory(bean, _)); | |
}); | |
} else { |
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
// Change underscore's templating from ERB-style to Mustache-style | |
_.templateSettings = { | |
interpolate : /\{\{(.+?)\}\}/g | |
}; |
NewerOlder