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
define(['block/mixin','template/mixin', 'mediator/mixin'], | |
function ( BlockMixin, TemplateMixin, EventsMixin, undef ) { | |
var slice = Array.prototype.slice | |
,toString = Object.prototype.toString; | |
function typeOf (obj) { | |
return toString.call(obj).match(/\s([a-zA-Z]+)/)[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
#!/bin/sh | |
# Usage: generate-fiddle <folder> | |
# Creates a folder and adds some files commonly used with JSFiddle | |
set -e | |
# Create folder | |
mkdir $1 | |
cd $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
if(!Object.extend) | |
Object.extend = function(original){ | |
var i = (original)?1:0 | |
,args = arguments | |
,original = original || this | |
,length = args.length | |
,key,extended | |
for (; i < length; i++){ | |
extended = args[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
if(!Object.namespace) | |
Object.namespace = function( str ){ | |
if(!str) return; | |
var i = 0 | |
,base = window | |
,shards,length | |
if(str.indexOf("::") !== -1){ | |
shards = str.split("::"); | |
base = window[shards[0]] = window[shards[0]] || {}; |
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(global,namespace){ | |
if(!namespace) namespace = global; | |
/* | |
--- | |
name: Hash | |
authors: ["Chase Wilson"] | |
requires: [typeOf] | |
provides: [Hash] | |
... | |
*/ |
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 REGEX = /:(latch(ed$)?)/i; | |
function removeLatched(type){ | |
if(type.indexOf(':')){ | |
if(REGEX.test(type)){ | |
type = type.replace(REGEX,''); | |
this._latched[type] = 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
if(!window.Oakley){ | |
Oakley = {}; | |
if(!Oakley.products){ | |
Oakley.products = {}; | |
} | |
} | |
Oakley.products.jawbone = { | |
"product_key": "jawbone", |