$(function () {
$.FBF = {};
//A set of functions used by FBF
$.FBF.fn = {
//Gets the app Id from meta tags in the head
_getAppId: function() {
var metaTags = document.getElementsByTagName("meta"),
appId;
for (var i = 0; i < metaTags.length; i++) {
if (metaTags[i].getAttribute("property") == "fb:app_id") {
appId = metaTags[i].getAttribute("content");
break
}
}
return appId
},
loading: {
init: function() {
$.FBF.config.$container.addClass("not-ready not-connected loading loading-userdata");
},
set: function (loading) {
}
}
};
//The default options/configuation of FBF
$.FBF.config = {
appId: this.appId || $.FBF.fn._getAppId(), //Facebook App ID
scope: null, //Array of permissions
facebookpage: null, //If the application is a Page Tab App, this setting should be set to whatever page the app is located on
$container: $("body"), //Bindings and classes will be added to this selector
redirectUrl: document.location.protocol + "//" + document.location.host + document.location.pathname, //The URL which the application should redirect back to, if redirected to Facebook
mobileUrl: document.location.protocol + "//" + document.location.host + document.location.pathname, //The URL which mobiles will be redirected to
loading: true //Adds loading classes to the $container element
};
//Initial function which are kicked on by user
$.FBF.init = function (config, callback) {
$.FBF.config = $.extend($.FBF.config, config);
//Handle loading
if ($.FBF.config.loading && typeof $.FBF.config.$container !== "undefined") {
$.FBF.fn.loading.init();
}
//Callbackhandler. Init returns selected properties to the user
if (callback) {
var initReturn = $.FBF.initReturn = {};
//All information returned to the client, defined as strings
var...
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.