PageSourceSearch

https://catacamas.net/wp-content/cache/wpfc-minified/dhtvun26/dwqyp.js

js catacamas.net collected 2026-10-02 21:18:47 UTC 44,805 bytes, 1,177 lines download raw bytes

1// source --> https://catacamas.net/wp-content/themes/listingpro/assets/js/single-ajax.js 
2 jQuery(document).ready(function($){
3
4
5	/* for claim slider */
6	if( jQuery('div.claim_slider').length > 0 ){
7		$wol_claim = jQuery(".lp-form-planclaim-st .rightside").width();
8		console.log($wol_claim);
9		jQuery('.lp-form-planclaim-st .claim-detailstext').css('width', $wol_claim+'px');
10		jQuery('.claim_slider').slick({
11			dots: true,
12			infinite: true,
13			arrows:false,
14			slidesToShow: 1,
15			slidesToScroll: 1
16		});
17		
18	}
19	
20	jQuery('.singincheckboxx input').on('click', function(){
21		var checked = jQuery(".singincheckboxx input").is(":checked");
22		
23		if(checked){
24			jQuery('.lp-form-planclaim-st .claim_signup').hide();
25			jQuery('.lp-form-planclaim-st .claim_signin').show();
26		}else{
27			jQuery('.lp-form-planclaim-st .claim_signin').hide();
28			jQuery('.lp-form-planclaim-st .claim_signup').show();
29		}
30	});
31	
32	
33	 
34	 
35	 jQuery('#claimform').on('submit', function(e){
36		
37		$this = jQuery(this);
38		jQuery('.planclaim-page-popup-st .statuss').hide();
39		jQuery('.planclaim-page-popup-st .statuss .lp-claim-cuccess').html('');
40		jQuery(this).find('.formsubmitting').css('visibility','visible');
41		e.preventDefault();
42		
43		
44		var data = new FormData(this);
45		data.append('action', 'listingpro_claim_list');
46		data.append('lpNonce', jQuery('#lpNonce').val());
47
48		jQuery.ajax({
49            type: 'POST',
50            url: single_ajax_object.ajaxurl,
51            data: data,   
52            success: function(resp){
53				var res = jQuery.parseJSON(resp);
54				console.log(res.result);
55                if(res.result > '0'){
56                    $this.find('.formsubmitting').css('visibility','hidden');
57                    jQuery('.planclaim-page-popup-st .statuss .lp-claim-cuccess').html(res.state);
58                    jQuery('.planclaim-page-popup-st .statuss').show();
59                    jQuery('.planclaim-page-popup-st .claim-details.insidewrp').hide();
60                    jQuery('.rightside').css("height","");
61                }else{
62                    $this.find('.formsubmitting').css('visibility','hidden');
63                    jQuery('.planclaim-page-popup-st .lp-claim-cuccess-return').hide();
64                    jQuery('.planclaim-page-popup-st .statuss .lp-claim-cuccess').html(res.state);
65                    jQuery('.planclaim-page-popup-st .statuss').show();
66                    jQuery('.planclaim-page-popup-st .claim-details.insidewrp').hide();
67                    jQuery('.rightside').css("height","");
68
69                }
70				
71				$this[0].reset();
72            },
73			processData: false,
74			contentType: false,
75        });
76		//return false;
77		 //alert(formData);
78	 });
79	 
80	  jQuery('#claimformmobile').on('submit', function(e){
81		$this = jQuery(this);
82		$this.find('.statuss').html('');
83		jQuery(this).find('.formsubmitting').css('visibility','visible');
84		e.preventDefault();
85		var data = new FormData(this);
86		data.append('action', 'listingpro_claim_list');
87		data.append('lpNonce', jQuery('#lpNonce').val());
88
89		jQuery.ajax({
90            type: 'POST',
91            url: single_ajax_object.ajaxurl,
92            data: data,   
93            success: function(resp){
94				var res = jQuery.parseJSON(resp);
95				$this.find('.formsubmitting').css('visibility','hidden');
96                //alert(res.state);
97				$this.find('.statuss').html(res.state);
98				
99				$this[0].reset();
100            },
101			processData: false,
102			contentType: false,
103        });
104		//return false;
105		 //alert(formData);
106	 });
107
108
109
110jQuery('#contactOwner').on('submit', function(e){
111
112         $this = jQuery(this);
113
114         e.preventDefault();
115
116         var lEmail     =   jQuery('#email7').val(),
117             lName      =   jQuery('#name7').val(),
118             lMsg       =   jQuery('#message7').val(),
119             proceedIt  =   true;
120
121         if( lEmail == '' || lName == '' || lMsg == '' )
122         {
123
124             if( lEmail == '' )
125             {
126                 jQuery('#email7').addClass('error-msg');
127             }
128             else
129             {
130                 jQuery('#email7').removeClass('error-msg');
131             }
132             if( lName == '' )
133             {
134                 jQuery('#name7').addClass('error-msg');
135             }
136             else
137             {
138                 jQuery('#name7').removeClass('error-msg');
139             }
140             if( lMsg == '' )
141             {
142                 jQuery('#message7').addClass('error-msg');
143             }
144             else
145             {
146                 jQuery('#message7').removeClass('error-msg');
147             }
148
149             proceedIt  =   false;
150         }
151         if( jQuery('input:checkbox.lp-required-field').length > 0 )
152         {
153             if (jQuery('input:checkbox.lp-required-field', this).is(':checked'))
154             {
155                 jQuery('input:checkbox.lp-required-field').closest('label' ).removeClass('error-msg');
156             }
157             else
158             {
159                 jQuery('input:checkbox.lp-required-field').closest('label' ).addClass('error-msg');
160                 proceedIt  =   false;
161             }
162         }
163         if( jQuery('input:radio.lp-required-field').length > 0 )
164         {
165             if(jQuery('input:radio.lp-required-field', this).is(':checked') )
166             {
167                 jQuery('input:radio.lp-required-field').closest('label' ).removeClass('error-msg');
168             }
169             else
170             {
171                 jQuery('input:radio.lp-required-field').closest('label' ).addClass('error-msg');
172                 proceedIt  =   false;
173
174             }
175         }
176
177         if( jQuery('#contactOwner .lp-required-field').length > 0 )
178         {
179             jQuery('#contactOwner .lp-required-field').each(function (index) {
180                 var $this      =   jQuery(this),
181                     $thisVal   =   $this.val(),
182                     $thisType  =   $this.attr('type');
183
184                 if( $this.prop('tagName') == 'SELECT' )
185                 {
186                     if( $thisVal == 0 )
187                     {
188                         proceedIt  =   false;
189                         $this.addClass('error-msg');
190                     }
191                     else
192                     {
193                         $this.removeClass('error-msg');
194                     }
195                 }
196                 else
197                 {
198
199                     if( $thisVal == '' )
200                     {
201                         proceedIt  =   false;
202                         $this.addClass('error-msg');
203                     }
204                     else
205                     {
206                         $this.removeClass('error-msg');
207                     }
208                 }
209
210             });
211         }
212         if( proceedIt === false )
213         {
214             return proceedIt;
215         }
216
217
218
219         var formData = $(this).serialize();
220         $this.find('.lp-search-icon').removeClass('fa-send');
221         $this.find('.lp-search-icon').addClass('fa-spinner fa-spin');
222		 
223		isCaptcha = jQuery(this).data('lp-recaptcha');
224		siteKey = jQuery(this).data('lp-recaptcha-sitekey');
225		token = '';
226		if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) {
227
228				 jQuery.ajax({
229					 type: 'POST',
230					 dataType: 'json',
231					 url: single_ajax_object.ajaxurl,
232					 data: {
233						 'action': 'listingpro_contactowner',
234						 'formData': formData,
235                         'lpNonce' : jQuery('#lpNonce').val()
236					 },
237					 success: function(res){
238						 
239						 if(res.result==="fail"){
240							 jQuery.each(res.errors, function (k, v) {
241								 if(k==="email"){
242									 jQuery("input[name='email7']").addClass('error-msg');
243								 }
244								 if(k==="message"){
245									 jQuery("textarea[name='message7']").addClass('error-msg');
246								 }
247								 if(k==="name7"){
248									 jQuery("input[name='name7']").addClass('error-msg');
249								 }
250								 $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin');
251								 $this.find('.lp-search-icon').addClass('fa-cross');
252								 //$this.append(res.state);
253							 });
254						 }
255						 else{
256							 $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin');
257							 $this.find('.lp-search-icon').addClass('fa-check');
258							 // success msg.
259							 jQuery('.lp-lead-success-msg-outer').fadeIn('700');
260							 //$this.append(res.state);
261							 $this[0].reset();
262						 }
263					 }
264				 });
265		}else{
266			
267			grecaptcha.ready(function() {
268				grecaptcha.execute(siteKey, {action: 'lp_lead'}).then(function(token) {
269					
270						jQuery.ajax({
271							 type: 'POST',
272							 dataType: 'json',
273							 url: single_ajax_object.ajaxurl,
274							 data: {
275								 'action': 'listingpro_contactowner',
276								 'formData': formData,
277								 'recaptha-action' : 'lp_lead',
278								 'token' : token,
279                                 'lpNonce' : jQuery('#lpNonce').val()
280							 },
281							 success: function(res){
282								 
283								 if(res.result==="fail"){
284									 jQuery.each(res.errors, function (k, v) {
285										 if(k==="email"){
286											 jQuery("input[name='email7']").addClass('error-msg');
287										 }
288										 if(k==="message"){
289											 jQuery("textarea[name='message7']").addClass('error-msg');
290										 }
291										 if(k==="name7"){
292											 jQuery("input[name='name7']").addClass('error-msg');
293										 }
294										 $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin');
295										 $this.find('.lp-search-icon').addClass('fa-cross');
296										 //$this.append(res.state);
297									 });
298								 }
299								 else{
300									 $this.find('.lp-search-icon').removeClass('fa-spinner fa-spin');
301									 $this.find('.lp-search-icon').addClass('fa-check');
302									 // success msg.
303									 jQuery('.lp-lead-success-msg-outer').fadeIn('700');
304									 //$this.append(res.state);
305									 $this[0].reset();
306								 }
307							 }
308						 });
309					
310				});
311			})
312			
313		}
314         
315
316     });
317	 
318	 
319/* jquery ajax code for expired listing plan change */
320	
321	jQuery(document).on('click','.lp-change-proceed-link', function(e){
322		jQuery('div.lp-existing-plane-container').slideToggle(700);
323		jQuery('div.lp-new-plane-container').slideToggle(700);
324		e.preventDefault();
325	})
326	
327	jQuery(document).on('click','.lp-role-back-to-current-plan', function(e){
328		jQuery('div.lp-existing-plane-container').slideToggle(700);
329		jQuery('div.lp-new-plane-container').slideToggle(700);
330		e.preventDefault();
331	})
332	
333	/* for recurring stripe */
334	jQuery(document).on('click','#select-plan-form .select-plan-form input[name=plans-posts]', function(){
335		jQuery("a.lp_change_plan_action").hide('');
336		jQuery("div.lp-action-div form").hide('');
337	});
338	
339	
340	jQuery('.lp-change-plan-btn').on('click', function(e){
341		var listing_id = '';
342		var listing_status = '';
343		var plan_title = '';
344		var plan_price = '';
345		var haveplan = '';
346		jQuery('div.lp-loadingPlans').html(jQuery('div.lp-loadingPlans').data('default'));
347		listing_id = jQuery(this).data('listingid');
348		plan_title = jQuery(this).data('plantitle');
349		plan_price = jQuery(this).data('planprice');
350		haveplan = jQuery(this).data('haveplan');
351		listing_status = jQuery(this).data('listingstatus');
352		jQuery('.lp-selected-plan-price h3' ).html('');
353		jQuery('.lp-selected-plan-price h3' ).text(plan_title);
354		jQuery('.lp-selected-plan-price h4' ).html('');
355		jQuery('.lp-selected-plan-price h4' ).html(plan_price);
356		jQuery('#select-plan-form input#listing_id' ).val(listing_id);
357		jQuery('#select-plan-form input#listing_statuss' ).val(listing_status);
358			jQuery.ajax({
359				type: 'POST',
360				dataType: 'json',
361				url: single_ajax_object.ajaxurl,
362				data: { 
363					'action': 'listingpro_change_plan_data', 
364					'listing_id': listing_id, 
365					'plan_title': plan_title, 
366					'plan_price': plan_price, 
367					'haveplan': haveplan, 
368					'listing_status': listing_status,
369                    'lpNonce' : jQuery('#lpNonce').val()
370				},   
371				success: function(data){
372					jQuery('div.lp-loadingPlans').html(data);
373				}
374			});		
375			
376			e.preventDefault();
377	});
378	jQuery(document).on('submit', '#select-plan-form',function(event){
379		var plan_id = '';
380		$this = jQuery(this);
381		listing_idd = '';
382		listing_status = '';
383		listing_idd = jQuery("input[name='plans-posts']:checked").val();
384		listing_id = jQuery("input[name='listing-id']").val();
385		listing_status = jQuery("input[name='listing_status']").val();
386		jQuery('.lp-change-plane-status .lp-action-div').html('');
387		if( typeof(listing_idd)  !== "undefined" ){
388			jQuery("div.lp-expire-update-status").html('<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"></i>');
389			jQuery.ajax({
390				type: 'POST',
391				dataType: 'json',
392				url: single_ajax_object.ajaxurl,
393				data: { 
394					'action': 'listingpro_change_plan', 
395					'ch_plan_id': listing_idd, 
396					'ch_listing_id': listing_id, 
397					'ch_listing_status': listing_status,
398                    'lpNonce' : jQuery('#lpNonce').val()
399				},   
400				success: function(data){
401					//jQuery('#select-plan-form')[0].reset();
402					if( data.subscribed ){
403						if(data.subscribed=="yes"){
404							alert(data.alertmsg);
405						}
406					}
407					jQuery("div.lp-expire-update-status").html('');
408					jQuery('.lp-change-plane-status .lp-action-div').html('');
409					jQuery('.lp-change-plane-status .lp-action-div').html(data.action);
410					
411				}
412			});
413			
414		}
415		event.preventDefault();
416	})
417	 
418 });
419 
420 
421 /* change plan proceedings */
422 jQuery(document).on('click', '.lp_change_plan_action', function(e){
423	 var planid = jQuery('.lp-action-div input[name="planid"]').val();
424	 var listingid = jQuery('.lp-action-div input[name="listingid"]').val();
425	 jQuery('.lp-action-div').html('');
426	 jQuery("div.lp-expire-update-status").html('<i class="fa fa-circle-o-notch fa-spin fa-2x fa-fw"></i>');
427	 jQuery.ajax({
428				type: 'POST',
429				dataType: 'json',
430				url: single_ajax_object.ajaxurl,
431				data: { 
432					'action': 'listingpro_change_plan_proceeding', 
433					'plan_iddd': planid, 
434					'listing_iddd': listingid,
435                    'lpNonce' : jQuery('#lpNonce').val()
436				},   
437				success: function(data){
438					//jQuery('#select-plan-form')[0].reset();
439					jQuery("div.lp-expire-update-status").html('');
440					jQuery("div.lp-expire-update-status").html(data.message);
441				}
442			});
443	 
444	 e.preventDefault();
445 })
446 /* end change plan proceedings */ 
447 
448 /* delete subscription proceedings */
449jQuery(document).on('click', 'a.delete-subsc-btn', function(e){
450
451     e.preventDefault();
452     var $this = jQuery(this),
453         cMsg   =   $this.data('cmsg');
454
455
456     var r = confirm(cMsg);
457
458
459     if( r == true )
460     {
461         jQuery('body').addClass('listingpro-loading');
462         var subscript_id = jQuery(this).attr('href');
463        if($this.hasClass('paystack-unsub')) {
464            var mail_token  =   $this.attr('data-mailtoekn');
465            unsubsribe_paystack(subscript_id, mail_token, $this);
466
467        }else if ($this.hasClass('razorpay-unsub')) {
468            unsubsribe_razorpay(subscript_id, $this);
469        } else {
470            jQuery.ajax({
471                type: 'POST',
472                dataType: 'json',
473                url: single_ajax_object.ajaxurl,
474                data: {
475                    'action': 'listingpro_cancel_subscription_proceeding',
476                    'subscript_id': subscript_id,
477                    'lpNonce' : jQuery('#lpNonce').val()
478                },
479                success: function(data){
480                    jQuery('body').removeClass('listingpro-loading');
481                    alert(data.msg);
482                    if(data.status=="success"){
483                        $this.closest('tr').slideToggle();
484                    }
485
486                },
487                error: function(jqXHR, textStatus, errorThrown) {
488                    jQuery('body').removeClass('listingpro-loading');
489                    console.log(textStatus, errorThrown);
490                }
491            });
492        }
493     }
494 });
495 
496 /* Report listing or Report Review */
497 jQuery(document).on('click', '#lp-report-listing a#lp-report-this-listing, #lp-report-review a#lp-report-this-review, .lp-review-right-bottom a#lp-report-this-review', function(e){
498	 var $this = jQuery(this);
499	 var $posttype = $this.data('posttype');
500	 var $postid = $this.data('postid');
501	 var $reportedby = $this.data('reportedby');
502	 jQuery('body').addClass('listingpro-loading');
503	 jQuery.ajax({
504				type: 'POST',
505				dataType: 'json',
506				url: single_ajax_object.ajaxurl,
507				data: { 
508					'action': 'listingpro_report_this_post', 
509					'posttype': $posttype, 
510					'postid': $postid, 
511					'reportedby': $reportedby,
512                    'lpNonce' : jQuery('#lpNonce').val()
513				},   
514				success: function(data){
515					jQuery('body').removeClass('listingpro-loading');
516					jQuery('div.lp-top-notification-bar').html('');
517					var alertmsgs = '';
518					if(data.status==="success"){
519						alertmsgs = '<div class="lp-reporting-success">
519'+data.msg+'</div>';
520						jQuery('div.lp-top-notification-bar').html(alertmsgs);
521					}
522					else{
523						alertmsgs = '<div class="lp-reporting-error">'+data.msg+'</div>';
524						jQuery('div.lp-top-notification-bar').html(alertmsgs);
525					}
526					jQuery('div.lp-top-notification-bar').slideDown('slow').delay(2000).slideUp('slow');
527					//alert(data.msg);
528					
529				},
530				error: function(jqXHR, textStatus, errorThrown) {
531					jQuery('body').removeClass('listingpro-loading');
532					console.log(textStatus, errorThrown);
533				}
534			});
535	 
536	 e.preventDefault();
537 })
538
539
540 /* lp bar graph print options */
541
542 jQuery(document).on('click', 'div.lp_user_stats_btn, ul li .lp_stats_duratonBtn', function(e){
543     $this = jQuery(this);
544     if($this.hasClass('active') && ($this.hasClass('lp_user_stats_btn'))){}else{
545         jQuery('div.lp_user_stats_btn').removeClass('active');
546         jQuery( "#lpgraph" ).empty();
547         $duration = jQuery('ul li .lp_stats_duratonBtn.active').data('chartduration');
548         $type = $this.data('type');
549         $label = $this.data('label');
550         jQuery('ul.lp_stats_duration_filter li button').data('label', $label);
551         jQuery('body').addClass('listingpro-loading');
552         jQuery.ajax({
553             type: 'POST',
554             dataType: 'json',
555             url: single_ajax_object.ajaxurl,
556             data: {
557                 'action': 'listingpro_show_bar_chart',
558                 'type': $label,
559                 'duration': $duration,
560                 'lpNonce' : jQuery('#lpNonce').val()
561             },
562             success: function(data){
563                 jQuery('body').removeClass('listingpro-loading');
564                 jQuery('ul.lp_stats_duration_filter').show();
565                 showthischart(data.data, $type, $label);
566                 jQuery('.lp_user_stats_btn.active p.lpstatsnumber').text('');
567                 jQuery('.lp_user_stats_btn.active p.lpstatsnumber').text(data.counts);
568                 jQuery('.lp_user_stats_btn.active').find('.lp_status_duration_counter').text('');
569                 jQuery('.lp_user_stats_btn.active').find('.lp_status_duration_counter').text(data.resp);
570                 //alert(data.msg);
571
572             },
573             error: function(jqXHR, textStatus, errorThrown) {
574                 jQuery('body').removeClass('listingpro-loading');
575                 console.log(textStatus, errorThrown);
576             }
577         });
578     }
579 });
580
581function showthischart($datarray, $type, $label){
582    Morris.Bar({
583      element: 'lpgraph',
584      data : $datarray,
585      xkey: 'x',
586      ykeys: ['y'],
587      labels: [$type]
588    });
589    if($label=="view"){
590        jQuery('div.lpviewchart').addClass('active');
591    }else if($label=="leads"){
592        jQuery('div.lpviewleads').addClass('active');
593    }else if($label=="reviews"){
594        jQuery('div.lpviewreviews').addClass('active');
595    }
596}
597
598/* start for coupon button on checkout page */
599jQuery(document).on('click', 'button.coupon-apply-bt', function(){
600     var couponcode = jQuery('input[name=coupon-text-field]').val();
601     var $price = jQuery('input[name=listing_id]:checked').data('planprice');
602     var $listingID = jQuery('input[name=listing_id]:checked').val();
603     var $post_title = jQuery('input[name=listing_id]:checked').data('title');
604     var $planID = jQuery('input[name=listing_id]:checked').data('planid');
605     var $tax =jQuery('input[name=listing_id]:checked').data('taxenable');
606     var $taxRate = jQuery('input[name=listing_id]:checked').data('taxrate');
607
608     if(couponcode === ''){}else{
609         jQuery('body').addClass('listingpro-loading');
610         jQuery.ajax({
611             type: 'POST',
612             dataType: 'json',
613             url: single_ajax_object.ajaxurl,
614             data: {
615                 'action': 'listingpro_apply_coupon_code',
616                 'coupon': couponcode,
617                 'listingid': $listingID,
618                 'taxrate': $taxRate,
619                 'price': $price,
620                 'lpNonce' : jQuery('#lpNonce').val()
621             },
622             success: function(data){
623                 jQuery('body').removeClass('listingpro-loading');
624                 if(data.status=="success"){
625                     $discount = data.discount;
626                     $discounttype = data.coupontype;
627					 $discountIn = '%';
628					 if($discounttype=='on'){
629						 /* means it is fixed price coupon */
630						 $discountIn = '';
631					 }
632					 $newprice = data.price;
633                     $newprice = parseFloat($newprice).toFixed(2);
634                     lp_add_checkout_data_fields_in_form($listingID, $post_title, $planID, $newprice, $tax, $taxRate);
635					  if(jQuery('li').hasClass('checkout_discount_val')){}else{
636					 jQuery('span.lp-subtotal-p-price').parent().after('<li class="checkout_discount_val"><span class="item-price-total-left lp-subtotal-plan">Discounted</span><span class="item-price-total-right lp-subtotal-p-prasaice">'+$discount+$discountIn+'</span></li>');
637					  }
638                 }else{
639                     ajax_success_popup( data, '' )
640                 }
641
642             },
643             error: function(jqXHR, textStatus, errorThrown) {
644                 jQuery('body').removeClass('listingpro-loading');
645                 console.log(textStatus, errorThrown);
646             }
647         });
648     }
649
650 });
651 
652/* reset tax in database while switching offto discound */
653jQuery(document).on('click', 'input[name="lp_checkbox_coupon"]', function(){
654	if(jQuery(this).hasClass('active')){}else{
655		
656		 var couponcode = jQuery('input[name=coupon-text-field]').val();
657		 var $price = jQuery('input[name=listing_id]:checked').data('planprice');
658		 var $listingID = jQuery('input[name=listing_id]:checked').val();
659		 var $post_title = jQuery('input[name=listing_id]:checked').data('title');
660		 var $planID = jQuery('input[name=listing_id]:checked').data('planid');
661		 var $tax =jQuery('input[name=listing_id]:checked').data('taxenable');
662		 var $taxRate = jQuery('input[name=listing_id]:checked').data('taxrate');
663		 
664		 jQuery.ajax({
665             type: 'POST',
666             dataType: 'json',
667             url: single_ajax_object.ajaxurl,
668             data: {
669                 'action': 'listingpro_apply_coupon_code',
670                 'coupon': couponcode,
671                 'notusing': 'true',
672                 'listingid': $listingID,
673                 'taxrate': $taxRate,
674                 'price': $price,
675                 'lpNonce' : jQuery('#lpNonce').val()
676             },
677             success: function(data){
678                 jQuery('body').removeClass('listingpro-loading');
679                 if(data.status=="success"){
680                     $discount = data.discount;
681                     $discounttype = data.coupontype;
682					 $discountIn = '%';
683					 if($discounttype=='on'){
684						 /* means it is fixed price coupon */
685						 $discountIn = '';
686					 }
687					 $newprice = data.price;
688                     $newprice = parseFloat($newprice).toFixed(2);
689                     lp_add_checkout_data_fields_in_form($listingID, $post_title, $planID, $newprice, $tax, $taxRate);
690					  if(jQuery('li').hasClass('checkout_discount_val')){}else{
691					 jQuery('span.lp-subtotal-p-price').parent().after('<li class="checkout_discount_val"><span class="item-price-total-left lp-subtotal-plan">Discounted</span><span class="item-price-total-right lp-subtotal-p-prasaice">'+$discount+$discountIn+'</span></li>');
692					  }
693                 }
694
695             },
696             error: function(jqXHR, textStatus, errorThrown) {
697                 jQuery('body').removeClass('listingpro-loading');
698                 console.log(textStatus, errorThrown);
699             }
700         });
701		 
702		
703	}
704     
705 });
706 
707 
708 
709/* ajax call to reply to leads message */
710jQuery(document).on('submit', 'form[name=lp_leadReply]', function(e){
711	
712	$this = jQuery(this);
713	$this.find('.lpthisloading').show();
714	var fd = new FormData(this);
715	fd.append('action', 'lp_reply_to_lead_msg');
716	fd.append('lpNonce', jQuery('#lpNonce').val());
717	jQuery.ajax({
718            type: 'POST',
719            url: single_ajax_object.ajaxurl,
720            data:fd,  
721			contentType: false,
722			processData: false,
723            success: function(res){
724				$this.find('.lpthisloading').removeClass('fa-spinner fa-spin');
725				$this.find('.lpthisloading').addClass('fa-check');
726				window.location.href=window.location.href
727				$this[0].reset();
728            },
729			error: function(request, error){
730				//alert(error);
731				$this.find('.lpthisloading').removeClass('fa-spinner fa-spin');
732				$this.find('.lpthisloading').addClass('fa-check');
733				window.location.href=window.location.href
734			}
735        });
736	e.preventDefault();
737	return false;	
738});
739
740/* ajax call read message thread on click */
741 jQuery(document).on('click', '.lp-read-messages .lp-read-message-inner', function(e){
742     $this = jQuery(this);
743     $loaderImg = $this.data('loader');
744     $listingid = $this.data('listingid');
745     $useremail = $this.data('email');
746	 jQuery('.lp-read-messages .lp-read-message-inner').removeClass('active');
747	 jQuery('.lp-read-messages .lp-read-message-inner').removeClass('unread');
748	 $this.addClass('active');
749	 $this.addClass('read');
750     if($listingid){
751         jQuery('.lpinboxmiddlepart').html('');
752         jQuery('.lpinboxrightpart').html('');
753         jQuery('.lpinboxmiddlepart').html('<div class="text-center loadercenterclass"><img src="'+$loaderImg+'" width=35 height=35></div>');
754         jQuery('.lpinboxrightpart').html('<div class="text-center loadercenterclass"><img src="'+$loaderImg+'" width=35 height=35></div>');
755         jQuery.ajax({
756             type: 'POST',
757             dataType: 'json',
758             url: single_ajax_object.ajaxurl,
759             data: {
760                 'action': 'lp_preview_this_message_thread',
761                 'listindid': $listingid,
762                 'useremail': $useremail,
763                 'lpNonce' : jQuery('#lpNonce').val()
764             },
765             success: function(data){
766                 jQuery('.lpinboxmiddlepart').html('');
767                 jQuery('.lpinboxrightpart').html('');
768                 jQuery('.lpinboxmiddlepart').html(data.outputcenter);
769                 jQuery('.lpinboxrightpart').html(data.outputright);
770
771             },
772             error: function(jqXHR, textStatus, errorThrown) {
773                 jQuery('.lpinboxmiddlepart').html('');
774                 jQuery('.lpinboxrightpart').html('');
775                 jQuery('.lpinboxmiddlepart').html(data.outputcenter);
776                 jQuery('.lpinboxrightpart').html(data.outputright);
777             }
778         });
779     }
780
781
782
783 });
784
785
786/* ==================for saving id in session for checkout============= */
787 
788 jQuery(document).on('click', 'a.lp-pay-publish-btn, a.lp-listing-pay-button, input.lp-listing-pay-button', function(){
789	 $listingID = jQuery(this).data('lpthisid');
790	 jQuery.ajax({
791         type: 'POST',
792         dataType: 'json',
793         url: single_ajax_object.ajaxurl,
794         data: {
795             'action': 'lp_save_thisid_in_session',
796             'listing_id': $listingID,
797             'lpNonce' : jQuery('#lpNonce').val()
798         },
799         success: function(data){
800             console.log(data);
801         },
802         error: function(jqXHR, textStatus, errorThrown) {
803             console.log(errorThrown);
804         }
805     });
806 });
807	
808/* ==================delete converstaion inbox============= */
809 
810 jQuery(document).on('click', 'button.lp-delte-conv', function(){
811	 $this = jQuery(jQuery(this));
812	 $emailid = jQuery(this).data('emailid');
813	 $listingid = jQuery(this).data('listingid');
814	 $this.closest('#lp-ad-click-inner').find('.lpthisloading').show();
815	 jQuery.ajax({
816         type: 'POST',
817         dataType: 'json',
818         url: single_ajax_object.ajaxurl,
819         data: {
820             'action': 'lp_delete_this_conversation',
821             'listingid': $listingid,
822             'emailid': $emailid,
823             'lpNonce' : jQuery('#lpNonce').val()
824         },
825         success: function(data){
826            $this.closest('#lp-ad-click-inner').find('.lpthisloading').removeClass('fa-spinner fa-spin');
827			$this.closest('#lp-ad-click-inner').find('.lpthisloading').addClass('fa-check');
828			window.location.href=window.location.href
829         },
830         error: function(jqXHR, textStatus, errorThrown) {
831             console.log(errorThrown);
832         }
833     });
834 });
835
836
837/* ==================submit contact us form============= */
838jQuery(document).ready(function($){
839    jQuery( '#contactMSGForm' ).on('submit', function(e){
840		jQuery('#contactMSGForm #error').hide();
841		jQuery('#contactMSGForm #success').hide();
842		jQuery('#contactMSGForm .statuss').show();
843		e.preventDefault();
844		$this = jQuery(this);
845		isCaptcha = jQuery(this).data('lp-recaptcha');
846		siteKey = jQuery(this).data('lp-recaptcha-sitekey');
847		token = '';
848		var fd = new FormData(this);
849		fd.append('action', 'lp_ajax_contact_submit');
850		fd.append('lpNonce', jQuery('#lpNonce').val());
851			if ( (isCaptcha == '' || isCaptcha === null) || (siteKey == '' || siteKey === null) ) {
852					
853						jQuery.ajax({
854							type: 'POST',
855							url: single_ajax_object.ajaxurl,
856							data:fd,
857							contentType: false,
858							processData: false,
859							
860							success: function(res){
861								jQuery('#contactMSGForm .statuss').hide();
862								var res = jQuery.parseJSON(res);
863								if(res.status=="error"){
864									jQuery('#contactMSGForm #error span p').html('');
865									jQuery('#contactMSGForm #error span p').html(res.msg);
866									jQuery('#contactMSGForm #error').show();
867								}
868								else if(res.status=="success"){
869									jQuery('#contactMSGForm #success span p').html('');
870									jQuery('#contactMSGForm #success span p').html(res.msg);
871									jQuery('#contactMSGForm #success').show();
872								}
873								
874							},
875							error: function(request, error){
876								jQuery('#contactMSGForm .statuss').hide();
877								alert(error);
878							}
879						});
880			}else{
881						//for recpatcha
882						
883						grecaptcha.ready(function() {
884							grecaptcha.execute(siteKey, {action: 'lp_contact'}).then(function(token) {
885								
886								fd.append('recaptha-action', 'lp_contact');
887								fd.append('token', token);
888								
889								jQuery.ajax({
890									type: 'POST',
891									url: single_ajax_object.ajaxurl,
892									data:fd,
893									contentType: false,
894									processData: false,
895									
896									success: function(res){
897										jQuery('#contactMSGForm .statuss').hide();
898										var res = jQuery.parseJSON(res);
899										if(res.status=="error"){
900											jQuery('#contactMSGForm #error span p').html('');
901											jQuery('#contactMSGForm #error span p').html(res.msg);
902											jQuery('#contactMSGForm #error').show();
903										}
904										else if(res.status=="success"){
905											jQuery('#contactMSGForm #success span p').html('');
906											jQuery('#contactMSGForm #success span p').html(res.msg);
907											jQuery('#contactMSGForm #success').show();
908										}
909										
910									},
911									error: function(request, error){
912										jQuery('#contactMSGForm .statuss').hide();
913										alert(error);
914									}
915								});
916								
917							});
918						})
919			}
920		
921	 });
922});
923
924/* ===============lp review filter=============== */
925 jQuery(document).ready(function($){
926	jQuery('#lp_reivew_drop_filter').on('change', function(e){
927		e.preventDefault();
928		jQuery('.reviews-section').html('');
929		jQuery('.review-filter-loader').show();
930		jQuery('.lp-listing-reviews .lp-listing-review').remove();
931		$this = jQuery(this);
932					jQuery.ajax({
933						 type: 'POST',
934						 dataType: 'json',
935						 url: single_ajax_object.ajaxurl,
936						 data: {
937							 'action': 'lp_show_sorted_reivews',
938							 'order_by': $this.val(),
939							 'listing_id': jQuery('input[name=post_id]').val(),
940                             'lpNonce' : jQuery('#lpNonce').val()
941						 },
942						 success: function(data){
943							jQuery('.review-filter-loader').hide();
944							jQuery('.reviews-section').html(data);
945							jQuery('.lp-listing-reviews').append(data);
946						 },
947						 error: function(jqXHR, textStatus, errorThrown) {
948							 jQuery('.review-filter-loader').hide();
949							 console.log(errorThrown);
950						 }
951					});
952	}); 
953 });
954
955/* ===============lp make listing publish with 100% discount=============== */
956 function lp_make_this_listing_publish_withdiscount($listing_id){
957	 
958	 jQuery('body').addClass('listingpro-loading');
959					jQuery.ajax({
960						 type: 'POST',
961						 dataType: 'json',
962						 url: single_ajax_object.ajaxurl,
963						 data: {
964							 'action': 'lp_make_listing_published',
965							 'listing_id': $listing_id,
966                             'plan_price': jQuery("#listings_checkout_form input[name=plan_price]").val(),
967				             'taxrate': jQuery("#listings_checkout_form input[name=listings_tax_price]").val(),
968                              'coupon' : jQuery("#listings_checkout_form input[name=coupon-text-field]").val(),
969                             'lpNonce' : jQuery('#lpNonce').val()
970						 },
971						 success: function(data){
972							jQuery('body').removeClass('listingpro-loading');
973							if(data.status=="success"){
974								/* redirect to the listing page */
975								document.location.href = data.url;
976							}else{
977								alert(data.url);
978							}
979						 },
980						 error: function(jqXHR, textStatus, errorThrown) {
981							 jQuery('body').removeClass('listingpro-loading');
982							 alert(errorThrown);
983							 console.log(errorThrown);
984						 }
985					});
986 }
987 
988 
989 /* =================lp save user analytics===================== */
990 jQuery(document).on('submit','#lp-user-g-analytics form', function(e){
991		e.preventDefault();
992		formData = jQuery(this);
993		jQuery('#lp-user-g-analytics .analyticsspin').show();
994		
995		jQuery.ajax({
996						 type: 'POST',
997						 dataType: 'json',
998						 url: single_ajax_object.ajaxurl,
999						 data: {
1000							 'action': 'lp_save_user_analytics',
1001							 'data': formData.serialize(),
1002                             'lpNonce' : jQuery('#lpNonce').val()
1003						 },
1004						 success: function(data){
1005							if(data=="success"){
1006							}else{
1007								
1008							}
1009							jQuery('#lp-user-g-analytics .analyticsspin').hide();
1010						 },
1011						 error: function(jqXHR, textStatus, errorThrown) {
1012							 alert(errorThrown);
1013							 jQuery('#lp-user-g-analytics .analyticsspin').hide();
1014						 }
1015					});
1016	});
1017
1018
1019
1020 /* =================claim form enable disbale button and fields validation===================== */
1021 jQuery(document).ready(function () {
1022     var kldf = jQuery("#claim_new_user_email").attr('placeholder');
1023     if (kldf != undefined) {
1024         jQuery('#lp-signin-on-claim').click(function () {
1025             jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1026
1027             jQuery('#claim_username').val("");
1028             jQuery('#claim_userpass').val("");
1029             jQuery('#claim_new_user_email').val("");
1030         });
1031         jQuery("#claimform #fullname, #lastname, #phoneClaim, #bemail, #message, #claim_username, #claim_userpass, #claim_new_user_email").keyup(function(){
1032             if (jQuery('#lp-signin-on-claim').prop('checked')) {
1033                 var name = jQuery('#fullname').val(),
1034                     lname = jQuery('#lastname').val(),
1035                     phone = jQuery('#phoneClaim').val(),
1036                     email = jQuery('#bemail').val();
1037                 comment = jQuery('#message').val();
1038                 newusername = jQuery('#claim_username').val();
1039                 newuserpass = jQuery('#claim_userpass').val();
1040                 if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 && newusername.length > 0 && newuserpass.length > 0 ){
1041                     var checkpandp = jQuery('#textforjq').val();
1042                     if (checkpandp == 'true') {
1043                         var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1044                         if (checkpandpcheck == 'false') {
1045                             jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1046                         }else if (checkpandpcheck == 'true') {
1047                             jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1048                         }
1049                     }else if (checkpandp == 'false') {
1050                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1051                     }
1052                 }else{
1053                     jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1054                 }
1055             }else{
1056                 var name = jQuery('#fullname').val(),
1057                     lname = jQuery('#lastname').val(),
1058                     phone = jQuery('#phoneClaim').val(),
1059                     email = jQuery('#bemail').val();
1060                 comment = jQuery('#message').val();
1061                 newuser = jQuery('#claim_new_user_email').val();
1062                 if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 && newuser.length > 0 ){
1063                     var checkpandp = jQuery('#textforjq').val();
1064                     if (checkpandp == 'true') {
1065                         var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1066                         if (checkpandpcheck == 'false') {
1067                             jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1068                         }else if (checkpandpcheck == 'true') {
1069                             jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1070                         }
1071                     }else if (checkpandp == 'false') {
1072                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1073                     }
1074                 }else{
1075                     jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1076                 }
1077             }
1078         });
1079         jQuery("#claimform #fullname, #lastname, #phoneClaim, #bemail, #message, #claim_username, #claim_userpass, #claim_new_user_email, #claimform .lpprivacycheckboxopt").click(function(){
1080             if (jQuery('#lp-signin-on-claim').prop('checked')) {
1081                 var name = jQuery('#fullname').val(),
1082                     lname = jQuery('#lastname').val(),
1083                     phone = jQuery('#phoneClaim').val(),
1084                     email = jQuery('#bemail').val();
1085                 comment = jQuery('#message').val();
1086                 newusername = jQuery('#claim_username').val();
1087                 newuserpass = jQuery('#claim_userpass').val();
1088                 if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 && newusername.length > 0 && newuserpass.length > 0 ){
1089                     var checkpandp = jQuery('#textforjq').val();
1090                     if (checkpandp == 'true') {
1091                         var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1092                         if (checkpandpcheck == 'false') {
1093                             jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1094                         }else if (checkpandpcheck == 'true') {
1095                             jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1096                         }
1097                     }else if (checkpandp == 'false') {
1098                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1099                     }
1100                 }else{
1101                     jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1102                 }
1103             }else{
1104                 var name = jQuery('#fullname').val(),
1105                     lname = jQuery('#lastname').val(),
1106                     phone = jQuery('#phoneClaim').val(),
1107                     email = jQuery('#bemail').val();
1108                 comment = jQuery('#message').val();
1109                 newuser = jQuery('#claim_new_user_email').val();
1110                 if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 && newuser.length > 0 ){
1111                     var checkpandp = jQuery('#textforjq').val();
1112                     if (checkpandp == 'true') {
1113                         var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1114                         if (checkpandpcheck == 'false') {
1115                             jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1116                         }else if (checkpandpcheck == 'true') {
1117                             jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1118                         }
1119                     }else if (checkpandp == 'false') {
1120                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1121                     }
1122                 }else{
1123                     jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1124                 }
1125             }
1126         });
1127     }else{
1128         jQuery("#claimform #fullname, #lastname, #phoneClaim, #bemail, #message, #claim_new_user_email").keyup(function(){
1129
1130             var name = jQuery('#fullname').val(),
1131                 lname = jQuery('#lastname').val(),
1132                 phone = jQuery('#phoneClaim').val(),
1133                 email = jQuery('#bemail').val();
1134             comment = jQuery('#message').val();
1135             if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 ){
1136                 var checkpandp = jQuery('#textforjq').val();
1137                 if (checkpandp == 'true') {
1138                     var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1139                     if (checkpandpcheck == 'false') {
1140                         jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1141                     }else if (checkpandpcheck == 'true') {
1142                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1143                     }
1144                 }else if (checkpandp == 'false') {
1145                     jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1146                 }
1147             }else{
1148                 jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1149             }
1150         });
1151
1152         jQuery("#claimform #fullname, #lastname, #phoneClaim, #bemail, #message, #claim_new_user_email, #claimform .lpprivacycheckboxopt").click(function(){
1153
1154             var name = jQuery('#fullname').val(),
1155                 lname = jQuery('#lastname').val(),
1156                 phone = jQuery('#phoneClaim').val(),
1157                 email = jQuery('#bemail').val();
1158             comment = jQuery('#message').val();
1159
1160             if( name.length > 0 && lname.length > 0 && phone.length > 0 && email.length > 0 && comment.length > 0 ){
1161                 var checkpandp = jQuery('#textforjq').val();
1162                 if (checkpandp == 'true') {
1163                     var checkpandpcheck = jQuery('#claimform .lpprivacycheckboxopt').is(':checked');
1164                     if (checkpandpcheck == 'false') {
1165                         jQuery('#claimform').find('input[type=submit]').attr("disabled", "disabled");
1166                     }else if (checkpandpcheck == 'true') {
1167                         jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1168                     }
1169                 }else if (checkpandp == 'false') {
1170                     jQuery('#claimform').find('input[type=submit]').removeAttr('disabled');
1171                 }
1172             }else{
1173                 jQuery(this).closest('form').find('input[type=submit]').attr("disabled", "disabled");
1174             }
1175         });
1176     }
1177 });

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.