PageSourceSearch

https://melmagazine.com/wp-content/themes/mel/redesign/assets/js/gutenberg-custom.js?ver=86

js melmagazine.com collected 2026-09-24 08:37:06 UTC 2,423 bytes, 84 lines download raw bytes

1(function ($) {
2    'use strict';
3
4    $(document).ready(function () {
5
6        // Load Lozad for img tags and divs with background images.
7        try {
8            let observer = lozad('.lozad', {
9                load: function (el) {
10
11                    var img = new Image();
12
13                    img.onload = function () {
14
15                        let attr = $(el).attr('src');
16                        if (typeof attr !== typeof undefined && attr !== false) {
17                            $(el).attr('src', img.src);
18                        } else {
19                            $(el).css('background-image', 'url(' + img.src + ')');
20                        }
21
22                        $(el).attr('data-loaded', 'loaded');
23                    };
24
25                    let attr = $(el).attr('src');
26                    if (typeof attr !== typeof undefined && attr !== false) {
27                        img.src = $(el).attr('data-src');
28                    } else {
29                        img.src = $(el).attr('data-background-image');
30                    }
31                }
32            });
33            observer.observe();
34        } catch (e) {
35            console.log(e);
36        }
37
38        // Load Lozad for text
39        try {
40            let observer_2 = lozad('.lozad-text', {
41                load: function (el) {
42                    $(el).css('visibility', 'visible');
43                }
44            });
45            observer_2.observe();
46        } catch (e) {
47            console.log(e);
48        }
49
50        // Load Lozad for iframes
51        /*try {
52            let observer_3 = lozad('.lozad-iframe');
53            observer_3.observe();
54        } catch (e) {
55            console.log(e);
56        }*/
57
58        $('.open-cart').on('click', function(e) {
59            e.preventDefault();
60            let cart = $('#react-shopify-cart');
61            cart.addClass('visible');
62            if ($('#react-shopify-cart .cart').length < 1) {
63                cart.load('/cart-production');
64            }
65        });
66
67
68        /**
69         * Add ch classes to titles that have the class add-ch
70         */
71        $('.add-ch').each(function() {
72            let title = $(this).text();
73            let characters = Math.floor(135 / 10) * 10;
74            let chClass = 'ch' + characters;
75            $(this).addClass(chClass);
76        });
77
78    });
79
80    $(window).on('load', function () {
81        /* Nothing Yet */
82    });
83
84})(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.