PageSourceSearch

https://belenergomash.com/Main/js/main.ui.js

js belenergomash.com collected 2026-10-07 18:03:07 UTC 6,892 bytes, 217 lines download raw bytes

1/**
2 * Общий модуль интерфейсов
3 * @author Гончаров Станислав <[email protected]>
4 */
5
6function __MainUI(){
7    return Form('MainUI').extend({
8
9        // Рекаптча
10        recaptcha: {
11
12            // Список элементов
13            captches: {},
14
15            // Инициализация
16            init: function(){
17
18                var __self = this;
19
20                var keys = {};
21                $('.wdcl-recaptcha').each(function(){
22
23                    var __elenentID = $(this).attr('id');
24                    keys[__elenentID] = $(this).data('sitekey');
25
26                });
27
28                for(var id in keys){
29                    __self.captches[id] = grecaptcha.render(id, {
30                        sitekey: keys[id]
31                    });
32                }
33
34            },
35
36            /**
37             * Сброс рекапчи
38             * @param {Object} field
39             */
40            reset: function(field){
41
42                if (this.captches[field.attr('id')] === undefined){
43                    return;
44                }
45
46                grecaptcha.reset(this.captches[field.attr('id')]);
47
48            }
49
50        },
51
52        /**
53         * Инициализация слайдера
54         */
55        initSlider : function(){
56            
57            $('#mainSlider').flexslider({
58                namespace: "flex-",             
59                selector: ".slides > li",       
60                animation: "slide",             
61                easing: "swing",               
62                direction: "horizontal",        
63                reverse: false,                 
64                animationLoop: true,            
65                smoothHeight: false,            
66                startAt: 0,                     
67                slideshow: true,                
68                slideshowSpeed: 5000,           
69                animationSpeed: 600,            
70                initDelay: 0,                   
71                randomize: false,               
72
73                // Usability features
74                pauseOnAction: true,            
75                pauseOnHover: true,            
76                useCSS: true,                  
77                touch: true,                    
78                video: false,                   
79
80                // Primary Controls
81                controlNav: true,               
82                directionNav: true,             
83                prevText: "",           
84                nextText: "",               
85
86                // Secondary Navigation
87                keyboard: true,                 
88                multipleKeyboard: false,        
89                mousewheel: false,              
90                pausePlay: false,              
91                pauseText: 'Pause',             
92                playText: 'Play',              
93
94                // Special properties
95                controlsContainer: "",          
96                manualControls: "",             
97                sync: "",                       
98                asNavFor: "",                   
99
100                // Carousel Options
101                itemWidth: 0,                   
102                itemMargin: 0,                  
103                minItems: 0,                    
104                maxItems: 0,                    
105                move: 0,                        
106
107                start: function(){
108                    $('.flex-active-slide .container .carousel-caption').addClass('show');
109                },        
110                before: function(){
111                    $('.flex-active-slide .container .carousel-caption').removeClass('show');
112                },
113                after: function(slider){
114                    $('.flex-active-slide .container .carousel-caption').addClass('show');
115                }       
116
117            });
118
119
120        },
121
122        /**
123         * Инициализация карты
124         */
125        initMap : function(params){
126
127            $('#map').yandexMap({
128                zoom: 16,
129                center: params.coord,
130                init: function(sender){
131                    sender.placemark({
132                        caption: params.title,
133                        content: params.address,
134                        point: {
135                            lat: params.coord[0],
136                            lng: params.coord[1]
137                        },
138                        center: true
139                    });
140                }
141            });
142        },
143        
144        /**
145         * Инициализация просмотра сайта
146         */
147        initViewer : function(){
148            $('#imageViewer').imagegallery();
149        },
150                
151        /**
152         * Инициализация карусели
153         */
154        initJcarausel : function(sliderName){
155            $('#'+sliderName).jcarousel({wrap: 'circular' });
156            $('#'+sliderName+'Prev').jcarouselControl({target: '-=1'});
157            $('#'+sliderName+'Next').jcarouselControl({target: '+=1'});
158        },
159        
160        /**
161         * Инициализация скрола
162         */
163        initScroll : function(){
164            
165            $('.b-nav-scroll').on('click', function(){
166                
167                $('.b-nav-scroll').addClass('m-scroll-lock');
168                
169                $('html,body').animate({'scrollTop':0},'slow', function(){
170                    $('.b-nav-scroll').removeClass('m-scroll-lock');
171                });
172                $(this).css({'right' : '-45px'});
173            });
174                  
175            $(document).on('scroll', function(event){
176                
177                if (!$('.b-nav-scroll').hasClass('m-scroll-lock')){
178                    if ($(this).scrollTop() >= 30){
179                        $('.b-nav-scroll').css({'right' : '10px'});
180                    }else{
181                        $('.b-nav-scroll').css({'right' : '-45px'});
182                    }
183                }
184                
185                if ($(this).scrollTop() >= 100){
186                    $('#toppanelInfo').hide();
187                    $('#toppanelNav').addClass('m-fixed');
188                    $('#toppanelNavPhone').show().css('opacity', 1);
189                }else{
190                    $('#toppanelNav').removeClass('m-fixed');
191                    $('#toppanelInfo').show();
192                    $('#toppanelNavPhone').hide().css('opacity', 0);
193                }
194            });
195        }      
196    });
197}
198
199var MainUI = new __MainUI();
200
201$(document).ready(function(){
202    
203    // Инит вьювера
204    if ($('#imageViewer').length){
205        MainUI.initViewer();
206    }
207    
208    // Инициализауия скрола
209    MainUI.initScroll();
210    
211});
212
213
214// Инициализация антибота
215var RecaptchaInit = function(){
216    MainUI.recaptcha.init();
217};

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.