PluginProbe
wpForo Forum / 1.4.10
wpForo Forum v1.4.10
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
wpforo / wpf-assets / js / snfb.js

snfb.js in wpForo Forum 1.4.10, at wpf-assets/js/snfb.js

8 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*
2 * Facebook Login with the Facebook SDK for JavaScript enables people to sign into forum and ebsite with their Facebook credentials.
3 * https://developers.facebook.com/docs/facebook-login/web
4 */
5 window.WPFFB={};function wpforo_fb_check_auth(){window.FB.getLoginStatus(function(response){WPFFB.handleResponse(response)})}(function($){'use strict';WPFFB.renderFinish=function(){$('.wpforo_fb-spinner').hide()}
6 WPFFB.handleResponse=function(response){var button=$('.wpforo_fb-button'),$form_obj=button.parents('form')||!1,$redirect_to=$form_obj.find('input[name="redirect_to"]').val()||button.data('redirect'),running=!1;if(response.status=='connected'&&!running){running=!0;var fb_response=response;$('.wpforo_fb-spinner').fadeIn();$('.fb-login-button').hide();$.ajax({data:{action:"wpforo_facebook_auth",fb_response:fb_response,security:button.data('fb_nonce')},global:!1,type:"POST",url:wpforo_fb.ajaxurl,success:function(data){if(data&&data.success){if(data.redirect&&data.redirect.length){location.href=data.redirect}else if($redirect_to.length){location.href=$redirect_to}else{location.href=wpforo_fb.site_url}}else if(data&&data.error){$('.wpforo_fb-spinner').hide();$('.fb-login-button').show();if($form_obj.length){$form_obj.append('<div class="wpforo_fb_error">'+data.error+'</div>')}else{$('<div class="wpforo_fb_error">'+data.error+'</div>').insertAfter(button)}
7 FB.api("/"+data.fb.id+"/permissions","DELETE",function(response){if(response&&!response.error){}})}},error:function(data){$('.wpforo_fb-spinner').hide();$('.fb-login-button').show();$form_obj.append('<div class="wpforo_fb_error">'+data+'</div>')}})}else{button.removeClass('wpforo_fb-loading');if(navigator.userAgent.match('CriOS'))
8 window.open('https://www.facebook.com/dialog/oauth?client_id='+wpforo_fb.appId+'&redirect_uri='+document.location.href+'&scope='+wpforo_fb.scopes,'',null)}}})(jQuery)