MediaWiki:Common.js: Difference between revisions
Brett Holman (talk | contribs) (Created page with "→Any JavaScript here will be loaded for all users on every page load.: →Added by bholman 2012-03-28 to make collapsible elements work: /* per http://www.mediawiki.org/...") |
Tony Allan (talk | contribs) (Add Facebook social plugin support) |
||
Line 7: | Line 7: | ||
$('.mw-collapsible').makeCollapsible(); | $('.mw-collapsible').makeCollapsible(); | ||
}) | }) | ||
// 01/02/2015 Tony Allan - Facebook support | |||
// see https://developers.facebook.com/quickstarts/727460864013163/?platform=web | |||
window.fbAsyncInit = function() { | |||
FB.init({ | |||
appId : '420807218085510', | |||
xfbml : true, | |||
version : 'v2.1' | |||
}); | |||
}; | |||
(function(d, s, id){ | |||
var js, fjs = d.getElementsByTagName(s)[0]; | |||
if (d.getElementById(id)) {return;} | |||
js = d.createElement(s); js.id = id; | |||
js.src = "//connect.facebook.net/en_GB/sdk.js"; | |||
//js.src = "//connect.facebook.net/en_GB/sdk/debug.js"; | |||
fjs.parentNode.insertBefore(js, fjs); | |||
}(document, 'script', 'facebook-jssdk')); |
Revision as of 00:09, 1 February 2015
/* Any JavaScript here will be loaded for all users on every page load. */ /* Added by bholman 2012-03-28 to make collapsible elements work */ /* per http://www.mediawiki.org/wiki/Manual_talk:Collapsible_elements#Use_new_1.18_collapsible_in_1.17 */ mw.messages.set({"collapsible-collapse":"Collapse","collapsible-expand":"Expand"}); $(document).ready(function(){ $('.mw-collapsible').makeCollapsible(); }) // 01/02/2015 Tony Allan - Facebook support // see https://developers.facebook.com/quickstarts/727460864013163/?platform=web window.fbAsyncInit = function() { FB.init({ appId : '420807218085510', xfbml : true, version : 'v2.1' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/sdk.js"; //js.src = "//connect.facebook.net/en_GB/sdk/debug.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));