PageSourceSearch

https://www.topgoogle.com/wp-content/themes/listingpro/assets/js/main-new.js

js topgoogle.com collected 2026-09-24 10:20:11 UTC 188,516 bytes, 5,648 lines download raw bytes

1jQuery.noConflict();
2
3setTimeout(function() {
4    if( jQuery('body').hasClass('home') )
5    {
6        var currentTOP  =   jQuery('.header-container header').height();
7        jQuery( '.lp-header-search-wrap' ).css('top', '-'+currentTOP+'px');
8    }
9
10
11
12    jQuery(".lp-header-search .lp-header-search-form form, .lp-header-search .lp-header-search-cats ul").show()
13
14}, 600);
15
16jQuery(function(){
17    var sidebarHeight   =   jQuery('.sidebar-top0').height(),
18        DesHeight       =   sidebarHeight-200,
19        topHeader       =   jQuery('.lp-listing-top-title-header').height(),
20        minHeight       =   jQuery('.min-height-class').height(),
21        desHeightT      =   topHeader+minHeight,
22        minHeightT      =   sidebarHeight-DesHeight;
23
24    if( DesHeight >= sidebarHeight )
25
26    {
27
28        jQuery('.min-height-class').css('min-height', minHeightT);
29
30    }
31
32    else
33    {
34        minHeightT  =   sidebarHeight-topHeader+140;
35        jQuery('.min-height-class').css('min-height', minHeightT);
36
37    }
38});
39
40//babis add this
41jQuery(window).on("load", function() {
42  if(jQuery('.lp-listing-top-title-header').length) {
43      var top_title_header_height =   jQuery('.lp-listing-top-title-header').height();
44      jQuery('.sidebar-top0').css('top', '-'+parseInt(top_title_header_height+40)+'px');
45  }
46});
47//babis add this
48
49jQuery(document).ready(function (e) {
50
51    //babis remove this
52    /*if(jQuery('.lp-listing-top-title-header').length) {
53        var top_title_header_height =   jQuery('.lp-listing-top-title-header').height();
54        jQuery('.sidebar-top0').css('top', '-'+parseInt(top_title_header_height+40)+'px');
55    }*/
56    //babis remove this
57
58    if(jQuery('#menu-placeholder-image').length){
59        var menu_placeholder_image  =   jQuery('#menu-placeholder-image').val();
60        var menu_chili_image  =   jQuery('#menu-chili-image').val();
61
62        if (menu_placeholder_image != '') {
63            jQuery('.lp-listing-menu-top').css('background', 'url(' + menu_placeholder_image + ')');
64        }
65        jQuery('.lp-listing-menuu-slide').each(function(index){
66            var $thisSlide      =   jQuery(this),
67                targetImg       =   $thisSlide.find('img'),
68                topImgSrc       =   '';
69            jQuery(targetImg).each(function (imgIndex) {
70                var loopImg     =   jQuery(this),
71                    targetSrc   =   loopImg.attr('src');
72
73                if(targetSrc != menu_placeholder_image && targetSrc != menu_chili_image) {
74                    topImgSrc   =   targetSrc;
75
76                    return;
77                }
78            });
79            if (topImgSrc != '') {
80                $thisSlide.find('.lp-listing-menu-top').css('background', 'url(' + topImgSrc + ')');
81            }
82        });
83    }
84
85    if(jQuery('#datepicker-lang').length) {
86        var datepicker_lang =   jQuery('#datepicker-lang').val();
87        jQuery.datepicker.regional[datepicker_lang];
88    }
89
90    if(jQuery('.loop-grid-clearfix').length > 0){
91        jQuery('.loop-grid-clearfix:nth-child(4)').after('<div class="clearfix"></div>');
92    }
93
94	jQuery('.claimformtrigger2').click(function () {
95        jQuery('.planclaim-page-popup').show();
96    })
97
98jQuery('.lp-review-form-top-multi .lp-review-stars i').click(function (e) {
99        if( jQuery('.lp-review-stars').hasClass('do-not-proceed') )
100        {
101
102        }
103        else
104        {
105            e.preventDefault();
106            jQuery('.lp-review-form-bottom').slideDown(500);
107            var ratingNum   =   jQuery(this).data('rating'),
108                colorCode   =   '#de9147';
109
110            jQuery(this).closest('.lp-review-stars').addClass('do-not-proceed active-rating-avg'+ratingNum);
111            jQuery(this).removeClass('fa-star-o').addClass('fa-star');
112
113            jQuery(this).prevAll('.fa-star-o').removeClass('fa-star-o').addClass('fa-star');
114            jQuery(this).nextAll('.fa-star').removeClass('fa-star-o').addClass('fa-star-o');
115
116            if( ratingNum == 2 ) {
117                colorCode   =   '#de9147';
118            } else if ( ratingNum == 3 || ratingNum == 4 ) {
119                colorCode   =   '#c5de35';
120            } else if ( ratingNum == 5 ) {
121                colorCode   =   '#73cf42';
122            }
123
124            jQuery('.lp-multi-rating-ui-wrap > .padding-left-0').each(function () {
125                jQuery(this).find('.lp-multi-rating-val').val(ratingNum);
126                jQuery(this).find('span:first').each(function () {
127
128                    jQuery(this).addClass('active-stars-wrap');
129                    jQuery(this).find('.rating-symbol').each(function (index) {
130
131                        if( index < ratingNum )
132                        {
133                            jQuery(this).find('.rating-symbol-foreground span').css('color', colorCode);
134                            jQuery(this).find('.rating-symbol-foreground span').addClass('fa fa-star fa-2x');
135                            jQuery(this).find('.rating-symbol-foreground').css('width', 'auto');
136                        }
137                    });
138                });
139            });
140        }
141
142    });
143
144    jQuery('.manage-group-types').click(function (e) {
145        e.preventDefault();
146        window.location.replace(jQuery(this).data('url')) ;
147    });
148
149    jQuery('.show-more-event-content').click(function (e) {
150
151        var showMore    =   jQuery(this).data('more'),
152
153            showLess    =   jQuery(this).data('less');
154        if( jQuery(this).hasClass('expanded') )
155        {
156            jQuery('.lp-evnt-content-container p').css('height', '31px');
157            jQuery(this).text(showMore);
158            jQuery(this).removeClass('expanded');
159        }
160        else
161        {
162            jQuery('.lp-evnt-content-container p').height('auto');
163            jQuery(this).addClass('expanded');
164            jQuery(this).text(showLess);
165        }
166    });
167
168    jQuery( ".header-cat-menu" ).hover(
169        function() {
170            jQuery( this ).find('#menu-category').addClass( "show-cat-nav" );
171        }, function() {
172            jQuery( this ).find('#menu-category').removeClass( "show-cat-nav" );
173        }
174    );
175
176if (jQuery('#lp-submit-form').length != 0) {
177
178    var lp_custom_title = '';
179        if (jQuery('#lp_custom_title').length != 0) {
180            lp_custom_title = jQuery('#lp_custom_title').offset().top;
181        }
182        var inputAddress = '';
183        if (jQuery('#inputAddress').length != 0) {
184            inputAddress = jQuery('#inputAddress').offset().top;
185        }
186        var inputTagline = '';
187        if (jQuery('#lptagline').length != 0) {
188            inputTagline = jQuery('#lptagline').offset().top;
189        }
190        var inputCity = '';
191        if (jQuery('#inputCity').length != 0) {
192            inputCity = jQuery('#inputCity').offset().top;
193        }
194         if (jQuery('#citiess').length != 0) {
195            inputCity = jQuery('#citiess').offset().top;
196        }
197        var inputPhone = '';
198        if (jQuery('#inputPhone').length != 0) {
199            inputPhone = jQuery('label[for="inputPhone"]').offset().top;
200        }
201        var inputWhatsapp = '';
202        if (jQuery('#inputWhatsapp').length != 0) {
203            inputWhatsapp = jQuery('label[for="inputWhatsapp"]').offset().top;
204        }
205        var inputWebsite = '';
206        if (jQuery('#inputWebsite').length != 0) {
207            inputWebsite = jQuery('#inputWebsite').offset().top;
208        }
209        var inputCategory = '';
210        if (jQuery('label[for="inputCategory"]').length != 0) {
211            inputCategory = jQuery('label[for="inputCategory"]').offset().top;
212        }
213        var price_status = '';
214        if (jQuery('label[for="price_status"]').length != 0) {
215            price_status = jQuery('label[for="price_status"]').offset().top;
216        }
217        var bussinTop = '';
218        if (jQuery('.bussin-top').length != 0) {
219            bussinTop = jQuery('.bussin-top').offset().top;
220        }
221        var socialMedia = '';
222        if (jQuery('#socialMedia').length != 0) {
223            socialMedia = jQuery('#socialMedia').offset().top;
224        }
225        if (jQuery('#get_media').length != 0) {
226            socialMedia = jQuery('#get_media').offset().top;
227        }
228        var get_media_url = '';
229        if (jQuery('#get_media_url').length != 0) {
230            get_media_url = jQuery('#get_media_url').offset().top;
231        }
232        var inpuFaqsLp = '';
233        if (jQuery('label[for="inpuFaqsLp"]').length != 0) {
234            inpuFaqsLp = jQuery('label[for="inpuFaqsLp"]').offset().top;
235        }
236        var descTop = '';
237        if (jQuery('.description-tip').length != 0) {
238            descTop = jQuery('.description-tip').offset().top;
239        }
240        if (jQuery('label[for="inputDescription"]').length != 0) {
241            descTop = jQuery('label[for="inputDescription"]').offset().top;
242        }
243        var postVideo = '';
244        if (jQuery('#postVideo').length != 0) {
245            postVideo = jQuery('#postVideo').offset().top;
246        }
247        var gallTop = '';
248        if (jQuery('.lp-img-gall-upload-section').length != 0) {
249            var gallTop = jQuery('.lp-img-gall-upload-section').offset().top;
250        }
251        var bLogoTop = '';
252        if (jQuery('.b-logo-img-label').length != 0) {
253            var bLogoTop = jQuery('.b-logo-img-label').offset().top;
254        }
255        var featTop = '';
256        if (jQuery('.featured-img-label').length != 0) {
257            featTop = jQuery('.featured-img-label').offset().top;
258        }
259        var quicktags = '';
260        if (jQuery('#inputtagsquicktip').length > 0) {
261            quicktags = jQuery('#inputtagsquicktip').offset().top;
262        }
263        if (jQuery('#inputTags').length > 0) {
264            quicktags = jQuery('#inputTags').offset().top;
265        }
266        jQuery(window).scroll(function (e) {
267            /*if (inputTagline < 400 ) {
268                inputTagline = inputTagline+400;
269            }*/
270            var scrollPos = jQuery(window).scrollTop()+400;
271            if ( scrollPos > lp_custom_title ) {
272                    jQuery('.quick-tip-inner').html(jQuery('#lptitle').data('quick-tip'));
273            }
274            /*if (scrollPos > inputTagline) {
275                jQuery('.quick-tip-inner').html(jQuery('#lptagline').data('quick-tip'));
276            }*/
277            if (scrollPos > inputAddress) {
278                jQuery('.quick-tip-inner').html(jQuery('#inputAddress').data('quick-tip'));
279            }
280            if (scrollPos > inputCity) {
281                if (jQuery('#inputCity').length!=0) {
282                    jQuery('.quick-tip-inner').html(jQuery('#inputCity').data('quick-tip'));
283                }
284                else{
285                    jQuery('.quick-tip-inner').html(jQuery('#citiess').data('quick-tip'));
286                }
287            }
288            if (scrollPos > inputPhone) {
289                jQuery('.quick-tip-inner').html(jQuery('#inputPhone').data('quick-tip'));
290            }
291            if (scrollPos > inputWebsite) {
292                jQuery('.quick-tip-inner').html(jQuery('#inputWebsite').data('quick-tip'));
293            }
294            if (scrollPos > inputWhatsapp) {
295                jQuery('.quick-tip-inner').html(jQuery('#inputWhatsapp').data('quick-tip'));
296            }
297            if (scrollPos > inputCategory) {
298                jQuery('.quick-tip-inner').html(jQuery('#inputCategory').data('quick-tip'));
299            }
300            if (scrollPos > price_status) {
301                jQuery('.quick-tip-inner').html(jQuery('#price_status').data('quick-tip'));
302            }
303            if (scrollPos > bussinTop) {
304                jQuery('.quick-tip-inner').html(jQuery('.bussin-top').data('quick-tip'));
305            }
306            if (scrollPos > socialMedia) {
307                if (jQuery('#socialMedia').length != 0) {
308                    jQuery('.quick-tip-inner').html(jQuery('#socialMedia').data('quick-tip'));
309                }
310                else{
311                    jQuery('.quick-tip-inner').html(jQuery('#get_media').data('quick-tip'));
312                }
313            }
314            if (scrollPos > inpuFaqsLp) {
315                if (jQuery('#inpuFaqsLp').data('quick-tip')) {
316                    jQuery('.quick-tip-inner').html(jQuery('#inpuFaqsLp').data('quick-tip'));
317                } else {
318                    jQuery('.quick-tip-inner').html(jQuery('#inpuFaqsLp1').data('quick-tip'));
319                }
320            }
321            if (scrollPos > descTop) {
322                if (jQuery('.description-tip').length > 0) {
323                    jQuery('.quick-tip-inner').html(jQuery('.description-tip').data('quick-tip'));
324                } else {
325                    jQuery('.quick-tip-inner').html(jQuery('label[for="inputDescription"]').data('quick-tip'));
326                }
327            }
328            if (scrollPos > quicktags) {
329                if (jQuery('#inputTags').length > 0) {
330                    jQuery('.quick-tip-inner').html(jQuery('#inputTags').data('quick-tip'));
331                }
332                else{
333                    jQuery('.quick-tip-inner').html(jQuery('#inputtagsquicktip').data('quick-tip'));
334                }
335            }
336            if (scrollPos > postVideo) {
337                jQuery('.quick-tip-inner').html(jQuery('#postVideo').data('quick-tip'));
338            }
339            if (scrollPos > gallTop) {
340                jQuery('.quick-tip-inner').html(jQuery('.lp-img-gall-upload-section').data('quick-tip'));
341            }
342            if (scrollPos > bLogoTop) {
343                jQuery('.quick-tip-inner').html(jQuery('.b-logo-img-label').data('quick-tip'));
344            }
345            if (scrollPos > featTop) {
346                jQuery('.quick-tip-inner').html(jQuery('.featured-img-label').data('quick-tip'));
347            }
348        });
349
350        jQuery('#lp-submit-form input, #lp-submit-form textarea').on('focus', function (e) {
351
352            var quickTip = jQuery(this).data('quick-tip');
353
354            jQuery('.quick-tip-inner').html(quickTip);
355
356        });
357
358    jQuery('#price_status').on('chosen:showing_dropdown', function () {
359        var quickTip = jQuery(this).data('quick-tip');
360        jQuery('.quick-tip-inner').html(quickTip);
361    });
362
363    jQuery('.b-logo-img-label, .featured-img-label, .lplistgallery').on('click', function(){
364        var quickTip = jQuery(this).data('quick-tip');
365        jQuery('.quick-tip-inner').html(quickTip);
366    });
367        jQuery('select.select2').on('select2:open', function (e) {
368
369            var quickTip = jQuery(this).data('quick-tip');
370
371            jQuery('.quick-tip-inner').html(quickTip);
372
373        });
374
375    }
376
377    if( jQuery('.page-style2-sidebar').length!= 0 )
378
379    {
380
381        var scrollState =   '';
382
383        var offset = jQuery('.page-style2-sidebar').offset().top-50;
384
385        jQuery(window).scroll(function (event) {
386
387            var scroll = jQuery(window).scrollTop();
388
389            if( offset >= scroll )
390
391            {
392
393                jQuery('.page-style2-sidebar').css({
394
395                    'position':'static',
396
397                    'width': 'auto'
398
399                });
400
401                jQuery('.page-style2-sidebar').removeClass('style2-sidebar-fixed');
402                scrollState =   'scrolled';
403            }
404            else
405            {
406                var topMAr  =   10;
407                if( jQuery('.page-style2-sidebar').hasClass('logged-in') )
408                {
409                    topMAr  =   50;
410                }
411                if( scrollState == 'scrolled' )
412                {
413
414                    // jQuery('.page-style2-sidebar').css({
415
416                    //     'position':'fixed',
417
418                    //     'top' : topMAr+'px',
419
420                    //     'width': '338px'
421
422                    // });
423
424                    // jQuery('.page-style2-sidebar').css({
425                    //
426                    //     'position':'fixed',
427                    //
428                    //     'top' : 0,
429                    //
430                    //     'width': '338px'
431                    //
432                    // }).animate({
433                    //
434                    //     top: -150
435                    //
436                    // }, 250, function () {
437                    //
438                    //     jQuery('.page-style2-sidebar').animate({
439                    //
440                    //         top: 200
441                    //
442                    //     }, 250, function () {
443                    //
444                    //         jQuery('.page-style2-sidebar').animate({
445                    //
446                    //             top: -100
447                    //
448                    //         }, 300, function () {
449                    //
450                    //             jQuery('.page-style2-sidebar').animate({
451                    //
452                    //                 top: 100
453                    //
454                    //             }, 300, function () {
455                    //
456                    //                 jQuery('.page-style2-sidebar').animate({
457                    //
458                    //                     top: -50
459                    //
460                    //                 }, 350, function () {
461                    //
462                    //                     jQuery('.page-style2-sidebar').animate({
463                    //
464                    //                         top: topMAr
465                    //
466                    //                     }, 400)
467                    //
468                    //                 })
469                    //
470                    //             })
471                    //
472                    //         });
473                    //
474                    //     })
475                    //
476                    // })
477
478                    jQuery('.page-style2-sidebar').addClass('style2-sidebar-fixed testClass');
479                    scrollState =   '';
480                }
481
482            }
483
484        });
485
486    }
487    var firstDay = jQuery('#start_of_weekk').val();
488    if(jQuery('#event-date-s').length) {
489        var dateTodayy = new Date();
490        jQuery('#event-date-s').datepicker({
491            firstDay: firstDay,
492            minDate: dateTodayy,
493            dateFormat: 'mm/dd/yy',
494            onSelect: function(dateText, inst) {
495                // Get the selected date
496                var inDate = new Date(jQuery(this).val());
497                // Set the minimum date for the check out option to the selected date
498                jQuery("#event-date-e").datepicker('option', 'minDate',inDate);
499            }
500        });
501        jQuery('#event-date-e').datepicker({
502            firstDay: firstDay,
503            minDate: dateTodayy,
504            dateFormat: 'mm/dd/yy'
505        });
506    }
507
508    var dateToday = new Date();
509    jQuery('.discount-date').datepicker({
510        firstDay: firstDay,
511        minDate: dateToday,
512        dateFormat: 'mm/dd/yy'
513    });
514
515
516    jQuery('.mobile-toggle-filters').click(function (e) {
517
518        e.preventDefault();
519
520        jQuery('.filters-wrap-for-mobile').slideToggle(500);
521
522    });
523
524
525
526    jQuery('#lp-review-listing').on('select2:select', function (e) {
527
528        var reviewStyle =   jQuery('#reviews-nav-li').data('style'),
529            listID      =   jQuery('#lp-review-listing option:selected').val(),
530            authorID    =   jQuery('.lp-author-nav').data('author');
531
532        jQuery('#reviews').find('.author-inner-content-wrap').addClass('content-loading');
533        jQuery.ajax({
534            type: 'POST',
535            url: ajax_search_term_object.ajaxurl,
536            data: {
537                'action': 'author_review_tab_cb',
538                'reviewStyle': reviewStyle,
539                'listID' : listID,
540                'authorID': authorID,
541                'lpNonce' : jQuery('#lpNonce').val()
542            },
543
544            success: function(data)
545            {
546                jQuery('#reviews').find('.author-inner-content-wrap').removeClass('content-loading');
547                jQuery('#reviews').find('.author-inner-content-wrap').html(data);
548
549                //$this.addClass('data-available');
550
551            }
552
553        });
554
555    })
556
557    jQuery('.lp-author-nav li a').click(function (e) {
558
559        e.preventDefault();
560
561        var $this   =   jQuery(this),
562            targetID    =   $this.attr('href'),
563            authorID    =   jQuery('.lp-author-nav').data('author'),
564            tabType     =   '',
565            reviewStyle =   '',
566            listingLayout   =   '';
567
568
569        if( targetID == '#reviews' )
570        {
571            tabType =   'reviews';
572            var reviewStyle =   $this.data('style');
573        }
574        else if( targetID == '#photos' )
575        {
576            tabType =   'photos';
577        }
578        else if( targetID == '#aboutme' )
579        {
580            tabType =   'aboutme';
581        }
582        else if( targetID == '#contact' )
583        {
584            tabType =   'contact';
585        }
586        else if ( targetID == '#mylistings' )
587        {
588            tabType =   'mylistings';
589            listingLayout   =   $this.data('listing-layout');
590        }
591
592        jQuery('.lp-author-nav li a.active').removeClass('active');
593        $this.addClass('active');
594
595        jQuery('.author-tab-content .active').removeClass('active').hide();
596        jQuery(targetID).addClass('active').show();
597
598        if( $this.hasClass( 'data-available' ) )
599        {
600            return false;
601        }
602        else
603        {
604            jQuery(targetID).find('.author-inner-content-wrap').addClass('content-loading');
605
606            jQuery.ajax({
607                type: 'POST',
608                url: ajax_search_term_object.ajaxurl,
609                data: {
610                    'action': 'author_archive_tabs_cb',
611                    'tabType': tabType,
612                    'reviewStyle': reviewStyle,
613                    'authorID': authorID,
614                    'listingLayout' : listingLayout,
615                    'lpNonce' : jQuery('#lpNonce').val()
616                },
617                success: function(data) {
618                    jQuery(targetID).find('.author-inner-content-wrap').removeClass('content-loading');
619                    jQuery(targetID).find('.author-inner-content-wrap').html(data);
620                    $this.addClass('data-available');
621                    jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
622                    jQuery('.author-contact-wrap input, .author-contact-wrap textarea').keyup(function () {
623                        var name = jQuery('.author-contact-wrap input#name7').val();
624                        var email = jQuery('.author-contact-wrap input#email7').val();
625                        var phone = jQuery('.author-contact-wrap input#phone7').val();
626                        var message = jQuery('.author-contact-wrap textarea#message7').val();
627                        if (name.length > 0 && email.length > 0 && phone.length > 0 && message.length > 0) {
628                            jQuery('.author-contact-wrap').find('.lp-review-btn').removeAttr('disabled');
629                        } else {
630                            jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
631                        }
632                    });
633                    jQuery('.author-contact-wrap .lp-review-btn').click(function (event) {
634                        event.preventDefault();
635                        var $this = jQuery(this),
636                            name = jQuery('.author-contact-wrap input#name7').val(),
637                            email = jQuery('.author-contact-wrap input#email7').val(),
638                            phone = jQuery('.author-contact-wrap input#phone7').val(),
639                            message = jQuery('.author-contact-wrap textarea#message7').val(),
640                            target_user_mail = jQuery('.mail_target_author').val();
641                        jQuery('.author-contact-wrap').find('.lp-review-btn').attr('disabled', 'disabled');
642                        jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-send');
643                        jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-spinner fa-spin');
644                        jQuery('.author-contact-wrap input, .author-contact-wrap textarea').attr('disabled', 'disabled');
645                        jQuery.ajax({
646                            type: 'POST',
647                            url: ajax_search_term_object.ajaxurl,
648                            data: {
649                                'action': 'send_author_mail',
650                                'field-name': name,
651                                'field-email': email,
652                                'field-phone': phone,
653                                'field-message': message,
654                                'data-userMail': target_user_mail,
655                                'lpNonce': jQuery('#lpNonce').val()
656                            },
657                            success: function (data) {
658                                jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-check');
659                                jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-spinner fa-spin');
660                                setTimeout(function () {
661                                    jQuery('.author-contact-wrap').find('.lp-review-btn').removeAttr('disabled');
662                                    jQuery('.author-contact-wrap input, .author-contact-wrap textarea').removeAttr('disabled');
663                                    jQuery('.author-contact-wrap input#name7').val('');
664                                    jQuery('.author-contact-wrap input#email7').val('');
665                                    jQuery('.author-contact-wrap input#phone7').val('');
666                                    jQuery('.author-contact-wrap textarea#message7').val('');
667                                    jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').addClass('fa-send');
668                                    jQuery('.author-contact-wrap').find('.lp-review-btn').closest('.form-group').find('.lp-search-icon').removeClass('fa-check');
669                                }, 2000);
670                            },
671                        });
672                        return false;
673                    });
674                }
675            });
676        }
677    });
678
679
680
681    jQuery('.author-inner-content-wrap .lp-pagination span').click(function (e) {
682
683        var $this   =   jQuery(this);
684        var pageNum =   jQuery(this).data('pageurl');
685
686        jQuery('span.current').removeClass('current');
687        jQuery('#content-grids').html('').addClass('content-loading');
688
689
690
691        jQuery.ajax({
692            type: 'POST',
693            url: ajax_search_term_object.ajaxurl,
694            data: {
695                'action': 'author_archive_listings_cb',
696                'pageNum': pageNum,
697                'lpNonce' : jQuery('#lpNonce').val()
698
699            },
700            success: function(data)
701            {
702                $this.addClass('current');
703                jQuery('#content-grids').removeClass('content-loading').html(data);
704            }
705        });
706
707
708
709    });
710
711    jQuery('.lp-header-nav-btn button').click(function (e) {
712
713        if( jQuery('.lp-header-nav-btn').hasClass('active-can-menu') )
714
715        {
716
717            jQuery('.lp-header-nav-btn').removeClass('active-can-menu');
718
719            jQuery('#menu-categories-menu').css('opacity', '0');
720
721            jQuery('#menu-categories-menu').css('transform', 'scale(0)');
722
723        }
724
725        else
726
727        {
728
729            jQuery('#menu-categories-menu').css('opacity', '1');
730
731            jQuery('#menu-categories-menu').css('transform', 'scale(1)');
732
733            jQuery('.lp-header-nav-btn').addClass('active-can-menu');
734
735        }
736
737    });
738
739
740
741
742
743    jQuery( '.browse-imgs' ).click(function (e) {
744
745        e.preventDefault();
746        jQuery('#filer_input2').trigger('click');
747
748    });
749
750
751
752    jQuery('.search-filter-response .loop-switch-class').last().find('.lp-listing').addClass('last');
753
754    jQuery('.lp-author-listings-wrap .loop-switch-class').last().find('.lp-listing').addClass('last');
755
756    jQuery('.lp-listing-announcement .announcement-wrap').last().addClass('last');
757
758
759
760    jQuery('.lp-review-form-top-multi .lp-listing-stars, .lp-review-images .browse-imgs, .lp-review-form-top-multi .lp-review-stars').click(function(e){
761        if( jQuery('.lp-review-form-bottom').hasClass('review-form-opened') )
762       {  }
763       else
764       {
765           jQuery('.lp-review-form-bottom').slideDown(500);
766           jQuery('.lp-review-form-bottom').addClass('review-form-opened');
767       }
768
769    });
770
771    // jQuery('.lp-listing-stars').click(function(e){
772
773    //     jQuery('.lp-review-form-bottom').slideToggle(500);
774
775    // })
776
777    var topWidgetWrap       =   jQuery('.lp-widget-inner-wrap').first();
778
779    var lastWidgetWrap      =   jQuery('.lp-widget-inner-wrap').last();
780
781
782
783    if( topWidgetWrap.hasClass('lp-listing-timings') )
784
785    {
786
787        topWidgetWrap.find('.lp-today-timing').addClass('top-border-radius');
788
789    }
790
791    else
792
793    {
794
795        topWidgetWrap.addClass('top-border-radius');
796
797    }
798
799    if( lastWidgetWrap.hasClass('lp-listing-timings') )
800
801    {
802
803        lastWidgetWrap.find('.lp-today-timing').addClass('bottom-border-radius');
804
805    }
806
807    else if( lastWidgetWrap.hasClass('singlemap') )
808
809    {
810
811        jQuery('.lp-widget-social-links').addClass('bottom-border-radius');
812
813    }
814
815    else
816
817    {
818
819        lastWidgetWrap.addClass('bottom-border-radius');
820
821    }
822
823    // if( jQuery('.dis-code-copy-pop').length != 0 )
824    //
825    // {
826    //     jQuery('.dis-code-copy-pop').each(function (e) {
827    //
828    //         var minusBottom =   0;
829    //         if( jQuery(this).hasClass('extra-bottom') )
830    //         {
831    //             minusBottom =   49;
832    //         }
833    //         var $this       =   jQuery(this),
834    //             popHeight   =   $this.height()-minusBottom;
835    //
836    //
837    //         $this.css('bottom', '-'+popHeight+'px');
838    //
839    //         $this.attr('bottom', popHeight);
840    //     });
841    //
842    // }
843
844
845
846    jQuery('.lp-dis-code-copy span').click(function (e)
847
848    {
849
850        var targetCodeEL    =   jQuery(this).data('target-code'),
851
852            targetCodeELC   =   '.'+targetCodeEL;
853
854
855
856        var copyCode    =   jQuery( targetCodeELC).find('strong.copycode').text();
857
858
859
860        jQuery( targetCodeELC).find('input.codtopcopy').val(copyCode).select();
861
862        document.execCommand("copy");
863
864        jQuery(this).html('<i class="fa fa-files-o" aria-hidden="true"></i> copied').delay(1000).show(500, function(e)
865
866        {
867
868            jQuery(targetCodeELC).fadeOut();
869
870            jQuery('.code-overlay').fadeOut();
871
872        });
873
874
875
876    });
877
878
879
880    jQuery('.close-copy-code').click(function (e)
881
882    {
883
884        e.preventDefault();
885
886        var targetCodeEL    =   jQuery(this).data('target-code'),
887
888            targetCodeELC   =   '.'+targetCodeEL;
889
890
891
892        jQuery(targetCodeELC).fadeOut();
893
894        jQuery('.code-overlay').fadeOut();
895
896    });
897
898
899
900    jQuery('.more-filters').click(function(e)
901
902    {
903
904        jQuery('.lp-header-search-filters .lp-features-filter').toggleClass( 'add-border' );
905
906        jQuery('.more-filters-container').slideToggle();
907
908    })
909
910
911
912    function toggleIcon(e)
913
914    {
915
916
917
918        jQuery(e.target)
919
920            .prev('.faq-heading')
921
922            .find(".more-less")
923
924            .toggleClass('glyphicon-plus glyphicon-minus');
925
926
927
928
929
930    }
931
932    // jQuery('.faq-heading a').on('click',function(e){
933
934    //     jQuery( '.collapse.in.faq-answer' ).collapse('hide');
935
936    // });
937
938    slickINIT();
939
940    if( jQuery('.listing-slider').length != 0 )
941
942    {
943
944        jQuery('.listing-sl
944ider').slick({
945
946            infinite: true,
947
948            slidesToShow: 3,
949
950            slidesToScroll: 3,
951
952            prevArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
953
954            nextArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
955
956            responsive: [
957
958                {
959
960                    breakpoint: 768,
961
962                    settings: {
963
964                        slidesToShow: 1,
965
966                        slidesToScroll: 1,
967
968                        infinite: true
969
970                    }
971
972                }
973
974            ]
975
976        });
977
978        jQuery('.lp-listings .listing-slider').show();
979
980    }
981
982
983
984    // slickINIT();
985
986    // jQuery('.single-tabber2 ul li a').click(function (e) {
987    //
988    //     var menuCheck   =   jQuery(this).attr('href');
989    //     if( menuCheck == '#menu_tab' )
990    //     {
991    //         slickINIT();
992    //     }
993    //
994    // });
995
996
997
998    if( jQuery('.lp-child-cats-tax-slider').length != 0 )
999
1000    {
1001
1002        var chilCatsLoc =   jQuery( '.lp-child-cats-tax-slider' ).data('child-loc'),
1003
1004            childCatNum =   3;
1005
1006        if( chilCatsLoc == 'fullwidth' )
1007
1008        {
1009
1010            childCatNum =   5;
1011
1012        }
1013
1014        if( jQuery('.lp-child-cats-tax-wrap').length > childCatNum )
1015        {
1016            jQuery('.lp-child-cats-tax-slider').slick({
1017
1018                infinite: true,
1019
1020                slidesToShow: childCatNum,
1021
1022                slidesToScroll: 1,
1023
1024                prevArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1025
1026                nextArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
1027
1028            });
1029        }
1030
1031    }
1032
1033    if( jQuery('.events-sidebar-wrap').length )
1034    {
1035        var eventsNum   =   jQuery('.events-sidebar-wrap').data('num');
1036
1037        if( eventsNum > 1 )
1038        {
1039            jQuery('.events-sidebar-wrap').slick({
1040                infinite: true,
1041                slidesToShow: 1,
1042                slidesToScroll: 1,
1043                prevArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1044                nextArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
1045                adaptiveHeight: true
1046            });
1047        }
1048    }
1049    if( jQuery('.events-content-area-wrap').length )
1050    {
1051        var eventsNum   =   jQuery('.events-content-area-wrap').data('num');
1052
1053        if( eventsNum > 2 )
1054        {
1055            jQuery('.events-content-area-wrap').slick({
1056                infinite: true,
1057                slidesToShow: 2,
1058                slidesToScroll: 1,
1059                prevArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1060                nextArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
1061            });
1062        }
1063    }
1064    if( jQuery('.events-element-content-area-wrap').length )
1065    {
1066        var eventsNum   =   jQuery('.events-element-content-area-wrap').data('num');
1067
1068        if( eventsNum > 3 )
1069        {
1070            jQuery('.events-content-area-wrap').slick({
1071                infinite: true,
1072                slidesToShow: 3,
1073                slidesToScroll: 1,
1074                prevArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1075                nextArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
1076            });
1077        }
1078    }
1079
1080    if( jQuery('.app-view-new-ads-slider').length )
1081    {
1082        jQuery('.app-view-new-ads-slider').slick({
1083            infinite: true,
1084            slidesToShow: 1,
1085            slidesToScroll: 1,
1086            arrows: false,
1087            autoplay: true
1088        });
1089    }
1090    if( jQuery('.app-view2-banner-cat-slider').length )
1091    {
1092        jQuery('.app-view2-banner-cat-slider').slick({
1093            infinite: true,
1094            slidesToShow: 4,
1095            slidesToScroll: 1,
1096            arrows: false,
1097            dots: false,
1098        });
1099    }
1100    if( jQuery('.app-view2-location-container').length )
1101    {
1102        jQuery('.app-view2-location-container').slick({
1103            infinite: true,
1104            slidesToShow: 3,
1105            slidesToScroll: 1,
1106            arrows: false,
1107            dots: false
1108        });
1109    }
1110
1111    if( jQuery('.lp-locations-slider') .length != 0 && jQuery('.lp-locations-slider .lp-location-box').length > 6 )
1112
1113    {
1114        jQuery('.lp-locations-slider').slick({
1115
1116            infinite: true,
1117
1118            slidesToShow: 6,
1119
1120            slidesToScroll: 1,
1121
1122            nextArrow:"<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1123
1124            prevArrow:"<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
1125			responsive: [
1126
1127                   {
1128                       breakpoint: 480,
1129                       settings: {
1130                           arrows: true,
1131                           centerMode: false,
1132                           centerPadding: '0px',
1133                           slidesToShow: 2
1134                       }
1135                   }
1136               ]
1137
1138        });
1139
1140    }
1141    jQuery('.sort-by-filter').hover(function (e)
1142
1143    {
1144
1145        e.preventDefault();
1146
1147
1148
1149        if( jQuery( this ).hasClass('active-tooltip-filter') )
1150
1151        {
1152
1153            return false;
1154
1155        }
1156
1157        jQuery('.active-tooltip-filter').find('.sort-filter-inner').fadeOut(200);
1158
1159        jQuery('.active-tooltip-filter').removeClass('active-tooltip-filter');
1160
1161        jQuery(this).addClass('active-tooltip-filter');
1162
1163        jQuery(this).find('.sort-filter-inner').fadeIn(200);
1164
1165    })
1166
1167    jQuery('body').click(function(e){
1168
1169
1170
1171        if(e.target.id == "header-rated-filter" || e.target.id == "header-reviewed-filter" || e.target.id == "header-viewed-filter" )
1172
1173            return;
1174
1175        if(jQuery('.sort-filter-inner').is(":visible"))
1176
1177        {
1178
1179            jQuery('.sort-filter-inner').fadeOut(200);
1180
1181        }
1182
1183        jQuery('.active-tooltip-filter').removeClass('active-tooltip-filter');
1184
1185    });
1186
1187    // jQuery('.listing-toggle-btn').click(function(e)
1188
1189    // {
1190
1191    //     e.preventDefault();
1192
1193    //     if( !jQuery(this).hasClass('active') )
1194
1195    //     {
1196
1197    //         var targetView  =   jQuery(this).data('view');
1198
1199    //         jQuery('.listing-toggle-btn').removeClass('active');
1200
1201    //         jQuery(this).addClass('active');
1202
1203    //
1204
1205    //
1206
1207    //         if( targetView == 'grid-style' )
1208
1209    //         {
1210
1211    //             jQuery('.loop-switch-class').removeClass('col-md-12');
1212
1213    //             jQuery('.loop-switch-class').addClass('col-md-6');
1214
1215    //             jQuery('.lp-listings.active-view').removeClass('list-style');
1216
1217    //             jQuery('.lp-listings.active-view').addClass('grid-style');
1218
1219    //         }
1220
1221    //         if( targetView == 'list-style' )
1222
1223    //         {
1224
1225    //             jQuery('.loop-switch-class').removeClass('col-md-6');
1226
1227    //             jQuery('.loop-switch-class').addClass('col-md-12');
1228
1229    //             jQuery('.lp-listings.active-view').addClass('list-style');
1230
1231    //             jQuery('.lp-listings.active-view').removeClass('grid-style');
1232
1233    //
1234
1235    //         }
1236
1237    //
1238
1239    //     }
1240
1241    //
1242
1243    // });
1244
1245    jQuery('.listing-view-layout ul li a').click(function (e) {
1246
1247       e.preventDefault();
1248
1249       var $this   =   jQuery(this),
1250
1251           targetView  =   '';
1252
1253       if($this.hasClass('list'))
1254
1255       {
1256
1257           targetView  =   'list-style';
1258
1259       }
1260
1261       if($this.hasClass('grid'))
1262
1263       {
1264
1265           targetView  =   'grid-style';
1266
1267       }
1268
1269       if( targetView == 'grid-style' )
1270
1271       {
1272
1273           jQuery('.loop-switch-class').removeClass('col-md-12');
1274
1275           jQuery('.loop-switch-class').addClass('col-md-6');
1276           jQuery('.loop-switch-class.listing-style-1').removeClass('col-md-6');
1277           jQuery('.loop-switch-class.listing-style-1').addClass('col-md-4');
1278
1279           jQuery('.lp-listings.active-view').removeClass('list-style');
1280
1281           jQuery('.lp-listings.active-view').addClass('grid-style');
1282
1283       }
1284
1285       if( targetView == 'list-style' )
1286
1287       {
1288
1289           jQuery('.loop-switch-class').removeClass('col-md-6');
1290             jQuery('.loop-switch-class.listing-style-1').removeClass('col-md-4');
1291
1292           jQuery('.loop-switch-class').addClass('col-md-12');
1293
1294           jQuery('.lp-listings.active-view').addClass('list-style');
1295
1296           jQuery('.lp-listings.active-view').removeClass('grid-style');
1297
1298
1299
1300       }
1301
1302
1303
1304   });
1305
1306
1307
1308    if( jQuery('.lp-listing-slider').length != 0 )
1309
1310    {
1311
1312        var totalSlides     =   jQuery('.lp-listing-slider').attr('data-totalSlides'),
1313
1314            slidesToShow    =   3;
1315
1316        if( totalSlides == 1 )
1317
1318        {
1319
1320            slidesToShow    =   1;
1321
1322        }
1323
1324        if( totalSlides ==  2 )
1325
1326        {
1327
1328            slidesToShow    =   2;
1329
1330        }
1331
1332        jQuery('.lp-listing-slider').slick({
1333
1334            infinite: true,
1335
1336            slidesToShow: slidesToShow,
1337
1338            slidesToScroll: 1,
1339
1340            prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1341
1342            nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>",
1343			responsive: [
1344                   {
1345                       breakpoint: 480,
1346                       settings: {
1347                           arrows: true,
1348                           centerMode: false,
1349                           centerPadding: '0px',
1350                           slidesToShow: 2
1351                       }
1352                   }
1353               ]
1354
1355        });
1356
1357
1358
1359        jQuery('.lp-listing-slider').show();
1360
1361    }
1362
1363    if( jQuery('.listing-review-slider').length != 0 )
1364
1365    {
1366        var totalSlieds =   jQuery( '.listing-review-slider' ).attr('data-review-thumbs');
1367        jQuery('.listing-review-slider').slick({
1368            infinite: true,
1369            slidesToShow: 4,
1370            slidesToScroll: 1,
1371            prevArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
1372            nextArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
1373
1374        });
1375    }
1376
1377
1378    jQuery( '.btn-link-field-toggle' ).click( function (e)
1379
1380    {
1381
1382        var dataTargetLink  =   jQuery(this).data('target-link');
1383
1384
1385
1386        jQuery( '.btn-link-target' ).slideToggle(300);
1387
1388        jQuery( this ).toggleClass( 'link-active' );
1389
1390
1391
1392        var targetSwitch    =   'input#'+dataTargetLink;
1393
1394        jQuery(targetSwitch).val('');
1395
1396    });
1397
1398
1399
1400    jQuery('.review-form-toggle, .lp-listing-review-form h2').click(function(e)
1401    {
1402        e.preventDefault();
1403        jQuery('.lp-listing-review-form .lp-form-opener').hide();
1404
1405        jQuery('.lp-listing-review-form').find( 'i.fa-chevron-down, i.fa-chevron-up' ).toggleClass('fa-chevron-down fa-chevron-up');
1406        jQuery('.lp-review-form-bottom').slideToggle(500);
1407        jQuery('html,body').animate(
1408
1409            {
1410
1411                scrollTop: jQuery(".lp-listing-review-form").offset().top -100
1412
1413            },
1414
1415            'slow');
1416
1417    });
1418
1419    jQuery('.lp-see-menu-btn').click(function (e) {
1420
1421        e.preventDefault();
1422
1423        jQuery('html,body').animate(
1424
1425            {
1426
1427                scrollTop: jQuery(".lp-listing-menuu-wrap").offset().top - 120
1428
1429            },
1430
1431            'slow');
1432
1433    })
1434
1435
1436
1437    jQuery('.toggle-all-days').click(function(e)
1438    {
1439        e.preventDefault();
1440        var leftColHeight   =   jQuery('.min-height-class').height(),
1441            timingsIH       =   jQuery('.lp-listing-timings').height();
1442
1443        jQuery('.lp-today-timing.all-days-timings').slideToggle(200).toggleClass('days-opened');
1444        var lessText = jQuery(this).data('contract');
1445        var moreText    =   jQuery(this).data('expand');
1446        setTimeout(function(){
1447            var isOpened    =   jQuery('.lp-today-timing.all-days-timings').is('.days-opened');
1448
1449            if( isOpened === true ) {
1450                var timingsOH           =   jQuery('.lp-listing-timings').height(),
1451                    leftColHeightN      =   leftColHeight+timingsOH;
1452                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1453                jQuery('.toggle-all-days').html('<i class="fa fa-minus" aria-hidden="true"></i> ' + lessText);
1454            }
1455            else
1456            {
1457                var leftColHeightN      =   leftColHeight-timingsIH;
1458                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1459                jQuery('.toggle-all-days').html('<i class="fa fa-plus" aria-hidden="true"></i> '+moreText);
1460            }
1461        }, 150);
1462
1463    });
1464
1465
1466    jQuery('.toggle-all-days2').click(function(e)
1467    {
1468        e.preventDefault();
1469        var leftColHeight   =   jQuery('.min-height-class').height(),
1470            timingsIH       =   jQuery('.lp-listing-timings').height();
1471        jQuery('.lp-today-timing.all-days-timings').slideToggle(200).toggleClass('days-opened');
1472        setTimeout(function(){
1473            var isOpened    =   jQuery('.lp-today-timing.all-days-timings').is('.days-opened');
1474            if( isOpened === true ) {
1475                var timingsOH           =   jQuery('.lp-listing-timings').height(),
1476                    leftColHeightN      =   leftColHeight+timingsOH;
1477                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1478            }
1479            else
1480            {
1481                var leftColHeightN      =   leftColHeight-timingsIH;
1482                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1483            }
1484        }, 150);
1485    });
1486
1487    jQuery('.toggle-additional-details').click(function(e)
1488    {
1489        e.preventDefault();
1490        jQuery('.additional-detail-hidden').slideToggle(200).toggleClass('details-opened');
1491
1492        var lessText    =   jQuery(this).data('contract');
1493        var moreText    =   jQuery(this).data('expand');
1494
1495        var leftColHeight       =   jQuery('.min-height-class').height(),
1496            additoinalIH        =   jQuery('.lp-listing-additional-details').height();
1497
1498        setTimeout(function(){
1499            var isOpened    =   jQuery('.additional-detail-hidden').is('.details-opened');
1500            if( isOpened === true )
1501            {
1502                var additoinalOH    =   jQuery('.lp-listing-additional-details').height(),
1503                    leftColHeightN  =   (leftColHeight+additoinalOH)-360;
1504
1505                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1506                jQuery('.toggle-additional-details').html('<i class="fa fa-minus" aria-hidden="true"></i> '+lessText);
1507            }
1508            else
1509            {
1510                var leftColHeightN      =   (leftColHeight-additoinalIH)+360;
1511                jQuery('.min-height-class').css('min-height', leftColHeightN+'px');
1512
1513                jQuery('.toggle-additional-details').html('<i class="fa fa-plus" aria-hidden="true"></i> '+moreText);
1514            }
1515        }, 150);
1516
1517    });
1518
1519
1520
1521    jQuery('.lp-listing-faqs').on('hidden.bs.collapse', toggleIcon);
1522
1523    jQuery('.lp-listing-faqs').on('shown.bs.collapse', toggleIcon);
1524
1525
1526
1527    jQuery(document).on('click', '.add-to-fav-v2',function(e)
1528
1529    {
1530
1531        e.preventDefault()
1532
1533        $this = jQuery(this);
1534
1535        $this.find('i').addClass('fa-spin fa-spinner');
1536
1537        var val = jQuery(this).data('post-id');
1538
1539        var type = jQuery(this).data('post-type');
1540
1541
1542
1543        jQuery.ajax({
1544
1545            type: 'POST',
1546
1547            dataType: 'json',
1548
1549            url: ajax_search_term_object.ajaxurl,
1550
1551            data: {
1552
1553                'action': 'listingpro_add_favorite_v2',
1554
1555                'post-id': val,
1556
1557                'type': type,
1558                'lpNonce' : jQuery('#lpNonce').val()
1559
1560            },
1561
1562            success: function(data)
1563
1564            {
1565
1566                if(data){
1567
1568                    if(data.active == 'yes'){
1569
1570                        $this.find('i').removeClass('fa-spin fa-spinner');
1571
1572                        if(data.type == 'grid' || data.type == 'list')
1573
1574                        {
1575
1576                            $this.find('i').removeClass('fa-heart-o');
1577
1578                            $this.find('i').addClass('fa-heart');
1579
1580                        }
1581
1582                        else
1583
1584                        {
1585
1586                            var successText =$this.data('success-text');
1587
1588                            $this.find('span').text(successText);
1589
1590                            $this.html('<i class="fa fa-bookmark" aria-hidden="true"></i> '+data.text);
1591
1592                        }
1593
1594                        $this.removeClass('add-to-fav-v2');
1595
1596                        $this.addClass('remove-fav-v2');
1597
1598                    }
1599
1600                }
1601
1602            }
1603
1604        });
1605
1606    });
1607
1608
1609
1610    jQuery(document).on('click', '.remove-fav-v2', function(e)
1611
1612    {
1613
1614        e.preventDefault();
1615
1616        var val = jQuery(this).data('post-id');
1617
1618        var type = jQuery(this).data('post-type');
1619
1620        jQuery(this).find('i').removeClass('fa-close');
1621
1622        jQuery(this).find('i').addClass('fa-spinner fa-spin');
1623
1624
1625
1626        $this = jQuery(this);
1627
1628        jQuery.ajax({
1629
1630            type: 'POST',
1631
1632            dataType: 'json',
1633
1634            url: ajax_search_term_object.ajaxurl,
1635
1636            data: {
1637
1638                'action': 'listingpro_remove_favorite_v2',
1639
1640                'post-id': val,
1641
1642                'type' : type,
1643                'lpNonce' : jQuery('#lpNonce').val()
1644
1645            },
1646
1647            success: function(data)
1648
1649            {
1650
1651                if(data){
1652
1653                    if(data.remove == 'yes')
1654
1655                    {
1656                        $this.find('i').removeClass('fa-spin fa-spinner');
1657
1658                        if(data.type == 'grid' || data.type == 'list')
1659
1660                        {
1661                            $this.find('i').addClass('fa-heart-o');
1662                        }
1663
1664                        else
1665
1666                        {
1667                            $this.html('<i class="fa fa-bookmark-o" aria-hidden="true"></i> '+data.text);
1668                        }
1669						 if( jQuery('.page-template-template-favourites').length != 0 )
1670						{
1671						$this.closest( ".lp-grid-box-contianer" ).fadeOut();
1672						}
1673                        $this.removeClass('remove-fav-v2');
1674
1675                        $this.addClass('add-to-fav-v2');
1676
1677                    }
1678
1679                }
1680
1681            }
1682
1683        });
1684
1685
1686
1687    });
1688
1689
1690
1691    /* Social Share */
1692
1693    var social = jQuery('.lp-listing-action-btns ul li div.social-icons.post-socials');
1694
1695    var socialOvrly = jQuery('.lp-listing-action-btns ul li .md-overlay');
1696
1697
1698
1699    jQuery('.lp-single-sharing').on('click', function(event)
1700
1701    {
1702
1703        event.preventDefault();
1704
1705        social.fadeIn(400);
1706
1707
1708
1709        if(socialOvrly.hasClass('hide')){
1710
1711            jQuery(socialOvrly).removeClass('hide');
1712
1713            jQuery(socialOvrly).addClass('show');
1714
1715        }
1716
1717        else{
1718
1719            jQuery(socialOvrly).removeClass('show');
1720
1721            jQuery(socialOvrly).addClass('hide');
1722
1723
1724
1725        }
1726
1727    });
1728
1729
1730
1731    socialOvrly.on('click', function(event)
1732
1733    {
1734
1735
1736
1737        event.preventDefault();
1738
1739        social.hide();
1740
1741
1742
1743        if(socialOvrly.hasClass('show')){
1744
1745            jQuery(socialOvrly).removeClass('show');
1746
1747            jQuery(socialOvrly).addClass('hide');
1748
1749        }
1750
1751        else{
1752
1753            jQuery(socialOvrly).removeClass('hide');
1754
1755            jQuery(socialOvrly).addClass('show');
1756
1757        }
1758
1759    });
1760
1761
1762
1763    jQuery(document).on('click' , '.lp-review-right-bottom .review-reaction, .lp-activity-description .review-reaction',function(e)
1764
1765    {
1766        e.preventDefault();
1767        if(jQuery(this).hasClass('active-now')) { return false; }
1768        reviewID = '';
1769
1770        ajaxResErr = '';
1771
1772        var $this = jQuery(this);
1773
1774        $this.addClass('active-now');
1775
1776        reviewID = $this.data('id'),
1777
1778            currentVal = $this.data('score'),
1779
1780            restype = $this.data('restype');
1781
1782
1783
1784        $this.find('span.react-count').html('<i class="fa fa-spinner fa-spin"></i>');
1785
1786        jQuery.ajax({
1787
1788            type: 'POST',
1789
1790            dataType: 'json',
1791
1792            url: ajax_review_object.ajaxurl,
1793
1794            data:{
1795
1796                action:'lp_reviews_interests',
1797
1798                interest : currentVal,
1799
1800                restype : restype,
1801
1802                id : reviewID,
1803                'lpNonce' : jQuery('#lpNonce').val()
1804
1805            },
1806
1807
1808
1809            success: function(res){
1810
1811
1812
1813                if(res.errors=="no"){
1814
1815                    ajaxResErr = 'no';
1816
1817                    var newscore = res.newScore;
1818
1819                    $this.data('score', newscore);
1820
1821                    $this.find('span.react-count').html(newscore);
1822
1823                    $this.find('span.react-msg').text(res.statuss).fadeIn(500).delay(2000).fadeOut(500);
1824
1825
1826
1827                    if(restype=='interesting'){
1828
1829                        $this.css({'background-color': '#417cdf',
1830
1831                            'color': '#fff'});
1832
1833                        $this.find('span.react-count').css({'color': '#fff'});
1834
1835                    }
1836
1837                    else if(restype=='lol'){
1838
1839                        $this.css({'background-color': '#ff8e29',
1840
1841                            'color': '#fff'});
1842
1843                        $this.find('span.react-count').css({'color': '#fff'});
1844
1845                    }
1846
1847                    else if(restype=='love'){
1848
1849                        $this.css({'background-color': '#ff2357',
1850
1851                            'color': '#fff'});
1852
1853                        $this.find('span.react-count').css({'color': '#fff'});
1854
1855                    }
1856
1857                    currentVal = false;
1858
1859                } else{
1860
1861                    ajaxResErr = 'yes';
1862
1863                    var newscore = res.newScore;
1864
1865                    $this.find('span.react-count').text(newscore);
1866
1867                    $this.find('span.react-msg').text(res.statuss).fadeIn(500).delay(2000).fadeOut(500);
1868
1869                }
1870
1871                $this.removeClass('active-now');
1872
1873            },
1874
1875            error: function(request, error){
1876
1877                alert(error);
1878
1879            }
1880
1881        });
1882
1883
1884
1885        e.preventDefault();
1886
1887    });
1888
1889    jQuery(document).on('click', '#add-menu-image_btn', function (e) {
1890        e.preventDefault();
1891        var $this = jQuery(this);
1892        var userID = $this.data('uid'),
1893            img_Url = jQuery(this).closest('.add-menu_image').find('#selected_image_menu_url').val(),
1894            selected_list_Id = jQuery('#add_image_menu').val();
1895
1896        if ((selected_list_Id == '0') || (img_Url == '')) {
1897            $this.closest('.add-menu_image').append('<p class="add_img_menu_error">Something Went Wrong</p>');
1898            return false;
1899        }
1900        jQuery('#add-menu-img-spinner').show();
1901        jQuery.ajax({
1902            type: 'POST',
1903            dataType: 'json',
1904            url: ajax_search_term_object.ajaxurl,
1905            data: {
1906                'action': 'add_image_menu',
1907                'userID': userID,
1908                'img_Url': img_Url,
1909                'selected_list_Id': selected_list_Id,
1910                'lpNonce' : jQuery('#lpNonce').val()
1911            },
1912            success: function (res) {
1913                jQuery('.add_img_menu_error').remove();
1914                $this.closest('.ordering-service-wrap').find('ul.listing_append_img_menu').append('<li class="clearfix"><a class="pull-left online_ordring_list_title" target="_blank" href="' + res.selected_list_Link + '">' + res.selected_list_Title + '</a><span data-uid="' + userID + '" data-target="' + selected_list_Id + '" class="pull-right del_img_menu">
1914<i class="fa fa-trash fa-spinner"></i></span></li>');
1915                jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text('Browse File');
1916                jQuery('#add-menu-img-spinner').hide();
1917                $this.closest('.add-menu_image').find('#selected_image_menu_url').val('');
1918                $this.closest('.add-menu_image').find('#selected_image_menu_url').text('Select Listing');
1919                jQuery('#add_image_menu').val('');
1920                jQuery('.no-img_menu').hide();
1921            },
1922
1923            error: function (err) {
1924                alert(err);
1925                jQuery('#add-menu-img-spinner').hide();
1926            }
1927        });
1928    });
1929    jQuery(document).on('click', '.add-menu_image .jFiler-input-choose-btn', function () {
1930        jQuery('#selected_image_menu_url').val('');
1931    });
1932    jQuery(document).on('click', '.del_img_menu', function (e) {
1933        e.preventDefault();
1934        var $this = jQuery(this);
1935        var userID = $this.data('uid'),
1936            target = $this.data('target');
1937        $this.find('i.fa-spinner').removeClass('fa-trash');
1938        $this.find('i.fa-spinner').addClass('fa-spin');
1939        jQuery.ajax({
1940            type: 'POST',
1941            dataType: 'json',
1942            url: ajax_search_term_object.ajaxurl,
1943            data: {
1944                'action': 'del_add_image_menu',
1945                'userID': userID,
1946                'target': target,
1947                'lpNonce' : jQuery('#lpNonce').val()
1948            },
1949            success: function (res) {
1950                console.log(res);
1951                $this.closest("li").remove();
1952                // jQuery('#add-menu-img-spinner').hide();
1953            },
1954
1955            error: function (err) {
1956                alert(err);
1957                // jQuery('#add-menu-img-spinner').hide();
1958            }
1959        });
1960    });
1961
1962
1963
1964jQuery(document).on('click', '.lp-edit-menu', function (e) {
1965
1966    e.preventDefault();
1967
1968    var $this       =   jQuery(this),
1969        userID      =   $this.data('uid'),
1970        LID      =   $this.data('lid'),
1971        menuID  =   $this.data('menuid'),
1972        mTitle  =   jQuery('#menu-title-'+menuID).val(),
1973        mDetail  =   jQuery('#menu-detail-'+menuID).val(),
1974        mOldPrice  =   jQuery('#menu-old-price-'+menuID).val(),
1975        mNewPrice  =   jQuery('#menu-new-price-'+menuID).val(),
1976        mQuoteT  =   jQuery('#menu-quote-text-'+menuID).val(),
1977        mQuoteL  =   jQuery('#menu-quote-link-'+menuID).val(),
1978        mLink  =   jQuery('#menu-link-'+menuID).val(),
1979        mGroup  =   jQuery('#menu-group-'+menuID).val(),
1980        mType  =   jQuery('#menu-type-'+menuID).val(),
1981        mImage      =   jQuery('.edit-upload-'+menuID+' .frontend-input').val(),
1982        multipleImage = jQuery('.upload-field.dashboard-upload-field.edit-upload-'+menuID).data('multiple');
1983
1984
1985    if(jQuery('.frontend-input-multiple').length > 0 && multipleImage === true){
1986        mImage      =   jQuery('.edit-upload-'+menuID+' .frontend-input-multiple').val();
1987    }
1988            popularItem  =   '';
1989
1990            if( jQuery('.menu_Popular_Item-'+menuID).is(':checked') )
1991            {
1992                popularItem = 'mItemPopularTrue';
1993            }
1994            else
1995            {
1996                popularItem = 'mItemPopularfalse';
1997            }
1998            var spiceLVL = jQuery('.menuSpice-control-'+menuID+' option:selected').data('level');
1999            if ( spiceLVL == '1' ) {
2000                spiceLVL    =   'spicelvl1';
2001            }else if ( spiceLVL == '2' ) {
2002                spiceLVL    =   'spicelvl2';
2003            }else if ( spiceLVL == '3') {
2004                spiceLVL    =   'spicelvl3';
2005            }else if ( spiceLVL == '4') {
2006                spiceLVL    =   'spicelvl4';
2007            }else{
2008                spiceLVL    =   'spicelvlunset';
2009            }
2010
2011    $this.append('<i class="fa fa-spin fa-spinner"></i>');
2012
2013    jQuery.ajax({
2014        type: 'POST',
2015        dataType: 'json',
2016        url: ajax_search_term_object.ajaxurl,
2017        data: {
2018            'action': 'add_menu_cb',
2019            'user_id': userID,
2020            'LID' : LID,
2021            'menuID' : menuID,
2022            'mTitle': mTitle,
2023            'mDetail': mDetail,
2024            'mOldPrice': mOldPrice,
2025            'mNewPrice': mNewPrice,
2026            'mQuoteT': mQuoteT,
2027            'mQuoteL': mQuoteL,
2028            'mLink': mLink,
2029            'mImage': mImage,
2030            'mType' : mType,
2031            'mGroup' : mGroup,
2032            'popularItem' : popularItem,
2033            'spiceLVL' : spiceLVL,
2034            'menuUp': 'yes',
2035            'lpNonce' : jQuery('#lpNonce').val()
2036        },
2037        success: function (res) {
2038            var menu_id = $this.data('menuid');
2039            // alert(menu_id);
2040            // ajax_success_popup( res, $this );
2041            console.log(res);
2042            jQuery('.active-update-formm').slideUp();
2043            $this.find('i').remove();
2044            jQuery('#menu-update-'+menuID).closest('.lp-menu-close-outer').find('.lp-menu-closed').find('h4.lp-right-side-title').html('<span>Item Name</span><br>'+mTitle);
2045            jQuery('#menu-update-'+menuID).closest('.lp-menu-close-outer').find('.lp-menu-closed').find('.col-md-2.price').html('<span>Price</span><br>'+mOldPrice);
2046        },
2047
2048        error: function (err) {
2049            alert(err);
2050            $this.find('i').remove();
2051        }
2052    });
2053});
2054if (jQuery('#selected_image_menu_url').length != 0) {
2055    jQuery(document).on('click', function (e) {
2056        var jqhiddeninputfeild = jQuery('#selected_image_menu_url').val();
2057        var jqtriggerforcheck = jQuery('#selected_image_menu_url').hasClass('.frontend-input-multiple');
2058        if (jqtriggerforcheck = true) {
2059            var asd = jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text();
2060            if (jqhiddeninputfeild != '') {
2061                var lastFive = jqhiddeninputfeild.substr(jqhiddeninputfeild.length - 13);
2062                var finalcom = '...' + lastFive;
2063                if (asd != finalcom) {
2064                    var string = finalcom.substr(0, 15);
2065                    jQuery('.add-new-service_img_menu .jFiler-input-choose-btn').text(string);
2066                    return false;
2067                }
2068            }
2069        }
2070    });
2071}
2072
2073    jQuery(function (){
2074        jQuery(document).on('change', '.coupons-fields-switch input[type="checkbox"]', function (e) {
2075            var targetID = jQuery(this).data('target');
2076            if (targetID == 'quote-button') {
2077                if (jQuery(this).is(':checked')) {
2078                    jQuery('#menu-old-price').val('');
2079                    jQuery('#menu-new-price').val('');
2080                    jQuery('#menu-quote-text').val('');
2081                    jQuery('#menu-quote-link').val('');
2082                }
2083            }
2084        });
2085    });
2086    jQuery(document).on('click', '#lp-save-menu', function (e) {
2087        e.preventDefault();
2088        var $this   =   jQuery(this),
2089            userID  =   $this.data('uid'),
2090            mTitle  =   jQuery('#menu-title').val(),
2091            mDetail  =   jQuery('#menu-detail').val(),
2092            mOldPrice  =   jQuery('#menu-old-price').val(),
2093            mNewPrice  =   jQuery('#menu-new-price').val(),
2094            mQuoteT  =   jQuery('#menu-quote-text').val(),
2095            mQuoteL  =   jQuery('#menu-quote-link').val(),
2096            mListing  =   jQuery('#menu-listing').val(),
2097            mLink  =   jQuery('#menu-link').val(),
2098            mImage  =   jQuery('.new-file-upload .frontend-input').val(),
2099            mType  =   jQuery('#lp-menus .panel-heading li.active').text(),
2100            mGroup  =   jQuery('#menu-group').val(),
2101            orderP  =   '',
2102            orderU  =   '',
2103            calcPrice  =   '',
2104            popularItem  =   '';
2105
2106        if( jQuery('.menu_Popular_Item').is(':checked') )
2107        {
2108            popularItem = 'mItemPopularTrue';
2109        }
2110        else
2111        {
2112            popularItem = 'mItemPopularfalse';
2113        }
2114
2115        if( jQuery('.menu_Popular_Item').is(':checked') )
2116        {
2117            popularItem = 'mItemPopularTrue';
2118        }
2119        else
2120        {
2121            popularItem = 'mItemPopularfalse';
2122        }
2123        var spiceLVL = jQuery('.menuSpice-control option:selected').data('level');
2124        if ( spiceLVL == '1' ) {
2125            spiceLVL    =   'spicelvl1';
2126        }else if ( spiceLVL == '2' ) {
2127            spiceLVL    =   'spicelvl2';
2128        }else if ( spiceLVL == '3') {
2129            spiceLVL    =   'spicelvl3';
2130        }else if ( spiceLVL == '4') {
2131            spiceLVL    =   'spicelvl4';
2132        }else{
2133            spiceLVL    =   'spicelvlunset';
2134        }
2135
2136        if (mNewPrice.length > 0){
2137            calcPrice   =   mNewPrice;
2138        }else{
2139            calcPrice   =   mOldPrice;
2140        }
2141        if( mImage == '' && jQuery('.new-file-upload .frontend-input-multiple').length != 0 )
2142        {
2143            mImage  =   jQuery('.new-file-upload .frontend-input-multiple').val();
2144        }
2145
2146        if( mListing == '' || mListing == null || mListing == 0 )
2147        {
2148            jQuery('#select2-menu-listing-container').addClass('error');
2149        }
2150        else
2151        {
2152            jQuery('#select2-menu-listing-container').removeClass('error');
2153        }
2154        if( mTitle == '' )
2155        {
2156            jQuery('#menu-title').addClass('error');
2157        }
2158        else
2159        {
2160            jQuery('#menu-title').removeClass('error');
2161        }
2162        if( mType == '' || mType == 0 || mType == null )
2163        {
2164            jQuery('select#menu-type').next('.select2-container').addClass('error');
2165        }
2166        else
2167        {
2168            jQuery('select#menu-type').next('.select2-container').removeClass('error');
2169        }
2170        if( mGroup == '' || mGroup == 0 || mGroup == null )
2171        {
2172            jQuery('select#menu-group').next('.select2-container').addClass('error');
2173        }
2174        else
2175        {
2176            jQuery('select#menu-group').next('.select2-container').removeClass('error');
2177        }
2178        if( mTitle == '' || ( mType == '' && mType == 0 || mType == null ) || ( mGroup == '' && mGroup == 0 || mGroup == null ) || mListing == '' || mListing == null || mListing == 0  )
2179        {
2180            var dataError   =   [];
2181            dataError.status    =   'error';
2182            dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
2183            ajax_success_popup( dataError, $this );
2184            return false;
2185        }
2186        var QpriceTog = false;
2187        if( jQuery('.coupons-fields-switch input[type="checkbox"]').is(':checked') ){
2188            QpriceTog = true;
2189        }
2190        $this.append('<i class="fa fa-spin fa-spinner"></i>');
2191        $this.attr('disabled', 'disabled');
2192        jQuery.ajax({
2193            type: 'POST',
2194            dataType: 'json',
2195            url: ajax_search_term_object.ajaxurl,
2196            data:{
2197                'action': 'add_menu_cb',
2198                'user_id' : userID,
2199                'mTitle' : mTitle,
2200                'mDetail' : mDetail,
2201                'mOldPrice' : mOldPrice,
2202                'mNewPrice' : mNewPrice,
2203                'mQuoteT' : mQuoteT,
2204                'mQuoteL' : mQuoteL,
2205                'mListing' : mListing,
2206                'mLink' : mLink,
2207                'mImage' : mImage,
2208                'mType' : mType,
2209                'mGroup' : mGroup,
2210                'orderP' : orderP,
2211                'orderU' : orderU,
2212                'popularItem' : popularItem,
2213                'spiceLVL'  :   spiceLVL,
2214                'showQute'  : QpriceTog,
2215                'lpNonce' : jQuery('#lpNonce').val()
2216            },
2217            success: function( res )
2218            {
2219                jQuery('.lp-menu-close-outer').prepend('<input type="hidden" id="lp-showQOrP" value="'+QpriceTog+'">');
2220                var menuLength  =   parseInt(res.menu_after_update[mType][mGroup].length-1);
2221                jQuery('#menu-group').val(null).trigger('change');
2222                var  type_rep  =   mType.replace(/ /g,'-');
2223                var  grp_rep  =   mGroup[0].replace(/ /g,'-');
2224                var  listid  =   mListing;
2225                var  menu_id  =  type_rep+'_'+grp_rep+'_'+menuLength+'_'+listid;
2226                var regmQuoteT = '';
2227                var mQuoteLinK = '';
2228                var $menu_price_check = '';
2229                if (jQuery('#lp-showQOrP').val() == 'true') {
2230                    regmQuoteT = '<div class="col-sm-6">' +
2231                        '<label class="lp-dashboard-top-label" for="menu-quote-text-' + menu_id + '">Quote Text</label>' +
2232                        '<input id="menu-quote-text-' + menu_id + '"     type="text"   class="form-control lp-dashboard-text-field"    value="' + mQuoteT + '"    placeholder="Ex: Quote">' +
2233                        '</div>';
2234                    mQuoteLinK = '<div class="col-sm-6">' +
2235                        '<label class="lp-dashboard-top-label" for="menu-quote-link-' + menu_id + '">Quote Link</label>' +
2236                        '<input id="menu-quote-link-' + menu_id + '"           type="text"          class="form-control lp-dashboard-text-field"            value="' + mQuoteL + '"              placeholder="Ex: hht://yourweb.com/page">' +
2237                        '</div>';
2238                }
2239                if (jQuery('#lp-showQOrP').val() == 'false') {
2240                    $menu_price_check = '<div class="menu-price-wrap">' +
2241                        '<div class="col-sm-2 padding-left-0">' +
2242                        '<label class="lp-dashboard-top-label" for="menu-old-price-' + menu_id + '">Reg. Price</label>' +
2243                        '<input name="menu-old-price-' + menu_id + '"  id="menu-old-price-' + menu_id + '"  type="text" class="form-control lp-dashboard-text-field" placeholder="Ex: $10" value="' + mOldPrice + '">' +
2244                        '</div>' +
2245                        '<div class="col-sm-2 padding-left-0">' +
2246                        '<label class="lp-dashboard-top-label" for="menu-new-price-' + menu_id + '">Sale Price</label>' +
2247                        '<input id="menu-new-price-' + menu_id + '"  name="menu-new-price-' + menu_id + '"  type="text"  class="form-control lp-dashboard-text-field"  placeholder="Ex: $10"  value="' + mNewPrice + '">' +
2248                        '</div>' +
2249                        '</div>';
2250                }
2251                var checkedpoP = '';
2252                if (popularItem == 'mItemPopularTrue') {
2253                    checkedpoP = 'checked';
2254                }
2255                var selected_spicelvl1 = '';
2256                var selected_spicelvl2 = '';
2257                var selected_spicelvl3 = '';
2258                var selected_spicelvl4 = '';
2259
2260                if (spiceLVL == 'spicelvl1') {
2261                    selected_spicelvl1 = 'selected';
2262                } else if (spiceLVL == 'spicelvl2') {
2263                    selected_spicelvl2 = 'selected';
2264                } else if (spiceLVL == 'spicelvl3') {
2265                    selected_spicelvl3 = 'selected';
2266                } else if (spiceLVL == 'spicelvl4') {
2267                    selected_spicelvl4 = 'selected';
2268                }
2269                var imagedivvar = '';
2270                if ( mImage != '' ) {
2271                    imagedivvar = '<div class="menu-edit-img-wrap gal-img-count-single">' +
2272                    '<span data-src="'+mImage+'" data-target="dis-old-img-'+menu_id+'" class="remove-menu-img"><i class="fa fa-close"></i></span>' +
2273                    '<img class="gal-img-count-single lp-uploaded-img event-old-img-'+menu_id+'" src="'+mImage+'" alt="">' +
2274                    '</div>' ;
2275                }
2276
2277                var html    =   '<div class="lp-menu-close-outer">
2277' +
2278                    '<div class="lp-menu-closed clearfix ">' +
2279                    '<div class="row">' +
2280                    '<div class="col-md-6"><i class="fa fa-check-circle fa-check-circle2" aria-hidden="true"></i><h4 class="lp-right-side-title"><span>Item Name</span><br>'+ mTitle +'</h4></div>' +
2281                    '<div class="col-md-2"><span>Group</span><br>'+ mGroup +'</div>' +
2282                    '<div class="col-md-2 price"><span>Price</span><br>'+ calcPrice +'</div>' +
2283                    '<div class="col-md-2"><span class="lp-dot-extra-buttons"><i class="fa fa-ellipsis-v" aria-hidden="true"></i>' +
2284                    '<ul class="lp-user-menu list-style-none">' +
2285                    '<li><a class="edit-menu-item" data-menuID="'+menu_id+'" data-uid="'+ userID +'" href=""><i class="fa fa-pencil" aria-hidden="true"></i><span>Edit</span></a></li>' +
2286                    '<li><a href="" class="menu-del del-this" data-LID="'+mListing+'" data-targetid="'+menu_id+'" data-uid="'+ userID +'"><i class="fa fa-trash" aria-hidden="true"></i><span>Delete</span></a></li>' +
2287                    '</ul>' +
2288                    '</span></div>' +
2289                    '</div>' +
2290                    '</div>' +
2291                    '<div id="menu-update-'+menu_id+'" class="lp-menu-form-outer background-white" style="display: none">' +
2292                    '<div class="lp-menu-form-inner">' +
2293                    '<form class="row">' +
2294                    '<input value="'+mType+'" type="hidden" id="menu-type-'+menu_id+'" name="menu-type-'+menu_id+'">' +
2295                    '<input type="hidden" value="'+mGroup+'" id="menu-group-'+menu_id+'" name="menu-group-'+menu_id+'">' +
2296                    '<div class="col-sm-12 margin-top-10">' +
2297                    '<div class="lp-menu-form-feilds">' +
2298                    '<div class="row clearfix">' +
2299                    '<div class="col-md-12">' +
2300                    '<div class="row">' +
2301                    '<div class="margin-bottom-10 col-md-8">' +
2302                    '<label class="lp-dashboard-top-label" for="menu-title-'+menu_id+'">Menu Item</label>' +
2303                    '<input name="menu-title-'+menu_id+'"  id="menu-title-'+menu_id+'"  type="text"  class="form-control lp-dashboard-text-field" placeholder="Ex: Roasted Chicken" value="'+ mTitle +'">' +
2304                    '</div>' + $menu_price_check +
2305                    '<div class="menu-quote-wrap clearfix margin-bottom-20">' +
2306                    regmQuoteT +
2307                    mQuoteLinK +
2308                    '</div>' +
2309                    '</div>' +
2310                    '<div class="margin-bottom-30">' +
2311                    '<label class="lp-dashboard-top-label" for="menu-detail-'+menu_id+'">Short Description</label>' +
2312                    '<textarea name="menu-detail-'+menu_id+'" id="menu-detail-'+menu_id+'" type="text" class="form-control lp-dashboard-des-field" rows="3" placeholder="Ex: Roasted Chicken">'+mDetail+'</textarea>' +
2313                    '</div>' +
2314                    '</div>' +
2315
2316
2317                    '<div class="lp-invoices-all-stats-on-off clearfix margin-bottom-10 Popular_item_container">' +
2318                    '<label class="switch">' +
2319                    '<input '+checkedpoP+' value="Yes" class="form-control switch-checkbox menu_Popular_Item-'+menu_id+'" type="checkbox" name="lp_form_fields_inn[235]">' +
2320                    '<div class="slider round"></div>' +
2321                    '</label>' +
2322                    '<span class="margin-left-10" style="font-size: 16px!important;font-weight: normal!important;">Popular Item</span>' +
2323                    '</div>' +
2324                    '<div class="clearfix margin-bottom-10 menuSpice-control_containter">' +
2325                    '<select style="width: 100%!important;margin-left: 0;" id="menuSpice-control" class="form-control menuSpice-control-'+menu_id+'">' +
2326                    '<option>Spice Level</option>' +
2327
2328
2329                    '<option data-level="1" '+selected_spicelvl1+' >🌶</option>' +
2330                    '<option data-level="2" '+selected_spicelvl2+' >🌶🌶</option>' +
2331                    '<option data-level="3" '+selected_spicelvl3
2331+' >🌶🌶🌶</option>' +
2332
2333                    '</select>' +
2334                    '</div>' +
2335
2336                    '<div class="col-md-12">' +
2337                    '<div class="jFiler-input-dragDrop pos-relative event-featured-image-wrap-dash">' +
2338                    '<div class="upload-field dashboard-upload-field edit-upload-'+menu_id+'">' +
2339                    '<input class="frontend-input-multiple" type="hidden" id="dis-old-img-'+menu_id+'" value="'+mImage+'">' +
2340                    '<input type="hidden" class="frontend-input" name="frontend_input"><label><a class="jFiler-input-choose-btn blue">Browse File</a><input class="frontend-button" type="button" value="" style="position: relative; z-index: 1;"> </label><div class="clearfix"></div><img class="frontend-image" alt="">    ' +
2341                    '<div class= "menu-edit-imgs-wrap" >' +
2342                    imagedivvar +
2343                    '</div>' +
2344                    '</div>' +
2345                    '</div>' +
2346                    '</div>' +
2347
2348                    '</div>' +
2349                    '</div>' +
2350                    '</div>' +
2351                    '<div class="clearfix"></div>' +
2352                    '<div class="lp-menu-save-btns clearfix col-md-12 margin-bottom-20">' +
2353                    '<button class="lp-cancle-btn cancel-update-menu">Cancel</button>' +
2354                    '<button data-LID="'+mListing+'" data-menuID="'+menu_id+'"  data-uid="'+userID+'"  class="lp-save-btn lp-edit-menu">save</button>' +
2355                    '</div>' +
2356                    '</form>' +
2357                    '</div>' +
2358                    '</div>' +
2359                    '<div>';
2360                jQuery('.panel-body.lp-panel-body-outer.lp-menu-panel-body-outer .tab-content.lp-tab-content-outer .tab-pane.fade.in.active').append( html );
2361                $this.find('i.fa.fa-spin.fa-spinner').remove();
2362                $this.removeAttr('disabled');
2363
2364
2365                jQuery('.menu-edit-imgs-wrap .frontend-input-multiple').val('');
2366                $this.closest('#menu-form-toggle').find('.lp-menu-close-outer.lp-menu-open').slideUp();
2367                $this.attr('id', 'lp-save-menu-reopen');
2368                jQuery('#menu-title').val('');
2369                jQuery('#menu-detail').val('');
2370                jQuery('#menu-old-price').val('');
2371                jQuery('#menu-new-price').val('');
2372                jQuery('#menu-quote-text').val('');
2373                jQuery('#menu-quote-link').val('');
2374                jQuery('#menu-link').val('');
2375                jQuery('.new-file-upload .frontend-input').val('');
2376                jQuery('.new-file-upload .frontend-image').hide('slow');
2377            },
2378            error: function( err )
2379            {
2380                console.log( err );
2381                $this.find('i').remove();
2382                $this.removeAttr('disabled');
2383                var dataError   =   [];
2384                dataError.status    =   'error';
2385                dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
2386                ajax_success_popup( dataError, $this );
2387            }
2388        });
2389    });
2390
2391    jQuery('.add-new-open-form').click(function (e) {
2392        e.preventDefault();
2393        var targetForm  =   '#'+jQuery(this).data('form')+'-form-toggle';
2394        jQuery( 'div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11' ).fadeOut( "fast", function() {
2395            jQuery(targetForm).fadeIn("fast", function () {
2396                jQuery( ".lp-blank-section" ).fadeOut();
2397            });
2398        });
2399    });
2400    jQuery('.lp-blank-section .add-new-open-form').click(function (e) {
2401        e.preventDefault();
2402        var targetForm  =   '#'+jQuery(this).data('form')+'-form-toggle';
2403        jQuery(targetForm).fadeIn("fast", function () {
2404            jQuery( ".lp-blank-section" ).fadeOut();
2405        });
2406    });
2407    var targetPlanMetaKey   =   'menu';
2408    if( jQuery('.select2-ajax').length != 0 )
2409    {
2410        targetPlanMetaKey   =   jQuery('.select2-ajax').data('metakey');
2411
2412        var noResultsText   =   jQuery('#select2-ajax-noresutls').val(),
2413            inputShortText  =   jQuery('#select2-ajax-tooshort').val(),
2414            searchingText   =   jQuery('#select2-ajax-searching').val();
2415    }
2416
2417    jQuery('.select2-ajax').select2({
2418        ajax: {
2419            url: ajax_search_term_object.ajaxurl,
2420            dataType: 'json',
2421            type:'GET',
2422            data: function (params) {
2423                return {
2424                    q: params.term, // search query
2425                    targetPlanMetaKey: targetPlanMetaKey,
2426                    action: 'select2_ajax_dashbaord_listing' // AJAX action for admin-ajax.php
2427                };
2428            },
2429            processResults: function( data ) {
2430                var options = [];
2431                var disabled_opts   =   false;
2432                if ( data ) {
2433
2434                    // data is the array of arrays, and each of them contains ID and the Label of the option
2435                    jQuery.each( data, function( index, text ) { // do not forget that "index" is just auto incremented value
2436                        var disabled_opts   =   false;
2437                        if( text[2] == 'yes' )
2438                        {
2439                            disabled_opts   =   true;
2440                        }
2441                        options.push( { id: text[0], text: text[1], disabled:disabled_opts } );
2442                    });
2443
2444                }
2445                return {
2446                    results: options
2447                };
2448            },
2449            cache: true
2450        },
2451        minimumInputLength: 3,
2452        language: {
2453            inputTooShort: function () {
2454                return inputShortText;
2455            },
2456            noResults: function () {
2457                return noResultsText;
2458            },
2459            searching: function () {
2460                return searchingText;
2461            }
2462        }
2463    });
2464
2465
2466	/* for campaigns */
2467	jQuery('.lp-search-listing-camp').select2({
2468        ajax: {
2469            url: ajax_search_term_object.ajaxurl,
2470            dataType: 'json',
2471            type:'GET',
2472            data: function (params) {
2473                return {
2474                    q: params.term, // search query
2475                    action: 'select2_ajax_dashbaord_listing_camp' // AJAX action for admin-ajax.php
2476                };
2477                console.log(params);
2478            },
2479            processResults: function( data ) {
2480                var options = [];
2481                if ( data ) {
2482
2483                    // data is the array of arrays, and each of them contains ID and the Label of the option
2484                    jQuery.each( data, function( index, text ) { // do not forget that "index" is just auto incremented value
2485                        options.push( { id: text[0], text: text[1]  } );
2486                    });
2487
2488                }
2489                return {
2490                    results: options
2491                };
2492            },
2493            cache: true
2494        },
2495        minimumInputLength: 3
2496    });
2497	/* end for camp */
2498
2499    var uniqueMetaKey   =   'event_id';
2500    var planmetakey     =   'events';
2501    if( jQuery('.select2-ajax-unique').length != 0 )
2502    {
2503        uniqueMetaKey   =   jQuery('.select2-ajax-unique').data('metakey');
2504        planmetakey     =   jQuery('.select2-ajax-unique').data('planmetakey');
2505
2506        var noResultsText   =   jQuery('#select2-ajax-noresutls').val(),
2507            inputShortText  =   jQuery('#select2-ajax-tooshort').val(),
2508            searchingText   =   jQuery('#select2-ajax-searching').val();
2509    }
2510
2511    jQuery('.select2-ajax-unique').select2({
2512        ajax: {
2513            url: ajax_search_term_object.ajaxurl,
2514            dataType: 'json',
2515            type:'GET',
2516            data: function (params) {
2517                return {
2518                    q: params.term, // search query
2519                    uniqueMetaKey: uniqueMetaKey,
2520                    planmetakey: planmetakey,
2521                    action: 'select2_ajax_dashbaord_listing_unique' // AJAX action for admin-ajax.php
2522                };
2523            },
2524            processResults: function( data ) {
2525                var options = [];
2526                if ( data ) {
2527
2528                    // data is the array of arrays, and each of them contains ID and the Label of the option
2529                    jQuery.each( data, function( index, text ) { // do not forget that "index" is just auto incremented value
2530                        var disabled_opts   =   false;
2531                        if( text[2] == 'yes' )
2532                        {
2533                            disabled_opts   =   true;
2534                        }
2535
2536                        options.push( { id: text[0], text: text[1], disabled:disabled_opts } );
2537                    });
2538
2539                }
2540                return {
2541                    results: options
2542                };
2543            },
2544            cache: true
2545        },
2546        minimumInputLength: 3,
2547        language: {
2548            inputTooShort: function () {
2549                return inputShortText;
2550            },
2551            noResults: function () {
2552                return noResultsText;
2553            },
2554            searching: function () {
2555                return searchingText;
2556            }
2557        }
2558    });
2559
2560    jQuery('#ad-announcement-btn').on( 'click', function (e) {
2561       e.preventDefault();
2562       var $this   =   jQuery(this),
2563           userID  =   $this.data('uid'),
2564           annMsg  =   jQuery('#announcements-message').val(),
2565           annBT   =   jQuery('#announcements-btn-text').val(),
2566           annBL   =   jQuery('#announcements-btn-link').val(),
2567           annLI   =   jQuery('#announcements-listing').val(),
2568           annSt   =   jQuery('#ann-style').find(':selected').val(),
2569           annIC   =   jQuery('#announcements-icon').val(),
2570           annType =   '',
2571           annTI   =   jQuery('#announcements-title').val();
2572
2573       if( annIC != '' )
2574
2575       {
2576           var annType =   jQuery('#announcements-icon').attr('icon-type');
2577       }
2578
2579       if( annLI == 0 || annLI == '' || annLI == null )
2580       {
2581           jQuery('#select2-announcements-listing-container').addClass('error');
2582       }
2583       else
2584       {
2585           jQuery('#select2-announcements-listing-container').removeClass('error');
2586       }
2587       if( annMsg == '' )
2588       {
2589           jQuery('#announcements-message').addClass('error');
2590       }
2591       else
2592       {
2593           jQuery('#announcements-message').removeClass('error');
2594       }
2595
2596       if( annLI == 0 || annLI == '' || annMsg == '' || annLI == 0 || annLI == '' || annLI == null )
2597       {
2598		   var dataError   =   [];
2599       dataError.status    =   'error';
2600       dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
2601       ajax_success_popup( dataError, $this );
2602           $this.find('i').remove();
2603           return false;
2604       }
2605       if( $this.hasClass('processing-ann') )
2606       {}
2607       else
2608       {
2609           $this.append('<i class="fa fa-spin fa-spinner"></i>');
2610           $this.addClass('processing-ann');
2611
2612           jQuery.ajax({
2613               type: 'POST',
2614               dataType: 'json',
2615               url: ajax_search_term_object.ajaxurl,
2616               data:{
2617                   'action': 'add_announcements_cb',
2618                   'user_id' : userID,
2619                   'annSt' : annSt,
2620                   'annMsg' : annMsg,
2621                   'annBT' : annBT,
2622                   'annBL' : annBL,
2623                   'annLI' : annLI,
2624                   'annTI' : annTI,
2625                   'annIC' : annIC,
2626                   'annType' : annType,
2627                   'lpNonce' : jQuery('#lpNonce').val()
2628               },
2629               success: function( res )
2630               {
2631                  ajax_success_popup( res, $this );
2632               },
2633
2634               error: function( err )
2635               {
2636                   $this.find('i').remove();
2637               }
2638           });
2639       }
2640
2641
2642   });
2643
2644
2645    jQuery('#ann-style').on('change', function (e) {
2646
2647        var $this   =   jQuery(this),
2648
2649            $thisDes    =   $this.find(':selected').attr('data-des'),
2650
2651            $thisTI     =   $this.find(':selected').attr('data-title'),
2652
2653            $thisIC     =   $this.find(':selected').attr('data-icon'),
2654
2655            $thisBT     =   $this.find(':selected').text(),
2656
2657            $thisST     =   $this.find(':selected').attr('data-st');
2658
2659
2660
2661        jQuery('.announcement-wrap span').text($thisDes);
2662
2663        jQuery('#announcements-message').val($thisDes);
2664
2665        jQuery('.announcement-wrap a').text($thisBT);
2666
2667        jQuery('.announcement-wrap strong').text($thisTI);
2668
2669        jQuery('#announcements-btn-text').val($thisBT);
2670
2671        jQuery('#announcements-title').val($thisTI);
2672
2673        jQuery('.announcement-wrap i').removeClass();
2674
2675        jQuery('.announcement-wrap i').addClass($thisIC);
2676
2677
2678
2679
2680
2681        jQuery('.field-desc strong').text($thisDes.length);
2682
2683
2684
2685
2686
2687    })
2688
2689    jQuery('.ann-style-wrap span').click(function (e) {
2690
2691        var $this   =   jQuery(this),
2692
2693            $thisWrap   =   $this.closest('.ann-style-wrap'),
2694
2695            $thislabel  =   $this.closest('label'),
2696
2697            $thisDes    =   $this.data('des'),
2698
2699            $thisBT     =   $this.data('bt');
2700
2701
2702
2703
2704
2705        $thisWrap.find('input[name="ann-style"]:checked').removeAttr('checked');
2706
2707        $thisWrap.find('.ann-style-val').val($thislabel.find('input').val());
2708
2709        $thislabel.find('input').attr('checked', true);
2710
2711
2712
2713        jQuery('.announcement-wrap span, #announcements-message').text($thisDes);
2714
2715        jQuery('.announcement-wrap a').text($thisBT);
2716
2717        jQuery('#announcements-btn-text').val($thisBT);
2718
2719
2720
2721
2722
2723    });
2724
2725
2726
2727    jQuery(document).on('click', '#lp-save-dis', function(e)
2728    {
2729        e.preventDefault();
2730
2731        var $this   =   jQuery(this),
2732            userID  =   $this.data('uid'),
2733            disHea  =   jQuery('#dis-heading').val(),
2734            disCod  =   jQuery('#dis-code').val(),
2735            disExpE  =   jQuery('#dis-expiry-e').val(),
2736            disExpS  =   jQuery('#dis-expiry-s').val(),
2737            disTimeE    =   jQuery('#dis-time-e').val(),
2738            disTimeS    =   jQuery('#dis-time-s').val(),
2739            disBT   =   jQuery('#dis-btn-text').val(),
2740            disBL   =   jQuery('#dis-btn-link').val(),
2741            disLI   =   jQuery('#dis-listing').val(),
2742            disImg   =   jQuery('.new-file-upload .frontend-input').val(),
2743            disOff   =   jQuery('#dis-off').val(),
2744            disDes   =   jQuery('#dis-description').val();
2745
2746
2747        if( disLI == 0 || disLI == '' || disLI == null )
2748        {
2749            jQuery('#select2-dis-listing-container').addClass('error');
2750        }
2751        else
2752        {
2753            jQuery('#select2-dis-listing-container').removeClass('error');
2754        }
2755        if( disHea == '' )
2756        {
2757            jQuery('#dis-heading').addClass('error');
2758        }
2759        else
2760        {
2761            jQuery('#dis-heading').removeClass('error');
2762        }
2763
2764        if( disLI == 0 || disLI == '' || disLI == null || disHea == '' )
2765        {
2766			var dataError   =   [];
2767		   dataError.status    =   'error';
2768		   dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
2769		   ajax_success_popup( dataError, $this );
2770            $this.find('i').removeClass('fa-spin fa-spinner');
2771            return false;
2772        }
2773        if( $this.hasClass('processing-dis') )
2774        {}
2775        else
2776        {
2777            $this.addClass('processing-dis');
2778            $this.append('<i class="fa fa-spin fa-spinner"></i>');
2779            jQuery.ajax({
2780                type: 'POST',
2781                dataType: 'json',
2782                url: ajax_search_term_object.ajaxurl,
2783                data:{
2784                    'action': 'add_discount_cb',
2785                    'user_id' : userID,
2786                    'disHea' : disHea,
2787                    'disCod' : disCod,
2788                    'disExpE' : disExpE,
2789                    'disExpS' : disExpS,
2790                    'disTimeE': disTimeE,
2791                    'disTimeS': disTimeS,
2792                    'disBT' : disBT,
2793                    'disBL' : disBL,
2794                    'disLI' : disLI,
2795                    'disDes' : disDes,
2796                    'disOff' : disOff,
2797                    'disImg' : disImg,
2798                    'disSta' : 'active',
2799                    'lpNonce' : jQuery('#lpNonce').val()
2800                },
2801                success: function( res )
2802                {
2803                   ajax_success_popup( res, $this );
2804                },
2805
2806                error: function( err )
2807                {
2808                    alert( err );
2809                    $this.find('i').remove();
2810                }
2811            });
2812        }
2813    });
2814
2815    jQuery(document).on('click', '#lp-save-offer', function(e)
2816    {
2817
2818        e.preventDefault();
2819
2820
2821
2822        var $this   =   jQuery(this),
2823
2824            userID  =   $this.data('uid'),
2825
2826            offerTitle  =   jQuery('#offer-title').val(),
2827
2828            offerDes  =   jQuery('#offer-description').val(),
2829
2830            offerExp  =   jQuery('#offer-expriry').val(),
2831
2832            offerBT  =   jQuery('#offer-btn-text').val(),
2833
2834            offerBL  =   jQuery('#offer-btn-link').val(),
2835
2836            offerImg  =   jQuery('#frontend-input').val(),
2837
2838            offerLI  =   jQuery('#offer-listing').val();
2839
2840
2841
2842        if( !jQuery('.btn-link-field-toggle').hasClass('link-active') )
2843
2844        {
2845
2846            offerBL =   '';
2847
2848        }
2849
2850
2851
2852        $this.append('<i class="fa fa-spin fa-spinner"></i>');
2853
2854
2855
2856        if( offerLI == null || offerLI == '' || offerTitle == '' || offerExp == '' )
2857
2858        {
2859
2860            jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
2861
2862            $this.find('i').remove();
2863
2864            return false;
2865
2866        }
2867
2868
2869
2870        jQuery.ajax({
2871
2872            type: 'POST',
2873
2874            dataType: 'json',
2875
2876            url: ajax_search_term_object.ajaxurl,
2877
2878            data:{
2879
2880                'action': 'add_offer_cb',
2881
2882                'user_id' : userID,
2883
2884                'offerTitle' : offerTitle,
2885
2886                'offerDes' : offerDes,
2887
2888                'offerExp' : offerExp,
2889
2890                'offerBT' : offerBT,
2891
2892                'offerBL' : offerBL,
2893
2894                'offerLI' : offerLI,
2895
2896                'offerImg' : offerImg,
2897                'lpNonce' : jQuery('#lpNonce').val()
2898
2899            },
2900
2901            success: function( res )
2902
2903            {
2904
2905                console.log( res );
2906
2907                $this.find('i').removeClass('fa-spin fa-spinner');
2908
2909                $this.find('i').addClass('fa fa-check');
2910
2911                location.reload();
2912
2913            },
2914
2915            error: function( err )
2916
2917            {
2918
2919                alert( err );
2920
2921                $this.find('i').remove();
2922
2923            }
2924
2925        });
2926
2927    });
2928
2929    jQuery(document).on('click', '.del-this', function(e)
2930    {
2931        e.preventDefault();
2932        jQuery('.remove-active').removeClass('remove-active');
2933        jQuery(this).addClass('remove-active');
2934        jQuery('#dashboard-delete-modal').modal('show');
2935        jQuery('.modal-backdrop').hide();
2936    });
2937
2938    jQuery(document).on('click', '.dashboard-confirm-del-btn', function (e) {
2939        var $this       =   jQuery('.remove-active');
2940        if( $this.hasClass('del-all-menu') )
2941        {
2942            var lid     =   $this.data('lid'),
2943                user_id =   $this.data('uid');
2944
2945
2946
2947            jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
2948
2949            jQuery.ajax({
2950                type: 'POST',
2951                dataType: 'json',
2952                url: ajax_search_term_object.ajaxurl,
2953                data:{
2954                    'action': 'del_all_menu_cb',
2955                    'user_id' : user_id,
2956                    'lid' : lid,
2957                    'lpNonce' : jQuery('#lpNonce').val()
2958                },
2959                success: function( res )
2960                {
2961                    if( res.status == 'success' )
2962                    {
2963                        location.reload();
2964                    }
2965                    $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
2966                },
2967                error: function( err )
2968                {
2969                    console.log( err );
2970                    $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
2971                }
2972            });
2973        }
2974        else
2975        {
2976            var targetID    =   $this.data('targetid'),
2977                userID      =   $this.data('uid'),
2978                delType     =   '',
2979                delIDS      =   '',
2980                dellAll     =   '';
2981
2982            if( $this.hasClass('dis-del') )
2983            {
2984                delType =   'dis';
2985            }
2986            if( $this.hasClass('event-del') )
2987            {
2988                delType =   'event';
2989            }
2990            if( $this.hasClass('ann-del') )
2991            {
2992                delType =   'ann';
2993            }
2994            if( $this.hasClass('offer-del') )
2995            {
2996                delType     =   'offer';
2997                delIDS      =   $this.data('del-ids');
2998            }
2999            if( $this.hasClass('menu-del') )
3000            {
3001                delType =   'menu';
3002                delIDS  =   $this.data('lid');
3003            }
3004            if( $this.hasClass('del-type') )
3005            {
3006                delType =   'type';
3007                dellAll =   jQuery('input[name="delete-group-type"]:checked').val();
3008            }
3009            if( $this.hasClass('del-group') )
3010            {
3011                delType =   'group';
3012                dellAll =   jQuery('input[name="delete-group-type"]:checked').val();
3013            }
3014            jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
3015            jQuery.ajax({
3016                type: 'POST',
3017                dataType: 'json',
3018                url: ajax_search_term_object.ajaxurl,
3019                data:{
3020                    'action': 'del_ann_dis_menu_cb',
3021                    'user_id' : userID,
3022                    'delType' : delType,
3023                    'targetID' : targetID,
3024                    'delIDS' : delIDS,
3025                    'dellAll' : dellAll,
3026                    'lpNonce' : jQuery('#lpNonce').val()
3027                },
3028                success: function( res )
3029                {
3030                    if( res.status == 'success' )
3031                    {
3032                        if(delType == 'menu') {
3033                            jQuery('.menu-del[data-targetid="'+targetID+'"]').closest('.lp-menu-close-outer').remove();
3034                            jQuery('#dashboard-delete-modal').modal('hide');
3035                            jQuery('.dashboard-confirm-del-btn').find('i').remove();
3036                        } else {
3037                            jQuery('#dashboard-delete-modal').modal('hide');
3038                            location.reload();
3039                        }
3040
3041                    }
3042                    $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
3043                },
3044                error: function( err )
3045                {
3046                    console.log( err );
3047                    $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
3048                }
3049            });
3050        }
3051    });
3052    jQuery(document).on('click', 'a.event-edit, a.menu-edit, a.ann-edit, a.dis-edit, a.offer-edit', function(e)
3053    {
3054        e.preventDefault();
3055        var $this       =   jQuery(this),
3056            targetID    =   $this.data('targetid'),
3057            updateWrap  =   '#update-wrap-'+targetID;
3058
3059        if( jQuery('.active-update-form').length != 0 )
3060        {
3061            jQuery('.active-update-form').slideUp(500, function (e) {
3062                jQuery('.active-update-form').removeClass('active-ann-form');
3063                jQuery(updateWrap).slideToggle('500', function (e) {
3064                    jQuery(updateWrap).addClass('active-update-form');
3065                    jQuery('.cancel-update').click(function(e)
3066                    {
3067                        e.preventDefault();
3068                        jQuery('.active-update-form').slideUp(500, function (e) {
3069                            jQuery('.active-update-form').removeClass('active-update-form');
3070                        })
3071                    })
3072                });
3073            });
3074        }
3075        else
3076        {
3077            jQuery(updateWrap).slideToggle('500', function (e) {
3078                jQuery(updateWrap).addClass('active-update-form');
3079                jQuery('.cancel-update').click(function(e)
3080                {
3081                    e.preventDefault();
3082                    jQuery('.active-update-form').slideUp(500, function (e) {
3083                        jQuery('.active-update-form').removeClass('active-update-form');
3084                    })
3085                })
3086            });
3087        }
3088    });
3089    jQuery(document).on( 'click', '.edit-menu-item', function (e) {
3090        e.preventDefault();
3091        var $this       =   jQuery(this),
3092            targetID    =   $this.data('menuid'),
3093            updateWrap  =   '#menu-update-'+targetID;
3094
3095        if( jQuery('.active-update-formm').length != 0 )
3096        {
3097            jQuery('.active-update-formm').slideUp(500, function (e) {
3098                jQuery('.active-update-formm').removeClass('active-ann-form');
3099                jQuery(updateWrap).slideToggle('500', function (e) {
3100                    jQuery(updateWrap).addClass('active-update-formm');
3101                    jQuery('.cancel-update-menu').click(function(e)
3102                    {
3103                        e.preventDefault();
3104                        jQuery('.active-update-formm').slideUp(500, function (e) {
3105                            jQuery('.active-update-formm').removeClass('active-update-formm');
3106                        })
3107                    })
3108                });
3109            });
3110        }
3111        else
3112        {
3113            jQuery(updateWrap).slideToggle('500', function (e) {
3114                jQuery(updateWrap).addClass('active-update-formm');
3115                jQuery('.cancel-update-menu').click(function(e)
3116                {
3117                    e.preventDefault();
3118                    jQuery('.active-update-formm').slideUp(500, function (e) {
3119                        jQuery('.active-update-formm').removeClass('active-update-formm');
3120                    })
3121                })
3122            });
3123        }
3124    } );
3125
3126    if( jQuery('.lp-countdown').length != 0 )
3127    {
3128        jQuery('.lp-countdown').each(function (i, obj) {
3129            var selector    =   '#'+jQuery(this).attr('id');
3130            init_countdown(selector);
3131        });
3132    }
3133});
3134
3135jQuery(document).on('change', '#discount_displayin', function (e) {
3136
3137    e.preventDefault();
3138
3139    var $this   =   jQuery(this),
3140
3141        thisval =   $this.val(),
3142
3143        userID  =   $this.data('udi');
3144
3145
3146
3147    jQuery($this).after('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
3148
3149    jQuery.ajax({
3150
3151        type: 'POST',
3152
3153        dataType: 'json',
3154
3155        url: ajax_search_term_object.ajaxurl,
3156
3157        data:{
3158
3159            'action': 'discount_display_area',
3160
3161            'userID' : userID,
3162
3163            'thisval' : thisval,
3164            'lpNonce' : jQuery('#lpNonce').val()
3165
3166        },
3167
3168        success: function( res )
3169
3170        {
3171
3172            jQuery('#discount_displayin').next('i').remove();
3173
3174        },
3175
3176        error: function( err )
3177
3178        {
3179
3180            alert( err );
3181
3182            $this.find('i').remove();
3183
3184        }
3185
3186    });
3187
3188})
3189
3190jQuery(document).on('change', '#event_displayin', function (e) {
3191
3192    e.preventDefault();
3193
3194    var $this   =   jQuery(this),
3195
3196        thisval =   $this.val(),
3197
3198        userID  =   $this.data('udi');
3199
3200    jQuery($this).after('<i class="fa fa-spinner fa-spin" aria-hidden="true"></i>');
3201
3202    jQuery.ajax({
3203
3204        type: 'POST',
3205
3206        dataType: 'json',
3207
3208        url: ajax_search_term_object.ajaxurl,
3209
3210        data:{
3211
3212            'action': 'event_display_area',
3213
3214            'userID' : userID,
3215
3216            'thisval' : thisval,
3217            'lpNonce' : jQuery('#lpNonce').val()
3218
3219        },
3220
3221        success: function( res )
3222
3223        {
3224
3225            jQuery('#event_displayin').next('i').remove();
3226
3227        },
3228
3229        error: function( err )
3230
3231        {
3232
3233            alert( err );
3234
3235            $this.find('i').remove();
3236
3237        }
3238
3239    });
3240
3241});
3242
3243
3244jQuery(document).on('click', '.lp-edit-offer', function(e)
3245
3246{
3247
3248    e.preventDefault();
3249
3250    var $this   =   jQuery(this),
3251
3252        userID  =   $this.data('uid'),
3253
3254        offerID       =   $this.data('offerid'),
3255
3256        offerTitle  =   jQuery('#offer-title-'+offerID).val(),
3257
3258        offerDes  =   jQuery('#offer-description-'+offerID).val(),
3259
3260        offerExp  =   jQuery('#offer-expriry-'+offerID).val(),
3261
3262        offerBT  =   jQuery('#offer-btn-text-'+offerID).val(),
3263
3264        offerBL  =   jQuery('#offer-btn-link-'+offerID).val(),
3265
3266        offerLI  =   jQuery('#offer-listing-'+offerID).val();
3267
3268
3269
3270    if( !jQuery('.btn-link-field-toggle').hasClass('link-active') )
3271
3272    {
3273
3274        offerBL =   '';
3275
3276    }
3277
3278
3279
3280
3281
3282    $this.append('<i class="fa fa-spin fa-spinner"></i>');
3283
3284
3285
3286    if( offerLI == null || offerLI == '' || offerTitle == '' || offerExp == '' )
3287
3288    {
3289
3290        jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
3291
3292        $this.find('i').remove();
3293
3294        return false;
3295
3296    }
3297
3298
3299
3300
3301
3302    jQuery.ajax({
3303
3304        type: 'POST',
3305
3306        dataType: 'json',
3307
3308        url: ajax_search_term_object.ajaxurl,
3309
3310        data:{
3311
3312            'action': 'add_offer_cb',
3313
3314            'user_id' : userID,
3315
3316            'offerTitle' : offerTitle,
3317
3318            'offerDes' : offerDes,
3319
3320            'offerExp' : offerExp,
3321
3322            'offerBT' : offerBT,
3323
3324            'offerBL' : offerBL,
3325
3326            'offerLI' : offerLI,
3327
3328            'offerUP' : 'yes',
3329
3330            'offerID' : offerID,
3331            'lpNonce' : jQuery('#lpNonce').val()
3332
3333        },
3334
3335        success: function( res )
3336
3337        {
3338
3339            // console.log(res);
3340
3341            $this.find('i').removeClass('fa-spin fa-spinner');
3342
3343            $this.find('i').addClass('fa fa-check');
3344
3345            location.reload();
3346
3347        },
3348
3349        error: function( err )
3350
3351        {
3352
3353            alert( err );
3354
3355            $this.find('i').remove();
3356
3357        }
3358
3359    });
3360
3361});
3362
3363
3364
3365jQuery(document).on('click', '.lp-edit-dis', function (e)
3366
3367{
3368    e.preventDefault();
3369    var $this       =   jQuery(this),
3370
3371        disID       =   $this.data('disid'),
3372        userID      =   $this.data('uid'),
3373        disHea      =   jQuery('#dis-heading-'+disID).val(),
3374        disCod      =   jQuery('#dis-code-'+disID).val(),
3375        disExpE     =   jQuery('#dis-expiry-e-'+disID).val(),
3376        disExpS     =   jQuery('#dis-expiry-s-'+disID).val(),
3377        disTimeE    =   jQuery('#dis-time-e-'+disID).val(),
3378        disTimeS    =   jQuery('#dis-time-s-'+disID).val(),
3379        disBT       =   jQuery('#dis-btn-text-'+disID).val(),
3380        disBL       =   jQuery('#dis-btn-link-'+disID).val(),
3381        disLI       =   $this.data('listid'),
3382        disOff      =   jQuery('#dis-off-'+disID).val(),
3383		disImg      =   jQuery('.edit-upload-'+disID+' .frontend-input').val();
3384        disDes      =   jQuery('#dis-description-'+disID).val();
3385
3386    $this.append('<i class="fa fa-spin fa-spinner"></i>');
3387    if( disLI == 0 || disLI == '' )
3388    {
3389        jQuery('.ann-err-msg').fadeIn(500).delay(1500).fadeOut(500);
3390        $this.find('i').remove();
3391        return false;
3392    }
3393	if( disImg == '' )
3394   {
3395       disImg  =   jQuery('#dis-old-img-'+disID).val();
3396   }
3397    jQuery.ajax({
3398        type: 'POST',
3399        dataType: 'json',
3400        url: ajax_search_term_object.ajaxurl,
3401        data:{
3402            'action': 'add_discount_cb',
3403            'user_id' : userID,
3404            'disID' : disID,
3405            'disHea' : disHea,
3406            'disCod' : disCod,
3407            'disExpE' : disExpE,
3408            'disExpS' : disExpS,
3409            'disTimeE': disTimeE,
3410            'disTimeS': disTimeS,
3411            'disBT' : disBT,
3412            'disBL' : disBL,
3413            'disLI' : disLI,
3414            'disDes' : disDes,
3415            'disOff' : disOff,
3416			'disImg' : disImg,
3417            'disUp' : 'yes',
3418            'lpNonce' : jQuery('#lpNonce').val()
3419        },
3420        success: function( res )
3421        {
3422            ajax_success_popup( res, $this );
3423        },
3424        error: function( err )
3425        {
3426            // alert( err );
3427            // $this.find('i').remove();
3428        }
3429    });
3430});
3431
3432
3433
3434jQuery(document).on('click', '.lp-edit-announcements', function (e)
3435{
3436    e.preventDefault();
3437    var $this       =   jQuery(this),
3438        annID       =   $this.data('annid'),
3439        userID      =   $this.data('uid'),
3440        annMsg  =   jQuery('#announcements-message-'+annID).val(),
3441        annBT   =   jQuery('#announcements-btn-text-'+annID).val(),
3442        annBL   =   jQuery('#announcements-btn-link-'+annID).val(),
3443        annSt   =   jQuery('#ann-style-val-'+annID).val(),
3444        annTI   =   jQuery('#announcements-title-'+annID).val(),
3445        annIC   =   jQuery('#announcements-icon-'+annID).val(),
3446        annLI   =   jQuery(this).data('lid');
3447
3448    $this.append('<i class="fa fa-spin fa-spinner"></i>');
3449    if( annLI == 0 || annLI == '' || annMsg == '' )
3450    {
3451        jQuery('.ann-err-msg-'+annID).fadeIn(500).delay(1500).fadeOut(500);
3452        $this.find('i').remove();
3453        return false;
3454    }
3455
3456    jQuery.ajax({
3457        type: 'POST',
3458        dataType: 'json',
3459        url: ajax_search_term_object.ajaxurl,
3460        data:{
3461            'action': 'add_announcements_cb',
3462            'user_id' : userID,
3463            'annMsg' : annMsg,
3464            'annSt' : annSt,
3465            'annBT' : annBT,
3466            'annBL' : annBL,
3467            'annLI' : annLI,
3468            'annTI' : annTI,
3469            'annIC' : annIC,
3470            'annUP' : 'yes',
3471            'annID' : annID,
3472            'lpNonce' : jQuery('#lpNonce').val()
3473        },
3474
3475        success: function( res )
3476        {
3477            ajax_success_popup( res, $this );
3478
3479        },
3480
3481        error: function( err )
3482        {
3483
3484        }
3485    });
3486});
3487
3488function init_countdown( selector )
3489{
3490    var $this   =   jQuery(selector);
3491    if( !$this.length ) return false;
3492
3493    var clock;
3494    var daysLabel  =   jQuery(selector).data('label-days'),
3495        hoursLabel   =   jQuery(selector).data('label-hours'),
3496        minsLabel   =   jQuery(selector).data('label-mints'),
3497        cHour        =   jQuery(selector).data('hour'),
3498        cMinute        =   jQuery(selector).data('minute'),
3499        cDay        =   jQuery(selector).data('day'),
3500        cMonth      =   jQuery(selector).data('month'),
3501        cYear       =   jQuery(selector).data('year');
3502
3503    FlipClock.Lang.Custom = { days: daysLabel, hours: hoursLabel, minutes: minsLabel };
3504
3505    var startDate = new Date(cYear, cMonth, cDay, cHour , cMinute); //year, month, day
3506    var now = Math.floor(Date.now()/1000); //Current timestamp in seconds
3507    var clockStart = startDate.getTime()/1000 - now; //What to set the clock at when page loads
3508    var numDays = Math.floor(clockStart / 86400);
3509
3510    var minDigits   =   6;
3511    if( numDays > 99 )
3512    {
3513        minDigits   =   7;
3514    }
3515
3516    clock = jQuery(selector).FlipClock({
3517        clockFace: 'DailyCounter',
3518        autoStart: true,
3519        showSeconds: false,
3520        language: 'Custom',
3521        minimumDigits: minDigits
3522    });
3523
3524    clock.setTime(clockStart);
3525    clock.setCountdown(true);
3526}
3527
3528jQuery(document).on( 'mouseleave', '#menu-categories-menu', function (e) {
3529
3530    jQuery('.lp-header-nav-btn').removeClass('active-can-menu');
3531
3532    jQuery('#menu-categories-menu').css('opacity', '0');
3533
3534    jQuery('#menu-categories-menu').css('transform', 'scale(0)');
3535
3536});
3537
3538jQuery(document).on( 'click', '.lp-ann-btn', function (e) {
3539
3540    e.preventDefault();
3541
3542    if(jQuery(this).hasClass('lp-no-review-btn')) {
3543
3544    } else {
3545        var targetANN   =   '#'+jQuery(this).attr('data-ann');
3546        jQuery(targetANN).show();
3547
3548        jQuery(targetANN).find('.lp-listing-announcement').fadeIn();
3549        jQuery(targetANN).find('.lp-listing-announcement').addClass('active-ann');
3550
3551        jQuery('.code-overlay').fadeIn();
3552    }
3553});
3554
3555
3556
3557
3558jQuery(document).on( 'click', '.close-ann', function (e) {
3559
3560    e.preventDefault();
3561
3562    jQuery('.active-ann').fadeOut();
3563    jQuery('.active-ann').removeClass('active-ann');
3564    jQuery('.code-overlay').fadeOut();
3565    jQuery('.lp-listing-announcements').fadeOut();
3566});
3567
3568
3569
3570jQuery(document).on('click', '.lp-coupon-btn', function(e){
3571
3572    e.preventDefault();
3573
3574
3575
3576    var targetCOUP   =   '#'+jQuery(this).data('coupon');
3577
3578
3579
3580    jQuery(targetCOUP).fadeIn();
3581
3582    jQuery(targetCOUP).addClass('active-coupon');
3583
3584
3585
3586    jQuery('.code-overlay').fadeIn();
3587
3588
3589
3590});
3591
3592jQuery(document).on('click', '.close-coupon', function (e) {
3593
3594    e.preventDefault();
3595
3596
3597
3598    jQuery('.active-coupon').fadeOut();
3599
3600    jQuery('.active-coupon').removeClass('active-coupon');
3601
3602    jQuery('.code-overlay').fadeOut();
3603
3604});
3605
3606
3607
3608jQuery(document).on('shown.bs.tab', 'a[href="#menu_tab"]', function (e) {
3609    //slickINIT();
3610    jQuery('.lp-listing-menuu-slider').slick('refresh');
3611});
3612
3613
3614
3615
3616
3617jQuery(document).on( 'click', '.ann-toggle-btn', function (e) {
3618
3619    e.preventDefault();
3620    var $this   =   jQuery(this),
3621        status  =   $this.attr('data-status'),
3622        annID   =   $this.data('annid'),
3623        userID  =   $this.data('uid');
3624
3625    jQuery.ajax({
3626        type: 'POST',
3627        dataType: 'json',
3628        url: ajax_search_term_object.ajaxurl,
3629        data:{
3630            'action': 'add_announcements_cb',
3631            'user_id' : userID,
3632            'status' : status,
3633            'annID' : annID,
3634            'annUP' : 'on-off',
3635            'lpNonce' : jQuery('#lpNonce').val()
3636        },
3637
3638        success: function( res )
3639        {
3640            if( res.status == 0 )
3641            {
3642                status  =   'inactive';
3643            }
3644            else if ( res.status == 1 )
3645            {
3646                status  =   'active';
3647            }
3648            $this.attr('data-status', status);
3649        },
3650        error: function( err )
3651        {
3652            $this.find('i').remove();
3653        }
3654    });
3655
3656});
3657jQuery(document).on('change', '.on-off-ann', function (e) {
3658    e.preventDefault();
3659
3660    var $this   =   jQuery(this),
3661        status  =   $this.attr('data-status'),
3662        annID   =   $this.data('annid'),
3663        userID  =   $this.data('uid');
3664
3665    jQuery.ajax({
3666        type: 'POST',
3667        dataType: 'json',
3668        url: ajax_search_term_object.ajaxurl,
3669        data:{
3670            'action': 'add_announcements_cb',
3671            'user_id' : userID,
3672            'status' : status,
3673            'annID' : annID,
3674            'annUP' : 'on-off',
3675            'lpNonce' : jQuery('#lpNonce').val()
3676        },
3677
3678        success: function( res )
3679        {
3680            if( res.status == 0 )
3681            {
3682                status  =   'inactive';
3683            }
3684            else if ( res.status == 1 )
3685            {
3686                status  =   'active';
3687            }
3688            $this.attr('data-status', status);
3689        },
3690        error: function( err )
3691        {
3692            $this.find('i').remove();
3693        }
3694    });
3695});
3696
3697
3698jQuery(document).on('keyup', '#announcements-message', function (e) {
3699
3700    var thisText    =   jQuery(this).val();
3701
3702    jQuery('.ann-preivew-wrap .announcement-wrap span').text(thisText);
3703
3704
3705
3706    jQuery('.field-desc strong').text(thisText.length);
3707
3708});
3709
3710jQuery(document).on('keyup', '#announcements-title', function (e) {
3711
3712    var thisText    =   jQuery(this).val();
3713
3714    jQuery('.ann-preivew-wrap .announcement-wrap strong').text(thisText);
3715
3716});
3717
3718jQuery(document).on('keyup', '#announcements-btn-text', function (e) {
3719
3720    var thisText    =   jQuery(this).val();
3721
3722    jQuery('.ann-preivew-wrap .announcement-wrap .announcement-btn').text(thisText);
3723
3724
3725
3726});
3727
3728jQuery(document).on('focusout', '#announcements-icon', function (e) {
3729
3730    var thisText    =   jQuery(this).val();
3731	if( thisText == '' ) { return false; }
3732
3733    if (thisText.match("^fa"))
3734
3735    {
3736
3737        jQuery('.announcement-wrap img').hide();
3738
3739        jQuery('.announcement-wrap i').show();
3740
3741        jQuery(this).attr('icon-type', 'fa-icon');
3742
3743        jQuery('.announcement-wrap i').removeClass().addClass('fa '+thisText);
3744
3745    }
3746
3747    else
3748
3749    {
3750
3751        jQuery('.announcement-wrap i').hide()
3752
3753        jQuery('.announcement-wrap img').show();
3754
3755        jQuery('.announcement-wrap img').attr('src', thisText);
3756
3757        jQuery(this).attr('icon-type', 'img-icon');
3758
3759    }
3760
3761
3762
3763});
3764
3765
3766
3767
3768
3769function  slickINIT() {
3770
3771    if( jQuery('.lp-listing-menuu-slider').length != 0 )
3772    {
3773        jQuery('.lp-listing-menuu-slider').slick({
3774            infinite: true,
3775            slidesToShow: 1,
3776            slidesToScroll: 1,
3777            adaptiveHeight: true,
3778            nextArrow: "<i class=\"fa fa-angle-right arrow-left\" aria-hidden=\"true\"></i>",
3779            prevArrow: "<i class=\"fa fa-angle-left arrow-right\" aria-hidden=\"true\"></i>"
3780        });
3781
3782    }
3783
3784}
3785jQuery(document).on('change', '.coupons-fields-switch input[type="checkbox"]', function (e) {
3786    e.preventDefault();
3787    var targetID    =   jQuery(this).data('target');
3788    if( targetID == 'coupon-external' )
3789    {
3790        if( jQuery(this).is(':checked') )
3791        {
3792            jQuery('#btn-url-switch').slideDown(500);
3793            //jQuery('#dis-code').closest('.lp-coupon-box-row').slide
3793Up(500);
3794        }
3795        else
3796        {
3797            jQuery('#btn-url-switch').slideUp(500);
3798            //jQuery('#dis-code').closest('.lp-coupon-box-row').slideDown(500);
3799        }
3800
3801    }else if(targetID == 'quote-button'){
3802        if( jQuery(this).is(':checked') )
3803        {
3804            jQuery('.menu-price-wrap').slideUp(500, function () {
3805                jQuery('.menu-quote-wrap').slideDown(500);
3806            });
3807        }
3808        else
3809        {
3810            jQuery('.menu-quote-wrap').slideUp(500, function () {
3811                jQuery('.menu-price-wrap').slideDown(500);
3812            });
3813        }
3814    }
3815    else if(targetID == 'coupon-end'){
3816        if( jQuery(this).is(':checked') )
3817        {
3818            jQuery('.lp-cpn-end-container').slideDown(500);
3819        }
3820        else
3821        {
3822            jQuery('.lp-cpn-end-container').slideUp(500);
3823        }
3824    }
3825    else
3826    {
3827        jQuery('#'+targetID+'-switch').slideToggle(500, function () {
3828            if( !jQuery('#date-switch').is(':visible') && !jQuery('#time-switch').is(':visible') )
3829            {
3830                jQuery('.empty-row-check').slideToggle();
3831            }
3832        });
3833    }
3834
3835});
3836
3837
3838jQuery(document).on('click', '.del-all-menu', function (e) {
3839    e.preventDefault();
3840
3841    jQuery(this).addClass('remove-active');
3842    jQuery('#dashboard-delete-modal').modal('show');
3843    jQuery('.modal-backdrop').hide();
3844
3845
3846});
3847
3848jQuery(document).on('click', '#lp-save-events', function(e){
3849    e.preventDefault();
3850    var $this   =   jQuery(this),
3851        eTitle  =   jQuery('#event-title').val(),
3852        eDesc   =   jQuery('#event-description').val(),
3853        eDate   =   jQuery('#event-date-s').val(),
3854        eDateE  =   jQuery('#event-date-e').val(),
3855        eTime   =   jQuery('#event-time').val(),
3856        eTimeE  =   jQuery('#event-time-e').val(),
3857        eLoc    =   '',
3858        eLat    =   jQuery('#lp-events-form #latitude').val(),
3859        eLon    =   jQuery('#lp-events-form #longitude').val(),
3860        eTUrl   =   jQuery('#event-tickets-data').val(),
3861        eLID    =   jQuery('#event-listing').val(),
3862        eImg    =   jQuery('.new-file-upload .frontend-input').val(),
3863        eUID    =   $this.data('uid'),
3864        eUtils  =    '';
3865    if( jQuery('.events-map-wrap a[data-type="gaddresscustom"]').hasClass('active'))
3866    {
3867        eLoc    =   jQuery('#lp-events-form input[name="gAddresscustom"]').val();
3868    }
3869    else
3870    {
3871        eLoc    =   jQuery('#lp-events-form input[name="gAddress"]').val();
3872    }
3873    jQuery('.coupons-fields-switch').find('.switch-checkbox').each(function () {
3874        var CheckboxX       =   jQuery(this),
3875            target          =   CheckboxX.data('target'),
3876            targetVal       =   ''
3877        if( CheckboxX.is(':checked') )
3878        {
3879            targetVal   =   'yes';
3880        }
3881        else
3882        {
3883            targetVal   =   'no';
3884        }
3885        eUtils  +=   target+'|'+targetVal+'*';
3886    });
3887    if( eLID == '' || eLID == 0 || eLID == null )
3888    {
3889        if(jQuery('#event-listing').length) {
3890            jQuery('#event-listing').addClass('error');
3891        } else {
3892            jQuery('#select2-event-listing-container').addClass('error');
3893        }
3894    }
3895    else
3896    {
3897        if(jQuery('#event-listing').length) {
3898            jQuery('#event-listing').removeClass('error');
3899        } else {
3900            jQuery('#select2-event-listing-container').removeClass('error');
3901        }
3902
3903    }
3904    if( eTitle == '' )
3905    {
3906        jQuery('#event-title').addClass('error');
3907    }
3908    else
3909    {
3910        jQuery('#event-title').removeClass('error');
3911    }
3912
3913
3914    if( eDate == '' ){
3915        jQuery('#event-date-s').addClass('error');
3916    }
3917    else
3918    {
3919        jQuery('#event-date-s').removeClass('error');
3920    }
3921    if( eTime == '' ){
3922        jQuery('#event-time').addClass('error');
3923    }
3924    else
3925    {
3926        jQuery('#event-time').removeClass('error');
3927    }
3928    if( eLID == '' || eLID == 0 || eLID == null || eTitle == '' || eTime == '' || eDate == '' )
3929    {
3930        var dataError   =   [];
3931        dataError.status    =   'error';
3932        dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
3933        ajax_success_popup( dataError, $this );
3934        return false;
3935    }
3936    if( jQuery('a[data-type="gaddress"]').hasClass('active') )
3937    {
3938        if( eLoc == '' ){
3939            jQuery('#lp-events-form input[name="gAddresscustom"]').addClass('error');
3940
3941            var dataError   =   [];
3942            dataError.status    =   'error';
3943            dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
3944            ajax_success_popup( dataError, $this );
3945            return false;
3946        }
3947        else
3948        {
3949            jQuery('#lp-events-form input[name="gAddresscustom"]').removeClass('error');
3950        }
3951    } else {
3952        if( eLat == '' || eLon == '' || eLoc == '' ) {
3953
3954            jQuery('#event-location').addClass('error');
3955
3956            var dataError   =   [];
3957            dataError.status    =   'error';
3958            dataError.msg    =   jQuery('.lp-notifaction-area').data('error-msg');
3959            ajax_success_popup( dataError, $this );
3960            return false;
3961        }
3962    }
3963
3964    $this.append('<i class="fa fa-spin fa-spinner"></i>');
3965    jQuery.ajax({
3966        type: 'POST',
3967        dataType: 'json',
3968        url: ajax_search_term_object.ajaxurl,
3969        data:{
3970            'action': 'add_events_cb',
3971            'eTitle' : eTitle,
3972            'eDesc' : eDesc,
3973            'eDate' : eDate,
3974            'eDateE' : eDateE,
3975            'eTime' : eTime,
3976            'eTimeE' : eTimeE,
3977            'eLoc' : eLoc,
3978            'eLat' : eLat,
3979            'eLon' : eLon,
3980            'eTUrl' : eTUrl,
3981            'eLID' : eLID,
3982            'eUID' : eUID,
3983            'eImg' : eImg,
3984            'eUtils' : eUtils,
3985            'lpNonce' : jQuery('#lpNonce').val()
3986        },
3987        success: function( res )
3988        {
3989            ajax_success_popup( res, $this );
3990        },
3991        error: function( err )
3992        {
3993            console.log( err );
3994        }
3995    });
3996});
3997
3998//lp-save-events
3999
4000
4001jQuery(document).on('click', '.lp-save-events', function(e){
4002    e.preventDefault();
4003    var $this   =   jQuery(this),
4004        eID     =   $this.data('eid'),
4005        eTitle  =   jQuery('#event-title-'+eID).val(),
4006        eDesc   =   jQuery('#event-description-'+eID).val(),
4007        eDate   =   jQuery('#event-date-s-'+eID).val(),
4008        eDateE   =   jQuery('#event-date-e-'+eID).val(),
4009        eTime   =   jQuery('#event-time-'+eID).val(),
4010        eTimeE   =   jQuery('#event-time-e-'+eID).val(),
4011        eLoc    =   jQuery('#event-location-'+eID).val(),
4012        eLat    =   $this.closest('.lp-coupons-form-inner').find('.latitude').val(),
4013        eLong    =  $this.closest('.lp-coupons-form-inner').find('.longitude').val(),
4014        eTUrl   =   jQuery('#event-tickets-data-'+eID).val(),
4015        eImg    =   jQuery('.edit-upload-'+eID+' .frontend-input').val(),
4016        eUID    =   $this.data('uid');
4017
4018
4019    if( eTitle == '' )
4020    {
4021        jQuery('#event-title').addClass('error');
4022    }
4023    else
4024    {
4025        jQuery('#event-title').removeClass('error');
4026    }
4027    if( eTitle == '' )
4028    {
4029        return false;
4030    }
4031    if( eImg == '' )
4032    {
4033        eImg    =   jQuery('#event-old-img-'+eID).val();
4034    }
4035    $this.append('<i class="fa fa-spin fa-spinner"></i>');
4036    jQuery.ajax({
4037        type: 'POST',
4038        dataType: 'json',
4039        url: ajax_search_term_object.ajaxurl,
4040        data:{
4041            'action': 'add_events_cb',
4042            'eTitle' : eTitle,
4043            'eDesc' : eDesc,
4044            'eDate' : eDate,
4045            'eDateE' : eDateE,
4046            'eTime' : eTime,
4047            'eTimeE' : eTimeE,
4048            'eLoc' : eLoc,
4049            'eLat' : eLat,
4050            'eLon' : eLong,
4051            'eTUrl' : eTUrl,
4052            'eUID' : eUID,
4053            'eID' : eID,
4054            'eImg' : eImg,
4055            'eUp' : 'yes',
4056            'lpNonce' : jQuery('#lpNonce').val()
4057        },
4058        success: function( res )
4059        {
4060            ajax_success_popup( res, $this );
4061        },
4062        error: function( err )
4063        {
4064            console.log( err );
4065        }
4066    });
4067});
4068
4069jQuery(document).on( 'click', '.attend-event', function (e) {
4070    e.preventDefault();
4071    var $this       =   jQuery(this),
4072        eID         =   $this.data('event'),
4073        eUID        =   $this.data('uid'),
4074        notGoing    =   '',
4075        goingText   =   jQuery('.going-text').val(),
4076        nGoingText  =   jQuery('.not-going-text').val();
4077
4078    if( $this.hasClass('processing') )
4079    {
4080
4081    }
4082    else
4083    {
4084        if( $this.hasClass('not-going') )
4085        {
4086            notGoing    =   'yes';
4087        }
4088        else
4089        {
4090
4091        }
4092        if( $this.hasClass('from-lpec') )
4093        {
4094            $this.find('i').removeClass('fa-plus').addClass('fa-spinner fa-spin');
4095        }
4096        else
4097        {
4098            $this.append('<i class="fa fa-spinner fa-spin"></i>');
4099        }
4100
4101        $this.addClass('processing');
4102
4103        jQuery.ajax({
4104            type: 'POST',
4105            dataType: 'json',
4106            url: ajax_search_term_object.ajaxurl,
4107            data: {
4108                'action': 'event_attending_cb',
4109                'eID': eID,
4110                'eUID': eUID,
4111                'notGoing': notGoing,
4112                'lpNonce' : jQuery('#lpNonce').val()
4113            },
4114            success: function (res) {
4115                if( $this.hasClass('from-lpec') )
4116                {
4117                    jQuery('#lpec-attendee-count-'+eID).text(parseInt(res.total_attending));
4118                }
4119                else
4120                {
4121                    jQuery('.total-going').text(res.total_attending);
4122                    $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-check');
4123                }
4124
4125                $this.removeClass('processing');
4126                if( notGoing == 'yes' )
4127                {
4128                    $this.removeClass('not-going');
4129                    if( $this.hasClass('from-lpec') )
4130                    {
4131                        jQuery('ul#lpec-attendees-avatar-'+eID).find('li#lpec-attendee-avatar-'+eUID+'-'+eID).remove();
4132                        $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-plus');
4133                    }
4134                    else
4135                    {
4136                        $this.text(goingText);
4137                    }
4138
4139                }else
4140                {
4141                    $this.addClass('not-going');
4142                    if( $this.hasClass('from-lpec') )
4143                    {
4144                        jQuery('ul#lpec-attendees-avatar-'+eID).prepend(res.attendee_avatar);
4145                        $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-times');
4146                    }
4147                    else
4148                    {
4149                        $this.text(nGoingText);
4150                    }
4151                }
4152
4153            },
4154            error: function (err) {
4155                console.log(err);
4156            }
4157        });
4158    }
4159});
4160
4161jQuery(document).on('click', '.cancel-ad-new-btn', function (e) {
4162    e.preventDefault();
4163    var targetForm      =   '#'+jQuery(this).data('cancel')+'-form-toggle';
4164    jQuery( targetForm ).fadeOut( "fast", function() {
4165        if (jQuery('body').find('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11')) {
4166            jQuery( ".lp-blank-section" ).fadeIn();
4167        }
4168        jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-11').fadeIn();
4169    });
4170});
4171
4172
4173jQuery(document).on('click', '.menu-add-new', function (e) {
4174    jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeOut("slow", function () {
4175        jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeIn("fast", function () {
4176            jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-12.lp-left-panel-height.lp-left-panel-height-outer.padding-bottom0').fadeIn("fast");
4177        });
4178    });
4179});
4180
4181jQuery(document).on('click', '.lp-view-all-btn', function (e) {
4182    e.preventDefault();
4183    if(jQuery(this).hasClass('all-with-refresh')) {
4184        location.reload();
4185    } else {
4186        jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.col-md-12.lp-left-panel-height.lp-left-panel-height-outer.padding-bottom0').fadeOut("fast", function () {
4187            jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeOut("fast", function () {
4188                jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeIn("Slow");
4189            });
4190        });
4191    }
4192
4193});
4194
4195jQuery(document).on('click', '.cancel-add-menu', function (e) {
4196    e.preventDefault();
4197    jQuery('#lp-save-menu').attr('id', 'lp-save-menu-reopen');
4198    jQuery('.lp-menu-close-outer.lp-menu-open').slideUp();
4199});
4200jQuery(document).on('click', '#lp-save-menu-reopen', function (e) {
4201    e.preventDefault();
4202    jQuery(this).attr('id', 'lp-save-menu');
4203    jQuery('.lp-menu-close-outer.lp-menu-open').slideDown();
4204});
4205
4206jQuery(document).on('click', '.lp-notifi-icons', function (e) {
4207    e.preventDefault();
4208    jQuery(this).closest('.active-wrap').removeClass('active-wrap');
4209});
4210jQuery(document).ready(function () {
4211    jQuery('#fill-o-bot-check').on('change', function(e){
4212       if( jQuery(this).is(':checked') )
4213       {
4214            jQuery('#lptitle').attr('type', 'hidden');
4215           jQuery('.lptitle').addClass('fill-o-bot-active');
4216            jQuery('#lptitle').attr('name', '');
4217            jQuery('#lptitleGoogle').attr('name', 'postTitle');
4218            jQuery('#lptitleGoogle').attr('type', 'text');
4219       }
4220       else
4221       {
4222            jQuery('#lptitleGoogle').attr('type','hidden');
4223           jQuery('.lptitle').removeClass('fill-o-bot-active');
4224            jQuery('#lptitle').attr('name', 'postTitle');
4225            jQuery('#lptitle').attr('type', 'text');
4226            jQuery('#lptitleGoogle').attr('name', '');
4227
4228       }
4229   });
4230
4231});
4232jQuery('html').click(function (e) {
4233   if(jQuery('.lp-multi-star-wrap').is(":visible") && e.target.className != 'open-multi-rate-box' ) {
4234       if(jQuery('.lp-multi-star-wrap').hasClass('lp-multi-start-wrap-edit-review')) {
4235
4236       } else {
4237           jQuery('.lp-multi-star-wrap').slideUp();
4238       }
4239   }
4240});
4241
4242function ajax_success_popup( res, $this )
4243{
4244   if( res.status == 'success' )
4245   {
4246       if($this != ''){
4247           $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-check');
4248        }
4249
4250       jQuery('.lp-notifaction-area').find('h4').text(res.msg);
4251       jQuery('.lp-notifaction-area').removeClass('lp-notifaction-error').addClass('lp-notifaction-success');
4252       jQuery('.lp-notifaction-area').addClass('active-wrap');
4253
4254
4255       location.reload();
4256   }
4257   if ( res.status == 'error' )
4258   {
4259        if($this != ''){
4260           $this.find('i').remove();
4261        }
4262
4263       jQuery('.lp-notifaction-area').find('h4').text(res.msg);
4264       jQuery('.lp-notifaction-area').removeClass('lp-notifaction-success').addClass('lp-notifaction-error');
4265       jQuery('.lp-notifaction-area').addClass('active-wrap');
4266   }
4267}
4268jQuery(document).on('keyup', '#menu-type-new, #menu-group-new', function()
4269
4270{
4271    var typeGroupText   =   jQuery(this).val(),
4272        errMsg          =   jQuery(this).data('err'),
4273        re = /[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi;
4274
4275    var isSplChar = re.test(typeGroupText);
4276    if(isSplChar)
4277
4278    {
4279        var no_spl_char = typeGroupText.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '');
4280
4281        jQuery(this).val(no_spl_char);
4282        jQuery(this).after('<p>'+ errMsg +'</p>');
4283    }
4284
4285});
4286//Event detail page view more and less more
4287jQuery(document).ready(function() {
4288    jQuery('.lp-event-view-less').click(function(e){
4289        e.preventDefault();
4290        var lessText = jQuery(this).data('contract');
4291        var moreText    =   jQuery(this).data('expand');
4292        if(jQuery(this).hasClass('event-shown')){
4293            jQuery(this).removeClass('event-shown');
4294            jQuery(this).html(moreText);
4295            jQuery('.lp-attende-extra').removeClass('active');
4296        }else{
4297            jQuery(this).addClass('event-shown');
4298            jQuery('.lp-attende-extra').addClass('active');
4299            jQuery(this).html(lessText);
4300        }
4301
4302    });
4303
4304    /* for event gaddress */
4305
4306    function initializeEventAddr() {
4307        if( jQuery('.event-addr').length > 0 )
4308        {
4309            jQuery('.event-addr').each(function(index){
4310                var input = document.getElementById(jQuery(this).attr('id'));
4311                var autocomplete = new google.maps.places.Autocomplete(input);
4312                google.maps.event.addListener(autocomplete, 'place_changed', function () {
4313                    var place = autocomplete.getPlace();
4314                    var lat = place.geometry.location.lat();
4315                    var lon =  place.geometry.location.lng();
4316                    jQuery('input.latitude').val(lat);
4317                    jQuery('input.longitude').val(lon);
4318                });
4319            });
4320        }
4321
4322    }
4323    google.maps.event.addDomListener(window, 'load', initializeEventAddr);
4324
4325    /* gaddress ends */
4326});
4327
4328jQuery(document).on('click', 'span.remove-menu-img', function (e) {
4329    e.preventDefault();
4330    var targetID    =   jQuery(this).data('target'),
4331        targetSrc   =   jQuery(this).data('src')+',',
4332        targetImgs  =   jQuery('.active-upload').find('.frontend-input-multiple').val();    if( targetImgs == undefined )
4333    {
4334        targetImgs  =   jQuery('#'+targetID).val();
4335    }    targetImgs  =   targetImgs.replace( targetSrc, '' );
4336    jQuery(this).closest('.menu-edit-img-wrap').remove();
4337    jQuery('input#'+targetID).val(targetImgs);
4338});
4339
4340jQuery(document).on('click', '.select2-results ul li', function(e){
4341    jQuery('.lp-pp-noa-tip').fadeIn();
4342});
4343
4344jQuery('.select2-ajax-unique').on('select2:select', function (e) {
4345    jQuery('.lp-pp-noa-tip').fadeOut();
4346});
4347
4348jQuery('.select2-ajax').on('select2:select', function (e) {
4349   jQuery('.lp-pp-noa-tip').fadeOut();
4350});
4351
4352
4353jQuery(document).on('click', '.remove-event-img', function (e) {
4354    e.preventDefault();
4355    var $this   =   jQuery(this);
4356    if( $this.hasClass('remove-eei') )
4357    {
4358        var targetID    =   $this.data('targetid');
4359        $this.closest('.removeable-image').find('.frontend-image').attr('src', '');
4360        $this.closest('.removeable-image').find('.frontend-image').hide();
4361        $this.closest('.removeable-image').find('.lp-uploaded-img').attr('src', '');
4362        $this.closest('.removeable-image').find('.frontend-input').val('');
4363        jQuery('#event-old-img-'+targetID).val('');
4364        $this.remove();
4365    }
4366    else
4367    {
4368        $this.closest('.removeable-image').find('.frontend-image').attr('src', '');
4369        $this.closest('.removeable-image').find('.frontend-image').hide();
4370        $this.closest('.removeable-image').find('.frontend-input').val('');
4371        $this.remove();
4372    }
4373});
4374
4375
4376jQuery(document).on('click', '.lp-copy-code', function (e)
4377{
4378    e.preventDefault();
4379    var $this           =   jQuery(this);
4380    var targetCodeEL    =   jQuery(this).data('target-code'),
4381        thisHtml        =   jQuery(this).data('html'),
4382        targetCodeELC   =   '.'+targetCodeEL;
4383    if( $this.hasClass('close-copy-pop') ){
4384        /*SAUD*/
4385        $this.closest('.lp-discount-widget').find(targetCodeELC).animate({
4386            bottom: '-'+ jQuery(targetCodeELC).height() +'px'
4387        }, 500, function (e) {
4388            $this.html(thisHtml);
4389            $this.removeClass('close-copy-pop');
4390        });
4391    }
4392    else
4393    {
4394        var bottomPlus  =   0;
4395        if( $this.hasClass('lp-discount-btn') )
4396        {
4397            bottomPlus  =   49;
4398        }
4399
4400        var parent_class = '.coupons-bottom-content-wrap';
4401
4402        if (jQuery(parent_class).length > 0) {
4403            parent_class = '.coupons-bottom-content-wrap';
4404        }else {
4405            parent_class = '.lp-deal';
4406            if (jQuery(parent_class).length > 0) {
4407                parent_class = '.lp-deal';
4408            }else{
4409                parent_class = '.lp-discount-widget';
4410            }
4411        }
4412
4413        if (jQuery(parent_class).length < 1) {
4414            parent_class = '.lp-listing-offer';
4415        }
4416
4417        $this.closest(parent_class).find(targetCodeELC).animate({
4418            bottom: bottomPlus + 'px'
4419        }, 500, function (e) {
4420            if ($this.hasClass('lp-discount-btn')) {
4421                $this.addClass('close-copy-pop');
4422                $this.html('<span><i class="fa fa-times"></i></span>');
4423            }
4424        });
4425    }
4426});
4427jQuery(document).on('click', '.close-right-icon', function (e) {
4428    e.preventDefault();
4429    var $this  =   jQuery(this),
4430        target =   '.'+$this.data('target');
4431
4432    jQuery(target).animate({
4433        bottom: '-'+jQuery(target).height()+'px'
4434    });
4435});
4436jQuery(document).on('click', '.copy-now', function (e) {
4437
4438    e.preventDefault();
4439    var targetCodeEL    =   jQuery(this).data('target-code'),
4440        targetCodeELC   =   '#'+targetCodeEL;
4441
4442    jQuery(targetCodeELC).find('input[type="text"]').select();
4443    document.execCommand("copy");
4444    jQuery(targetCodeELC).find('.dis-code-copy-pop-inner-cell').find('p:first-child').text(jQuery('.copy-now').data('coppied-label'));
4445});
4446
4447
4448jQuery(document).on('click', '.lp-pagination.author-reviews-pagination span', function (e) {
4449    e.preventDefault();
4450    var paginNo     =   jQuery(this).data('pageurl');
4451
4452    jQuery('.reviews-pagin-wrap').hide();
4453    jQuery('.reviews-pagin-wrap.reviews-pagin-wrap-'+paginNo).show();
4454});
4455jQuery(document).on('click', '.lp-filter-pagination-ajx ul li span.author-haspaglink', function (e) {
4456    e.preventDefault();
4457    var pageNo	=	jQuery(this).data('pageurl'),
4458        authorID    =   jQuery('.lp-author-nav').data('author'),
4459        authorPagin =   'yes',
4460        listingLayout   =   jQuery('#mylistings').data('listing-layout');
4461
4462    jQuery('.lp-filter-pagination-ajx ul li span').removeClass('current');
4463    jQuery(this).addClass('current');
4464
4465    jQuery('#mylistings').find('.author-inner-content-wrap').addClass('content-loading');
4466    jQuery('#mylistings #content-grids').remove();
4467
4468    jQuery.ajax({
4469        type: 'POST',
4470        url: ajax_search_term_object.ajaxurl,
4471        data: {
4472            'action': 'author_archive_tabs_cb',
4473            'pageNo': pageNo,
4474            'authorID':authorID,
4475            'authorPagin' : authorPagin,
4476            'listingLayout':listingLayout,
4477            'lpNonce' : jQuery('#lpNonce').val()
4478        },
4479        success: function(data) {
4480            jQuery('#mylistings').find('.author-inner-content-wrap').removeClass('content-loading');
4481            jQuery('#mylistings').find('.author-inner-content-wrap').html(data);
4482            console.log(data);
4483        }
4484    });
4485});
4486
4487jQuery(document).ready(function(){
4488    if( jQuery('.featuresDataContainer.lp-check-custom-wrapp').length > 0)
4489    {
4490        jQuery('.featuresDataContainerOuterSubmit').show();
4491        jQuery('.featuresDataContainer.lp-check-custom-wrapp').show();
4492    }
4493});
4494jQuery(document).ready(function(){
4495    jQuery('.lp-review-form-top .lp-listing-stars').click(function (e) {
4496        e.preventDefault();
4497        if( jQuery(this).hasClass('do-not-proceed') )
4498        {}
4499        else
4500        {
4501            jQuery(this).addClass( 'do-not-proceed' );
4502            jQuery('.lp-review-form-bottom').slideToggle(500);
4503            jQuery('html,body').animate( {
4504             scrollTop: jQuery(".lp-listing-review-form").offset().top -100
4505          },'slow');
4506        }
4507    });
4508 });
4509// for events
4510jQuery(document).on('change', '#toggle-attendees-check', function () {
4511    if( jQuery(this).is(':checked') )
4512    {
4513        jQuery('.attendee-checkbox').attr('checked', 'checked');
4514    }
4515    else
4516    {
4517        jQuery('.attendee-checkbox').removeAttr('checked');
4518    }
4519});
4520jQuery(document).on('click', '.download-attendees', function (e) {
4521    e.preventDefault();
4522});
4523jQuery(document).on('click', '#lp-send-message', function(e){
4524    e.preventDefault();
4525    var $this       =   jQuery(this),
4526        msgError    =   jQuery('#event-msg-error').val(),
4527        msgSuccess  =   jQuery('#event-msg-success').val(),
4528        uid         =   $this.data('uid'),
4529        msgContent  =   jQuery('.attendeesmessage').val(),
4530        attendees   =   jQuery(".attendee-checkbox:checked").map(function(){
4531            return jQuery(this).val();
4532        }).get();
4533
4534    var responseData    =   [];
4535
4536    if( msgContent == '' || attendees == '' )
4537    {
4538        responseData.status =   'error';
4539        responseData.msg    =   msgError;
4540        ajax_success_popup( responseData, $this );
4541        return false;
4542    }
4543
4544
4545    if( $this.hasClass('processing') )
4546    {
4547
4548    }
4549    else
4550    {
4551        $this.append('<i class="fa fa-spinner fa-spin"></i>');
4552        $this.addClass('processing');
4553        jQuery.ajax({
4554            type: 'POST',
4555            dataType: 'json',
4556            url: ajax_search_term_object.ajaxurl,
4557            data: {
4558                'action': 'send_attendees_msg',
4559                'msgContent': msgContent,
4560                'attendees': attendees,
4561                'uid': uid,
4562                'lpNonce' : jQuery('#lpNonce').val()
4563            },
4564            success: function (res) {
4565                responseData.status =   'success';
4566                responseData.msg    =   msgSuccess;
4567                ajax_success_popup( responseData, $this );
4568            },
4569            error: function (err) {
4570                console.log(err);
4571            }
4572        });
4573    }
4574});
4575jQuery(document).on('click', '.open-send-msg-form, .cancel-send-mas-atten', function (e) {
4576    e.preventDefault();
4577    jQuery('#notification-form').slideToggle('fast', function () {
4578        jQuery("html, body").animate({ scrollTop:  jQuery('#notification-form').offset().top }, 1000);
4579    });
4580});
4581
4582jQuery(document).on('click', '.attendees-pagination span', function (e) {
4583    e.preventDefault();
4584    var $this   =   jQuery(this),
4585        pageNo  =   $this.data('pageurl'),
4586        targetC =   '.attendees-pagin-wrap-'+pageNo;
4587
4588    if( jQuery(this).hasClass( 'current' ) )
4589    {
4590        return false;
4591    }
4592    jQuery('.attendees-pagination span.current').removeClass('current');
4593    $this.addClass('current');
4594    jQuery('.current-pagin-wrap').fadeOut(500, function () {
4595        jQuery('.current-pagin-wrap').removeClass('current-pagin-wrap');
4596        jQuery(targetC).fadeIn(500, function () {
4597            jQuery(targetC).addClass('current-pagin-wrap');
4598        })
4599    });
4600});
4601
4602jQuery(document).on('click', '.listing-tabs-element li a', function (e) {
4603    e.preventDefault();
4604    var $this       =   jQuery(this),
4605        taxonomy    =   $this.attr('data-tax'),
4606        term        =   $this.attr('data-term'),
4607        numPost     =   $this.attr('data-num'),
4608        layout     =   $this.attr('data-layout'),
4609        list     =   $this.attr('data-list'),
4610        grid     =   $this.attr('data-grid');
4611
4612
4613    jQuery('.listing-tabs-element li.active').removeClass('active');
4614    $this.closest( 'li' ).addClass('active');
4615    jQuery('#listing-tabs-inner-container').html();
4616    jQuery('#listing-tabs-inner-container').closest('.wpb_wrapper').find('.listingcampaings').remove();
4617    jQuery.ajax({
4618        type: 'POST',
4619        dataType: 'json',
4620        url: ajax_search_term_object.ajaxurl,
4621        data: {
4622            'action': 'listing_tabs_get_listings',
4623            'taxonomy': taxonomy,
4624            'term': term,
4625            'numPost': numPost,
4626            'layout': layout,
4627            'list': list,
4628            'grid': grid,
4629            'lpNonce' : jQuery('#lpNonce').val()
4630        },
4631        success: function (res) {
4632            jQuery('#listing-tabs-inner-container').html(res);
4633            jQuery('#listing-tabs-inner-container').find('.listingcampaings').remove();
4634
4635            jQuery('#listing-tabs-inner-container').find('.app-view-new-ads-sli
4635der').slick({
4636                infinite: true,
4637                slidesToShow: 1,
4638                slidesToScroll: 1,
4639                arrows: false
4640            });
4641
4642        },
4643        error: function (err) {
4644            console.log(err);
4645        }
4646    });
4647
4648})
4649
4650//for events calander
4651jQuery(document).on('click', '.calender-header-switcher ul li', function(){
4652    var $this   =   jQuery(this);
4653
4654    jQuery('.calender-header-switcher ul li.active').removeClass('active');
4655    $this.addClass('active');
4656
4657    var calanderType    =   'event-calender-list-view';
4658    if( jQuery('.calender-type-wrap').length > 0 )
4659    {
4660        calanderType    =   jQuery('.calender-type-wrap').data('ctype');
4661    }
4662
4663    getCalanderMapView( calanderType, $this );
4664
4665});
4666jQuery(document).on('click', '.close-active-box', function (e) {
4667    e.preventDefault();
4668    jQuery('.current-active-box').removeClass('current-active-box');
4669    jQuery('.active-event-for-map').removeClass('active-event-for-map');
4670    jQuery('.caew-box').removeClass('caew-box').fadeOut(500);
4671    jQuery('.event-calander-classic2').fadeOut(500);
4672    jQuery('.calender-header-switcher ul li').removeClass('active');
4673    jQuery('.calender-header-switcher ul li.show-calader-list').addClass('active');
4674    jQuery('.calender-type-wrap').attr('data-activetoggle', 'calander');
4675    if(jQuery('.event-calander-classic2').length) {
4676        jQuery('.event-by-day-wrap').fadeOut();
4677    }
4678});
4679jQuery(document).on('click', '.week-day-date-box.has-events', function (e) {
4680    e.preventDefault();
4681
4682    var $this       =   jQuery(this),
4683        ewtTarget   =   $this.data('ewt'),
4684        targetDate  =   $this.data('todaytime'),
4685        targetDateA =   targetDate.split('-');
4686
4687    jQuery('.current-active-box').removeClass('current-active-box');
4688    if( $this.hasClass('current-active-box') )
4689    {
4690        $this.removeClass('current-active-box');
4691        jQuery('.active-event-for-map').removeClass('active-event-for-map');
4692        jQuery('.caew-box').removeClass('caew-box').fadeOut(500);
4693        jQuery('.event-calander-classic2').fadeOut(500);
4694        return false;
4695    }
4696    else
4697    {
4698        $this.addClass('current-active-box');
4699    }
4700    if( jQuery('.modern-calender-inner-left').length > 0 )
4701    {
4702        if( jQuery('.events-by-day-wrap.caew-box').length > 0 )
4703        {
4704            if( jQuery('.calender-type-wrap').attr('data-activetoggle') == 'map' )
4705            {
4706                jQuery('.active-event-for-map').removeClass('active-event-for-map');
4707                jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('caew-box active-event-for-map');
4708                jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
4709            }
4710            else
4711            {
4712                jQuery('.active-event-for-map').removeClass('active-event-for-map');
4713                jQuery('.caew-box').removeClass('caew-box').fadeOut(500, function () {
4714                    jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('caew-box active-event-for-map').fadeIn();
4715                });
4716            }
4717        }
4718        else
4719        {
4720            jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('caew-box active-event-for-map').fadeIn();
4721        }
4722        jQuery('.calender-header-moderen-date2 .today-event-date-container p').html(targetDateA[1]+ ' ' + targetDateA[0] +'<span>'+ targetDateA[2] +'</span>');
4723    }
4724    else
4725    {
4726        if( jQuery('.event-calander-classic2').length > 0 )
4727        {
4728            showClassic2CalEvents(ewtTarget, targetDate);
4729        }
4730        else
4731        {
4732            showClassicCalEvents(ewtTarget);
4733        }
4734    }
4735
4736});
4737jQuery(document).on('click', '.get-npm', function (e) {
4738    e.preventDefault();
4739    if( jQuery(this).hasClass('disabled') )
4740    {
4741        return false;
4742    }
4743    var $this           =   jQuery(this),
4744        targetDate      =   $this.data('npmnum'),
4745        currentCMN      =   jQuery('.cc-month').data('cmn'),
4746        cTypClass       =   jQuery('.calender-type-wrap').data('ctype'),
4747        cTypee          =   'classic',
4748        targetAction    =   'nm',
4749        currentMN       =   '',
4750        currentYN       =   '',
4751        per_page        =   '';
4752
4753    if( jQuery('#event_per_page').length > 0 )
4754    {
4755        per_page    =   jQuery('#event_per_page').val();
4756    }
4757    if( cTypee == 'classic' && jQuery('#ec_classic2_check').length > 0 )
4758    {
4759        cTypee  =   jQuery('#ec_classic2_check').val();
4760    }
4761    if( cTypClass == 'event-calender-modern' )
4762    {
4763        cTypee   =   'modern';
4764    }
4765    if( cTypClass == 'event-calender-list-view' )
4766    {
4767        cTypee  =   'list'
4768    }
4769    if( cTypClass == 'event-calender-classic-weekly' )
4770    {
4771        cTypee  =   'weekly';
4772    }
4773    if (currentCMN.indexOf(',') > -1)
4774    {
4775        var currentCMNArr   =   currentCMN.split(','),
4776            currentMN       =   currentCMNArr[0],
4777            currentYN       =   currentCMNArr[1];
4778    }
4779
4780    if( $this.hasClass( 'btn-pm' ) )
4781    {
4782        targetAction    =   'pm';
4783    }
4784
4785    if (targetDate.indexOf(',') > -1)
4786    {
4787        var targetDateArr   =   targetDate.split(','),
4788            targetDateM     =   targetDateArr[0],
4789            targetDateY     =   targetDateArr[1];
4790
4791
4792        jQuery('.'+cTypClass).fadeOut(500, function () {
4793            jQuery('.event-spinner').fadeIn();
4794        });
4795
4796        jQuery.ajax({
4797            type: 'POST',
4798            dataType: 'json',
4799            url: ajax_search_term_object.ajaxurl,
4800            data: {
4801                'action': 'get_event_calender_data',
4802                'targetDateM': targetDateM,
4803                'targetDateY': targetDateY,
4804                'targetAction' : targetAction,
4805                'currentMN' : currentMN,
4806                'currentYN' : currentYN,
4807                'cTypee' : cTypee,
4808                'per_page' : per_page,
4809                'lpNonce' : jQuery('#lpNonce').val()
4810            },
4811            success: function (res) {
4812                if( res.status == 'success' )
4813                {
4814                    jQuery('.prev-mon-markup').html(res.prev_mon_markup);
4815                    jQuery('.next-mon-markup').html(res.next_mon_markup);
4816                    jQuery('.curr-mon-markup').html(res.curr_mon_markup);
4817
4818                    if( cTypee == 'weekly' )
4819                    {
4820                        jQuery('.event-calender-weekly').html(res.calender_markup);
4821                        jQuery('.event-calender-weekly').addClass('events-after-
4821ajax');
4822
4823                        var weekFirstDate   =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
4824                        var weekLastDate    =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
4825
4826                        if( weekFirstDate == '' )
4827                        {
4828                            weekFirstDate   =   '1';
4829                        }
4830                        if( weekLastDate == '' )
4831                        {
4832                            weekLastDate    =   '31';
4833                        }
4834                        getActiveWeekEvents(weekFirstDate, weekLastDate);
4835                    }
4836                    else
4837                    {
4838                        jQuery('.event-calender-monthly').html(res.calender_markup);
4839                        if(cTypee == 'modern') {
4840                            if(jQuery('.month-dates-wrap .week-day-date-box.has-events').length) {
4841                                var target_first_event  =   jQuery('.month-dates-wrap .week-day-date-box.has-events:first').attr('data-ewt'),
4842                                    target_daytime      =   jQuery('.month-dates-wrap .week-day-date-box.has-events:first').attr('data-todaytime');
4843                            } else {
4844                                var target_first_event  =   jQuery('.month-dates-wrap .week-day-date-box.has-no-events:first').attr('data-ewt'),
4845                                    target_daytime      =   jQuery('.month-dates-wrap .week-day-date-box.has-no-events:first').attr('data-todaytime');
4846                            }
4847                            var target_daytime_arr  =   target_daytime.split('-');
4848                            var target_day_markup   =   target_daytime_arr[1]+' '+target_daytime_arr[0]+' <span>'+target_daytime_arr[2]+'</span>';
4849                            jQuery('.events-by-day-wrap[data-ebdt='+target_first_event+']').addClass('caew-box active-event-for-map').fadeIn();
4850                            jQuery('.today-event-date-container p').html(target_day_markup);
4851                        }
4852
4853                    }
4854                    jQuery('.event-spinner').fadeOut(500, function () {
4855                        jQuery('.'+cTypClass).fadeIn();
4856                    });
4857                }
4858            },
4859            error: function (err) {
4860                console.log(err);
4861            }
4862        });
4863    }
4864});
4865jQuery(document).on('click', '.event-pager ul li span', function (e) {
4866    var $this   =   jQuery(this),
4867        pageNo  =   $this.data('pageno');
4868
4869    if( $this.hasClass('current') )
4870    {
4871        return false;
4872    }
4873    jQuery('.event-pager ul li .current').removeClass('current');
4874    $this.addClass('current');
4875    jQuery('.list-calendar-pager-wrap.current-event-page-active').fadeOut(500, function () {
4876
4877        jQuery('.list-calendar-pager-wrap.current-event-page-active').removeClass('current-event-page-active');
4878        jQuery('.list-calendar-pager-wrap .active-event-for-map').removeClass('active-event-for-map');
4879
4880        if( jQuery('.calender-type-wrap').attr('data-activetoggle') == 'map' )
4881        {
4882            jQuery('.list-calendar-pager-wrap:eq( '+ pageNo +' )').addClass('current-event-page-active');
4883            jQuery('.current-event-page-active .events-by-day-wrap').addClass('active-event-for-map');
4884            jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
4885        }
4886        else
4887        {
4888            jQuery('.list-calendar-pager-wrap:eq( '+ pageNo +' )').fadeIn(500, function(){
4889                jQuery('.list-calendar-pager-wrap:eq( '+ pageNo +' )').addClass('current-event-page-active');
4890                jQuery('.current-event-page-active .events-by-day-wrap').addClass('active-event-for-map');
4891            });
4892        }
4893
4894    });
4895});
4896jQuery(document).on('click', '.event-npw', function(){
4897    var $this       =   jQuery(this),
4898        targetWeek  =   $this.data('targetweek');
4899
4900    var maxWeeks    =   jQuery('.event-calender-weekly .week-days-wrap').length;
4901
4902    if( targetWeek > 0 && targetWeek <= maxWeeks )
4903    {
4904        jQuery('.week-days-wrap.active-week').removeClass('active-week');
4905
4906        jQuery('.week-days-wrap').hide();
4907        jQuery('.event-week-'+targetWeek).show();
4908        jQuery('.week-days-wrap.event-week-'+targetWeek).addClass('active-week');
4909
4910        var weekFirstDate   =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
4911        var weekLastDate    =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
4912
4913        if( weekFirstDate == '' )
4914        {
4915            weekFirstDate   =   '1';
4916        }
4917        if( weekLastDate == '' )
4918        {
4919            weekLastDate    =   '31';
4920        }
4921        getActiveWeekEvents(weekFirstDate, weekLastDate);
4922    }
4923});
4924jQuery(document).on('click', '.week-days-wrap .week-day-box.has-events', function () {
4925
4926    var $this   =   jQuery(this),
4927        targetE =   $this.data('ewt');
4928
4929    jQuery('.events-for-day:visible').slideUp('fast', function () {
4930        jQuery('.'+targetE).slideDown('fast');
4931    });
4932
4933});
4934jQuery(document).ready(function () {
4935    jQuery('.active-week').removeClass('active-week');
4936    jQuery('.week-day-box.has-events:first').closest('.week-days-wrap').addClass('active-week');
4937
4938    var weekFirstDate   =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
4939    var weekLastDate    =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
4940
4941    getActiveWeekEvents(weekFirstDate, weekLastDate);
4942
4943    if( jQuery('.event-calender-modern').length > 0 )
4944    {
4945        jQuery('.week-day-date-box.has-events:first').trigger('click');
4946    }
4947
4948});
4949
4950function showClassicCalEvents(ewtTarget)
4951{
4952    jQuery('.event-calender-classic-map').empty();
4953    if( jQuery('.events-by-day-wrap.caew-box').length > 0 )
4954    {
4955        jQuery('.active-event-for-map').removeClass('active-event-for-map');
4956        jQuery('.caew-box').removeClass('caew-box').fadeOut(500, function () {
4957            jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('caew-box').fadeIn();
4958            jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').find('.event-by-day-wrap').addClass('active-event-for-map');
4959            if( jQuery('.calender-type-wrap').attr('data-activetoggle') == 'map' )
4960            {
4961                jQuery('.active-event-for-map').hide();
4962                jQuery('.calender-header-switcher ul li.show-calander-map.show-calander-map-'+ewtTarget).trigger('click');
4963            }
4964            else
4965            {
4966                jQuery('.calender-header-switcher ul li.show-calader-list').addClass('active');
4967                jQuery('.active-event-for-map').show();
4968            }
4969        });
4970    }
4971    else
4972    {
4973        jQuery('.active-event-for-map').removeClass('active-event-for-map');
4974        jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('caew-box').fadeIn();
4975        jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').find('.event-by-day-wrap').addClass('active-event-for-map');
4976        if( jQuery('.calender-type-wrap').attr('data-activetoggle') != 'map' ){
4977            jQuery('.events-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').find('.event-by-day-wrap').fadeIn();
4978        }
4979    }
4980}
4981
4982function showClassic2CalEvents(ewtTarget, targetDate)
4983{
4984
4985    var TargetDate  =   targetDate.split('-');
4986
4987    jQuery('.event-calander-classic2 .today-event-date-container span').text(TargetDate[1]+' '+TargetDate[0]);
4988    jQuery('.event-calender-classic-map').empty();
4989    jQuery('.active-event-for-map').hide().removeClass('active-event-for-map');
4990    jQuery('.event-calander-classic2').fadeIn(500);
4991    if( jQuery('.calender-type-wrap').attr('data-activetoggle') == 'map' )
4992    {
4993        jQuery('.event-calander-classic2 .event-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('active-event-for-map');
4994        jQuery('.event-calander-classic2 .calender-header-switcher .show-calander-map').trigger('click');
4995    }
4996    else
4997    {
4998        jQuery('.event-calander-classic2 .event-by-day-wrap[data-ebdt="'+ ewtTarget +'"]').addClass('active-event-for-map').fadeIn();
4999    }
5000}
5001function getActiveWeekEvents(weekFirstDate, weekLastDate)
5002{
5003    jQuery('.event-calender-weekly .event-by-day-wrap-inner.events-for-day').each(function () {
5004        var $this       =   jQuery(this),
5005            targetDate  =   $this.data('targetdate');
5006        $this.removeClass('active-event-for-map');
5007        $this.fadeOut(500);
5008
5009        if( targetDate >= weekFirstDate && targetDate <= weekLastDate )
5010        {
5011            $this.addClass('active-event-for-map');
5012            if(
5013                jQuery('.calender-type-wrap').attr('data-activetoggle') == 'calander' ||
5014                jQuery('.calender-type-wrap').attr('data-activetoggle') == undefined
5015            )
5016            {
5017                $this.fadeIn(500);
5018            }
5019        }
5020    });
5021    if( jQuery('.calender-type-wrap').attr('data-activetoggle') == 'map' )
5022    {
5023        jQuery('.calender-header-switcher ul li.show-calander-map').trigger('click');
5024    }
5025}
5026function getCalanderMapView( cType, $this )
5027{
5028    var mapWrapTartget  =   '.event-calender-weekly-map',
5029        eventWrapTarget =   '.event-by-day-wrap-inner',
5030        mapContainer    =   'map';
5031
5032    if( cType == 'event-calender-list-view' )
5033    {
5034        mapWrapTartget  =   '.event-calander-list-map';
5035        eventWrapTarget =   '.current-event-page-active';
5036    }
5037    if( cType == 'event-calender-modern' )
5038    {
5039        mapWrapTartget  =   '.event-calander-moder-map';
5040        eventWrapTarget =   '.events-by-day-wrap.active-event-for-map';
5041    }
5042    if( cType == 'event-calender-classic' )
5043    {
5044        eventWrapTarget =   '.event-by-day-wrap.active-event-for-map';
5045        if( jQuery('.event-calander-classic2').length == 0 )
5046        {
5047            var mapDate =   $this.data('targetdate');
5048            mapWrapTartget  =   '.event-calender-classic-map.classic-map-'+mapDate;
5049        }
5050        else
5051        {
5052            mapWrapTartget  =   '.event-calender-classic-map';
5053        }
5054    }
5055
5056    if( $this.hasClass('show-calander-map') )
5057    {
5058        jQuery('div[data-ctype="'+ cType +'"]').attr('data-activetoggle', 'map');
5059        jQuery(eventWrapTarget).fadeOut(500, function () {
5060            jQuery(mapWrapTartget).empty();
5061            jQuery(mapWrapTartget).html('<div id="map" class="event-calander-map"></div>');
5062            jQuery(mapWrapTartget).fadeIn();
5063            loadCalanderMap(mapContainer);
5064        });
5065    }
5066    if( $this.hasClass('show-calader-list') )
5067    {
5068        jQuery('div[data-ctype="'+ cType +'"]').attr('data-activetoggle', 'calander');
5069        jQuery(mapWrapTartget).fadeOut(500, function () {
5070            if( cType == 'event-calender-classic-weekly' )
5071            {
5072                var weekFirstDate   =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:first .week-day-date').text();
5073                var weekLastDate    =   jQuery('.week-days-wrap.active-week .lp-week-days-wrape-inner-container .week-day-box:last .week-day-date').text();
5074                getActiveWeekEvents(weekFirstDate, weekLastDate);
5075            }
5076            if( cType == 'event-calender-list-view' || cType == 'event-calender-modern' || cType == 'event-calender-classic' )
5077            {
5078                jQuery(eventWrapTarget).fadeIn(500);
5079            }
5080
5081        });
5082    }
5083}
5084function loadCalanderMap(mapContainer)
5085{
5086    var defmaplat = jQuery('body').data('defaultmaplat');
5087    var defmaplong = jQuery('body').data('defaultmaplot');
5088
5089    var map = null
5090    $mtoken = jQuery('#page').data("mtoken");
5091    $mtype = jQuery('#page').data("mtype");
5092    $mapboxDesign = jQuery('#page').data("mstyle");
5093
5094    if($mtoken != '' && $mtype == 'mapbox'){
5095
5096        L.mapbox.accessToken = $mtoken;
5097        map = L.mapbox.map(mapContainer);
5098        L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {
5099            id: jQuery('#page').data("mstyle"),
5100            accessToken: jQuery('#page').data("mtoken")
5101        }).addTo(map);
5102
5103        var markers = new L.MarkerClusterGroup();
5104        initializeMap(markers);
5105        if(markers===undefined){}else{
5106            map.fitBounds(markers.getBounds());
5107            map.scrollWheelZoom.disable();
5108        }
5109    }else{
5110
5111        var map = new L.Map('map', {
5112            minZoom: 3,
5113        }).setView(new L.LatLng(defmaplat, defmaplong), 18);
5114        if($mtype == 'google'){
5115            L.tileLayer('http://{s}.google.com/vt/lyrs=m&x={x}&y={y}&z={z}',{
5116                maxZoom: 18,
5117                subdomains:['mt0','mt1','mt2','mt3'],
5118                noWrap: true,
5119            });
5120            var googleLayer = new L.Google('ROADMAP');
5121            map.addLayer(googleLayer);
5122        }else{
5123            L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map);
5124        }
5125        var markers = new L.MarkerClusterGroup();
5126        initializeMap(markers);
5127        if(markers===undefined){}else{
5128
5129            map.fitBounds(markers.getBounds(), {padding: [50, 50]});
5130
5131        }
5132    }
5133    function initializeMap(markers) {
5134        markers.clearLayers();
5135        if( jQuery('.active-event-for-map').length > 0)
5136        {
5137            jQuery('.active-event-for-map').each(function () {
5138                var LPtitle  = jQuery(this).data("title"),
5139                    siteURL     = jQuery('#page').data("site-url");
5140                    LPposturl  = jQuery(this).data("posturl"),
5141                    LPlattitue  = jQuery(this).data("lattitue"),
5142                    LPlongitute  = jQuery(this).data("longitute"),
5143                    LPpostid  = jQuery(this).data("postid"),
5144                    LPimageSrc  = jQuery(this).find('.event-img').find('img').attr('src'),
5145                    LPaddress   =   jQuery(this).data('address');
5146
5147                if(LPlattitue != '' && LPlongitute != '')
5148                {
5149                    var LPimage = '';
5150                    if(LPimageSrc != ''){
5151                        LPimage = LPimageSrc;
5152                    }
5153
5154                    var markerLocation = new L.LatLng(LPlattitue, LPlongitute); // London
5155
5156                    var CustomHtmlIcon = L.HtmlIcon.extend({
5157                        options : {
5158                            html : "<div class='lpmap-icon-shape pin card"+LPpostid+"'><div class='lpmap-icon-contianer'><img src='"+siteURL+"/wp-content/themes/listingpro/assets/images/pins/lp-logo.png' /></div></div>",
5159                        }
5160                    });
5161
5162                    var customHtmlIcon = new CustomHtmlIcon();
5163                    var marker = new L.Marker(markerLocation, {icon: customHtmlIcon}).bindPopup('<div class="map-post"><div class="map-post-thumb"><a href="'+LPposturl+'"><img src="'+LPimage+'" ></a></div><div class="map-post-des"><div class="map-post-title"><h5><a href="'+LPposturl+'">'+LPtitle+'</a></h5></div><div class="map-post-address"><p><i class="fa fa-map-marker"></i> '+LPaddress+'</p></div></div></div>').addTo(map);
5164
5165                    markers.addLayer(marker);
5166                    map.addLayer(markers);
5167                }
5168            });
5169
5170        }
5171        else
5172        {
5173            alert('no listing foound');
5174        }
5175
5176    }
5177}
5178jQuery(document).on('click', '.event-tickets-list-dash i', function (e) {
5179    var $this           =   jQuery(this),
5180        $thisWrap       =   $this.closest('.event-tickets-list-dash'),
5181        currentUrls     =   $thisWrap.find('input[type="hidden"]').val(),
5182        ticketPlatform  =   $this.attr('data-ticket-platform'),
5183        ticketUrl       =   $this.attr('data-ticket-url'),
5184        newUrls         =   '';
5185    if (currentUrls.indexOf(',') > -1)
5186    {
5187        if( currentUrls.indexOf(','+ticketPlatform) > -1 )
5188        {
5189            var findStr =   ','+ticketPlatform+'|'+ticketUrl;
5190        }
5191        else
5192        {
5193            var findStr =   ticketPlatform+'|'+ticketUrl;
5194        }
5195        newUrls =   currentUrls.replace( findStr, '' );
5196    }
5197    else
5198    {
5199        var findStr =   ticketPlatform+'|'+ticketUrl;
5200        newUrls =   currentUrls.replace( findStr, '' );
5201    }
5202    $thisWrap.find('input[type="hidden"]').val(newUrls);
5203    jQuery(this).closest('li').remove();
5204});
5205
5206jQuery(document).on('click', '#add-event-ticket-platform', function(e){
5207    var thisWrap        =   jQuery(this).closest('.lp-coupon-box-row'),
5208        ticketPlatform  =   thisWrap.find('.event-tickets-platforms').val(),
5209        ticketUrl       =   thisWrap.find('.event-ticket-url').val(),
5210        currentUrls     =   thisWrap.find('input[type="hidden"]').val();
5211    if( ticketUrl == '' )
5212    {
5213        thisWrap.find('.event-ticket-url').addClass('error');
5214        return false;
5215    }
5216    else
5217    {
5218        thisWrap.find('.event-ticket-url').removeClass('error');
5219    }
5220    if( ticketPlatform == '' )
5221    {
5222        thisWrap.find('.event-tickets-platforms').addClass('error');
5223        return false;
5224    }
5225    else
5226    {
5227        thisWrap.find('.event-tickets-platforms').removeClass('error');
5228    }
5229    var embedMarkup =   '<li><strong>'+ ticketPlatform +'</strong> '+ ticketUrl +' <i class="fa fa-times" data-ticket-platform="'+ ticketPlatform +'" data-ticket-url="'+ ticketUrl +'"></i></li>';
5230    thisWrap.find('.event-tickets-list-dash ul').append( embedMarkup );
5231
5232    if( currentUrls == '' )
5233    {
5234        thisWrap.find('input[type="hidden"]').val(ticketPlatform+'|'+ticketUrl);
5235    }
5236    else
5237    {
5238        thisWrap.find('input[type="hidden"]').val(currentUrls+','+ticketPlatform+'|'+ticketUrl);
5239    }
5240});
5241
5242jQuery(document).on('click', '#add-new-service', function (e) {
5243    var $this       =   jQuery(this),
5244        uid         =   $this.attr('data-uid'),
5245        $thisWrap   =   $this.closest( '.ordering-service-wrap' ),
5246        serviceVal  =   $thisWrap.find('select').val(),
5247        serviceUrl  =   $thisWrap.find('input#service_url').val();
5248    if( $thisWrap.find('li:contains("'+ serviceVal +'")') .length )
5249    {
5250        $thisWrap.find('li:contains("'+ serviceVal +'")').css('color', 'red');
5251        return false;
5252    }
5253    if (jQuery('#service_url').val().length < 1){
5254        jQuery('.form-group.menu_online_order_url').addClass('with_error');
5255        return false;
5256    }else {
5257        jQuery('.form-group.menu_online_order_url').removeClass('with_error');
5258        if(/^(http|https|ftp):\/\/[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/i.test(jQuery("#service_url").val())){
5259                    jQuery('.form-group.menu_online_order_url').removeClass('with_error');
5260
5261        } else {
5262            jQuery('.form-group.menu_online_order_url').addClass('with_error');
5263            return false;
5264
5265        }
5266    }
5267
5268    jQuery('#add-new-service-spinner').fadeIn();
5269    jQuery.ajax({
5270        type: 'POST',
5271        dataType: 'json',
5272        url: ajax_search_term_object.ajaxurl,
5273        data:{
5274            'action': 'add_menu_service_cb',
5275            'serviceVal' : serviceVal,
5276            'serviceUrl': serviceUrl,
5277            'user_id' : uid,
5278            'lpNonce' : jQuery('#lpNonce').val()
5279        },
5280        success: function( res )
5281        {
5282            jQuery('.form-group.menu_online_order_url').removeClass('with_error');
5283            if( res.status == 'success' )
5284            {
5285                jQuery('#add-new-service-spinner').fadeOut();
5286                $thisWrap.find('li.no-services').remove();
5287                $thisWrap.find('ul').append(res.msg);
5288            }
5289            console.log(res);
5290        },
5291        error: function( err )
5292        {
5293            alert( err );
5294            $this.find('i').remove();
5295        }
5296    });
5297});
5298jQuery(document).on('click', '#add-new-type', function (e) {
5299    e.preventDefault();
5300    var $this        =   jQuery(this),
5301        $thisWrap    =   $this.closest('#manage-types-content'),
5302        newType      =   $thisWrap.find('input[type="text"]').val(),
5303        uid          =   $this.data('uid');
5304    if( newType == '' )
5305    {
5306        $thisWrap.find('input[type="text"]').addClass('error');
5307        return false;
5308    }
5309    else
5310    {
5311        $thisWrap.find('input[type="text"]').removeClass('error');
5312        $this.addClass('processing');
5313    }
5314    if( $thisWrap.find('li:contains("'+ newType +'")') .length )
5315    {
5316        $thisWrap.find('li:contains("'+ newType +'")').css('color', 'red');
5317        return false;
5318    }
5319    jQuery('#add-new-type-spinner').fadeIn();
5320    $this.hide();
5321    jQuery.ajax({
5322        type: 'POST',
5323        dataType: 'json',
5324        url: ajax_search_term_object.ajaxurl,
5325        data:{
5326            'action': 'add_menu_type_cb',
5327            'user_id' : uid,
5328            'type' : newType,
5329            'lpNonce' : jQuery('#lpNonce').val()
5330        },
5331        success: function( res )
5332        {
5333            jQuery('#add-new-type-spinner').fadeOut();
5334            $this.removeClass('processing');
5335            $this.show();
5336            $thisWrap.find('input[type="text"]').val('');
5337            jQuery('.lp-menu-step-one .panel-heading .nav-tabs li.active').removeClass('active');
5338            jQuery('.lp-menu-step-one .panel-body .tab-content .tab-pane.active').removeClass('in active');
5339            var embed_markup    =   '<li>'+ newType +' <span class="del-group-type del-type del-this" data-uid="'+ uid +'" data-targetid="'+ res.data_index +'">
5339<i class="fa fa-trash"></i></span></li>';
5340            var embed_tab       =   '<li class="active"><a href="#type-'+ newType +'" data-toggle="tab">'+ newType +'</a></li>';
5341            var embed_tab_cn    =   '<div class="tab-pane fade in active" id="type-'+ newType +'"></div>';
5342            $thisWrap.find('ul').append(embed_markup);
5343            jQuery('.lp-menu-step-one .panel-heading .nav-tabs').append(embed_tab);
5344            jQuery('.lp-menu-step-one .panel-body .tab-content').append(embed_tab_cn);
5345        },
5346        error: function( err )
5347        {
5348            alert( err );
5349            $this.find('i').remove();
5350            $this.show();
5351        }
5352    });
5353});
5354jQuery(document).on('click', '#add-new-group', function (e) {
5355    e.preventDefault();
5356    var $this        =   jQuery(this),
5357        $thisWrap    =   $this.closest('#manage-groups-content'),
5358        newGroup     =   $thisWrap.find('input[type="text"]').val(),
5359        uid          =   $this.data('uid');
5360    if( newGroup == '' )
5361    {
5362        $thisWrap.find('input[type="text"]').addClass('error');
5363        return false;
5364    }
5365    else
5366    {
5367        $thisWrap.find('input[type="text"]').removeClass('error');
5368        $this.addClass('processing');
5369    }
5370    if( $thisWrap.find('li:contains("'+ newGroup +'")') .length )
5371    {
5372        $thisWrap.find('li:contains("'+ newGroup +'")').css('color', 'red');
5373        return false;
5374    }
5375    jQuery('#add-new-group-spinner').fadeIn();
5376    $this.hide();
5377    jQuery.ajax({
5378        type: 'POST',
5379        dataType: 'json',
5380        url: ajax_search_term_object.ajaxurl,
5381        data:{
5382            'action': 'add_menu_group_cb',
5383            'user_id' : uid,
5384            'group' : newGroup,
5385            'lpNonce' : jQuery('#lpNonce').val()
5386        },
5387        success: function( res )
5388        {
5389            jQuery('#add-new-group-spinner').fadeOut();
5390            $this.removeClass('processing');
5391            $this.show();
5392            $thisWrap.find('input[type="text"]').val('');
5393            var embed_markup    =   '<li>'+ newGroup +' <span class="del-group-type del-group del-this" data-uid="'+ uid +'" data-targetid="'+ res.data_index +'"><i class="fa fa-trash"></i></span></li>';
5394            $thisWrap.find('ul').append(embed_markup);
5395            var optData = {
5396                id: newGroup,
5397                text: newGroup
5398            };
5399            var newOption = new Option(optData.text, optData.id, false, false);
5400            jQuery('#menu-group').append(newOption).trigger('change');
5401            var currentGroups   =   jQuery('#menu-group').val();
5402            if( currentGroups == null )
5403            {
5404                jQuery('#menu-group').val(group).trigger('change');
5405            }
5406            else
5407            {
5408                currentGroups.push(group);
5409                jQuery('#menu-group').val(currentGroups).trigger('change');
5410            }
5411        },
5412        error: function( err )
5413        {
5414            $this.show();
5415            alert( err );
5416            $this.find('i').remove();
5417        }
5418    });
5419});
5420jQuery(document).on('click', '.manange-typs-groups-tabs li', function (e) {
5421    e.preventDefault();
5422    jQuery('.manange-typs-groups-tabs li.active').removeClass('active');
5423    jQuery(this).addClass('active');
5424
5425    var targetID =   jQuery(this).attr('id');
5426
5427    if( targetID == 'manage-types-tab' )
5428    {
5429        jQuery('#manage-groups-content').removeClass('active-content');
5430        jQuery('#manage-types-content').addClass('active-content');
5431    }
5432    else
5433    {
5434        jQuery('#manage-types-content').removeClass('active-content');
5435        jQuery('#manage-groups-content').addClass('active-content');
5436    }
5437});
5438jQuery('#menu-group').on('select2:select', function (e) {
5439    jQuery('#menu-form-toggle').slideDown();
5440});
5441function myFuction(el) {
5442    jQuery(el).find('.show-number').css('display', 'none');
5443    jQuery(el).find('.grind-number').css('display', 'inline-block');
5444}
5445jQuery(document).on('click', '.listing-app-view-new-discount', function(){
5446    var $this   =   jQuery(this),
5447        target  =   $this.closest('.app-view2-first-recent');
5448
5449    jQuery('.app-view2-first-recent').find('.popover_overlay.active_popover_overlay').removeClass('active_popover_overlay');
5450
5451    if( $this.hasClass('current-active-pop')) {
5452        $this.removeClass('current-active-pop')
5453    } else {
5454        $this.addClass('current-active-pop');
5455        target.find('.popover_overlay').addClass('active_popover_overlay');
5456    }
5457});
5458
5459
5460/* ******************  SHOW ALL MENUS OF SELECTED LISTING  ******************* */
5461jQuery(document).on('change','#lp-menus #menu-listing', function() {
5462
5463    var selectedListingID = jQuery(this).find(":selected").val();
5464
5465
5466    jQuery.ajax({
5467        dataType:'html',
5468        url: ajax_search_term_object.ajaxurl,
5469        data:{
5470            'action':'listingpro_dashboard_menu_of_listing',
5471            'selectedListingID' : selectedListingID,
5472            'lpNonce' : jQuery('#lpNonce').val()
5473        },
5474        success:function (res) {
5475            jQuery('.lp-compaignForm-leftside .lp-menu-panel-body-outer').html(res);
5476        },
5477        error:function (err) {
5478            console.log(err);
5479        },
5480    });
5481
5482});
5483
5484/* ******************  DELETE ALL MENUS OF LISTING  ******************* */
5485jQuery(document).on('click', '.del-this-menu', function(e)
5486{
5487    e.preventDefault();
5488    jQuery('.remove-active-menu').removeClass('remove-active-menu');
5489    jQuery(this).addClass('remove-active-menu');
5490    jQuery('#dashboard-delete-modal3').modal('show');
5491    jQuery('.modal-backdrop').hide();
5492});
5493jQuery(document).on('click', '.dashboard-confirm-del-menu-btn', function (e) {
5494    var $this       =   jQuery('.remove-active-menu'),
5495        lid         =   $this.data('targetid'),
5496        user_id     =   $this.data('uid');
5497
5498    jQuery(this).append('<i class="fa fa-spin fa-spinner" style="margin-left: 5px;"></i>');
5499
5500    jQuery.ajax({
5501        type: 'POST',
5502        dataType: 'json',
5503        url: ajax_search_term_object.ajaxurl,
5504        data:{
5505            'action': 'del_assigned_menu_to_listing',
5506            'user_id' : user_id,
5507            'lid' : lid,
5508            'lpNonce' : jQuery('#lpNonce').val()
5509        },
5510        success: function( res )
5511        {
5512            if( res.status == 'success' )
5513            {
5514                location.reload();
5515            }
5516            $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
5517        },
5518        error: function( err )
5519        {
5520            console.log( err );
5521            $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
5522        }
5523    });
5524});
5525jQuery(document).on('click', '.open-edit-this-menu', function (e) {
5526    e.preventDefault();
5527    var targetID        =   jQuery(this).data('targetid'),
5528        listingTitle    =   jQuery(this).data('targettitle');
5529
5530    jQuery('.panel.with-nav-tabs.panel-default.lp-dashboard-tabs').fadeOut("slow", function () {
5531        jQuery('div.tab-pane.fade.in.active.clearfix.lp-dashboard-menu-container').fadeIn("fast", function () {
5532            jQuery('div.panel.with-nav-tabs.panel-default.lp-dashboard-tabs.lp-left-panel-height.lp-left-panel-height-outer').fadeIn("fast");
5533        });
5534    });
5535
5536    if(jQuery('#menu-listing').hasClass('select2-ajax')) {
5537        if (jQuery('#menu-listing').find("option[value='" + targetID + "']").length) {
5538            jQuery('#menu-listing').val(targetID).trigger('change');
5539        } else {
5540            var newOption = new Option(listingTitle, targetID, true, true);
5541            jQuery('#menu-listing').append(newOption).trigger('change');
5542        }
5543    } else {
5544        jQuery('#menu-listing').val(targetID);
5545        jQuery('#menu-listing').trigger('change');
5546    }
5547
5548});
5549
5550jQuery(document).on('click', '.discount-bar', function (e) {
5551    var $this       =   jQuery(this),
5552        thisWrap    =   $this.closest('.lp-listing-bottom-right');
5553
5554    $this.toggleClass('active-discount-bar');
5555
5556    if($this.hasClass('active-discount-bar')){
5557        $this.find('i.pull-right').removeClass('fa-chevron-down').addClass('fa-chevron-up');
5558    } else {
5559        $this.find('i.pull-right').removeClass('fa-chevron-up').addClass('fa-chevron-down');
5560    }
5561
5562
5563    thisWrap.find('.coupons-bottom-content-wrap').slideToggle(function () {
5564        $this.closest('.lp-listing-bottom-right').toggleClass('active');
5565    });
5566});
5567
5568jQuery(document).on('click', '.del-order-service', function (e) {
5569   var $this    =   jQuery(this),
5570       uid      =   $this.attr('data-uid'),
5571       target   =   $this.attr('data-target');
5572
5573   if($this.hasClass('active-ajax')){
5574
5575   } else {
5576       $this.addClass('active-ajax');
5577       $this.find('i').removeClass('fa-trash').addClass('fa-spinner fa-spin');
5578
5579       jQuery.ajax({
5580           type: 'POST',
5581           dataType: 'json',
5582           url: ajax_search_term_object.ajaxurl,
5583           data:{
5584               'action': 'del_ordering_service',
5585               'uid' : uid,
5586               'target' : target,
5587               'lpNonce' : jQuery('#lpNonce').val()
5588           },
5589           success: function( res )
5590           {
5591               if( res.status == 'success' )
5592               {
5593                   $this.closest('li').remove();
5594               }
5595           },
5596           error: function( err )
5597           {
5598               console.log( err );
5599               $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
5600           }
5601       });
5602   }
5603});
5604jQuery(document).on('click', '.delete-my-review', function (e) {
5605    e.preventDefault();
5606    var $this       =   jQuery(this),
5607        reviewID    =   $this.attr('data-reviewid');
5608
5609    if($this.hasClass('active-ajax')) {
5610
5611    } else {
5612        $this.addClass('active-ajax');
5613        $this.append('<i class="fa fa-spinner fa-spin" style="margin-left: 5px;"></i>');
5614
5615        jQuery.ajax({
5616            type: 'POST',
5617            dataType: 'json',
5618            url: ajax_search_term_object.ajaxurl,
5619            data:{
5620                'action': 'delete_own_review',
5621                'reviewID' : reviewID,
5622                'lpNonce' : jQuery('#lpNonce').val()
5623            },
5624            success: function( res )
5625            {
5626                location.reload();
5627            },
5628            error: function( err )
5629            {
5630                console.log( err );
5631                $this.find('i').removeClass('fa-spin fa-spinner').addClass('fa-trash-o');
5632            }
5633        });
5634    }
5635
5636});
5637jQuery(document).ready(function () {
5638    jQuery('.lp-ad-location-image').click(function (e) {
5639        e.preventDefault();
5640        var img_src = jQuery(this).find('img').data('model_img_src_ad');
5641        jQuery('#ad_preview').find('img#imgsrc').attr('src', img_src);
5642    });
5643});
5644jQuery(document).on('click', '.app-view2-show-search', function(e){
5645    e.preventDefault();
5646    var inputField = jQuery('.dropdown_fields');
5647    inputField.trigger('click');
5648});

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.