PageSourceSearch

https://www.lynlapidmusic.com/wp-content/plugins/umg-grand-royal-t…/shortcodes/music/exhibition.js?ver=3.5.9

js lynlapidmusic.com collected 2026-10-04 05:38:55 UTC 5,715 bytes, 141 lines download raw bytes

1(function ($) {
2    "use strict";
3
4    $(document).ready(function () {
5
6        //Load more releases
7        $('a[data-releases-load-more]').on('click', function(e) {
8            e.preventDefault();
9            
10            var loadMoreAnchor = $(this);
11            
12            var perPage = $(this).attr('data-load-num');
13            var orderBy = $(this).attr('data-order-by');
14            var orderDir = $(this).attr('data-order-dir');
15            if (orderBy == 'menu_order') {
16                var currentOffset = ($(this).attr('data-offset') == 1 ? 0 : $(this).attr('data-offset'));
17            } else {
18                var currentOffset = $(this).attr('data-offset');
19            }
20
21            var tileTemplate = $('.c-exhibition__music__item:last').clone();
22
23            //add loading icon to the button
24            $(loadMoreAnchor).addClass('-is-loading');
25
26            let posts = {};
27            $.ajax({
28                type: "GET",
29                url: theme_vars.wpjsonurl + '/wp/v2/release?_embed&orderby=' + orderBy +'&order=' + orderDir,
30                data: {
31                    'per_page' : perPage,
32                    'offset': currentOffset
33                },
34                success: function (response) {                    
35                    posts = response;
36                },
37            }).then( ( posts ) => {
38
39                if(typeof posts !== 'undefined' && posts.length) {
40                    //loop through retrived posts and render using tile template
41                    for(var i in posts) {
42                        var post = posts[i];
43
44                        var tile = tileTemplate.clone().attr('data-post-id', post.id).hide();
45                        
46                        //update link
47                        switch(post.release_action) {
48                            case 'post': 
49                                tile.find('.item-image a').attr('href', post.link);
50                                tile.find('.item-title a').attr('href', post.link);
51                                break;
52                            case 'external': 
53                                tile.find('.item-image a').attr('href', post.linkfire_url);
54                                tile.find('.item-title a').attr('href', post.linkfire_url);
55                                break;
56                            case 'none':
57                            default : break;
58                        }
59                        
60                        //update title
61                        tile.find('.item-content .item-title h3.title').html(post.title.rendered);
62                        tile.find('.item-content .item-title h2.title').html(post.title.rendered);
63
64                        //update the image                        
65                        tile.find('.item-image a img').attr('src', post._embedded['wp:featuredmedia']['0'].source_url);
66
67                        //update the link fire group buttons
68                        tile.find('.item-buttons').empty().html(post.music_release_menu);
69
70                        //add new tile before the Load More button
71                        if($('.c-exhibition__music__inner').length){$('.c-exhibition__music__inner').append(tile);}
72                        if($('.c-exhibition__music-section__inner').length){$('.c-exhibition__music-section__inner').append(tile);}
73
74                        //remove loading icon from the button
75                        $(loadMoreAnchor).removeClass('-is-loading');
76
77                        $('div[data-post-id="' + post.id + '"]').fadeIn();
78                    }
79                } else {
80                    //no posts left
81                }
82
83                return posts;
84
85            });
86
87            //calculate new offset
88            if (orderBy == 'menu_order') {
89                var newOffset = (currentOffset == 0 ? 1 + parseInt(perPage) : parseInt(currentOffset) + parseInt(perPage));
90            } else {
91                var newOffset = parseInt(currentOffset) + parseInt(perPage);
92            }
93
94            //check if there are any more posts, if not then hide the load more button
95            posts = {};
96            $.ajax({
97                type: "GET",
98                url: theme_vars.wpjsonurl + '/wp/v2/release',
99                data: {
100                    'per_page' : perPage,
101                    'offset': newOffset
102                },
103                success: function (response) {
104                    posts = response;
105                },
106            }).then( ( posts ) => {
107                if(typeof posts === 'undefined' || posts.length === 0) {
108                    loadMoreAnchor.hide();
109                } else {
110                    loadMoreAnchor.attr('data-offset', newOffset);
111                }
112            });
113            
114            return false;
115        });
116
117        //Listen Now Drop Down Slide
118        $('html').on("click", '.item-buttons .open-links', function (evt) {
119            $(this).next('.links-contain').slideToggle();
120            if (!$('.open-links').hasClass('open')) {
121                TweenMax.to($(this), 0.3, {opacity: 0.5});
122                $('.open-links').addClass('open');
123            } else {
124                TweenMax.to($(this), 0.3, {opacity: 1});
125                $('.open-links').removeClass('open');
126            }
127            evt.stopPropogation();
128        });
129
130        $('.lazy').each(function () {
131            $(this).Lazy({
132                beforeLoad: function (element) {
133                    $(element).parents('.item-image').show('div.loader');
134                },
135                afterLoad: function (element) {
136                    $(element).parent().find('div.loader').hide();
137                },
138            });
139        });
140    });
141})(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.