PageSourceSearch

https://www.myownmusic.de/include/js/global.js?v=1790584075

js myownmusic.de collected 2026-10-02 04:46:40 UTC 16,762 bytes, 475 lines download raw bytes

1var progress_interval = null;
2var cron_count = 0;
3
4
5
6function openPlayer(url) {
7
8    // Player V3: kein Popup mehr — normal navigieren, der persistente
9    // Player (MOM.audio) spielt über Seitenwechsel hinweg weiter.
10    if (window.MOM && window.MOM.audio)
11        return true;
12
13    var height;
14
15    if (club != 0 || free_account != 0) {
16        height = 540;
17    } else {
18        height = 640;
19    }
20
21    if (typeof url == 'object')
22        url = url.attr('href');
23
24    return !openPopUp(url, 750, height, true);
25}
26
27
28function openMessenger(url) {
29
30    var fromClick = (typeof url == 'object');   // a user clicked a conversation link
31    if (fromClick)
32        url = url.attr('href');
33
34    // Mobile: no popup window. A user tap opens the full messenger page directly;
35    // the auto-notifier is suppressed (the slide-out / badge surfaces new messages).
36    if (window.matchMedia && window.matchMedia('(max-width: 1023px)').matches) {
37        if (fromClick) window.location.href = url;
38        return false;
39    }
40
41    return !openPopUp(url, 550, 330, true);
42}
43
44// Mobile quick-messenger: slide the #messi_box up from the bottom as a usable sheet
45function momToggleMessenger() {
46    var box = document.getElementById('messi_box');
47    if (!box) { window.location.href = '/account/messenger/'; return false; }
48    var open = !box.classList.contains('mobile-open');
49    box.classList.toggle('mobile-open', open);
50    document.body.classList.toggle('messi-open', open);
51    if (open) {
52        var layer = document.getElementById('mom_im_layer');
53        if (layer) layer.style.display = 'block';
54        var oc = document.getElementById('oc'); if (oc) oc.textContent = '-';
55    }
56    return false;
57}
58
59
60function openInlinebox(url, width, height, type) {
61    var autosize = true;
62
63
64    if (typeof url == 'object')
65        url = url.attr('href');
66
67    if (!type)
68        type = 'ajax';
69
70    if (!width)
71        width = 'auto';
72
73    if (!height)
74        height = 'auto';
75
76    if (width != 'auto' && height != 'auto')
77        autosize = false;
78
79    $.fancybox.open({
80        type: type,
81        src: url,
82        opts: {
83            autoSize: autosize,
84            modal: false,
85            'minHeight': 50,
86            'href': url,
87            'padding': 0,
88            'width': width,
89            'height': height,
90            'openEffect': 'none',
91            'closeEffect': 'none',
92            'afterShow': function () {
93                $('#inline_popup form input[type=submit]').focus();
94                $('#inline_popup form').ajaxForm({
95                    target: '.fancybox-inner',
96                    success: showResponse
97                });
98            }
99        },
100        helpers: {
101            overlay: {
102                speedIn: 0,
103                speedOut: 0,
104                opacity: 0,
105                css: {
106                    cursor: 'pointer'
107                },
108                closeClick: true
109            }
110        }
111    });
112
113    return false;
114}
115
116
117
118function showResponse(responseText, statusText, xhr, $form) {
119    $('#inline_popup').ready(function () {
120
121        var test = $('#inline_popup .success_message a.load_content');
122        var redirect_to;
123
124        if (test.attr('href'))
125            redirect_to = test.attr('href');
126        else if (test.html())
127            redirect_to = document.location.href;
128
129
130        if (redirect_to) {
131            $.fancybox.close();
132            load_content(redirect_to);
133        } else if ($('#inline_popup form').length) {
134            // Formular neu gerendert (z. B. Validierungsfehler) → erneut binden
135            $('#inline_popup form').ajaxForm({
136                target: '.fancybox-inner',
137                success: showResponse
138            });
139        } else {
140            // Terminale Meldung ohne Formular (print_success/info/error_page)
141            // → kurz zeigen, dann automatisch schließen
142            setTimeout(function () { $.fancybox.close(); }, 1600);
143        }
144    });
145}
146
147
148function openPopUp(url, width, height, backvalue) {
149
150    if (typeof url == 'object')
151        url = url.attr('href');
152    var winname;
153    var startx = Math.round((screen.width - width) / 2) - 10;
154    var starty = Math.round((screen.height - height) / 2) - 20;
155
156    d = new Date;
157
158    winname = window.open(url, "Window" + d.getTime(), "width=" + width + ",height=" + height + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=no,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " ");
159
160    if (!winname) {
161        openInlinebox(url, width, height, 'iframe');
162    }
163
164    if (backvalue)
165        return true;
166
167}
168
169
170function calc_file_size(size) {
171    if (size <= 1024)
172        return size + ' b';
173    if (size <= 1048576)
174        return (size / 1024).toFixed(1) + ' kB';
175    else
176        return (size / 1048576).toFixed(2) + ' MB';
177}
178
179
180function progressbar(uuid) {
181    $.ajax({
182        url: '/progress',
183        type: "GET",
184        data: ({"X-Progress-ID": uuid}),
185        dataType: "json",
186        success: function (response) {
187            if (response) {
188                $('#progressbar_message').html('Upload gestartet... ' + calc_file_size(response.received) + ' / ' + calc_file_size(response.size));
189
190                if (response.state == 'done' || response.state == 'uploading') {
191                    w = Math.ceil(298 * response.received / response.size);
192                    $('#progressbar').animate({width: w}, 500);
193                    $('#progressbar_percent').html(Math.ceil(100 * response.received / response.size) + '%');
194                }
195
196                if (response.state == 'error') {
197                    //window.clearTimeout(interval);
198//						$('#progressbar_message').html('Fehler aufgetreten!');
199                } else if (response.state == 'done' || response.received == response.size) {
200                    window.clearTimeout(interval);
201                    $('#progressbar_message').html('Umrechnung...');
202                }
203            }
204        },
205        error: function (html_result) {
206            $('#progressbar_div').hide();
207        }
208    });
209}
210
211
212function SwapBoxHeader(name) {
213    var status = $('#' + name).css('display');
214
215    if (status == 'none')
216        $('#' + name).slideDown(200);
217    else
218        $('#' + name).slideUp(200);
219
220    set_cookie(name + '_off', (status == 'none' ? 0 : 1));
221}
222
223
224function set_cookie(name, value) {
225    var c = name + "=" + escape(value);
226    var days = 60;
227
228    var today = new Date();
229    var expiry = new Date(today.getTime() + days * 1000 * 60 * 60 * 24);
230    c += ";expires=" + expiry.toGMTString();
231
232    document.cookie = c + ";path=/";
233}
234
235
236function load_content(url, content_div) {
237    var scrollto;
238
239    if (!content_div)
240        content_div = 'content';
241
242    if (typeof url == 'object')
243        url = url.attr('href');
244
245    if (url.indexOf("#")) {
246
247        var splitted_url = url.split("#");
248        url = splitted_url[0];
249        scrollto = splitted_url[1];
250
251    }
252
253    $.get(url, {ajax_load: 1}, function (data) {
254
255        $('#' + content_div).html(data);
256
257        if (scrollto)
258            $.scrollTo('#' + scrollto, 800);
259
260
261        if (window.reload_js)
262            reload_js();
263
264    });
265
266    return false;
267}
268
269
270// Zähler-Pill an Navigationseinträgen (Rail + Drawer) nachführen — legt an,
271// aktualisiert, entfernt bei 0. Ersetzt auch serverseitig gerenderte
272// .right-Pills durch die generische .mom-nav-count (eine Quelle der Wahrheit).
273function updateNavCount(hrefPrefix, n) {
274    $('#artist_nav_box a[href^="' + hrefPrefix + '"], .mom-drawer a[href^="' + hrefPrefix + '"]').each(function () {
275        var $a = $(this);
276        $a.find('.mom-nav-count, .right').remove();
277        if (n > 0) $a.append($('<span>', { 'class': 'mom-nav-count', text: n }));
278    });
279}
280
281function browserCron_ajax(session_id) {
282
283    $.ajax({
284        url: '/account/refresh',
285        type: "GET",
286        data: ({ident: cron_count}),
287        dataType: "json",
288        success: function (response) {
289
290            if (response) {
291                if (response.notifier)
292                    for (var i = 0; i < response.notifier.length; i++) {
293
294                        if (response.notifier[i].type == 'mail')
295                            openPopUp("/account/mailbox/infowindow?mail_id=" + response.notifier[i].id, 420, 90);
296
297                        if (response.notifier[i].type == 'friend')
298                            openPopUp("/account/community/friends/infowindow?friend_id=" + response.notifier[i].id, 350, 90);
299
300                        if (response.notifier[i].type == 'im')
301                            openMessenger('/account/messenger/?toid=' + response.notifier[i].id);
302                    }
303
304
305
306                if (typeof response.mail_unread !== 'undefined')
307                    updateNavCount('/account/mailbox', parseInt(response.mail_unread, 10) || 0);
308                if (typeof response.friend_requests !== 'undefined')
309                    updateNavCount('/account/community', parseInt(response.friend_requests, 10) || 0);
310
311                if (response.friend_im_sent) {
312                    if (response.friend_im) {
313                        var new_content = '';
314                        for (var i = 0; i < response.friend_im.length; i++)
315                            new_content += '<a href="/account/messenger/?toid=' + response.friend_im[i].id + '" onclick="return openMessenger($(this))" class="nowrap"><img class="messi_pic" src="https://user.myownmusic.de/artist_pics_40x30/' + response.friend_im[i].id + '_40x30.' + response.friend_im[i].ext + '" alt="" /> <div class="messi_name">' + decodeURIComponent(response.friend_im[i].nick) + '</div></a>';
316                        $('#mom_im').html(new_content);
317                    } else
318                        $('#mom_im').html('<p>Keine Freunde online.</p><a href="/online/"><img src="/_.gif" class="icons_friend friend_add_icon" alt="Neue Freunde finden" /> Neue Freunde finden</a>');
319                    if (response.friend_im_genre) {
320                        var new_content_genre = '<br/><p>Aus deinem Genre</p>';
321                        for (var i = 0; i < response.friend_im_genre.length; i++)
322                            new_content_genre += '<a href="/account/messenger/?toid=' + response.friend_im_genre[i].id + '" onclick="return openMessenger($(this))" class="nowrap"><img src="' + response.friend_im_genre[i].position_addon + '" class="icons_position ' + response.friend_im_genre[i].position_class + '" alt="" /> ' + decodeURIComponent(response.friend_im_genre[i].nick) + '</a>';
323                        $('#mom_im').append(new_content_genre);
324                    }
325                }
326            }
327        }
328
329    });
330
331    cron_count++;
332
333}
334
335
336function closeThisWindow() {
337    setTimeout("window.close();", 1000);
338}
339
340
341$('HTML').addClass('JS');
342
343
344// :has()-Fallback für Browser ohne Support (Firefox < 121, u. a. 115 ESR als
345// letzte Version für Windows 7/8 und ältere macOS). Die verwerfen jede CSS-Regel
346// mit :has() komplett. Die layoutkritischen Regeln haben darum einen Zwilling
347// mit Hilfsklasse (LESS-Mixin .has-or in css/design/_mixins.less); hier werden
348// diese Klassen gesetzt. Neue Paare immer in beiden Dateien eintragen.
349// Moderne Browser verlassen die Funktion sofort.
350(function hasFallback() {
351
352    try {
353        if (window.CSS && CSS.supports && CSS.supports('selector(:has(*))'))
354            return;
355    } catch (e) {}
356
357    function hasChild(sel) {
358        return function (el) {
359            for (var i = 0; i < el.children.length; i++)
360                if (el.children[i].matches(sel)) return true;
361            return false;
362        };
363    }
364    function hasDesc(sel) {
365        return function (el) { return !!el.querySelector(sel); };
366    }
367
368    // [Elemente, Bedingung, Klasse] — Bedingung entspricht dem :has()-Argument
369    var HAS_FALLBACKS = [
370        ['label', hasDesc('.form_right, .form_full'), 'hs-formrow'],
371        ['.artistrow, .div_table, .forumrow', hasChild('.ur-pic'), 'hs-urrow'],
372        ['.div_table, .artistrow', function (el) { var f = el.firstElementChild; return !!f && f.matches('.ur-date'); }, 'hs-datefirst'],
373        ['#left_container div, #right_container div', function (el) {
374            for (var i = 0; i < el.children.length; i++)
375                if (el.children[i].matches('a') && el.children[i].querySelector('.icons_control')) return true;
376            return false;
377        }, 'hs-votes'],
378        ['#content_right .row', hasChild('.left'), 'hs-mediarow'],
379        ['.entry_wrapper', hasDesc('.user_comment_big_wrapper'), 'hs-bigcomment'],
380        ['.entry_wrapper', hasChild('.user_comment_pic'), 'hs-commentrow'],
381        ['.entry_wrapper', hasChild('.calendar'), 'hs-event'],
382        ['#main_content .drag_wrapper', hasChild('.entry_wrapper[id]'), 'hs-list'],
383        ['#main_content .drag_wrapper', hasDesc('.gallery_small'), 'hs-gallery'],
384        ['#content_half .drag_wrapper', hasChild('.mag-card'), 'hs-maggrid'],
385        ['.songbox_content .row .sg-actions', hasChild('.right'), 'hs-actright'],
386        ['.songbox_content .row', hasDesc('.sg-actions > .right'), 'hs-rowright'],
387        ['#content', hasChild('#content_half'), 'hs-halves'],
388        ['#content_half', function (el) {
389            var n = el.nextElementSibling;
390            return !!n && n.matches('#content_right') && !!n.querySelector('.mom-news-panel');
391        }, 'hs-news'],
392        ['#content_right', hasDesc('.mom-news-panel'), 'hs-news'],
393        [':is(.col_cover, .rec-row__cover, .wg-center, .left) > a[href*="/play/"]', hasChild('img[class*="picture_"]'), 'hs-playcover'],
394        ['.forum-heroes a[href*="inframe_player.php"]', hasChild('img'), 'hs-playcover'],
395        ['.dash-actions a', function (el) { return !el.querySelector('img'); }, 'hs-noimg'],
396        ['body', hasDesc('#messi_box'), 'hs-messi']
397    ];
398
399    function apply() {
400        for (var i = 0; i < HAS_FALLBACKS.length; i++) {
401            var rule = HAS_FALLBACKS[i], els;
402            try { els = document.querySelectorAll(rule[0]); } catch (e) { continue; }   // z. B. :is() in sehr alten Browsern
403            for (var j = 0; j < els.length; j++)
404                els[j].classList.toggle(rule[2], rule[1](els[j]));
405        }
406    }
407
408    apply();
409    document.addEventListener('DOMContentLoaded', apply);
410
411    // Nachgeladene Inhalte (load_content, Soft-Navigation, Mailbox, Messenger)
412    // laufen über viele Wege → einmal pro Frame nachziehen statt jeden Hook zu kennen.
413    // Beobachtet nur childList, die eigenen Klassenwechsel lösen also nichts aus.
414    if (window.MutationObserver) {
415        var pending = false;
416        new MutationObserver(function () {
417            if (pending) return;
418            pending = true;
419            requestAnimationFrame(function () { pending = false; apply(); });
420        }).observe(document.documentElement, {childList: true, subtree: true});
421    }
422})();
423
424
425// Mobile: Bottom-Leisten (.mom-tabbar, Mini-Player) ausblenden, solange eine
426// Texteingabe fokussiert ist — position:fixed hängt auf iOS am Layout-Viewport
427// und schwebt bei offener Tastatur sonst mitten überm Formular (CSS: mom-kbd-open).
428var kbd_close_timer = null;
429var kbd_field_selector = 'textarea, [contenteditable], input:not([type=button]):not([type=submit]):not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range]):not([type=image])';
430
431$(document).on('focusin', kbd_field_selector, function (e) {
432
433    if ($(e.target).closest('#messi_box').length)   // Messenger-Sheet dockt auf der Tabbar → sichtbar lassen
434        return;
435
436    clearTimeout(kbd_close_timer);
437    $('body').addClass('mom-kbd-open');
438});
439
440$(document).on('focusout', kbd_field_selector, function () {
441
442    clearTimeout(kbd_close_timer);
443    kbd_close_timer = setTimeout(function () {       // kurzer Puffer: Feldwechsel soll nicht flackern
444        $('body').removeClass('mom-kbd-open');
445    }, 150);
446});
447
448//Google Analytics Opt-Out
449var gaProperty = 'UA-5468548-1';
450var disableStr = 'ga-disable-' + gaProperty;
451if (document.cookie.indexOf(disableStr + '=true') > -1) {
452    window[disableStr] = true;
453}
454function gaOptout() {
455    document.cookie = disableStr + '=true; expires=Thu, 31 Dec 2099 23:59:59 UTC; path=/';
456    window[disableStr] = true;
457
458    alert('Google Analytics wurde erfolgreich deaktiviert.');
459}
vendor: 422 bytes, lines 459-472
459
460
461(function (i, s, o, g, r, a, m) {
462    i['GoogleAnalyticsObject'] = r;
463    i[r] = i[r] || function () {
464        (i[r].q = i[r].q || []).push(arguments)
465    }, i[r].l = 1 * new Date();
466    a = s.createElement(o),
467            m = s.getElementsByTagName(o)[0];
468    a.async = 1;
469    a.src = g;
470    m.parentNode.insertBefore(a, m)
471})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
472ga('create', '
472UA-5468548-1
vendor: 12 bytes, line 472
472', 'auto');
473ga('set', 'anonymizeIp', true);
474ga('send', 'pageview');
475	

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.