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.sml){ | |
sml.ns('sml.util'); | |
} | |
;(function(ns){ | |
var Events = ns.Events = function(options){ | |
var _events = {} | |
,key; | |
for(key in options){ |
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
<script> | |
var radical = function(name){ | |
alert(name || 'Random'); | |
} | |
exports.radical = radical; | |
</script> |
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 Events = new Class({ | |
Extends: Events, | |
$events: {}, | |
addEvent: function(type, fn, internal){ | |
var events = this.$events[type] = this.$events[type] || []; | |
if(events == 1){ | |
fn(); | |
return this; | |
} else { |
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
/* | |
Requires: | |
- Events: https://gist.github.com/884484 | |
- Extend: https://gist.github.com/1049896 | |
- Namespace: https://gist.github.com/1006005 | |
*/ | |
SML = Object.namespace('SML',new Events); | |
window.fbAsyncInit = function(){ |
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 (!Function.prototype.construct) | |
Function.prototype.construct = function(aArgs) { | |
if (aArgs.constructor !== Array) | |
throw new TypeError("second argument to Function.prototype.construct must be an array"); | |
var aBoundArgs = Array.prototype.concat.apply([null], aArgs), | |
fBound = this.bind.apply(this, aBoundArgs); | |
return new fBound(); |
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
$(document).bind('FB.ready',function(){ | |
console.log('FB is ready'); | |
FB.api('/me',function(response){ | |
console.log(response); | |
}); | |
}); | |
var _FB = { | |
count: 0 | |
,interval : setInterval(function(){ |
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(jq){ | |
var _events = []; | |
var _FB = { | |
count: 0 | |
,interval : setInterval(function(){ | |
try{ | |
if(FB._session && (typeof FB._session !== 'undefined')){ | |
clearInterval(_FB.interval); | |
jq.each(_events, function(indexhereisretarded,fn){ | |
fn(); |
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_){ | |
var State = _NAMESPACE_.State = function(){ | |
return { | |
_states:{} | |
,_stateData: {} | |
,setState: function(name, data) { | |
if(this._states[name] && typeof data == 'undefined'){ | |
this.setState(this._states[name]); | |
return false; | |
} |