PageSourceSearch

https://www.harddrivebenchmark.net/source/js/script.js

js harddrivebenchmark.net collected 2026-10-04 00:28:22 UTC 11,027 bytes, 333 lines download raw bytes

1(function($) {
2
3
4
5})(jQuery);
6
7
8
9jQuery(document).ready(function($) {
10
11    //open block by link hash
12if( $('.what_new_page').length ){
13    if(window.location.hash) {
14        window.scrollTo(0, 0);
15        var url = window.location.href;
16        var hash = window.location.hash.replace('#', '');
17        //console.log(hash);
18        setTimeout(function(){
19
20            if ($(window).width() < 767) {
21                var top_ofset = 100;
22            } else if($(window).width() < 575) {
23                var top_ofset = 40;
24            } else{
25                var top_ofset = 150;
26            }
27
28            var x = $('#'+hash).next().show();
29            $('html,body').animate({
30              scrollTop: $('#'+hash).offset().top - top_ofset
31            }, 1700);
32
33        }, 300);
34    }
35
36    setTimeout(function(){
37
38        $.fn.isBefore= function(sel){
39          return this.nextAll(sel).length !== 0;
40        }
41
42        if ($('.hide_content').length ) {
43            //console.log('hide_content');
44            var insert_before = $('.open_content');
45            $('<div class="collapse_btn_block"><span class="expandAll">Expand all</span><span class="collapseAll">Collapse all</span></div>')
46                .insertBefore( insert_before );
47               // .insertBefore( $('.container .titles_show:first-child') );
48        }
49
50        $('.expandAll').on('click', function(){
51            $( ".hide_content" ).show();
52        });
53
54        $('.collapseAll').on('click', function(){
55            $( ".hide_content" ).hide();
56        });
57
58        if($('.collapse_btn_block').prevAll("h2").length ) {
59            //$('.collapse_btn_block').addClass('h2_before');
60            var collapse_block = $('.collapse_btn_block'); 
61            var collapse_block_prev = $('.collapse_btn_block').prev(); 
62
63            $(collapse_block_prev).prepend(collapse_block);  
64
65            //$( collapse_block_prev ).replaceWith( collapse_block );
66        }
67
68
69
70    }, 100);
71}
72
73
74    if ($(window).width() > 767) {
75
76        var pop_up = $('.ajax-popup');
77        if(pop_up.length){
78            $('head').append('<link rel="stylesheet" href="/source/css/magnific-popup.css" type="text/css">');
79            $('head').append('<script src="/source/js/jquery.magnific-popup.min.js"></script>');
80
81            pop_up.magnificPopup({
82              type: 'image',
83              mainClass: 'mfp-fade',
84            });
85        }
86
87        var url = window.location.href;
88        set_active_url(url);
89
90        var num = 0; //number of pixels before modifying styles
91        $(window).bind('scroll', function () {
92            if ($(window).scrollTop() > num) {
93                if($('body').hasClass('simpl_page')){
94                    $('main').css('padding-top', "66px");
95                }
96            }
97        });
98
99        $("a[href^='#']").on('click', function(e) {
100           // prevent default anchor click behavior
101           e.preventDefault();
102           // animate
103           $('html, body').animate({
104               scrollTop: $(this.hash).offset().top - 150
105             }, 300, function(){
106             });
107        });
108
109    }else{
110
111        $(".product a[href^='#']").on('click', function(e) {
112           // prevent default anchor click behavior
113           e.preventDefault();
114           // animate
115           $('html, body').animate({
116               scrollTop: $(this.hash).offset().top - 90
117             }, 300, function(){
118             });
119        });
120
121        //change place image after text
122        $('.change_place').each( function(){
123            var next = $(this).next();
124            $(this).before(next);
125            console.log('123');
126        });
127
128        //fixed product menu on product page
129        if($( "body" ).hasClass( "product" )){
130            var num = 49; //number of pixels before modifying styles
131            $(window).bind('scroll', function () {
132                if ($(window).scrollTop() > num) {
133                    $('#prod_menu').addClass('fixed_prod_mobile');
134                    if($(window).width() > 575){
135                        $('main').css('padding-top', "90px");
136                    }else{
137                        $('main').css('padding-top', "83px");
138                    }
139                    
140                    $('#main_menu button.navbar-toggler').addClass('fixed_button');
141                    $('#navbarSupportedContent').addClass('fixed_dropdown_menu');
142                } else {
143                    $('#prod_menu').removeClass('fixed_prod_mobile');
144                    $('main').css('padding-top', "0px");
145                    $('#main_menu button.navbar-toggler').removeClass('fixed_button');
146                    $('#navbarSupportedContent').removeClass('fixed_dropdown_menu');
147                }
148            });
149        }
150
151    }
152
153    //select product version, change price
154    $('.btn_select_version').on('click', function(){
155        var price = $(this).attr('data-product-price');
156        var desc_product = $(this).find('span').text();
157        $('#price_value').text(price);
158        $('#product_desc').text(desc_product);
159        $('.btn_select_version.active').removeClass('active');
160        $(this).addClass('active');
161
162        if ($(window).width() < 767) {
163
164            if($(this).hasClass('active')){
165                $(this).siblings('.btn_select_version').toggle();
166                
167            }
168
169            if($(this).index() != 0){
170                //console.log('hello');
171                $(this).siblings('.btn_select_version').not('.active').hide();
172            }
173
174            $(this).siblings('.btn_select_version').insertAfter($(this));
175
176        }
177
178    });
179    
180    //search field
181    $('#search_form button').click(function(){
182        var input = $(this).parent().find('input');
183        if(input.hasClass('open')){
184            if(input.val() != ''){
185                return true;
186            }else{
187                input.removeClass('open');
188                return false;      
189            }
190            
191        }else{
192            input.addClass('open');
193            return false;
194        }
195        
196    });
197
198// mobile script
199
200    if ($(window).width() < 767) {
201
202        $('.collapse').collapse({
203            toggle: false
204          })
205
206        $(".block_title_icon .title_info").siblings('.block_title_icon .title_icon').insertAfter($(".block_title_icon .title_info"));
207
208        //change places copyright block in mobile version
209        $( "#footer_copyright_block .row" ).prepend( $( "#paiment_types" ) );
210
211        $('#tabs_block .show').removeClass("show");
212
213        //top slider on mobile version
214        var mobile_slider_nav = $('#mobile_slider_nav');
215        var gallery_imgs = $('.img_prew img');
216        var first_img_in_slider = $('.block_title_icon .wrapp_title_icon img');
217        var slider_nav_elements = '<div data-img-src="'+ first_img_in_slider.attr( 'src' ) +'" class="dot_nav active"></div>';
218        gallery_imgs.each(function( index ) {
219            
220            slider_nav_elements += '<div data-img-src="'+ $( this ).attr( 'src' ) +'" class="dot_nav"></div>';
221        });
222        mobile_slider_nav.prepend(slider_nav_elements);
223
224        // change image in mobile gallery
225        $('#mobile_slider_nav .dot_nav').on('click', function(){
226            
227            var url = $(this).attr( "data-img-src" );
228            var big_img = $(this).closest('.title_icon').find('.wrapp_title_icon');
229            big_img.find('img').fadeOut('slow').remove();
230            big_img.prepend("<img src="+url+" />");
231            $(this).closest('.title_icon').find('.dot_nav.active').removeClass('active');
232            $(this).addClass('active');
233            
234        }); 
235
236        $( ".block_title_icon .wrapp_title_icon" ).append("<div class='left_slide mobile_on_img_slide'></div><div class='right_slide mobile_on_img_slide'></div>");
237
238        $( ".block_title_icon .right_slide" ).on('click', function(){
239            var block_gallery = $(this).closest('.title_icon');
240            var active_url = block_gallery.find('.dot_nav.active');
241            var next_url = active_url.next();
242            if( next_url.length == 0 ) {
243               next_url = block_gallery.find('.dot_nav').first();
244            }        
245            var big_img = block_gallery.find('.wrapp_title_icon');
246    
247            big_img.find('img').fadeOut('slow').remove();
248            big_img.prepend("<img src="+next_url.attr( "data-img-src" )+" />");
249            active_url.removeClass('active');
250            next_url.addClass('active');
251
252        });
253
254        $( ".block_title_icon .left_slide" ).on('click', function(){
255            var block_gallery = $(this).closest('.title_icon');
256            var active_url = block_gallery.find('.dot_nav.active');
257            var next_url = active_url.prev();
258            if( next_url.length == 0 ) {
259               next_url = block_gallery.find('.dot_nav').last();
260            }        
261            var big_img = block_gallery.find('.wrapp_title_icon');
262    
263            big_img.find('img').fadeOut('slow').remove();
264            big_img.prepend("<img src="+next_url.attr( "data-img-src" )+" />");
265            active_url.removeClass('active');
266            next_url.addClass('active');
267
268        });
269
270        //when open tab go to top of page
271        $('#tabs_block .collapse').on('shown.bs.collapse', function(e) {
272            var $card = $(this).closest('.card');
273            $('html,body').animate({
274                scrollTop: $card.offset().top - 10
275            }, 800);
276
277        });
278        
279    }
280
281    // change image in gallery
282    $('.img_gallery .img_prew img').on('click', function(){
283        
284        var url = $(this).attr( "src" );       
285        $('.img_gallery .img_prew ul li').removeClass('active');
286
287        $(this).parent('li').addClass('active');
288        var big_img = $(this).closest('.img_gallery').find('.current_img');
289
290        big_img.find('img').fadeOut('slow').remove();
291        big_img.prepend("<img src="+url+" />");
292        
293    }); 
294
295    //collapse footer menu item on mobile
296    if ($(window).width() < 575) {
297        $("#footer_nav_block .menu_header").on('click', function(){
298            $(this).siblings(".mobile-collapse").toggle();
299        });
300    }
301
302    function set_active_url(url){
303
304        var menu_a = $('#main_menu a');
305        menu_a.each(function( index ) {
306
307            var this_item = $( this );
308
309            if(url.indexOf('_faq') >= 2 || url.indexOf('support') >= 2 ){
310                $('#support_link').addClass('active');
311                return false;
312            }
313
314            if(url.indexOf('sales') >= 2 ){
315                console.log('faq');
316                $('#sales_link').addClass('active');
317                return false;
318            }
319
320            if (url.indexOf(this_item.attr('href')) >= 10){
321
322                if(this_item.hasClass('dropdown-item')){
323                    var top_item = this_item.closest('li.nav-item.dropdown').find('a.nav-link.dropdown-toggle');
324                    top_item.addClass('active');
325                }else{
326                    
327                }
328            }
329        });
330    }
331    
332
333});    

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.