|
Server : LiteSpeed System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : nandedex ( 1060) PHP Version : 8.1.33 Disable Function : NONE Directory : /home/nandedex/www/wp-content/plugins11/better-facebook-comments/js/ |
(function () {
function appendFbScript() {
var js, id = 'facebook-jssdk',
fjs = document.getElementsByTagName('script')[0];
if (document.getElementById(id)) return;
js = document.createElement('script');
js.id = id;
js.src = "//connect.facebook.net/%%LOCALE%%/sdk.js#xfbml=1&appId=%%APP-ID%%&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
window.fbAsyncInit = function () {
FB.init({
appId: '%%APP-ID%%',
xfbml: true,
version: 'v2.0'
});
FB.Event.subscribe('comment.create', function (comment_data) {
console.log(comment_data);
update_comments_count();
});
FB.Event.subscribe('comment.remove', function (comment_data) {
update_comments_count();
});
function update_comments_count(comment_data, comment_action) {
jQuery.ajax({
type: 'GET',
dataType: 'json',
url: '%%ADMIN-AJAX%%',
data: {
action: 'clear_better_facebook_comments',
post_id: '%%POST-ID%%'
},
success: function (data) {
// todo sync comments count here! data have the counts
},
error: function (i, b) {
// todo
}
}
)
};
};
//%%TYPE%%
}
appendFbScript();
})();