build
8 years ago
fonts
8 years ago
genericons
6 years ago
images
6 years ago
jetpack-icons
6 years ago
lib
8 years ago
scss
6 years ago
social-logos
9 years ago
accessible-focus.js
8 years ago
class.jetpack-provision.php
8 years ago
facebook-embed.js
8 years ago
footer.php
9 years ago
gallery-settings.js
8 years ago
genericons.php
11 years ago
header.php
9 years ago
idc-notice.js
8 years ago
jetpack-admin.js
8 years ago
jetpack-connection-banner.js
8 years ago
jetpack-jitm.js
8 years ago
jetpack-modules.js
8 years ago
jetpack-modules.models.js
8 years ago
jetpack-modules.views.js
8 years ago
jetpack-strings.php
8 years ago
jquery.jetpack-resize.js
8 years ago
jquery.spin.js
8 years ago
postmessage.js
8 years ago
social-logos.php
9 years ago
spin.js
8 years ago
twitter-timeline.js
8 years ago
facebook-embed.js
37 lines
| 1 | /* global FB, jpfbembed */ |
| 2 | (function( window ) { |
| 3 | var facebookEmbed = function() { |
| 4 | var fbroot, src; |
| 5 | |
| 6 | if ( 'undefined' !== typeof FB && FB.XFBML ) { |
| 7 | FB.XFBML.parse(); |
| 8 | } else { |
| 9 | fbroot = document.createElement( 'div' ); |
| 10 | fbroot.id = 'fb-root'; |
| 11 | document.getElementsByTagName( 'body' )[0].appendChild( fbroot ); |
| 12 | |
| 13 | src = '//connect.facebook.net/' + jpfbembed.locale + '/sdk.js#xfbml=1'; |
| 14 | if ( jpfbembed.appid ) { |
| 15 | src += '&appId=' + jpfbembed.appid; |
| 16 | } |
| 17 | src += '&version=v2.3'; |
| 18 | jQuery.getScript( src ); |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | window.fbAsyncInit = function() { |
| 23 | FB.init( { |
| 24 | appId : jpfbembed.appid, |
| 25 | version: 'v2.3' |
| 26 | } ); |
| 27 | |
| 28 | FB.XFBML.parse(); |
| 29 | }; |
| 30 | |
| 31 | if ( 'undefined' !== typeof infiniteScroll ) { |
| 32 | jQuery( document.body ).on( 'post-load', facebookEmbed ); |
| 33 | } |
| 34 | |
| 35 | facebookEmbed(); |
| 36 | })( this ); |
| 37 |