1// source --> https://bat-records.com/wp-content/plugins/wp-facebook-login/public/js/facebook-login.js?ver=1.2.3.5 2window.FBL = {}; 3function fbl_loginCheck() { 4 window.FB.getLoginStatus( function(response) { 5 FBL.handleResponse(response); 6 } ); 7} 8(function( $ ) { 9 'use strict'; 10 FBL.renderFinish = function () { 11 $('.fbl-spinner').hide(); 12 } 13 14 FBL.handleResponse = function( response ) { 15 var button = $('.fbl-button'), 16 $form_obj = button.parents('form') || false, 17 $redirect_to = $form_obj.find('input[name="redirect_to"]').val() || button.data('redirect'), 18 running = false; 19 /** 20 * If we get a successful authorization response we handle it 21 */ 22 if (response.status == 'connected' && ! running) { 23 running = true; 24 var fb_response = response; 25 $('.fbl-spinner').fadeIn(); 26 $('.fb-login-button').hide(); 27 28 /** 29 * Send the obtained token to server side for extra checks and user data retrieval 30 */ 31 $.ajax({ 32 data: { 33 action: "fbl_facebook_login", 34 fb_response: fb_response, 35 security: button.data('fb_nonce') 36 }, 37 global: false, 38 type: "POST", 39 url: fbl.ajaxurl, 40 success: function (data) { 41 if (data && data.success) { 42 if( data.redirect && data.redirect.length ) { 43 location.href = data.redirect; 44 } else if ( $redirect_to.length ) { 45 location.href = $redirect_to; 46 } else { 47 location.href = fbl.site_url; 48 } 49 } else if (data && data.error) { 50 $('.fbl-spinner').hide(); 51 $('.fb-login-button').show(); 52 53 if ($form_obj.length) { 54 $form_obj.append('<p class="fbl_error">' + data.error + '</p>'); 55 } else { 56 // we just have a button 57 $('<p class="fbl_error">' + data.error + '</p>').insertAfter(button); 58 } 59 // if we had any error remove user from app so we request again permissions 60 FB.api( 61 "/"+data.fb.id+"/permissions", 62 "DELETE", 63 function (response) { 64 if (response && !response.error) { 65 } 66 } 67 ); 68 } 69 }, 70 error: function (data) { 71 $('.fbl-spinner').hide(); 72 $('.fb-login-button').show(); 73 $form_obj.append('<p class="fbl_error">' + data + '</p>'); 74 } 75 }); 76 77 } else { 78 button.removeClass('fbl-loading'); 79 if( navigator.userAgent.match('CriOS') ) 80 window.open('https://www.facebook.com/dialog/oauth?client_id=' + fbl.appId + '&redirect_uri=' + document.location.href + '&scope='+fbl.scopes, '', null); 81 82 if( "standalone" in navigator && navigator.standalone ) 83 window.location.assign('https://www.facebook.com/dialog/oauth?client_id=' + fbl.appId + '&redirect_uri=' + document.location.href + '&scope='+fbl.scopes); 84 } 85 }; 86})( jQuery );
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.