PageSourceSearch

https://welcome-suisse.ch/wp-content/themes/magic-mag/js/scripts.js

js welcome-suisse.ch collected 2026-10-09 05:14:08 UTC 5,903 bytes, 224 lines download raw bytes

1jQuery(document).ready(function() {
2
3
4    jQuery(".grid-layout").css({
5        "visibility": "visible"
6    });
7
8    setTimeout(function() {
9        loadComplete();
10    }, 3000);
11
12    var $images = jQuery('.post img'),
13        preloaded = 0,
14        total = $images.length;
15    $images.load(function() {
16        if (++preloaded === total) {
17            // Done!
18        }
19    });
20
21});
22
23// Lod
24jQuery(window).bind("load", function() {
25    loadComplete();
26    jQuery(window).resize();
27});
28
29// Load Complete
30function loadComplete() {
31    jQuery('#loading').remove();
32    jQuery('#b1d-layout').removeClass('loading');
33}
34
35/* Debounced Resize */
36(function($) {
37
38    var $event = $.event,
39        $special,
40        resizeTimeout;
41
42    $special = $event.special.debouncedresize = {
43        setup: function() {
44            $( this ).on( "resize", $special.handler );
45        },
46        teardown: function() {
47            $( this ).off( "resize", $special.handler );
48        },
49        handler: function( event, execAsap ) {
50            // Save the context
51            var context = this,
52                args = arguments,
53                dispatch = function() {
54                    // set correct event type
55                    event.type = "debouncedresize";
56                    $event.dispatch.apply( context, args );
57                };
58
59            if ( resizeTimeout ) {
60                clearTimeout( resizeTimeout );
61            }
62
63            execAsap ?
64                dispatch() :
65                resizeTimeout = setTimeout( dispatch, $special.threshold );
66        },
67        threshold: 150
68    };
69
70})(jQuery);
71
72/* Isotope Options */
73(function ($) {
74
75    //.grid-layout
76    //.isotope-item
77
78    var $container      = jQuery( '.grid-layout' ),
79        filters = {},
80        items_count     = jQuery( ".isotope-item" ).size();
81
82    isotopego = function () {
83
84        setColumnWidth();
85
86        $container.isotope({
87
88            itemSelector        : '.isotope-item',
89            hiddenClass         : 'isotope-hidden',
90            resizable           : true,
91            transformsEnabled   : true,
92            layoutMode          : 'masonry',
93            masonry             :
94            {
95                columnWidth     : columnWidth(),
96                gutterWidth     : 20
97            }
98        });
99    };
100
101
102    function getNumColumns(){
103
104        var $bdWarp = jQuery('.grid-layout').data('cols');
105
106        if( $bdWarp == '1col') {
107            var winWidth                = jQuery(".grid-layout").width();
108            var column                  = 1;
109            return column;
110        }
111
112        if( $bdWarp == '2cols') {
113            var winWidth                = jQuery(".grid-layout").width();
114            var column                  = 2;
115            if ( winWidth<380 ) column  = 1;
116            return column;
117        }
118
119        else if ( $bdWarp == '3cols' ) {
120            var winWidth                = jQuery(".grid-layout").width();
121            var column                  = 3;
122            if ( winWidth<380 ) column  = 1;
123            else if( winWidth>=380 && winWidth<788 )  column = 2;
124            else if( winWidth>=788 && winWidth<1160 )  column = 3;
125            else if( winWidth>=1160 ) column = 3;
126            return column;
127        }
128
129        else if ($bdWarp == '4cols') {
130            var winWidth                = jQuery(".grid-layout").width();
131            var column                  = 4;
132            if ( winWidth<380) column   = 1;
133            else if( winWidth>=380 && winWidth<788 )  column = 2;
134            else if( winWidth>=788 && winWidth<1160 )  column = 3;
135            else if( winWidth>=1160 ) column = 4;
136            return column;
137        }
138
139    }
140
141    function setColumnWidth(){
142
143        var columns         = getNumColumns();
144        var containerWidth  = jQuery(".grid-layout").width();
145        var postWidth       = containerWidth/columns;
146
147        postWidth = Math.floor(postWidth)-22;
148
149        jQuery(".isotope-item").each(function(index){
150            jQuery(this).css({"width":postWidth+"px"});
151        });
152    }
153
154    function columnWidth() {
155
156        var columns             = getNumColumns();
157        var containerWidth      = jQuery(".grid-layout").width();
158        var postWidth           = containerWidth/columns;
159
160        postWidth = Math.floor(postWidth);
161        return postWidth;
162    }
163
164    function arrange(){
165        jQuery(window).resize();
166        isotopego();
167        setColumnWidth();
168        //$container.isotope('reLayout');
169    }
170
171    jQuery(window).on("debouncedresize", function() {
172        arrange();
173    });
174    isotopego();
175
176    jQuery(window).load(function () {
177
178        //$container.isotope('reLayout');
179        var delay = 0;
180
181        jQuery('.isotope-item').each(function () {
182            jQuery(this).find('.posts-loading').delay(delay).animate({
183                width: 0 + '%'
184            }, {
185                duration: 0,
186                specialEasing: {
187                    width: "linear",
188                    height: "easeOutBounce"
189                }
190            });
191            delay += 400;
192        });
193        jQuery(window).resize();
194    });
195
196    // Filter projects
197    jQuery('.filter a').click(function(){
198
199        var $this = jQuery(this).parent('span');
200        // don't proceed if already active
201        if ( $this.hasClass('active') ) {
202            return;
203        }
204
205        var $optionSet = $this.parents('.filter');
206        // change active class
207        $optionSet.find('.active').removeClass('active');
208        $this.addClass('active');
209
210        var selector = jQuery(this).attr('data-filter');
211        $container.isotope({ filter: selector });
212
213        var hiddenItems = 0,
214            showenItems = 0;
215
216        jQuery(".isotope-item").each(function(){
217            if ( jQuery(this).hasClass('isotope-hidden') ) {
218                hiddenItems++;
219            }
220        });
221        return false;
222    });
223
224}(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.