PageSourceSearch

https://reva4ever.com/js/scripts.js

js reva4ever.com collected 2026-10-08 07:09:08 UTC 13,207 bytes, 446 lines download raw bytes

1var isMobile  = true,
2    isApple   = true,
3    animateIt = true,
4    blogCols  = 2,
5    gViewMode = 'grid', // 'grid' or 'list'
6    gNewDays  = 21;
7
8var words = {
9    menuOpen:   'Меню',
10    menuClose:  'Закрыть',
11    plusIcon:   'Увеличить',
12    minusIcon:  'Уменьшить',
13    allPhotos:  'Все',
14    upButton:   'Вверх!',
15    removeGood: 'Удалить',
16    toCompare:  'Сравнить'
17};  
18
19if (navigator.userAgent.match(/Android/i) ||
20    navigator.userAgent.match(/webOS/i) ||
21    navigator.userAgent.match(/iPhone/i) ||
22    navigator.userAgent.match(/iPad/i)||
23    navigator.userAgent.match(/iPod/i) ||
24    navigator.userAgent.match(/IEMobile/i) ||
25    navigator.userAgent.match(/BlackBerry/i)) {
26    isMobile = true;
27};
28
29if (navigator.userAgent.match(/iPhone/i) ||
30    navigator.userAgent.match(/iPad/i)||
31    navigator.userAgent.match(/iPod/i)) {
32    isApple = true;
33};
34
35
36window.onload = function () {
37
38    // preloader
39    $('#loader').fadeOut(500);
40    
41};
42
43
44
45// css3 animation
46
47if (isMobile == true) {
48    $('.animated').removeClass('animated');
49};
50if (isMobile == false && animateIt == true) {
51    $('*[data-animated]').addClass('animated');
52};
53function animated_contents() {
54    $(".animated:appeared").each(function (i) {
55        var $this    = $(this),
56            animated = $(this).data('animated');
57        setTimeout(function () {
58            $this.addClass(animated);
59        }, 100 * i);
60    });
61};
62if (isMobile == false && animateIt == true) {
63    animated_contents();
64    $(window).scroll(function () {
65        animated_contents();
66    });
67};
68
69
70// header
71$(function() {
72    $('.header-content').width( $('.logo').width() );
73});
74
75
76// up! button
77$(function() {
78    $('<span id="go-top" class="fa fa-angle-up" title="'+words['upButton']+'"></span>').appendTo('body');
79    $('#go-top').css({
80                'opacity'    : '0',
81                'visibility' : 'hidden'
82            });
83    $(window).scroll(function() {
84        if ($(this).scrollTop() > 500) {
85            $('#go-top').css({
86                'opacity'    : '1',
87                'visibility' : 'visible'
88            });
89        } else {
90            $('#go-top').css({
91                'opacity'    : '0',
92                'visibility' : 'hidden'
93            });
94        }
95    });
96    $('#go-top').click(function() {
97        $('body,html').animate({
98            scrollTop: 0
99        }, 800);
100        return false
101    });    
102});
103
104
105
106// shopping basket
107$(function() {
108    $('#shop-basket').on({
109        click: function() {
110            $(this).addClass('opened');
111        },
112        mouseleave: function() {
113            $(this).removeClass('opened');
114        }
115    });
116});
117
118
119// search form
120$(function() {
121    $('#search-input').width( $('#header > .cnt').width() -125 );
122});
123$(window).resize(function() {
124    $('#search-input').width( $('#header > .cnt').width() -125 );
125});
126$('#search-show').click(function(){
127    $('#search-form').fadeIn(300);
128});
129$('#search-close').click(function(){
130    $('#search-form').fadeOut(300);
131});
132
133
134
135
136// slider
137$(function() {
138    $("#slider").aSlider({
139        prevBtn: '.slide-arrow.fa-angle-left',
140        nextBtn: '.slide-arrow.fa-angle-right',
141        fadeSpeed: 500,
142        autoPlay: true,
143        autoPlayDelay: 6000
144    });
145});
146
147
148// carousel
149$(function() {
150    $(".gcarousel .goods-list").each(function() {
151        var carousel = $(this),
152            prev = $(this).parent().parent().parent().find('.gcarouselarrow.fa-angle-left'),
153            next = $(this).parent().parent().parent().find('.gcarouselarrow.fa-angle-right');
154        $(this).owlCarousel({
155            items: 4,
156            itemsDesktop: [1199, 4],
157            itemsDesktopSmall: [1268, 3],
158            itemsTablet: [991, 2],
159            itemsTabletSmall: [780, 2],
160            itemsMobile: [567, 1]
161        });
162        prev.click(function() {
163            carousel.trigger('owl.prev');
164        });
165        next.click(function() {
166            carousel.trigger('owl.next');
167        });
168    });
169});
170
171
172// menu
173$(function() {
174    $('#menu .uMenuRoot > li.uWithSubmenu > a').append('<i class="fa fa-angle-down"></i>');
175    $('#menu .uMenuRoot > li > ul li.uWithSubmenu > a').append('<i class="fa fa-angle-right"></i>');
176    $('.menu-icon').html('<i class="fa fa-bars"></i> '+words['menuOpen']);
177    $('.menu-icon').click(function() {
178        $(this).toggleClass('mobile-menu-opened');
179        if ($(this).hasClass('mobile-menu-opened')) {
180            $(this).html('<i class="fa fa-close"></i> '+words['menuClose']);
181        } else {
182            $(this).html('<i class="fa fa-bars"></i> '+words['menuOpen']);
183        }
184        $('#menu').toggle(200);
185    });
186    $('li.uWithSubmenu:after').click(function(){
187        $(this).parent().find('ul').toggle(300);
188    });
189    $('li.uWithSubmenu').append('<b class="fa fa-angle-down"></b>');
190    $('li.uWithSubmenu > b.fa').click(function(){
191        $(this).toggleClass('fa-angle-down fa-angle-up').parent().find('ul').first().toggle(300);
192    });
193});
194
195
196// counts
197$(function() {
198    $(document.body).on('appear', '.count-val', function(e, $affected) {
199        var c = $(this).data('count');
200        if ( $(this).is(':appeared') && !$(this).hasClass('starting') ) {
201            $(this).addClass('starting');
202            $(this).countTo({
203                from: 0,
204                to: c
205            });
206        }
207    });
208    $('.count-val').appear({force_process: true});
209});
210
211
212
213// timer
214$(function() {
215    var dateArr = [2016, 3, 23],  // задаем дату в формате [год, месяц, число], до которой будет вестись отсчет
216        endDate = new Date(dateArr[0], dateArr[1] - 1, dateArr[2]);
217    $('.uc-timer').countdown({until: endDate, format: 'DHMS'});
218});
219
220
221
222
223// tabs
224$(function() {
225    $('.tabs').aTabs();
226    $('.gp_tabs').aTabs();
227});
228
229
230
231// categories
232$(function() {
233    $(".block .catsTd .catNumData").each(function(){
234        var cat_num_data = $(this).text().replace(/[^0-9]/g, "");
235        $(this).text(cat_num_data);
236    });
237});
238
239
240
241// quote
242$(function() {
243    $('.bbQuoteName, .quoteMessage').removeAttr('style');
244});
245
246
247// reviews
248$(function(){
249    $('.reviews-tabs').aTabs();
250});
251
252
253
254// new goods
255$(function(){
256    if (typeof _ucoz_date != 'undefined') { c_date = new Date(_ucoz_date.replace(/(\d+).(\d+).(\d+)/, '$3/$2/$1')); }
257    $('.g-new').each(function() {
258        g_date = new Date($(this).data('date').replace(/(\d+).(\d+).(\d+)/, '$3/$2/$1'));
259        n_date = Math.floor((c_date - g_date) / (1000 * 60 * 60 * 24));
260        if (n_date <= gNewDays) {
261            $(this).css('display', 'inline-block');
262        };
263    });
264});
265
266
267// plus minus
268$(function(){
269    $('.gp-buttons input[type="text"]').before('<span class="gp-minus" title="'+words['minu
269sIcon']+'">-</span>');
270    $('.gp-buttons input[type="text"]').after('<span class="gp-plus" title="'+words['plusIcon']+'">+</span>');
271    $('.gp-buttons .gp-plus').click(function() {
272        var inputVal = +$('.gp-buttons input[type="text"]').val();
273        $('.gp-buttons input[type="text"]').val(inputVal+1)
274    });
275    $('.gp-buttons .gp-minus').click(function() {
276        var inputVal = +$('.gp-buttons input[type="text"]').val();
277        if ( inputVal > 1 ) {
278            $('.gp-buttons input[type="text"]').val(inputVal-1)
279        }
280    });    
281});
282
283
284// checkout page
285$(function(){
286  if (_ucoz_pageId == 'checkout') {
287    $('.order-item-cnt input[type="text"]').before('<span class="o-minus" title="'+words['minusIcon']+'">-</span>');
288    $('.order-item-cnt input[type="text"]').after('<span class="o-plus" title="'+words['plusIcon']+'">+</span>');
289    $('.order-item-cnt .o-plus').click(function() {
290	var field = $(this).parent().find('input[type="text"]');
291	var inputVal = +field.val();
292	field.val(inputVal+1);
293    });
294    $('.order-item-cnt .o-minus').click(function() {
295	var field = $(this).parent().find('input[type="text"]');
296	var inputVal = +field.val();
297	if ( inputVal > 1 ) {
298	    field.val(inputVal-1)
299		}
300    });		
301    $('.order-item-del').append('<i class="fa fa-trash-o" title="'+words['removeGood']+'"></i>');
302    $('.order-item-del .fa').click(function(){        
303	$(this).parent().find('input[type="checkbox"]').prop('checked', true);
304	if(_shopLockButtons()) return false;
305	_shopFadeControl('order-table');
306	_uPostForm('order-form');
307    });		
308    $('#order-table').after('<div id="order-total-line">'+$('#order-table tbody tr:last-child').html()+'</div>');
309    $('#order-table tbody tr:last-child').html('');		
310    $('.payment-item').each(function() {
311	if ($(this).prop("checked") == true) {
312	    $(this).parent().parent().find('.pl-text').fadeIn(300);
313	}
314    });
315    $('.payment-item').click(function() {
316	$('.pl-text').fadeOut(0);
317	$(this).parent().parent().find('.pl-text').fadeIn(300);
318    });		
319    $('.delivery-item').each(function() {
320	if ($(this).prop("checked") == true) {
321	    $(this).parent().parent().find('div[id^=delivery-descr]').fadeIn(300);
322	}
323    });
324    $('.delivery-item').click(function() {
325	$('div[id^=delivery-descr]').fadeOut(0);
326	$(this).parent().parent().find('div[id^=delivery-descr]').fadeIn(300);
327    });
328  };
329});
330
331
332// blog posts
333$(function() {
334    $('#allEntries .post').parent().addClass('post-wrap').parent().addClass('oh');
335    if (blogCols == 1) {
336        $('.post-wrap').css('margin-bottom', '30px');
337    };
338    if (blogCols == 2) {
339        $('.post-wrap').addClass('col2');
340    };
341    if (_ucoz_moduleId == 'blog' && _ucoz_pageId == 'entry') {
342        $('.post-tags noindex').html($('.post-tags noindex').html().replace(/\,/g, ''));
343    };
344});
345
346
347// photos
348$(function() {
349    $('.photo').parent().removeAttr('id').removeAttr('class').removeAttr('style').parent().removeAttr('id').removeAttr('class').removeAttr('style').addClass('photo-wrap col3').parent().removeAttr('id').removeAttr('class').removeAttr('style').addClass('photo-list');
350    $('<tr><td class="catsTd"><a href="/photo" class="catName catAll">'+words['allPhotos']+'</a></td></tr>').prependTo('.ph-cats .catsTable');
351    if ( _ucoz_uriId == 'phMain' ) {
352        $('.catAll').addClass('catNameActive');
353    }
354});
355
356
357
358// others
359$(function() {
360 $('.compare-widget-wrapper').attr('title', words['toCompare']);
361});
362
363
364
365// goods view mode
366$(function(){
367    switch (getCookie('itemViewMode')) {
368        case 'grid':
369            $('.goods-view-mode-grid').addClass('goods-view-mode-active');
370            $('#content #goods-cont').removeClass('list-item-view-mode-list');
371        break
372        case 'list':
373            $('.goods-view-mode-list').addClass('goods-view-mode-active');
374            $('#content #goods-cont').addClass('list-item-view-mode-list');
375        break
376        case undefined:
377            setCookie('itemViewMode', gViewMode);
378            switch (getCookie('itemViewMode')) {
379                case 'grid':
380                    $('.goods-view-mode-grid').addClass('goods-view-mode-active');
381                    $('#content #goods-cont').removeClass('list-item-view-mode-list');
382                break
383                case 'list':
384                    $('.goods-view-mode-list').addClass('goods-view-mode-active');
385                    $('#content #goods-cont').addClass('list-item-view-mode-list');
386                break
387                default:
388                alert('ERROR!\ninvalid gViewMode: "'+gViewMode+'"');
389            };
390        break
391        default:
392            alert('ERROR!\ninvalid gViewMode: "'+gViewMode+'"');
393    };
394
395    $('.goods-view-mode > span').click(function() {
396        if ( $(this).hasClass('goods-view-mode-active') ) {
397            return false;
398        }   else {
399            $('.goods-view-mode > span').removeClass('goods-view-mode-active');
400            $(this).addClass('goods-view-mode-active');
401            if ( $(this).hasClass('goods-view-mode-grid') ) {
402                setCookie('itemViewMode', 'grid');
403                $('#content #goods-cont').removeClass('list-item-view-mode-list');
404            } else if ( $(this).hasClass('goods-view-mode-list') ) {
405                setCookie('itemViewMode', 'list');
406                $('#content #goods-cont').addClass('list-item-view-mode-list');
407            }
408        }
409    });
410});
411
412
413// cookies
414function setCookie(name, value, options) {
415    options = options || {};
416    var expires = options.expires;
417    if (typeof expires == "number" && expires) {
418        var d = new Date();
419        d.setTime(d.getTime() + expires * 1000);
420        expires = options.expires = d;
421    }
422    if (expires && expires.toUTCString) {
423        options.expires = expires.toUTCString();
424    }
425    value = encodeURIComponent(value);
426    var updatedCookie = name + "=" + value;
427    for (var propName in options) {
428        updatedCookie += "; " + propName;
429        var propValue = options[propName];
430        if (propValue !== true) {
431            updatedCookie += "=" + propValue;
432        }
433    }
434    document.cookie = updatedCookie;
435};
436function getCookie(name) {
437    var matches = document.cookie.match(new RegExp(
438        "(?:^|; )" + name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g, '\\$1') + "=([^;]*)"
439    ));
440    return matches ? decodeURIComponent(matches[1]) : undefined;
441};
442function deleteCookie(name) {
443    setCookie(name, "", {
444        expires: -1
445    });
446};

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.