PageSourceSearch

https://rotiboy.com/Scripts/all.js?v=1782358165

js rotiboy.com collected 2026-10-02 12:55:17 UTC 39,906 bytes, 1,048 lines download raw bytes

1
2var thisUrl = '//' + location.host + '/' ;
3var thisLanguage = $('#language').val() ;
4var thisRedirect = $('#redirect').val() ;
5
6$(window).keydown(function(event){
7    if( event.keyCode == 13 ){
8        event.preventDefault() ;
9
10        return false ;
11    }
12}) ;
13
14// function doOnOrientationChange(){
15//     switch( window.orientation ) {  
16//         case -90 :
17//             // lockScroll('lock') ;
18//             document.getElementById("landscape").style.display = "block" ;
19//         break ;
20//         case 90 :
21//             // lockScroll('lock') ;
22//             document.getElementById("landscape").style.display = "block" ;                 
23//         break ;
24//         default :
25//             // lockScroll('unlock') ;
26//             document.getElementById("landscape").style.display = "none" ;
27//         break ;                            
28//     }
29// }
30
31// window.addEventListener( 'orientationchange', doOnOrientationChange ) ;
32
33$(document).ready(function(){
34    // if( $( window ).width() < 767 ){
35    //     doOnOrientationChange() ;
36    // }
37    // $( window ).on("resize", function(e) {
38    //     if( $( window ).width() < 767 ){
39    //         doOnOrientationChange() ;
40    //     }
41    // }) ;
42}) ;
43
44$(window).bind('scroll', function(){
45    if( $("#instagram-footer").hasClass("progress") ){
46        if( $(window).scrollTop() == ( $(document).height() - $(window).height() ) ){
47            var thisPost = $('#instagram-footer').val() ;
48
49            if( thisPost != '' ){
50                $('#instagram-loader').show() ;
51
52                $.ajax({
53                    type: 'POST' ,
54                    url: thisUrl + 'Requests/ajax_instagram.php?language='+thisLanguage ,
55                    data: { 'type' : 'pagination', 'link' : thisPost } ,
56                    dataType: 'json' ,
57                    success: function( data ){
58                        var list = data['list'] ;
59
60                        if( list['next'] != '' ){
61                            $('#instagram-footer').val( list['next'] ) ;
62                        }
63
64                        if( data['content'] != '' ){
65                            $('#instagram-append').append( data['content'] ) ;
66                        }
67
68                        $('#instagram-loader').hide() ;
69                    }
70                }) ;
71
72                return false ;
73            }
74        }
75    }
76}) ;
77
78$(document).ready(function(){
79    $('.filter-select').select2() ;
80
81    $(".fancybox").fancybox() ;
82
83    $('.fancybox_iframe').fancybox({
84        type: "iframe",
85        autoSize: false,
86        href: $(this).attr("href"),
87        width: 1200,
88        height: 600
89    }) ;
90    
91    $('#home-notice').show() ;
92    $('#home-notice').addClass( 'show' ) ;
93
94    $('.home-notice-close').on('click', function(){
95
96        $('#home-notice').hide() ;
97        $('#home-notice').removeClass( 'show' ) ;
98
99        return false ;
100    }) ;
101
102
103
104    /** Outlets Start **/
105    $('.outlets-group-header').click(function(){
106        var This = $(this), Parents = This.parents('.row'), content = Parents.find(".outlets-group-details"), ThisData = This.data("target");
107        console.log(ThisData);
108        Parents.find(ThisData).removeClass('d-none');
109        $(".outlets-group-details").msrItems({
110            "colums": outletsColumns ,
111            "margin": 15
112        }) ;
113    })
114
115        var outletsColumns = 3 ,
116            setColumns = function(){ outletsColumns = $( window ).width() > 767 ? 3 : $( window ).width() > 480 ? 2 : 1 ; } ;
117
118        if( $( window ).width() > 767 ){
119            outletsColumns = 3 ;
120        }else if( $( window ).width() > 480 ){
121            outletsColumns = 2 ;
122        }else{
123            outletsColumns = 1 ;
124        }
125
126        $( window ).resize( setColumns ) ;
127
128        $(".outlets-group-details").msrItems({
129            "colums": outletsColumns ,
130            "margin": 15
131        }) ;
132
133        $( window ).on("resize", function(e) {
134            $(".outlets-group-details").msrItems({
135                "colums": outletsColumns ,
136                "margin": 15
137            }) ;
138        }) ;
139        
140        $(window).bind('scroll', function(){
141            // $(".outlets-group-details").msrItems({
142            //     "colums": outletsColumns ,
143            //     "margin": 15
144            // }) ;
145        }) ;
146    /** Outlets End **/
147
148    $(".password-show").click(function(){
149        var thisParent = $(this).parents('.password-relative') ,
150            thisFind = thisParent.find('.form-password') ;
151
152        if( thisFind.prop( 'type') == 'password' ){
153            thisFind.prop( 'type', 'text');
154        }else{
155            thisFind.prop( 'type', 'password' ) ;
156        }
157
158        return false ;
159    }) ;
160
161    $('.tabs li').click(function(){
162        var tab_id = $(this).attr('data-tab');
163        $('.tabs li').removeClass('current');
164        $('.tabs-content').removeClass('current');
165        $(this).addClass('current');
166        $("#"+tab_id).addClass('current');
167    });
168
169    $('.location-popup').on('click', function(){
170        $('.location-modal-popup').addClass('active') ;
171        $('.location-background').addClass('active') ;
172
173        return false ;
174    }) ;
175
176    $('.location-close, .location-background').on('click', function(){
177        $('.location-modal-popup').removeClass('active') ;
178        $('.location-background').removeClass('active') ;
179
180        return false ;
181    }) ;
182
183    $('.location-dropdown-close').on('click', function(){
184        $('.location-dropdown-modal').hide( 500 ) ;
185
186        return false ;
187    }) ;
188
189    $('.checkout-policy-dropdown').on('click', function(){
190        var thisParent = $(this).parents('.policy-parent') ,
191            thisFind = thisParent.find('.policy-details') ;
192
193        if( thisFind.is(":visible") ){
194            thisFind.slideUp() ;
195        }else{
196            thisFind.slideDown() ;
197        }
198
199        return false ;
200    }) ;
201
202    $('.subcategory-dropdown').on('click', function(){
203        var thisKey = $(this) ,
204            thisParent = thisKey.parents('.item-toggle-tab') ,
205            thisFind = thisParent.find('.subcategory-ul') ;
206
207        thisFind.toggle('blind') ;
208
209        return false ;
210    }) ;
211
212
213    $('.tab_mobile_content').hide() ;
214
215    $('.tab_mobile_title').click(function() {
216        $('.tab_mobile_content').hide(500) ;
217
218        if($(this).next('div').is(":visible")){
219            $('.tab_mobile_content').hide(500) ;
220        }else{
221            $(this).next('div').slideToggle() ;
222        }
223        return false;
224    }) ;
225}) ;
226
227$(document).ready(function(){
228    $('.login-button').on('click', function(){
229        var thisKey = $(this) ,
230            thisForm = $(this).parents('.login-form') ;
231
232        thisForm.validate({
233            submitHandler: function( form ){
234                var thisData = thisForm.serialize() ;
235
236                thisKey.attr('disabled', 'disabled') ;
237
238                $.ajax({
239                    type: 'POST' ,
240                    url: thisUrl + 'Requests/ajax_login.php?language='+thisLanguage ,
241                    data: thisData ,
242                    dataType: 'json' ,
243                    success: function( data ){
244                        if( data['result'] != '' ){
245                            switch( data['result'] ){
246                                case 'success-login' :
247                                    toastr.success( data['message'] ) ;
248
249                                    setTimeout( function(){
250                                        window.location.href = data['redirect'] ;
251                                    }, 1000 ) ;
252                                break ;
253                                case 'failed-login' :
254                                    toastr.error( data['message'] ) ;
255                                    
256                                    setTimeout( function(){
257                                        window.location.href = thisUrl ;
258                                    }, 1000 ) ;
259                                break ;
260                                default :
261                                    toastr.error( data['message'] ) ;
262                                break ;
263                            }
264                        
265                            thisKey.removeAttr('disabled') ;
266                        }
267                    }
268                }) ;
269                return false ;
270            }
271        }) ;
272    }) ;
273
274    $('.verify-number-button').on('click', function(){
275        var thisKey = $(this) ,
276            thisForm = thisKey.parents('.verify-number-form') ;
277
278        thisForm.validate({
279            submitHandler: function( form ){
280                var thisData = thisForm.serialize() ,
281                    thisType = thisForm.attr('data-type') ;
282
283                thisKey.attr('disabled', 'disabled') ;
284
285                $.ajax({
286                    type: 'POST' ,
287                    url: thisUrl + 'Requests/ajax_verify_number.php?language='+thisLanguage ,
288                    data: thisData ,
289                    dataType: 'json' ,
290                    success: function( data ){
291                        var result = data['result'] ;
292
293                        if( result['code'] != '' ){
294                            var list = data['list'] ;
295
296                            switch( result['code'] ){
297                                case 'success-verify' :
298                                    ajaxResult( 'success', result ) ;
299
300                                    thisForm.find('.verify-code-div').show( 500 ) ;
301                                break ;
302                                case 'success-update' :
303                                    ajaxResult( 'success', result ) ;
304
305                                    $('.register-phone-number').val( list['PhoneNumber'] ) ;
306                                    $('.register-phone-number').attr( 'readonly', true ) ;
307
308                                    thisForm.find('.verify-code').val( '' ) ;
309                                    switch( thisType ){
310                                        case 'destop' :
311                                            $('.form_verify_number-destop').hide( 500 ) ;
312                                            $('.form_register-destop').show( 500 ) ;
313                                        break ;
314                                        case 'mobile' :
315                                            $('.form_verify_number').hide( 500 ) ;
316                                            $('.form_register').show( 500 ) ;
317                                        break ;
318                                    }
319                                break ;
320                                case 'failed-expired' :
321                                    ajaxResult( 'error', result ) ;
322
323                                    thisForm.find('.verity-phone-number').val( '' ) ;
324                                    thisForm.find('.verify-code-div').hide( 500 ) ;
325                                    thisForm.find('.verify-code').val( '' ) ;
326                                break ;
327                                case 'failed-login' :
328                                    ajaxResult( 'error', result ) ;
329                                    
330                                    setTimeout( function(){
331                                        window.location.href = thisUrl ;
332                                    }, 1000 ) ;
333                                break ;
334                                default :
335                                    ajaxResult( 'error', result ) ;
336                                break ;
337                            }
338                        
339                            thisKey.removeAttr('disabled') ;
340                        }
341                    }
342                }) ;
343                return false ;
344            }
345        }) ;
346    }) ;
347
348    $('.register-button').on('click', function(){
349        var thisKey = $(this) ,
350            thisForm = thisKey.parents('.register-form') ;
351
352        thisForm.validate({
353            submitHandler: function( form ){
354                var thisData = thisForm.serialize() ;
355
356                thisKey.attr('disabled', 'disabled') ;
357
358                $.ajax({
359                    type: 'POST' ,
360                    url: thisUrl + 'Requests/ajax_register.php?language='+thisLanguage ,
361                    data: thisData ,
362                    dataType: 'json' ,
363                    success: function( data ){
364                        var result = data['result'] ;
365
366                        if( result['code'] != '' ){
367                            switch( result['code'] ){
368                                case 'success-register' :
369                                    ajaxResult( 'success', result ) ;
370
371                                    setTimeout( function(){
372                                        window.location.href = data['redirect'] ;
373                                    }, 1000 ) ;
374                                break ;
375                                case 'failed-login' :
376                                    ajaxResult( 'error', result ) ;
377                                    
378                                    setTimeout( function(){
379                                        window.location.href = thisUrl ;
380                                    }, 1000 ) ;
381                                break ;
382                                default :
383                                    ajaxResult( 'error', result ) ;
384                                break ;
385                            }
386                        
387                            thisKey.removeAttr('disabled') ;
388                        }
389                    }
390                }) ;
391
392                return false ;
393            }
394        }) ;
395    }) ;
396
397    $('.forgot-button').on('click', function(){
398        var thisKey = $(this) ,
399            thisForm = thisKey.parents('.forgot-form') ;
400
401        thisForm.validate({
402            submitHandler: function( form ){
403                var thisData = thisForm.serialize() ;
404
405                thisKey.attr('disabled', 'disabled') ;
406
407                $.ajax({
408                    type: 'POST' ,
409                    url: thisUrl + 'Requests/ajax_verify_number.php?language='+thisLanguage ,
410                    data: thisData ,
411                    dataType: 'json' ,
412                    success: function( data ){
413                        var result = data['result'] ;
414
415                        if( result['code'] != '' ){
416                            var list = data['list'] ;
417
418                            switch( result['code'] ){
419                                case 'success-verify' :
420                                    ajaxResult( 'success', result ) ;
421
422                                    thisForm.find('.verify-code-div').show( 500 ) ;
423                                break ;
424                                case 'success-update' :
425                                    ajaxResult( 'success', result ) ;
426
427                                    $('.reset-phone-number').val( list['PhoneNumber'] ) ;
428                                    $('.reset-phone-number').attr( 'readonly', true ) ;
429                                    $('.reset-verify-code').val( list['VerifyCode'] ) ;
430
431                                    thisForm.find('.verify-code').val( '' ) ;
432                                    $('.RecoverPasswordForm').hide( 500 ) ;
433                                    $('.ResetPasswordForm').show( 500 ) ;
434                                break ;
435                                case 'failed-expired' :
436                                    ajaxResult( 'error', result ) ;
437
438                                    thisForm.find('.verity-phone-number').val( '' ) ;
439                                    thisForm.find('.verify-code-div').hide( 500 ) ;
440                                    thisForm.find('.verify-code').val( '' ) ;
441                                break ;
442                                case 'failed-login' :
443                                    ajaxResult( 'error', result ) ;
444                                    
445                                    setTimeout( function(){
446                                        window.location.href = thisUrl ;
447                                    }, 1000 ) ;
448                                break ;
449                                default :
450                                    ajaxResult( 'error', result ) ;
451                                break ;
452                            }
453                        
454                            thisKey.removeAttr('disabled') ;
455                        }
456                    }
457                }) ;
458
459                return false ;
460            }
461        }) ;
462    }) ;
463
464    $('.reset-button').on('click', function(){
465        var thisKey = $(this) ,
466            thisForm = thisKey.parents('.reset-form') ;
467
468        thisForm.validate({
469            submitHandler: function( form ){
470                var thisData = thisForm.serialize() ;
471
472                thisKey.attr('disabled', 'disabled') ;
473
474                $.ajax({
475                    type: 'POST' ,
476                    url: thisUrl + 'Requests/ajax_reset.php?language='+thisLanguage ,
477                    data: thisData ,
478                    dataType: 'json' ,
479                    success: function( data ){
480                        if( data['result'] != '' ){
481                            switch( data['result'] ){
482                                case 'success-update' :
483                                    toastr.success( data['message'] ) ;
484
485                                    $('.ResetPasswordForm').hide( 500 ) ;
486                                    $('.CustomerLoginForm').show( 500 ) ;
487                                break ;
488                                case 'failed-login' :
489                                    toastr.error( data['message'] ) ;
490                                    
491                                    setTimeout( function(){
492                                        window.location.href = thisUrl ;
493                                    }, 1000 ) ;
494                                break ;
495                                default :
496                                    toastr.error( data['message'] ) ;
497                                break ;
498                            }
499                        
500                            thisKey.removeAttr('disabled') ;
501                        }
502                    }
503                }) ;
504
505                return false ;
506            }
507        }) ;
508    }) ;
509
510    $('.profile-button').on('click', function(){
511        var thisForm = $(this).parents('.profile-form') ;
512
513        thisForm.validate({
514            submitHandler: function( form ){
515                var thisData = thisForm.serialize() ;
516
517                $.ajax({
518                    type: 'POST' ,
519                    url: thisUrl + 'Requests/ajax_profile.php?language='+thisLanguage ,
520                    data: thisData ,
521                    dataType: 'json' ,
522                    success: function( data ){
523                        if( data['result'] != '' ){
524                            switch( data['result'] ){
525                                case 'success-update' :
526                                    toastr.success( data['message'] ) ;
527                                break ;
528                                case 'failed-login' :
529                                    toastr.error( data['message'] ) ;
530                                    
531                                    setTimeout( function(){
532                                        window.location.href = thisUrl ;
533                                    }, 1000 ) ;
534                                break ;
535                                default :
536                                    toastr.error( data['message'] ) ;
537                                break ;
538                            }
539                        }
540                    }
541                }) ;
542
543                return false ;
544            }
545        }) ;
546    }) ;
547
548    $('.address-button').on('click', function(){
549        var thisForm = $(this).parents('.address-form') ;
550
551        thisForm.validate({
552            submitHandler: function( form ){
553                var thisData = thisForm.serialize() ;
554
555                $.ajax({
556                    type: 'POST' ,
557                    url: thisUrl + 'Requests/ajax_address.php?language='+thisLanguage ,
558                    data: thisData ,
559                    dataType: 'json' ,
560                    success: function( data ){
561                        if( data['result'] != '' ){
562                            switch( data['result'] ){
563                              
563  case 'success-insert' :
564                                    $('#address-new-div').hide() ;
565                                    $('#address-details').html( data['content'] ) ;
566
567                                    toastr.success( data['message'] ) ;
568                                break ;
569                                case 'success-update' :
570                                    $('#address-edit-div').hide() ;
571                                    $('#address-details').html( data['content'] ) ;
572
573                                    toastr.success( data['message'] ) ;
574                                break ;
575                                case 'failed-login' :
576                                    toastr.error( data['message'] ) ;
577                                    
578                                    setTimeout( function(){
579                                        window.location.href = thisUrl ;
580                                    }, 1000 ) ;
581                                break ;
582                                default :
583                                    toastr.error( data['message'] ) ;
584                                break ;
585                            }
586                        }
587                    }
588                }) ;
589
590                return false ;
591            }
592        }) ;
593    }) ;
594
595    $(document).on( 'click', '.account-dropdown', function(){
596        var divParent = $(this).parents(".widget") ;
597            divFind = divParent.find(".widget-content") ;
598
599        divFind.toggle() ;
600
601        return false ;
602    }) ;
603
604    $(document).on( 'click', '.address-new, #address-new-cancel', function(){
605        $('#address-new-div').toggle() ;
606
607        return false ;
608    }) ;
609
610    $(document).on( 'click', '.address-edit, #address-edit-cancel', function(){
611        var thisParent = $(this).parents('.address-edit-parent') ;
612
613        thisParent.find('#address-edit-div').toggle() ;
614
615        return false ;
616    }) ;
617
618    $(document).on( 'click', '.home-location-option', function(){
619        var thisKey = $(this) ,
620            thisParent = thisKey.parents('.home-location-div') ,
621            thisValue = thisKey.attr('data-value') ;
622
623        $.ajax({
624            type: 'POST' ,
625            url: thisUrl + 'Requests/ajax_shipping_method.php?language='+thisLanguage ,
626            data: { 'type' : 'shipping-method', 'post' : thisValue, 'boolean_redirect' : true } ,
627            dataType: 'json' ,
628            success: function( data ){
629                var result = data['result'] ;
630
631                if( result['code'] != '' ){
632                    var list = data['list'] ;
633
634                    switch( result['code'] ){
635                        case 'success-update' :
636                            $('.location-dropdown-modal').hide( 500 ) ;
637
638                            thisParent.find('.location-dropdown-modal').show( 500 ) ;
639                            thisParent.find('#location-redirect').val( data['redirect'] ) ;
640                        break ;
641                        case 'failed-login' :
642                            // ajaxResult( 'error', result ) ;
643                            
644                            $('.js-poup-login-destop').addClass('active') ;
645                            $('.js-bg-login-popup').addClass('active') ;
646                            $('.formlogin-destop').show() ;
647                            $('.form_register-destop').hide() ;
648                        break ;
649                        default :
650                            ajaxResult( 'error', result ) ;
651                        break ;
652                    }
653                }
654            }
655        }) ;
656
657        return false ;
658    }) ;
659
660    $(document).on( 'click', '.schedule-change-shipping', function(){
661        var thisKey = $(this) ,
662            thisParent = thisKey.parents('.home-location-div') ,
663            thisValue = thisKey.attr('data-value') ;
664
665        $.ajax({
666            type: 'POST' ,
667            url: thisUrl + 'Requests/ajax_shipping_method.php?language='+thisLanguage ,
668            data: { 'type' : 'shipping-method', 'post' : thisValue } ,
669            dataType: 'json' ,
670            success: function( data ){
671                var result = data['result'] ;
672
673                if( result['code'] != '' ){
674                    var list = data['list'] ;
675
676                    switch( result['code'] ){
677                        case 'success-update' :
678                            ajaxResult( 'success', result ) ;
679
680                            updateLocation( 'outlets', list['OutletsID'] ) ;
681                            
682                            setTimeout( function(){
683                                if( data['redirect'] != '' ){
684                                        window.location.href = data['redirect'] ;
685                                }else{
686                                    location.reload() ;
687                                }
688                            }, 1000 ) ;
689                        break ;
690                        case 'failed-login' :
691                            // ajaxResult( 'error', result ) ;
692                            
693                            $('.js-poup-login-destop').addClass('active') ;
694                            $('.js-bg-login-popup').addClass('active') ;
695                            $('.formlogin-destop').show() ;
696                            $('.form_register-destop').hide() ;
697                        break ;
698                        default :
699                            ajaxResult( 'error', result ) ;
700                        break ;
701                    }
702                }
703            }
704        }) ;
705
706        return false ;
707    }) ;
708
709    $('.checkout-summary').on('click', function(){
710        var thisKey = $(this) ,
711            thisParent = thisKey.parents('.checkout-summary-content') ,
712            thisShow = thisParent.find('.checkout-summary-show') ;
713            thisHide = thisParent.find('.checkout-summary-hide') ;
714            thisMenu = thisParent.find('.checkout-summary-dropdown') ;
715
716        if( thisShow.hasClass( 'summary-show' ) ){
717            thisShow.fadeOut(500, function(){
718                thisShow.removeClass( 'summary-show' ) ;
719                thisHide.addClass( 'summary-show' ).fadeIn( 500 ) ;
720                thisMenu.slideDown( 'slow' ) ;
721            }) ;
722        }else{
723            thisHide.fadeOut(500, function(){
724                thisShow.addClass( 'summary-show' ).fadeIn( 500 ) ;
725                thisHide.removeClass( 'summary-show' ) ;
726                thisMenu.slideUp( 'slow' ) ;
727            }) ;
728        }
729
730        return false ;
731    }) ;
732
733    $("#subscribe-form").validate({
734        submitHandler: function (form) {
735            var thisForm = $('#subscribe-form') ,
736                thisData = thisForm.serialize() ;
737
738            $.ajax({
739                type: 'POST' ,
740                url: thisUrl + 'Requests/ajax_subscribe.php?language='+thisLanguage ,
741                data: thisData ,
742                dataType: 'json' ,
743                success: function( data ){
744                    if( data['result'] != '' ){
745                        switch( data['result'] ){
746                            case 'success-subscribe' :
747                                toastr.success( data['message'] ) ;
748                            break ;
749                            case 'failed-login' :
750                                toastr.error( data['message'] ) ;
751                                
752                                setTimeout( function(){
753                                    window.location.href = thisUrl ;
754                                }, 1000 ) ;
755                            break ;
756                            default :
757                                toastr.error( data['message'] ) ;
758                            break ;
759                        }
760                    }
761                }
762            }) ;
763
764            return false ;
765        }
766    }) ;
767
768    $('#contact-form').validate({
769        submitHandler: function( form ){
770            var thisForm = $('#contact-form') ,
771                thisData = thisForm.serialize() ;
772                
773            $.ajax({
774                type: 'POST' ,
775                url: thisUrl + 'Requests/ajax_contact.php?language='+thisLanguage ,
776                data: thisData ,
777                dataType: 'json' ,
778                success: function( data ){
779                    if( data['result'] != '' ){
780                        switch( data['result'] ){
781                            case 'success-sended' :
782                                toastr.success( data['message'] ) ;
783
784                                $('.form-empty').val( '' ) ;
785                            break ;
786                            default :
787                                toastr.error( data['message'] ) ;
788                            break ;
789                        }
790                    }
791                }
792            }) ;
793
794            return false ;
795        }
796    }) ;
797
798    $(document).on( 'click', '.button-reset', function(){
799        var thisKey = $(this) ,
800            thisParent = thisKey.parents('form:first') ,
801            thisInput = thisParent.find('.form-control') ;
802
803        thisInput.val('') ;
804
805        return false ;
806    }) ;
807
808    /** Form Start **/
809        var fbTemplate = document.getElementById('fb-template') ,
810            formContainer = document.getElementById('rendered-form') ;
811
812        var formRenderOpts = {
813            container: formContainer
814        };
815
816        $(fbTemplate).formRender(formRenderOpts) ;
817
818        $("#rendered-form").validate({
819            submitHandler: function (form) {
820                $('#ajax_loading').show();
821
822                var parent = $('#rendered-form') ,
823                    data = parent.serialize() ,
824                    thisFormID = $('#rendered-form-id').val() ,
825                    array = [] ,
826                    count = 0 ,
827                    subThis = 
828                    subThisParent = '' ,
829                    current_title = $(document).attr('title') ;
830
831                $( "#rendered-form :button" ).after( "<span id='ajax_loading' ><i class='fa fa-refresh fa-spin'></i></span>" );
832
833                setTimeout(function(){
834                    $('#rendered-form input, #rendered-form select, #rendered-form textarea, #rendered-form h1').each(function(){
835                        subThis = $(this) ;
836                        subThisParent = subThis.parents('.form-group') ;
837                        if ( (subThis.attr('type') != 'checkbox' || (subThis.attr('type') == 'checkbox' && subThis.is(':checked'))) ){
838                            if ( (subThis.attr('type') != 'radio' || (subThis.attr('type') == 'radio' && subThis.is(':checked'))) ){
839                                if ( (subThis.attr('type') == 'file') &&  (subThis.val() != '')){
840
841                                    array[count] = {
842                                        'title': subThisParent.find('label:first').text() ,
843                                        'name': subThis.attr('name') ,
844                                        'type': subThis.attr('type') ,
845                                        'val':  subThis[0].files[0].name ,
846                                        'text': subThis.text() ,
847                                        'check': subThis.attr('checked') ,
848                                        'required': subThis.attr('required')
849                                    } ;
850                                    count++ ;
851
852                                    var file = new FormData() ;
853                                        file.append("file", $(this)[0].files[0]) ;
854
855                                    $.ajax({
856                                        url: thisUrl + 'Requests/ajax_form.php?language='+thisLanguage ,
857                                        data: file,
858                                        processData: false,
859                                        contentType: false,
860                                        async : false,
861                                        type: 'POST',
862                                        dataType: 'json' ,
863                                        success: function(result){
864
865
866                                        }
867                                    }) ;
868                                }
869
870                                if( (subThis.attr('type') == 'radio') ){
871                                    array[count] = {
872                                        'title': subThisParent.find('label:first').text() ,
873                                        'name': subThis.attr('name') ,
874                                        'type': subThis.attr('type') ,
875                                        'val': subThis.next("label").text() ,
876                                        'text': subThis.text() ,
877                                        'check': subThis.attr('checked') ,
878                                        'required': subThis.attr('required')
879                                    } ;
880                                    count++ ;
881
882                                }
883
884                                // other then submit / file
885                                if ( (subThis.attr('type') != 'hidden') && (subThis.attr('type') != 'file') && (subThis.attr('type') != 'radio')){
886
887                                    array[count] = {
888                                        'title': subThisParent.find('label:first').text() ,
889                                        'name': subThis.attr('name') ,
890                                        'type': subThis.attr('type') ,
891                                        'val': subThis.val() ,
892                                        'text': subThis.text() ,
893                                        'check': subThis.attr('checked') ,
894                                        'required': subThis.attr('required')
895                                    } ;
896                                    count++ ;
897
898                                }
899                            }
900                        }
901                    }) ;
902
903                    $.ajax({
904                        type: 'POST',
905                        url: thisUrl + 'Requests/ajax_form.php?language='+thisLanguage ,
906                        data: { 'title' : current_title, 'post': array, 'form_id' : thisFormID },
907                        dataType: 'json' ,
908                        success: function( data ){
909                            if( data['result'] != '' ){
910                                switch( data['result'] ){
911                                    case 'success-send' :
912                                        toastr.success( data['message'] ) ;
913
914                                        // $('input, textarea').val('') ;
915                                        // $('input').prop( "checked", false ) ;
916                                    break ;
917                                    default :
918                                        toastr.error( data['message'] ) ;
919                                    break ;
920                                }
921                            }
922
923                            $('#ajax_loading').hide() ;
924                            $('#ajax_loading').remove() ;
925                        }
926                    }) ;
927                }, 1000) ;
928
929                return false ;
930            }
931        }) ;
932    /** Form End **/
933
934    $('.franchise-button').on('click', function(){
935        var thisKey = $(this) ,
936            thisForm = $(this).parents('.franchise-form') ;
937
938        thisForm.validate({
939            submitHandler: function( form ){
940                var thisData = thisForm.serialize() ;
941
942                thisKey.attr('disabled', 'disabled') ;
943
944                $.ajax({
945                    type: 'POST' ,
946                    url: thisUrl + 'Requests/ajax_franchise.php?language='+thisLanguage ,
947                    data: thisData ,
948                    dataType: 'json' ,
949                    success: function( data ){
950                        if( data['result'] != '' ){
951                            switch( data['result'] ){
952                                case 'success-submit' :
953                                    toastr.success( data['message'] ) ;
954
955                                    setTimeout( function(){
956                                        window.location.href = data['redirect'] ;
957                                    }, 1000 ) ;
958                                break ;
959                                case 'failed-login' :
960                                    toastr.error( data['message'] ) ;
961                                    
962                                    setTimeout( function(){
963                                        window.location.href = thisUrl ;
964                                    }, 1000 ) ;
965                                break ;
966                                default :
967                                    toastr.error( data['message'] ) ;
968                                break ;
969                            }
970                        
971                            thisKey.removeAttr('disabled') ;
972                        }
973                    }
974                }) ;
975                return false ;
976            }
977        }) ;
978    }) ;
979
980    $(document).on( "click", "#footer-cookies-click", function(){
981        $("#footer-cookies").hide() ;
982
983        return false ;
984    }) ;
985
986}) ;
987
988function ajaxResult( type, data ){
989    switch( type ){
990        case 'success' :
991            if( data['title'] != '' && data['message'] != '' ){
992                toastr.success( data['message'], data['title'] ) ;
993            }else if( data['title'] != '' ){
994                toastr.success( '', data['title'] ) ;
995            }else{
996                if( data['message'] != '' ){
997                    toastr.success( data['message'] ) ;
998                }
999            }
1000        break ;
1001        case 'error' :
1002            if( data['title'] != '' && data['message'] != '' ){
1003                toastr.error( data['message'], data['title'] ) ;
1004            }else if( data['title'] != '' ){
1005                toastr.error( '', data['title'] ) ;
1006            }else{
1007                if( data['message'] != '' ){
1008                    toastr.error( data['message'] ) ;
1009                }
1010            }
1011        break ;
1012    }
1013}
1014
1015function copyText(){
1016    var copyText = document.getElementById( 'copy_introcode' ) ;
1017
1018    copyText.select() ;
1019    copyText.setSelectionRange( 0, 99999 ) ;
1020
1021    document.execCommand( 'copy' ) ;
1022}
1023
1024function goBack(e){
1025    history.go(-1) ;
1026    e.preventDefault() ;
1027}
1028
1029function lockScroll(type){
1030    if ( type == 'lock' ){
1031        // lock scroll position, but retain settings for later
1032        var scrollPosition = [
1033            self.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
1034            self.pageYOffset || document.documentElement.scrollTop  || document.body.scrollTop
1035        ];
1036        var html = jQuery('html') ; // it would make more sense to apply this to body, but IE7 won't have that
1037        html.data('scroll-position', scrollPosition) ;
1038        html.data('previous-overflow', html.css('overflow')) ;
1039        html.css('overflow', 'hidden') ;
1040        window.scrollTo(scrollPosition[0], scrollPosition[1]) ;
1041    }else{
1042        // un-lock scroll position
1043        var html = jQuery("html") ;
1044        var scrollPosition = html.data("scroll-position") ;
1045        html.css("overflow", html.data("previous-overflow")) ;
1046        window.scrollTo(scrollPosition[0], scrollPosition[1]) ;
1047    }
1048}

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.