PageSourceSearch

https://livemetallica.com/assets/metallica/js/env.js

js livemetallica.com collected 2026-09-24 22:29:34 UTC 8,344 bytes, 175 lines download raw bytes

1var NugsEnv = ((location.host == 'www.livemetallica.com') || (location.host == 'livemetallica.com')) ? 'prod' : 'dev';
2
3var isIE = navigator.appName === "Microsoft Internet Explorer";
4
5if (typeof console == 'undefined') {
6    var console = {
7        log: function () { }
8    }
9}
10
11var NugsUtil = {
12    cmpStr: function (a, b) {
13        // Sort function
14        var reA = /[^a-zA-Z]/g;
15        var reN = /[^0-9]/g;
16        var aA = a.replace(reA, "");
17        var bA = b.replace(reA, "");
18        if (aA === bA) {
19            var aN = parseInt(a.replace(reN, ""), 10);
20            var bN = parseInt(b.replace(reN, ""), 10);
21            return aN === bN ? 0 : aN > bN ? 1 : -1;
22        } else {
23            return aA > bA ? 1 : -1;
24        }
25    },
26    sortCollectionByDate: function (collection, dateProperty) {
27        collection.sort(function (i1, i2) {
28            // add a property for date using JS Date while we're doing it to object if not present.
29            if (typeof i1[dateProperty] == 'string') {
30                var date1 = NugsUtil.usDateToJSDate(i1[dateProperty]);
31                i1[dateProperty + 'JS'] = date1;
32            } else {
33                var date1 = i1[dateProperty];
34            }
35            if (typeof i2[dateProperty] == 'string') {
36                var date2 = NugsUtil.usDateToJSDate(i2[dateProperty]);
37                i2[dateProperty + 'JS'] = date2;
38            } else {
39                var date2 = i2[dateProperty];
40            }
41            return date2 - date1;
42        });
43    },
44    sortCollectionByDateAlbums: function (collection, dateProperty) {
45        collection.sort(function (i1, i2) {
46            // add a property for date using JS Date while we're doing it to object if not present.
47            if (typeof i1[dateProperty] == 'string') {
48                var date1 = NugsUtil.usDateToJSDateReverse(i1[dateProperty]);
49                i1[dateProperty + 'JS'] = date1;
50            } else {
51                var date1 = i1[dateProperty];
52            }
53            if (typeof i2[dateProperty] == 'string') {
54                var date2 = NugsUtil.usDateToJSDateReverse(i2[dateProperty]);
55                i2[dateProperty + 'JS'] = date2;
56            } else {
57                var date2 = i2[dateProperty];
58            }
59            return date2 - date1;
60        });
61    },
62    sortCollectionAlphaNumAsc: function (collection, property) {
63        collection.sort(function (i1, i2) {
64            return NugsUtil.cmpStr(i1[property], i2[property]);
65        });
66        return collection;
67    },
68    sortCollectionAlphaNumDesc: function (collection, property) {
69        collection.sort(function (i1, i2) {
70            return NugsUtil.cmpStr(i2[property], i1[property]);
71        });
72        return collection;
73    },
74    sortCollectionNumerically: function (collection, property, desc) {
75        if (typeof desc == 'undefined') desc = true;
76        collection.sort(function (i1, i2) {
77            return desc ? i2[property] - i1[property] : i1[property] - i2[property];
78        });
79        return collection;
80    },
81    usDateToJSDate: function (usDate, separator) {
82        if (typeof separator == 'undefined') separator = '/';
83        var s = usDate.split(separator);
84        return new Date(s[2], parseInt(s[0]) - 1, s[1]);
85    },
86    usDateToJSDateReverse: function (usDate, separator) {
87        if (typeof separator == 'undefined') separator = '/';
88        var s = usDate.split(separator);
89        return new Date(parseInt(s[0]) - 1, s[1], s[2]);
90    },
91    sqlDateToJSDate: function (sqlDate, separator) {
92        if (typeof separator == 'undefined') separator = '/';
93        var s = sqlDate.split(separator);
94        if (s[1].match(/^0/))
95            s[1] = s[1].substr(1);
96        if (s[2].match(/^0/))
97            s[2] = s[2].substr(1);
98        return new Date(s[0], parseInt(s[1]) - 1, s[2]);
99    },
100    jsDateToSqlDate: function (jsDate) {
101        var month = jsDate.getMonth() + 1;
102        var day = jsDate.getDate();
103        if (month < 10)
104            month = '0' + month;
105        if (day < 10)
106            day = '0' + day;
107        return jsDate.getFullYear() + '-' + month + '-' + day;
108    },
109    day: function (idx, short) {
110        var d = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'][idx];
111        return short ? d.substr(0, 3) : d;
112    },
113    month: function (idx, short) {
114        var m = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'][idx];
115        return short ? m.substr(0, 3) : m;
116    },
117    fullDate: function (jsdate) {
118        if (!jsdate) return '';
119        return this.month(jsdate.getMonth()) + ' ' + jsdate.getDate() + ', ' + jsdate.getFullYear();
120    },
121    formatDuration: function (seconds) {
122        var min = seconds / 60;
123        var sec = seconds % 60;
124        return min + ':' + sec;
125    }
126}
127
128var NugsSettings = {
129
130    dev: {
131        url: 'https://livemetallica.nugsdev.net',
132        securl: 'https://livemetallica.nugsdev.net',
133        fsite: 'https://livemetallica.nugsdev.net',
134        show_imgurl: 'https://www.livemetallica.com/images/covers/',
135        api: 'https://livemetallica.nugsdev.net/api.aspx?callback=?',
136        secure_api: 'https://livemetallica.nugsdev.net/secureApi.aspx?callback=?',
137        defaultshowimage_url: 'https://www.livemetallica.com/images/covers/met_default.jpg',
138        fb_app_id: 121205004623815,
139        featured_year: '46',
140        yearValues: [{ "ctID": 46, "ctYear": "2026" }, { "ctID": 45, "ctYear": "2025" }, { "ctID": 44, "ctYear": "2024" }, { "ctID": 43, "ctYear": "2023" }, { "ctID": 42, "ctYear": "2022" }, { "ctID": 41, "ctYear": "2021" },{ "ctID": 40, "ctYear": "2020" }, { "ctID": 36, "ctYear": "2019" }, { "ctID": 35, "ctYear": "2018" }, { "ctID": 34, "ctYear": "2017" }, { "ctID": 33, "ctYear": "2016" }, { "ctID": 32, "ctYear": "2015" }, { "ctID": 31, "ctYear": "2014" }, { "ctID": 30, "ctYear": "2013" }, { "ctID": 29, "ctYear": "2012" }, { "ctID": 18, "ctYear": "2011" }, { "ctID": 19, "ctYear": "2010" }, { "ctID": 20, "ctYear": "2009" }, { "ctID": 21, "ctYear": "2008" }, { "ctID": 22, "ctYear": "2007" }, { "ctID": 23, "ctYear": "2006" }, { "ctID": 24, "ctYear": "2004" }, { "ctID": 6, "ctYear": "FREE" }, { "ctID": 39, "ctYear": "VAULT" }]
141
142    },
143
144    prod: {
145        url: 'https://www.livemetallica.com/',
146        securl: 'https://www.livemetallica.com',
147        fsite: 'https://www.livemetallica.com',
148        show_imgurl: 'https://www.livemetallica.com/images/covers/',
149        api: 'https://www.livemetallica.com/api.aspx?callback=?',
150        secure_api: 'https://www.livemetallica.com/secureApi.aspx?callback=?',
151        defaultshowimage_url: 'https://www.livemetallica.com/assets/lm20/images/covers/large/met_default.jpg',
152        fb_app_id: 174371945944792,
153        featured_year: '46',
154        yearValues: [{ "ctID": 46, "ctYear": "2026" }, { "ctID": 45, "ctYear": "2025" }, { "ctID": 44, "ctYear": "2024" }, { "ctID": 43, "ctYear": "2023" }, { "ctID": 42, "ctYear": "2022" }, { "ctID": 41, "ctYear": "2021" },{ "ctID": 40, "ctYear": "2020" }, { "ctID": 36, "ctYear": "2019" }, { "ctID": 35, "ctYear": "2018" }, { "ctID": 34, "ctYear": "2017" }, { "ctID": 33, "ctYear": "2016" }, { "ctID": 32, "ctYear": "2015" }, { "ctID": 31, "ctYear": "2014" }, { "ctID": 30, "ctYear": "2013" }, { "ctID": 29, "ctYear": "2012" }, { "ctID": 18, "ctYear": "2011" }, { "ctID": 19, "ctYear": "2010" }, { "ctID": 20, "ctYear": "2009" }, { "ctID": 21, "ctYear": "2008" }, { "ctID": 22, "ctYear": "2007" }, { "ctID": 23, "ctYear": "2006" }, { "ctID": 24, "ctYear": "2004" }, { "ctID": 6, "ctYear": "FREE" }, { "ctID": 39, "ctYear": "VAULT" }]
155    },
156
157    get: function (key) {
158        return this[NugsEnv][key] ? this[NugsEnv][key] : null;
159    }
160}
161
162$(document).ready(function () {
163
164    if (navigator.userAgent.match(/Android/i)) {
165        window.scrollTo(0, 0); // reset in case prev not scrolled
166        var nPageH = $(document).height();
167        var nViewH = window.outerHeight;
168        if (nViewH > nPageH) {
169            nViewH -= 150;
170            $('BODY').css('height', nViewH + 'px');
171        }
172        window.scrollTo(0, 1);
173    }
174
175});

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.