1jQuery(document).ready(function () { 2 3 function firebaseInit() { 4 // console.log('firebaseInit') 5 firebase.auth().onAuthStateChanged(function (user) { 6 7 if (user) { 8 SocialInit(user) 9 } 10 }); 11 } 12 13 function SocialInit(user) { 14 // console.log(`SocialInit`) 15 // console.log(user) 16 var displayName = user.displayName; 17 var uid = user.uid; //firebase ID 18 19 var ProfilePic = user.ProfileBase64data; 20 21 var providerData = user.providerData[0]; 22 var ProviderUserID = providerData.uid; //FBID 23 var umail = providerData.email; 24 var providerId = providerData.providerId //facebook,google 25 26 27 28 jQuery.post(firebase_mbs_param.ajax_url, { 29 displayName: displayName, 30 uid: uid, 31 umail: umail, 32 uPic: ProfilePic, 33 pid: providerId, 34 puid: ProviderUserID, 35 action: 'std_mbs_firebaseinit', 36 cookie: document.cookie, 37 }, function (resp) { 38 //refresh or redirect 39 40 if (resp.Status == 'Complete') { 41 if (resp.Action == 'login') { 42 console.log(resp) 43 location.reload(); 44 } 45 46 } 47 48 }, "json"); 49 50 51 } 52 53 54 function getCookie(cname) { 55 var name = cname + "="; 56 var ca = document.cookie.split(';'); 57 for (var i = 0; i < ca.length; i++) { 58 var c = ca[i]; 59 while (c.charAt(0) == ' ') { 60 c = c.substring(1); 61 } 62 if (c.indexOf(name) == 0) { 63 return c.substring(name.length, c.length); 64 } 65 } 66 return ""; 67 } 68 69 70 if (!getCookie('STDID')){ 71 firebaseInit() 72 } 73 74 GetLoginStatus(); 75 76 let ViewID ; 77 function GetLoginStatus(){ 78 jQuery.post(firebase_mbs_param.ajax_url, { 79 post_id: firebase_mbs_param.post_id, 80 action: 'std_mbs_checkmbslogin', 81 cookie: document.cookie, 82 }, function (resp) { 83 //refresh or redirect 84 if (resp.Status == 'User') { 85 86 jQuery('.mbs-user,.mbs-user-xs').fadeIn() 87 jQuery('.fav-topic').show(); 88 jQuery('.fav-content').css({ "display": "inline-block" }) 89 90 91 jQuery('.profile_name').html(resp.Profile.Name) 92 jQuery('.profile_thumb').attr({ 'src': resp.Profile.ProfilePic}) 93 94 ViewID = resp.ViewID; 95 96 setTimeout(() => { 97 SpendTime(); 98 }, 1000); 99 100 // if (resp.Action == 'login') { 101 // console.log(resp) 102 // location.reload(); 103 // } 104 105 }else{ 106 jQuery('.mbs-guest,.mbs-guest-xs').fadeIn() 107 } 108 109 }, "json"); 110 111 } 112 113 114 function SpendTime(){ 115 116 117 jQuery.post(firebase_mbs_param.ajax_url, { 118 ViewID: ViewID, 119 action: 'std_mbs_spendtime', 120 cookie: document.cookie, 121 }, function (resp) { 122 //refresh or redirect 123 if (resp.Status == 'Complete') { 124 setTimeout(() => { 125 SpendTime(); 126 }, 1000); 127 128 } 129 130 }, "json"); 131 132 } 133 134}) 135 136function MBSLogout(){ 137 firebase.auth().signOut().then(function () { 138 139 jQuery.post(firebase_mbs_param.ajax_url, { 140 141 action: 'std_mbs_apilogout', 142 cookie: document.cookie, 143 }, function (resp) { 144 //refresh or redirect 145 146 if(resp.Status =='Complete'){ 147 location.reload(); 148 } 149 150 }, "json"); 151 }).catch(function (error) { 152 // An error happened. 153 }); 154 155 156 console.log(firebase_mbs_param) 157}
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.