Created
September 16, 2009 19:16
-
-
Save ChrisRicca/188151 to your computer and use it in GitHub Desktop.
facebook xfbml
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
Close Window | |
/* HTTP Host: static.ak.fbcdn.net */ | |
/* Generated: September 8th 2009 11:13:34 PM PDT */ | |
/* Machine: 10.16.140.103 */ | |
/* Source: Global Cache */ | |
/* Location: js/connect.js.pkg.php h:5s5y4rmx */ | |
/* Locale: nu_ll */ | |
/* Path: js/connect.js.pkg.php */ | |
if(!window.FB) { | |
FB = { | |
}; | |
} | |
FB.Type = { | |
createNamespace : function(name) { | |
if(!FB.__namespaces) { | |
FB.__namespaces = { | |
}; | |
} | |
if(!FB.__rootNamespaces) { | |
FB.__rootNamespaces = []; | |
} | |
if(FB.__namespaces[name]) { | |
return; | |
} | |
var ns = window; | |
var nameParts = name.split('.'); | |
for(var i = 0; i < nameParts.length; i++) { | |
var part = nameParts[i]; | |
var nso = ns[part]; | |
if(!nso) { | |
ns[part] = nso = { | |
}; | |
if(i == 0) { | |
FB.__rootNamespaces[FB.__rootNamespaces.length] = nso; | |
} | |
} | |
ns = nso; | |
} | |
} | |
, createEnum : function(fields, flags) { | |
var cls = function() { | |
}; | |
cls.prototype = fields; | |
for(var field in fields) { | |
cls[field] = fields[field]; | |
} | |
if(flags) { | |
cls.__flags = true; | |
} | |
return cls; | |
} | |
, createClass2 : function(cls, baseType) { | |
if(baseType && typeof(baseType) == "string") { | |
baseType = eval(baseType); | |
} | |
cls.prototype.constructor = cls; | |
this.extend(cls, FB.Type.Methods); | |
cls.__baseType = baseType || Object; | |
if(baseType) { | |
cls.__basePrototypePending = true; | |
} | |
} | |
, createClass : function(fullName, info) { | |
if(arguments.length == 1 && typeof(fullName) != "string") { | |
return this._createClass(fullName); | |
} | |
else { | |
var i = fullName.lastIndexOf('.'); | |
var className; | |
var scope = window; | |
if(i > 0) { | |
var ns = fullName.substring(0, i); | |
this.createNamespace(ns); | |
className = fullName.substring(i + 1); | |
scope = eval(ns); | |
} | |
else { | |
className = fullName; | |
} | |
scope[className] = this._createClass(info); | |
} | |
} | |
, _createClass : function(info) { | |
var cls = info['ctor'] || function() { | |
}; | |
if(info['static_ctor']) { | |
this.addStaticInit(info['static_ctor']); | |
} | |
if(info['instance']) { | |
cls.prototype = info['instance']; | |
} | |
if(info['static']) { | |
this.extend(cls, info['static']); | |
} | |
this.createClass2(cls, info['base']); | |
return cls; | |
} | |
, addStaticInit : function(callback) { | |
if(!FB.Type._pendingInits) { | |
FB.Type._pendingInits = []; | |
} | |
FB.Type._pendingInits[FB.Type._pendingInits.length] = callback; | |
window.setTimeout(FB.Type.runPendingInits, 0); | |
} | |
, runPendingInits : function() { | |
if(FB.Type._pendingInits) { | |
var callbacks = FB.Type._pendingInits; | |
FB.Type._pendingInits = null; | |
var c = callbacks.length; | |
for(var i = 0; i < c; i++) { | |
callbacks[i](); | |
} | |
} | |
} | |
, extend : function(destination, source) { | |
for(var property in source)destination[property] = source[property]; | |
return destination; | |
} | |
, getInstanceType : function(inst) { | |
return inst.constructor; | |
} | |
}; | |
FB.Type.Methods = { | |
setupBase : function() { | |
if(this.__basePrototypePending) { | |
var baseType = this.__baseType; | |
if(baseType.__basePrototypePending) { | |
baseType.setupBase(); | |
} | |
for(var memberName in baseType.prototype) { | |
var memberValue = baseType.prototype[memberName]; | |
if(!this.prototype[memberName]) { | |
this.prototype[memberName] = memberValue; | |
} | |
} | |
delete this.__basePrototypePending; | |
} | |
} | |
, constructBase : function(instance, args) { | |
if(this.__basePrototypePending) { | |
this.setupBase(); | |
} | |
if(!args) { | |
this.__baseType.apply(instance); | |
} | |
else { | |
this.__baseType.apply(instance, args); | |
} | |
} | |
, callBase : function(instance, name, args) { | |
var baseMethod = this.__baseType.prototype[name]; | |
if(!args) { | |
return baseMethod.apply(instance); | |
} | |
else { | |
return baseMethod.apply(instance, args); | |
} | |
} | |
, get_baseType : function() { | |
return this.__baseType || null; | |
} | |
} | |
FB.$ = function(id) { | |
return document.getElementById(id); | |
} | |
FB.Debug = FB.Type.createClass( { | |
static : { | |
logLevel : 0, assert : function(condition, message) { | |
if(FB.Debug.logLevel > 0 &&!condition) { | |
message = 'Assert failed: ' + message; if(confirm(message + '\r\n\r\nBreak into debugger?')) { | |
FB.Debug._fail(message); } | |
} | |
} | |
, writeLine : function(message) { | |
if(FB.Debug.logLevel > 0) { | |
if(window.Debug && window.Debug.writeln) { | |
window.Debug.writeln(message); } | |
else if(window.console) { | |
if(window.console.debug) { | |
window.console.debug(message); } | |
else if(window.console.log) { | |
window.console.log(message); } | |
} | |
else if(window.opera && window.opera.postError) { | |
window.opera.postError(message); } | |
} | |
} | |
, logLine : function(logLevel, message) { | |
if(logLevel <= FB.Debug.logLevel) { | |
FB.Debug.writeLine(message); } | |
} | |
, _fail : function(message) { | |
FB.Debug.writeLine(message); debugger; } | |
, _dumpCore : function(sb, object, name, indentation, dumpedObjects) { | |
if(object === null) { | |
sb.appendLine(indentation + name + ': null'); return; } | |
switch(typeof(object)) { | |
case'undefined':sb.appendLine(indentation + name + ': undefined'); break; case'number':case'string':case'boolean':sb.appendLine(indentation + name + ': ' + object); break; default : if(object instanceof Date || object instanceof RegExp) { | |
sb.appendLine(indentation + name + ': ' + object); break; } | |
if(FB.Sys.contains(dumpedObjects, object)) { | |
sb.appendLine(indentation + name + ': ...'); break; } | |
dumpedObjects[dumpedObjects.length] = object; var recursiveIndentation = indentation + ' '; if(object.tagName) { | |
sb.appendLine(indentation + name + ': <' + object.tagName + '>'); var attributes = object.attributes; for(var i = 0; i < attributes.length; i++) { | |
var attrValue = attributes[i].nodeValue; if(attrValue) { | |
FB.Debug._dumpCore(sb, attrValue, attributes[i].nodeName, recursiveIndentation, dumpedObjects); } | |
} | |
} | |
else { | |
sb.appendLine(indentation + name + ': '); for(var field in object) { | |
var v = object[field]; if(!(v instanceof Function)) { | |
FB.Debug._dumpCore(sb, v, field, recursiveIndentation, dumpedObjects); } | |
} | |
} | |
FB.Sys.remove(dumpedObjects, object); break; } | |
} | |
, dump : function(object, name, logLevel) { | |
if(logLevel && logLevel > FB.Debug.logLevel) { | |
return; } | |
if((!name ||!name.length) && (object !== null)) { | |
name = typeof(object); } | |
if(!name ||!name.length) { | |
return; } | |
var sb = new FB.StringBuilder(); FB.Debug._dumpCore(sb, object, name, '', []); FB.Debug.writeLine(sb.toString()); } | |
, fail : function(message) { | |
FB.Debug._fail(message); } | |
} | |
} | |
); | |
FB.FBDebug = FB.Debug; | |
FB.Enum = function() { | |
} | |
FB.Type.createClass2(FB.Enum); | |
FB.Enum.parse = function Enum$parse(enumType, s) { | |
var values = enumType.prototype; | |
if(!enumType.__flags) { | |
for(var f in values) { | |
if(f === s) { | |
return values[f]; | |
} | |
} | |
} | |
else { | |
var parts = s.split('|'); | |
var value = 0; | |
var parsed = true; | |
for(var i = parts.length - 1; i >= 0; i--) { | |
var part = parts[i].trim(); | |
var found = false; | |
for(var f in values) { | |
if(f === part) { | |
value |= values[f]; | |
found = true; | |
break; | |
} | |
} | |
if(!found) { | |
parsed = false; | |
break; | |
} | |
} | |
if(parsed) { | |
return value; | |
} | |
} | |
throw'Invalid Enumeration Value'; | |
} | |
FB.Enum.toString = function Enum$toString(enumType, value) { | |
var values = enumType.prototype; | |
if(!enumType.__flags || (value === 0)) { | |
for(var i in values) { | |
if(values[i] === value) { | |
return i; | |
} | |
} | |
throw'Invalid Enumeration Value'; | |
} | |
else { | |
var parts = []; | |
for(var i in values) { | |
if(values[i] & value) { | |
if(parts.length) { | |
arts[arts.length] = ' | '; | |
} | |
parts[parts.length] = i; | |
} | |
} | |
if(!parts.length) { | |
throw'Invalid Enumeration Value'; | |
} | |
return parts.join(''); | |
} | |
} | |
FB.Delegate = function() { | |
} | |
FB.Type.createClass2(FB.Delegate); | |
FB.Delegate.Null = function() { | |
} | |
FB.Delegate._create = function Delegate$_create(targets) { | |
var delegate = function() { | |
if(targets.length == 2) { | |
return targets[1].apply(targets[0], arguments); | |
} | |
else { | |
var targets_copy = targets.slice(); | |
for(var i = 0; i < targets_copy.length; i += 2) { | |
targets_copy[i + 1].apply(targets_copy[i], arguments); | |
} | |
return null; | |
} | |
}; | |
delegate.invoke = delegate; | |
delegate._targets = targets; | |
return delegate; | |
} | |
FB.Delegate.create = function Delegate$create(object, method) { | |
if(!object) { | |
return method; | |
} | |
return FB.Delegate._create([object, method]); | |
} | |
FB.Delegate.combine = function Delegate$combine(delegate1, delegate2) { | |
if(!delegate1) { | |
if(!delegate2._targets) { | |
return FB.Delegate.create(null, delegate2); | |
} | |
return delegate2; | |
} | |
if(!delegate2) { | |
if(!delegate1._targets) { | |
return FB.Delegate.create(null, delegate1); | |
} | |
return delegate1; | |
} | |
var targets1 = delegate1._targets ? delegate1._targets : [null, delegate1]; | |
var targets2 = delegate2._targets ? delegate2._targets : [null, delegate2]; | |
return FB.Delegate._create(targets1.concat(targets2)); | |
} | |
FB.Delegate.remove = function Delegate$remove(delegate1, delegate2) { | |
if(!delegate1 || (delegate1 === d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment