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 vendorPrefix = (function (de, e, cs) { | |
var prefix = ((cs(de.appendChild(e)).cssText || '').match(/\W-[^-]+/) || [''])[0].substr(2); | |
de.removeChild(de.lastChild); | |
return prefix; | |
})(document.documentElement, document.createElement('a'), window.getComputedStyle || function (e) { return e.currentStyle; }); |
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 getElementOffset(el) | |
{ | |
for (var offsetTop = 0, offsetLeft = 0; el.offsetParent; el = el.parentNode) | |
{ | |
offsetTop += el.offsetTop; | |
offsetLeft += el.offsetLeft; | |
} | |
return { | |
offsetTop: offsetTop, |
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
// every so often i feel the need to reinvent the wheel just to make sure i prefer it | |
(function (win, doc) { | |
/* String Helpers */ | |
function trim(str) { | |
return str.replace(/^\s+|\s+$/g, ''); | |
} | |
function padName(list) { |
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
// TemplateJS v3.1.1 MIT/GPL2 @jon_neal | |
(function (global) { | |
function escapeJS (str) { | |
return str.replace(/"/g, '\\"').replace(/\n/g, '\\n').replace(/\r/g, '\\r'); | |
} | |
function TemplateWalk (str, chars, helpers, instance) { | |
// check for the opening delimiters and init our array buffer | |
var index = str.indexOf(chars.START_PROP), buffer = '', helper; |
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
// localStorage For Everybody (but namely old ie) | |
!this.localStorage && ('addBehavior' in document.documentElement) && (this.localStorage = (function (glo) { | |
var localStorageElement = document.appendChild(document.createElement('x-local-storage')); | |
var localStorageKey = 'localStorage'; | |
var localStorageDataPrefix = 'data-'; | |
localStorageElement.addBehavior('#default#userData'); | |
localStorageElement.load(localStorageKey); |
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
('HTMLCanvasElement' in this) && (function () { | |
HTMLCanvasElement.prototype.trim = function (opts) { | |
opts = opts || {}; | |
var | |
element = this, | |
bound = { | |
top: null, | |
left: null, | |
right: null, |
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 property(obj, prop, val) { | |
for (var o = obj, i = 0, a = prop.split('.'), l = a.length; i < l; ++i) { | |
if (!(a[i] in o)) return; | |
if (val && i == l - 1) { | |
o[a[i]] = val; | |
} | |
o = o[a[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
/* Image Replacement */ | |
.ir | |
{ | |
direction: ltr; | |
font: 0/0 serif; | |
overflow: hidden; | |
text-indent: 100%; | |
white-space: nowrap; | |
} |
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 refreshLink(link) { | |
var instance = this; | |
var pageDomain = window.location.href.match(/\/\/([^\/]+)/); | |
var linkDomain = link.href.match(/\/\/([^\/]+)/); | |
if (!pageDomain || !linkDomain || pageDomain[1] != linkDomain[1]) { | |
return instance; | |
} |
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
HTMLCanvasElement.prototype.brightness = function (value) { | |
var | |
canvas = this, | |
context = canvas.getContext('2d'), | |
imageData = context.getImageData(0, 0, canvas.width, canvas.height), | |
canvasPixelArray = imageData.data, | |
canvasPixelArrayLength = canvasPixelArray.length, | |
i = 0; | |
value = parseFloat(value) || 0; |