PageSourceSearch

https://vjm.hu/wp-content/themes/simplemag/js/jquery.async.js?ver=1.0

js vjm.hu collected 2026-10-02 11:53:23 UTC 5,714 bytes, 174 lines download raw bytes

1jQuery(document).ready(function ($) {
2    
3    "use strict";
4    
5    /**
6     * Mega Menu
7    **/
8    $(function MegaMenuNav() {
9        
10        var mega_menu_container = $('.mega-menu-ajax'),
11            parent_link = $('.menu-item-has-mega-menu > a > span'),
12            sub_link = $('.menu-item-has-mega-menu .sub-links > .menu-item-type-taxonomy > a > span');
13
14        // Output the mega menu on category mouse over
15        $(parent_link).add(sub_link).mouseover(function () {
16
17            // Get tag slug from href attirbute
18            var selecetd_taxonomy = $(this).parent().attr('href');
19            
20            // Highlights active links
21            $('.active-link').not(this).removeClass('active-link');
22            $(this).parent().addClass('active-link');
23
24            $(mega_menu_container).parent().addClass('posts-loading');
25            $(mega_menu_container).parent().removeClass('posts-added');
26            
27            $.ajaxSetup({cache: true});
28            
29            $.ajax({
30
31                cache: true,
32                timeout: 8000,
33                url: ti_async.ti_ajax_url,
34                type: 'POST',
35                data: ({
36                    action: 'filter_posts',
37                    taxonomy: selecetd_taxonomy,
38                    ti_nonce: ti_async.ti_nonce
39                }),
40
41                success: function (data, textStatus, jqXHR) {
42                    
43                    var $response = $(data);
44                    
45                    // Display posts on page
46                    $(mega_menu_container).html($response);
47
48                    // Restore div visibility
49                    $(mega_menu_container).parent().removeClass('posts-loading');
50                    $(mega_menu_container).parent().addClass('posts-added');
51
52                }
53
54            });
55
56        });
57        
58    });    
59
60    
61    /**
62     * Latest By Format Section loader
63    **/
64    $(function LatestFormatLoader() {
65   
66        $('.media-posts .load-media-content').click(function (e) {
67
68            e.preventDefault();
69            
70            var postid = $(this).attr('data-postid'),
71                metakey = $(this).attr('data-metakey'),
72                container = $('.media-posts #postid-' + postid + ' .media-content');
73            
74            container.parent().addClass('content-loading').removeClass('content-added');
75            
76            $.ajax({
77
78                cache: false,
79                timeout: 8000,
80                url: ti_async.ti_ajax_url,
81                type: 'POST',
82                data: ({
83                    action: 'load_custom_field_data',
84                    ti_nonce: ti_async.ti_nonce, // wp_nonce
85                    postid: postid,
86                    metakey: metakey
87                }),
88
89                success: function (data, textStatus, jqXHR) {
90
91                    var $response = $(data);
92                    
93                    container.parent().addClass('content-added');
94                    container.html($response);
95                    container.find('.format-media-item').fitVids();
96                    
97                    // autoplay
98                    container.find('iframe').each(function() {
99                        var videosrc = $(this).attr('src');
100                        
101                        if ( videosrc.indexOf('vimeo.com') > -1 || videosrc.indexOf('youtube.com') > -1 ) {
102                            $(this).attr('src', videosrc += '?&autoplay=1');
103                            
104                        } else if ( videosrc.indexOf('soundcloud.com') > -1 ) {
105                            $(this).attr('src', videosrc += '?&auto_play=true');    
106                        } 
107                    });
108                   
109                }
110
111            });
112
113        });
114
115    });    
116
117    
118    /**
119     * Post Format loader
120    **/
121    $(function LatestFormatLoader() {
122   
123        $('.entries .load-media-content').click(function (e) {
124
125            e.preventDefault();
126            
127            var postid = $(this).attr('data-postid'),
128                metakey = $(this).attr('data-metakey'),
129                container = $('.entries #postid-' + postid + ' .media-content');
130            
131            container.parent().addClass('content-loading').removeClass('content-added');
132            
133            $.ajax({
134
135                cache: false,
136                timeout: 8000,
137                url: ti_async.ti_ajax_url,
138                type: 'POST',
139                data: ({
140                    action: 'load_custom_field_data',
141                    ti_nonce: ti_async.ti_nonce, // wp_nonce
142                    postid: postid,
143                    metakey: metakey
144                }),
145
146                success: function (data, textStatus, jqXHR) {
147
148                    var $response = $(data);
149                    
150                    container.parent().addClass('content-added');
151                    container.html($response);
152                    container.find('.format-media-item').fitVids();
153                    
154                    // autoplay
155                    container.find('iframe').each(function() {
156                        var videosrc = $(this).attr('src');
157                        
158                        if ( videosrc.indexOf('vimeo.com') > -1 || videosrc.indexOf('youtube.com') > -1 ) {
159                            $(this).attr('src', videosrc += '?&autoplay=1');
160                            
161                        } else if ( videosrc.indexOf('soundcloud.com') > -1 ) {
162                            $(this).attr('src', videosrc += '?&auto_play=true');    
163                        } 
164                    });
165                   
166                }
167
168            });
169
170        });
171
172    });
173    
174});

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.