PageSourceSearch

https://fatpipehosting.com/wp-content/themes/ordomain/js/main.js?ver=1.0

js fatpipehosting.com collected 2026-10-09 22:11:21 UTC 15,295 bytes, 383 lines download raw bytes

1/*
2
3[Main Script]
4
5Project: OrDomain - Responsive WHMCS Hosting WordPress Theme
6Version: 1.6
7Author : themelooks.com
8
9*/
10
11(function ($) {
12    "use strict";
13    
14    $(function () {
15        /* -------------------------------------------------------------------------*
16         * NAVIGATION AREA
17         * -------------------------------------------------------------------------*/
18        var navigation = $('#navigation')
19        ,   wn = $(window)
20        ,   navTotalH = navigation.find('.contact-bar').outerHeight() + navigation.find('.navbar').outerHeight()
21        ,   navigationSticky = function () {
22                return (wn.scrollTop() > 1) ? navigation.addClass('sticky') : navigation.removeClass('sticky');
23            };
24            
25        navigationSticky();
26        
27        navigation.find('.navbar').css('top', navigation.find('.contact-bar').outerHeight());
28        
29        navigation.next('.AdjustHeight').css('padding-top', navTotalH);
30
31        /* ------------------------------------------------------------------------- *
32         * BACKGROUND IMAGE
33         * ------------------------------------------------------------------------- */
34        var dataBgImg = $('[data-bg-img]');
35        
36        dataBgImg.each(function () {
37            $(this).css('background-image', 'url('+ $(this).data('bg-img') +')').removeAttr('data-bg-img').addClass('bg-img');
38        });
39        
40        /* ------------------------------------------------------------------------- *
41         * BACKGROUND VIDEO
42         * ------------------------------------------------------------------------- */
43        var $bgVideoEl = $('[data-bg-video]');
44        
45        if ( $bgVideoEl.length ) {
46            $bgVideoEl.tubular({videoId: $bgVideoEl.data('bg-video'), wrapperZIndex: '-1'});
47        }
48
49        /* ------------------------------------------------------------------------- *
50         * PAGE HEADER SLIDER HEIGHT
51         * ------------------------------------------------------------------------- */
52        var pageHsliderEl = $('#pageHslider');
53        
54        if ( wn.width() > 767 ) {
55            pageHsliderEl.css('height', wn.outerHeight());
56        }
57
58        /* ------------------------------------------------------------------------- *
59         * OWL CAROUSEL
60         * ------------------------------------------------------------------------- */
61        var pageHslider = $('.pageHslider-slider'),
62            $speed = $('#slidevtwo').data('slid-speed'),
63            $loop  = $('#slidevtwo').data('slid-loop');
64            
65        if ( pageHslider.length ) {
66            pageHslider.owlCarousel({
67                items: 1,
68                autoplay: true,
69				loop: $loop,
70                autoplaySpeed: $speed
71            });
72        }
73        
74        var clientsSlider = $('.clients-slider')
75        ,   feedbackSlider = $('.feedback-slider');
76        
77        if ( clientsSlider.length ) {
78            clientsSlider.owlCarousel({
79                items: 1,
80                autoplay: true,
81                loop: true,
82                dots: false,
83                onChanged: function (e) {
84                    var tIndx = $(e.target).find('.owl-item').eq(e.item.index).children('.item').data('id'), tIndx = tIndx - 1;
85                    
86                    feedbackSlider.trigger('to.owl.carousel', [tIndx, 500, true]);
87                }
88            }).on('click', '.owl-item', function (e) {
89                var tIndx = $(e.currentTarget).children('.item').data('id') - 1;
90                
91                clientsSlider.trigger('to.owl.carousel', [tIndx, 500, true]);
92            });
93        }
94        
95
96        if ( feedbackSlider.length ) {
97            feedbackSlider.owlCarousel({
98                items: 1,
99                autoplay: false,
100                loop: true,
101                dots: false,
102                mouseDrag: false,
103                touchDrag: false
104            });
105        }
106        
107        var extensionSlider = $('.extension-slider');
108        
109        if ( extensionSlider.length ) {
110            var extensionSliderItems = extensionSlider.data('items');
111            
112            extensionSlider.owlCarousel({
113                items: extensionSliderItems,
114                loop: true,
115                autoplay: true,
116                dots: false,
117                responsive:{
118                    0:{
119                        items: 1
120                    },
121                    480:{
122                        items: 3
123                    },
124                    768:{
125                        items: 4
126                    },
127                    992:{
128                        items: extensionSliderItems
129                    }
130                }
131            });
132        }
133        
134        /* -------------------------------------------------------------------------*
135         * VERTICAL SLIDER
136         * -------------------------------------------------------------------------*/
137        var serviceSlider = $('.service-slider')
138        ,
139            $OptionData = $('#slideData').data('slid-options')
140        ,   serviceSliderMode = function () {
141            return ( wn.width() < 991 ) ? 'horizontal' : 'vertical';
142        };
143            
144        if ( serviceSlider.length ) {
145            serviceSlider.bxSlider({
146                mode: serviceSliderMode(),
147                speed: $OptionData.speed,
148                infiniteLoop: $OptionData.loop,
149                controls: false,
150                auto: true,
151                pause: $OptionData.pause
152            });
153            
154            wn.on('resize', function () {
155                serviceSlider.reloadSlider();
156            });
157            
158            
159        }
160
161        /* ------------------------------------------------------------------------- *
162         * BACK TO TOP BUTTON
163         * ------------------------------------------------------------------------- */
164        var backToTop = $('.back-to-top')
165        ,   backToTopBtn = $('.back-to-top button')
166        ,   backToTopShow = function () {
167                return ( wn.scrollTop() > 1 ) ? backToTop.addClass('show') : backToTop.removeClass('show');
168            };
169        
170        backToTopBtn.on('click', function() {
171            $("html, body").animate({scrollTop: 0}, 500);
172        });
173        
174        /* -------------------------------------------------------------------------*
175         * ON SCROLL
176         * -------------------------------------------------------------------------*/
177        wn.on('scroll', function () {
178            /* NAVIGATION AREA BG */
179            navigationSticky();
180            
181            /* BACK TO TOP */
182            backToTopShow();
183        });
184        
185        /* -------------------------------------------------------------------------*
186         * TEXTAREA
187         * -------------------------------------------------------------------------*/
188        var bulkdomains = $('#bulkdomains')
189        ,   bulkdomainsPlaceholder = 'Enter up to 20 domain names.\nEach name must be on a separate line.\n\nExamples:\nexample.com\nexample.net';
190        
191        bulkdomains.attr('placeholder', bulkdomainsPlaceholder);
192        
193        /* -------------------------------------------------------------------------*
194         * COUNTER
195         * -------------------------------------------------------------------------*/
196        var counterNum = $('.counter-number');
197            
198        if ( counterNum.length ) {
199            counterNum.counterUp({
200                delay: 10,
201                time: 1000
202            });
203        }
204        
205        /* -------------------------------------------------------------------------*
206         * RESPONSIVE PRICING DETAILS
207         * -------------------------------------------------------------------------*/
208        if ( wn.width() < 992 ) {
209            $('.pricing-details-item.body li').each(function () {
210                var $this = $(this)
211                ,   $thisIndx = $this.index()
212                ,   $text = $this.parents('.pricing-details-item').siblings('.pricing-details-item.head').find('li').eq($thisIndx).text();
213
214                $this.prepend('<span class="labelText">'+ $text +'</span>');
215            });
216        }
217        
218        /* -------------------------------------------------------------------------*
219         * MAP
220         * -------------------------------------------------------------------------*/
221        var $map1 = $("#map1"),
222            $map2 = $("#map2"),
223            initMap = function ($el) {
224                var latlng, map, marker;
225                
226                $.ajax({
227                    type: 'POST',
228                    url: ajaxmap.ajaxurl,
229                    data: {
230                        action: 'map_ajax',
231                        vpscontent: ajaxmap.mapcontent
232                    },
233                    dataType: 'json',
234                    success: function (res) {
235                        latlng = {
236                            lat: parseFloat(res[0].lat),
237                            lng: parseFloat(res[0].lng)
238                        };
239                        
240                        map = new google.maps.Map(document.getElementById( $el.attr('id') ), {
241                            center: latlng,
242                            zoom: parseFloat(res[0].zoom),
243                            scrollwheel: false,
244                            disableDefaultUI: true
245                        });
246                        
247                        marker = new google.maps.Marker({
248                            position: latlng,
249                            map: map
250                        });
251                        
252                        if( $el.attr('id') === 'map2' ) {
253                            map.setOptions({
254                                zoom: 5,
255                                styles: [{featureType:"all",stylers:[{saturation:-80}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{hue:"#00ffee"},{saturation:50}]},{featureType:"poi.business",elementType:"labels",stylers:[{visibility:"off"}]}]
256                            });
257                        
258                            marker.setMap(null);
259                            
260                            for (var i = 0; i < res[1].locs.length; i++) {
261                                marker = new google.maps.Marker({
262                                    position: new google.maps.LatLng(res[1].locs[i].title, res[1].locs[i].progress),
263                                    map: map
264                                });
265                            }
266                        }
267                    }
268                });
269            };
270        
271        if ( $map1.length ) {
272            initMap( $map1 );
273        } else if ( $map2.length ) {
274            initMap( $map2 );
275        }
276        
277        /* -------------------------------------------------------------------------*
278         * ACCORDION
279         * -------------------------------------------------------------------------*/
280        $('.panel-heading a').on('click', function(e){
281            if($(this).parents('.panel').children('.panel-collapse').hasClass('in')) {
282                e.stopPropagation();
283                e.preventDefault();
284            }
285        });
286        
287        /* -------------------------------------------------------------------------*
288         * DOMAIN PRICING AREA
289         * -------------------------------------------------------------------------*/
290        if ( wn.width() < 992 ) {
291            $('#dedicatedPricing table td, #domainPricing table td').each(function () {
292                $(this).prepend('<span class="labelText">'+ $(this).data('label') + '</span>');
293            });
294        }
295        
296        /* -------------------------------------------------------------------------*
297         * VPS SLIDER
298         * -------------------------------------------------------------------------*/
299        var $vpsPricing = $('#vpsPricing'),
300            $vpsSlider = $('#vpsSlider').length ? $('#vpsSlider') : $('#vpsSlider2');
301
302        if ( $vpsSlider.length ) {
303            var $featureItemValue = $vpsPricing.find('.vps-item-feature-value'),
304                $vpsTotalPriceChild = $vpsPricing.find('.vps-total-price span'),
305                $vpsOrderLink = $vpsPricing.find('a.order-link');
306
307            var changingVpsPlans = function ( res, indx ) {
308                for ( var i = 0; i < res[ indx ][0].length; i++ ) {
309                    $featureItemValue.eq(i).text( res[ indx ][0][i] );
310                }
311
312                $vpsTotalPriceChild.text(res[ indx ][2]);
313                $vpsOrderLink.attr('href', res[ indx ][1]);
314            };
315
316            
317            
318            var vpsSliderInit = function (res) {
319                $vpsSlider.slider({
320                    animate: "fast",
321                    range: "min",
322                    min: 0,
323                    max: (res.length - 1),
324                    value: 0,
325                    step: 1,
326                    create: function( event ) {
327                        changingVpsPlans( res, '0' );
328
329                        $vpsSlider.find('.ui-slider-handle').append('<i class="fa fa-map-marker"></i>');
330                    },
331                    slide: function( event, ui ) {
332                        changingVpsPlans( res, ui.value );
333                    }
334                });
335            };
336
337            $.ajax({
338                type: 'POST',
339                url: ajaxvps.ajaxurl,
340                data: {
341                    action: 'vpspricing_ajax',
342                    vpscontent: ajaxvps.vpscontent
343                },
344                dataType: 'json',
345                success: function (res) {
346                    vpsSliderInit(res);
347                }
348            });
349        }
350        
351        /* ------------------------------------------------------------------------- *
352         * Mail Chimp ajax
353         * ------------------------------------------------------------------------- */
354        var $subscribeForm = $('#subscribeForm');
355        
356        $subscribeForm.on('submit', function () {
357            var $t = $(this),
358                email = $t.children('#subscribe_email').val(),
359                ajax_url = $t.children('#admin-url').data('url');
360            
361            $.ajax({
362                type: 'POST',
363                url: ajax_url,
364                data: {
365                    subscribe_email: email,
366                    action: 'ordomain_subscribe_ajax'
367                },
368                success: function( data ){
369                    $t.siblings('#alert-message').html( data );
370                }
371            });
372            
373            return false;
374        });
375    });
376    
377    $(window).on('load', function () {
378        /* ------------------------------------------------------------------------- *
379         * PRELOADER
380         * ------------------------------------------------------------------------- */
381        $('#preloader').fadeOut('slow');
382    });
383})(jQuery);

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.