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.getUrlVars | |
* | |
* Copyright 2013, Matthew Cobbs | |
* MIT Licensed | |
*/ | |
/*global jQuery */ | |
(function (window, $) { | |
"use strict"; |
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 (window, undefined) { | |
var Math = window.Math, | |
a = [0, 1]; | |
if (!Math.fibonacci) { | |
Math.fibonacci = function (n) { | |
var i; | |
if (a[n] === undefined) { |
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 toString = Object.prototype.toString, | |
slice = Array.prototype.slice, | |
/** | |
* determines type of passed argument | |
*/ | |
toType = function (thing) { | |
return toString.call(thing).match(/\s(\w+)/)[1].toLowerCase(); |
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
/** | |
* takes an input element and validates its value as a date by converting | |
* to a date object and then back to a string. Defaults to month-day-year order | |
* | |
* @param {HTMLElement} dateField The HTML input element to validate | |
* @param {Boolean} [isDMY] Is the value in day-month-year order? Optional | |
* @return {Boolean} is valid | |
*/ | |
function isValidDate(dateField, isDMY) { | |
var strDate = dateField.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
if (!String.prototype.trim) { | |
String.prototype.trim = function () { | |
return this.replace(/^\s+|\s+$/gi, ''); | |
} | |
} | |
function removeClass(el, className) { | |
var curClass = el.className, | |
re = new RegExp('\\b' + className + '\\b', 'g'); | |
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.prototype.tail = function (cb) { | |
var fn = this; | |
return function () { | |
var ret = fn.apply(this, arguments); | |
return cb ? cb.apply(this, [].concat(ret)): ret; | |
}; | |
}; |
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 (window) { | |
var document = window.document; | |
var getType = function (thing) { | |
return Object.prototype.toString.call(thing).match(/\s(\w+)/)[1].toLowerCase(); | |
}; | |
var getIsType = function (type) { | |
return (function (thing) { |
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 (window) { | |
// Return a random integer from 0 to `d` | |
function r(d) { | |
return Math.round(Math.random() * --d); | |
} | |
// Roll the dice. Returns a string of integers to represent which | |
// side each die fell on ("0" is the first side). | |
// |
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
// Example Use | |
(function () { | |
function success() { | |
console.log("success: ", this.src); | |
} | |
function failure() { | |
console.log("failure: ", this.src); | |
} |
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.schema | |
// | |
// Ported from dojox.json.schema release 1.6.1 | |
// Based on draft-zyp-json-schema-02 | |
// http://tools.ietf.org/html/draft-zyp-json-schema-02 | |
// | |
(function ($) { | |
var schema; |
OlderNewer