MediaWiki:FacebookWidget.js

/*           Luqgreg $(function {	// Don't load twice and in non-content namespaces	if ( window.FBWidgetLoaded || !mw.config.get('wgIsArticle') ) { return; }	window.FBWidgetLoaded = true;
 * FacebookWidget
 * Invokes Facebook widget in wiki right rail
 * @authors	Railfail536
 * v1.0

/*	* API call by Luqgreg * @param {string[]} msg * @returns {Promise.} */	var api = new mw.Api; function GetMessages(msg) { return new Promise(function(resolve, reject) {			api.get({ action: 'query', meta: 'allmessages', ammessages: msg.join('|'), }).done(function (d) { if(d.error) reject(d); var r = {}; d.query.allmessages.forEach(function(e) {					r[e.name] = e['*'];				}); resolve(r); }).error(reject);		}); }

// Download config GetMessages([		'Custom-FBWidget-config-page',		'Custom-FBWidget-config-width',		'Custom-FBWidget-config-height'	]).then(function(m) {		var page = (m['Custom-FBWidget-config-page']),			width = (m['Custom-FBWidget-config-width']) || 290,			height = (m['Custom-FBWidget-config-height']) || 130;

// Load widget // Docs:  $('#WikiaRail').prepend(			$(' ', { src: '//www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2F' + page + '%2F&tabs&width=' + width + '&height=' + height + '&small_header=false&adapt_container_width=true&hide_cover=false&show_facepile=false&appId', width: width, height: height, style: 'border: none; overflow: hidden', scrolling: 'no', frameborder: 0, allowTransparency: true, allow: 'encrypted-media' })		);	}); });