1function updateURL(append) { 2if (history.pushState) { 3var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + append; 4window.history.pushState({path:newurl},'',newurl); 5} 6} 7 8function addBackScrollToUrl(append){ 9var currURL=window.location.href; 10currURL=currURL+'&did='+append; 11var newURL=currURL.substr(currURL.lastIndexOf('?')); 12updateURL(newURL); 13} 14 15 16function getParameterByName(name, url) { 17if (!url) url = window.location.href; 18name = name.replace(/[\[\]]/g, "\\$&"); 19var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 20results = regex.exec(url); 21if (!results) return null; 22if (!results[2]) return ''; 23return decodeURIComponent(results[2].replace(/\+/g, " ")); 24} 25 26function showUniversalLoader(){ 27$("#universal-loader-action").css({ display: "block" }); 28$("#universal-loader-result").html(''); 29$("#universal-loader-result").css({ display: "none" }); 30$("#universal-loader").css({ display: "block" }); 31$("#disabling-div").css({ display: "block" }); 32} 33 34function hideUniversalLoader(){ 35if($("#universal-loader-result").html()=="") 36{ 37$("#universal-loader").css({ display: "none" }); 38$("#disabling-div").css({ display: "none" }); 39} 40} 41 42function successUniversalLoader(desc){ 43$("#universal-loader-result").html(desc); 44$("#universal-loader-action").css({ display: "none" }); 45$("#universal-loader-result").css({ display: "block" }); 46$("#disabling-div").css({ display: "none" }); 47$('#universal-loader').delay(5000).fadeOut(400); 48} 49 50function showNonMemberModal(){ 51$("#login-box-tabs").css({ display: "none" }); 52$(".login-stage").css({ display: "none" }); 53$("#login-box-prompt").css({ display: "block" }); 54$("#loginModal").modal('show'); 55} 56 57function openMemberOptions(attrib){ 58 if(logStatus=="out") 59 { 60 showNonMemberModal(); 61 return; 62 } 63$("#generic-modal-header").html('Member Information'); 64$("#generic-modal-body").html('<center><br><img src="img/loader.gif" style="width:90px;height:auto"></center>'); 65$("#genericModal").modal('show'); 66 67 $.ajax({ 68 type: "POST", 69 url: "webapi/get_member_info.php", 70 dataType:'json', 71 data: {attrib:attrib}, 72 timeout: 15000, 73 success: function(result) { 74 var s=""; 75 s=s+'<table width="100%"><tr><td width="1%"><img src="'+result.profile_pic+'" style="height:100px;width:100px;border-radius:50%;"></td><td width="99%" style="padding-left:10px;" valign="top"><h5>'+result.user_firstname+'</h5><div style="font-size:12px">Member since '+result.signup_date+'</div>'; 76 if(result.member_country!="") 77 { 78 s=s+'<div style="font-size:12px">From '+result.member_country+'</div>'; 79 s=s+'<img src="http://www.geonames.org/flags/x/'+result.country_iso+'.gif" style="width:50px;height:auto;margin-top:5px">'; 80 } 81 s=s+'</td></tr></table>'; 82 83 s=s+'<div style="background-color:#dbdbdb;margin-top:10px"><table width="100%"><tr><td width="50%"><a class="btn btn-lg" href="activity.php?ide='+result.other_member_id+'&idt='+result.signup_ts+'" style="border:2px solid #C0C0C0;background-color:#ffffff;color:#202020;font-size:14px;margin:10px;font-family:\'RalewayBold\'">View Activity</a></td><td width="50%" align="right" id="follow-button-container">'; 84 85 if(result.is_user!=1) 86 { 87 88 if(result.is_following==1) 89 { 90 s=s+'<button id="btn-add-follow" class="btn btn-lg" onclick="assignFollow(\''+result.other_member_id+'\');" style="border:2px solid #404040;background-color:#404040;color:#ffffff;font-size:14px;margin:10px;font-family:\'RalewayBold\'">Unfollow '+result.user_firstname+'</button>'; 91 } 92 else 93 { 94 s=s+'<button id="btn-add-follow" class="btn btn-lg" onclick="assignFollow(\''+result.other_member_id+'\');" style="border:2px solid #275c00;background-color:#275c00;color:#ffffff;font-size:14px;margin:10px;font-family:\'RalewayBold\'">Follow '+result.user_firstname+'</button>'; 95 } 96 } 97 s=s+'</td></tr></table></div>'; 98 s=s+'<br><table width="100%">'; 99 100 if(result.num_collection>0) 101 { 102 s=s+'<tr>
102<td width="40%" style="padding-right:10px;" align="right"><img src="img/tn_collection.png" style="width:40px;"></td><td width="60%">'+result.num_collection+' whisk'; 103 104 if(result.num_collection==1) 105 { 106 s=s+'y'; 107 } 108 else 109 { 110 s=s+'ies'; 111 } 112 s=s+' in collection.'; 113 s=s+'</td></tr>'; 114 } 115 116 if(result.member_num_tasting_notes>0) 117 { 118 s=s+'<tr><td width="40%" style="padding-right:10px;" align="right"><img src="img/tn_note.png" style="width:40px;"></td><td width="60%">'+result.member_num_tasting_notes+' public tasting note'; 119 120 if(result.member_num_tasting_notes!=1) 121 { 122 s=s+'s'; 123 } 124 s=s+'.</td></tr>'; 125 } 126 127 if(result.member_num_ratings>0) 128 { 129 s=s+'<tr><td width="40%" style="padding-right:10px;" align="right"><img src="img/tn_rate.png" style="width:40px;"></td><td width="60%">'+result.member_num_ratings+' rating'; 130 131 if(result.member_num_ratings!=1) 132 { 133 s=s+'s'; 134 } 135 s=s+'.</td></tr>'; 136 } 137 s=s+'</table>'; 138 139 if(result.highest_rated_product!="") 140 { 141 s=s+'<br><center>'; 142 s=s+result.user_firstname; 143 s=s+'\'s highest rated whisky:<br><a href="whisky.php?ref='+result.product_url+'">'+result.highest_rated_product+'</a>('+result.highest_rated_score+'/5)'; 144 s=s+'</center>'; 145 } 146 147 s=s+''; 148 $("#generic-modal-body").html(s); 149 }, 150 error: function() { 151 } 152 }); 153 154} 155 156function assignFollow(attrib){ 157 if(logStatus=="out") 158 { 159 showNonMemberModal(); 160 return; 161 } 162$("#btn-add-follow").html("Loading..."); 163$('#btn-add-follow').prop('disabled', true); 164 $.ajax({ 165 type: "POST", 166 dataType:'json', 167 url: "webapi/assign_follow.php", 168 data: {attrib:attrib}, 169 timeout: 10000, 170 success: function(result) { 171 if(result.act=="remove") 172 { 173 $("#follow-button-container").html('<button id="btn-add-follow" class="btn btn-lg" onclick="assignFollow(\''+attrib+'\');" style="border:2px solid #275c00;background-color:#275c00;color:#ffffff;font-size:14px;margin:10px;font-family:\'RalewayBold\'">Follow '+result.user_firstname+'</button>'); 174 $('#btn-add-follow').prop('disabled', false); 175 } 176 if(result.act=="add") 177 { 178 $("#follow-button-container").html('<button id="btn-add-follow" class="btn btn-lg" onclick="assignFollow(\''+attrib+'\');" style="border:2px solid #404040;background-color:#404040;color:#ffffff;font-size:14px;margin:10px;font-family:\'RalewayBold\'">Unfollow '+result.user_firstname+'</button>'); 179 $('#btn-add-follow').prop('disabled', false); 180 } 181 182 if(currPage=="following") 183 { 184 drawfollowing(); 185 } 186 187 }, 188 error: function() { 189 } 190 }); 191 192 193}
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.