1jQuery(document).ready(function ($) { 2 if (jQuery('body').hasClass('logged-in')) { 3 4 5 } else { 6 jQuery('.reviewformwithnotice input[type=text], .reviewformwithnotice textarea').keyup(function (e) { 7 if (jQuery('body').hasClass('listing-app-view')) { 8 jQuery('#app-view-login-popup').modal(); 9 jQuery('#app-view-login-popup').addClass('md-show'); 10 } else { 11 jQuery('#modal-3').modal(); 12 jQuery('#modal-3').addClass('md-show'); 13 } 14 }); 15 } 16 jQuery('#rewies_formm').on('submit', function (e) { 17 e.preventDefault(); 18 }); 19 jQuery('#rewies_form').on('submit', function (e) { 20 $this = jQuery(this); 21 22 23 var isCaptcha = $this.data('lp-recaptcha'), 24 siteKey = $this.data('lp-recaptcha-sitekey'); 25 26 var multiState = $this.data('multi-rating'); 27 28 $this.find('.review_status').text(''); 29 $this.find(':input[type=submit]').prop('disabled', true); 30 errorMSG = $this.find(":input[name='errormessage']").val(); 31 $title = jQuery('#post_title').val(); 32 var flag = false; 33 if (multiState == '1') { 34 var $rating = ''; 35 var multiFieldsCount = jQuery('.lp-multi-rating-val').length - 1; 36 var multiRatingSum = 0; 37 jQuery('.lp-multi-rating-val').each(function (index) { 38 var field_val = jQuery(this).val(), 39 fieldID = jQuery(this).data('mrf'); 40 multiRatingSum += Number(field_val); 41 42 console.log(field_val); 43 if (field_val == '' || field_val == 0 || field_val == null) { 44 flag = true; 45 e.preventDefault(); 46 e.stopPropagation(); 47 e.stopImmediatePropagation(); 48 return false; 49 } 50 51 if (index != multiFieldsCount) { 52 var cSep = ','; 53 } 54 else { 55 var cSep = ''; 56 } 57 58 var ratingVal = fieldID + ':' + field_val + cSep; 59 60 $rating += ratingVal; 61 }); 62 } 63 else { 64 $rating = jQuery('#review-rating').val(); 65 } 66 if (flag) { 67 $this.find('.review_status').text(errorMSG); 68 $this.find('.review_status').addClass('error-msg'); 69 $this.find(':input[type=submit]').prop('disabled', false); 70 $this.find('.loadinerSearch').removeClass('loadinerSearchblock'); 71 return false; 72 } 73 var ratingCheck = $rating; 74 if (multiState == '1') { 75 ratingCheck = multiRatingSum; 76 } 77 $description = jQuery('#post_description').val(); 78 var $umail = ''; 79 $umail = $this.find(":input[type=email]").val(); 80 if ($umail !== undefined) { 81 $this.find('.loadinerSearch').addClass('loadinerSearchblock'); 82 e.preventDefault(); 83 if ($title == '' || $description == '' || $umail == '') { 84 $this.find('.review_status').text(errorMSG); 85 $this.find('.review_status').addClass('error-msg'); 86 $this.find(':input[type=submit]').prop('disabled', false); 87 $this.find('.loadinerSearch').removeClass('loadinerSearchblock'); 88 } 89 else { 90 91 92 var fd = new FormData(this); 93 fd.append('action', 'ajax_review_submit'); 94 fd.append('multiState', multiState); 95 if (multiState == '1') { 96 fd.append('multirating', $rating); 97 } 98 99 fd.append('lpNonce', jQuery('#lpNonce').val()); 100 if ((isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null)) { 101 jQuery.ajax({ 102 type: 'POST', 103 url: ajax_review_object.ajaxurl, 104 data: fd, 105 contentType: false, 106 processData: false, 107 108 success: function (res) { 109 110 var res = jQuery.parseJSON(res); 111 $this.find('.loadinerSearch').removeClass('loadinerSearchblock'); 112 $this.find(':input[type=submit]').prop('disabled', false); 113 if (res.error) { 114 $this.find('.review_status').addClass('error-msg'); 115 $this.find('.review_status').text(res.status); 116 } 117 else { 118 119 $this.find('.review_status').text(res.status); 120 $this.find('.review_status').removeClass('error-msg'); 121 $this.find('.review_status').addClass('success-msg'); 122 $this[0].reset(); 123 var timer = ''; 124 125 function redirectPageNow() { 126 location.reload(true); 127 clearTimeout(timer); 128 } 129 130 timer = setTimeout(redirectPageNow, 100); 131 132 } 133 134 }, 135 error: function (request, error) { 136 137 alert(error); 138 } 139 }); 140 } else { 141 //for recpatcha 142 grecaptcha.ready(function () { 143 grecaptcha.execute(siteKey, {action: 'lp_review'}).then(function (token) { 144 145 fd.append('recaptha-action', 'lp_review'); 146 fd.append('token', token); 147 148 jQuery.ajax({ 149 type: 'POST', 150 url: ajax_review_object.ajaxurl, 151 data: fd, 152 contentType: false, 153 processData: false, 154 155 success: function (res) { 156 157 var res = jQuery.parseJSON(res); 158 $this.find('.loadinerSearch').removeClass('loadinerSearchblock'); 159 $this.find(':input[type=submit]').prop('disabled', false); 160 if (res.error) { 161 $this.find('.review_status').addClass('error-msg'); 162 $this.find('.review_status').text(res.status); 163 } 164 else { 165 166 $this.find('.review_status').text(res.status); 167 $this.find('.review_status').removeClass('error-msg'); 168 $this.find('.review_status').addClass('success-msg'); 169 $this[0].reset(); 170 var timer = ''; 171 172 function redirectPageNow() { 173 location.reload(true); 174 clearTimeout(timer); 175 } 176 177 timer = setTimeout(redirectPageNow, 100); 178 179 } 180 181 }, 182 error: function (request, error) { 183 184 alert(error); 185 } 186 }); 187 188 }); 189 }) 190 191 } 192 193 } 194 } 195 196 else if ($title == '' || $description == '') { 197 $this.find('.review_status').text(errorMSG); 198 $this.find('.review_status').addClass('error-msg'); 199 $this.find(':input[type=submit]').prop('disabled', false); 200 } 201 else { 202 $this.find('.loadinerSearch').addClass('loadinerSearchblock'); 203 e.preventDefault(); 204 205 var fd = new FormData(this); 206 fd.append('multiState', multiState); 207 if (multiState == '1') { 208 fd.append('multirating', $rating); 209 } 210 fd.append('action', 'ajax_review_submit'); 211 fd.append('lpNonce', jQuery('#lpNonce').val()); 212 213 jQuery.ajax({ 214 type: 'POST', 215 url: ajax_review_object.ajaxurl, 216 data: fd, 217 contentType: false, 218 processData: false, 219 220 success: function (res) { 221 222 223 $this.find('.loadinerSearch').removeClass('loadinerSearchblock'); 224 $this.find(':input[type=submit]').prop('disabled', false); 225 var res = jQuery.parseJSON(res); 226 if (res.error) { 227 $this.find('.review_status').addClass('error-msg'); 228 $this.find('.review_status').text(res.status); 229 } 230 else { 231 $this.find('.review_status').text(res.status); 232 $this.find('.review_status').removeClass('error-msg'); 233 $this.find('.review_status').addClass('success-msg'); 234 $this[0].reset(); 235 var timer = ''; 236 237 function redirectPageNow() { 238 location.reload(true); 239 clearTimeout(timer); 240 } 241 242 timer = setTimeout(redirectPageNow, 100); 243 } 244 245 }, 246 error: function (request, error) { 247 alert(error); 248 249 } 250 }); 251 252 } 253 return false;
254 }); 255 256 /* by zaheer on 16 march */ 257 258 jQuery('.reviews-section a.review_actv').tooltip(); 259 260 jQuery(document).on('click', '.reviews-section a.reviewRes', function (e) { 261 reviewID = ''; 262 ajaxResErr = ''; 263 var $this = jQuery(this); 264 if ($this.hasClass('review_actv')) { 265 $this.find('.lp_state').text($this.data('reacted')); 266 $this.find('.lp_state').slideToggle('slow'); 267 var showStatDiv = function () { 268 $this.find('.lp_state').slideToggle('slow'); 269 }; 270 timVar = setTimeout(showStatDiv, 3000); 271 e.preventDefault(); 272 } 273 else { 274 $this.find('.lp_state').hide(); 275 $this.find('span.interests-score').text(''); 276 $this.find('span.interests-score').append('<i class="fa fa-spinner fa-spin"></i>'); 277 reviewID = $this.data('id'); 278 var currentVal = $this.data('score'); 279 var restype = $this.data('restype'); 280 281 jQuery.ajax({ 282 type: 'POST', 283 dataType: 'json', 284 url: ajax_review_object.ajaxurl, 285 data: { 286 action: 'lp_reviews_interests', 287 interest: currentVal, 288 restype: restype, 289 id: reviewID, 290 'lpNonce': jQuery('#lpNonce').val() 291 }, 292 293 294 success: function (res) { 295 if (res.errors == "no") { 296 ajaxResErr = 'no'; 297 var newscore = res.newScore; 298 $this.data('score', newscore); 299 $this.find('span.interests-score').empty(''); 300 $this.find('span.interests-score').text(newscore); 301 if (restype == 'interesting') { 302 $this.css({ 303 'background-color': '#417cdf', 304 'color': '#fff' 305 }); 306 $this.find('.interests-score').css({'color': '#fff'}); 307 } 308 else if (restype == 'lol') { 309 $this.css({ 310 'background-color': '#ff8e29', 311 'color': '#fff' 312 }); 313 $this.find('.interests-score').css({'color': '#fff'}); 314 } 315 else if (restype == 'love') { 316 $this.css({ 317 'background-color': '#ff2357', 318 'color': '#fff' 319 }); 320 $this.find('.interests-score').css({'color': '#fff'}); 321 } 322 currentVal = false; 323 $this.find('.lp_state').text(res.statuss); 324 $this.find('.lp_state').slideToggle('slow'); 325 var showStatDiv = function () { 326 $this.find('.lp_state').slideToggle('slow'); 327 }; 328 timVar = setTimeout(showStatDiv, 3000); 329 $this.addClass('review_actv'); 330 331 } 332 else { 333 ajaxResErr = 'yes'; 334 var newscore = res.newScore; 335 $this.find('span.interests-score').empty(''); 336 $this.find('span.interests-score').empty(''); 337 $this.find('span.interests-score').text(newscore); 338 $this.find('.lp_state').text(res.statuss); 339 $this.find('.lp_state').slideToggle('slow'); 340 var showStatDiv = function () { 341 $this.find('.lp_state').slideToggle('slow'); 342 $this.addClass('review_actv'); 343 }; 344 timVar = setTimeout(showStatDiv, 3000); 345 //clearTimeout(timVar); 346 } 347 }, 348 error: function (request, error) { 349 alert(error); 350 } 351 }); 352 } 353 e.preventDefault(); 354 }); 355 356 357 jQuery('.reviews-section a.lol').click(function (e) { 358 var currentVal = ''; 359 currentVal = jQuery(this).data('score'); 360 }); 361 362 jQuery('.reviews-section a.love').click(function (e) { 363 var currentVal = ''; 364 currentVal = jQuery(this).data('score'); 365 }); 366 367 368 /* end by zaheer on 16 march */ 369 370
vendor: 3 bytes, line 371
371});
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.