PageSourceSearch

https://www.nasheradio.ua/static/js/updater.js?v=1790972361

js nasheradio.ua collected 2026-10-02 20:19:50 UTC 7,285 bytes, 221 lines download raw bytes

1//Необходим подключеный jquery
2var key     = key || "nasheradio",
3    playerTitle = playerTitle || " ";
4error   = false,
5    Updater = {};
6UpdaterHeader = {};
7UpdaterLeft = {};
8//console.log(key + ' my');
9
10Updater.update_main = function () {
11    // var sleep = typeof _sleep !== 'undefined' ?  _sleep : 5000;
12    $.getJSON("https://o.tavr.media/"+key, null, Updater.upup);
13    setTimeout( Updater.update_main, 5000 );
14}
15//функция которая обновляет как на главной странице правую колонку, так и в плеере центральныю колонку
16Updater.upup = function ( e ) {
17    if ( typeof e[ 0 ] === "object" ) {
18
19        let mobileEfir = $('.efir.d-mob');
20        mobileEfir.find('.mobile-song')
21            .html('<b>' + e[0].singer + '</b> &mdash; ' + e[0].song);
22
23        let curDJ = false;
24
25        $.each( e, function ( index, val ) {
26            if(val.djType) {
27                $('#cur-header-dj-photo').attr('src', val.img);
28
29                if(val.absnum == 32 && val.djType == 'programs') {
30                    val.title = 'Ранкове шоу "Динаміки"';
31                }
32
33                $('#cur-header-dj-title').html(val.title);
34                $('#cur-header-dj-time').html('до ' + val.cur_end_time);
35                $('#cur-dj-not-now').addClass('d-none');
36
37                $('.current-dj-link').attr('href', val.link);
38
39                $('.current-dj, .cur-mobile-header-dj-title').removeClass('d-none');
40                $('.current-song').removeClass('ml-160-px');
41
42                curDJ = true;
43                return;
44            }
45
46            var target = "_blank";
47            if ( index == 0 && document.location.href.indexOf( "/player" ) != - 1 ) {
48                changePlayerTitle(val.singer, val.song);
49            }
50
51            if(document.location.href.indexOf( "/player" ) == - 1) {
52                target = "_top";
53            }
54
55            $( "#time" + index ).text( val.time );
56
57
58            let static_img = 'https://static.nasheradio.ua/nasheradio/img/main/NasheRadio_NewLogo_85x85_white.jpg';
59
60            let src = ( val.cover === undefined || val.cover == '' )
61                ?   static_img
62                :   val.cover;
63            static_img = '<img src="' + src + '">';
64
65
66            if ( val.singer_url.length > 5 )
67            {
68                val.singer =
69                    '<a class="bold" href="' + val.singer_url + '" target="' + target + '">' +
70                    $.trim(val.singer) +
71                    '</a>';
72                static_img = '<a href="' + val.singer_url + '"><img src="' + src + '"></a>';
73            }
74
75            $( "#singer" + index ).html( val.singer );
76
77
78            if ( val.song_url.length > 5 )
79            {
80                val.song =
81                    '<a href="' + val.song_url + '" target="' + target + '">' +
82                    $.trim( val.song ) +
83                    '</a>';
84                static_img = '<a href="' + val.song_url + '"><img src="' + src + '"></a>';
85            }
86
87            $( "#song" + index ).html( val.song );
88
89
90            $("#cover-song" + index).html(static_img);
91        });
92
93        if(!curDJ) {
94            if($('.current-dj').hasClass('d-none') || $('.cur-mobile-header-dj-title').hasClass('d-none')) {
95
96            } else {
97                $('.current-dj, .cur-mobile-header-dj-title').addClass('d-none');
98                $('#cur-dj-not-now').removeClass('d-none');
99            }
100            if(!$('.current-song').hasClass('ml-160-px')) {
101                $('.current-song').addClass('ml-160-px');
102            }
103        }
104    }
105}
106
107function changePlayerTitle(singer, song) {
108    var channelSub = playerTitle;
109    if(key != "hit") {
110        channelSub = "Онлайн-радіо " + playerTitle + " від Хіт FM";
111    }
112
113    var title = singer + " - " + song + " | Слухати Хіт FM онлайн";
114    //var title = "Слухати Хіт FM онлайн";
115    /*if (singer == "Хіт FM") {
116        title = channelSub;
117    }*/
118
119    document.title = title;
120}
121Updater.videoChange = function ( val, index ) {
122    if ( val.video !== '' ) {
123        var icon = $( "#right-page .play-button-youtube:eq(" + index + ")" );
124
125        icon
126            .parent( "div" )
127            .show();
128        icon.attr( {
129            "data-song"       : val.song,
130            "data-song-url"   : val.song_url,
131            "data-singer"     : val.singer,
132            "data-singer-url" : val.singer_url,
133            "data-video"      : val.video
134        } );
135
136        $( "#right-page .url-player:eq(" + index + ")" ).attr( {
137            "data-song"       : val.song,
138            "data-song-url"   : val.song_url,
139            "data-singer"     : val.singer,
140            "data-singer-url" : val.singer_url,
141            "data-video"      : val.video
142        } );
143
144    } else {
145        $( "#right-page .play-button-youtube:eq(" + index + ")" )
146            .parent( "div" )
147            .hide();
148    }
149
150};
151
152$(document).ready(function() {
153    let timeUpdate = Math.round(+new Date()/1000);
154
155    $('.listen').mouseenter(function() {
156        let timeCur = Math.round(+new Date()/1000);
157
158        if(timeUpdate + 5 < timeCur) {
159            $.getJSON("https://o.tavr.media/nasheradio3songs", null, UpdaterHeader.upup);
160            timeUpdate = timeCur;
161        }
162    });
163});
164
165UpdaterHeader.update = function () {
166    $.getJSON("https://o.tavr.media/nasheradio3songs", null, UpdaterHeader.upup);
167};
168
169UpdaterHeader.upup = function ( e ) {
170    if ( typeof e[ 0 ] === "object" ) {
171        $.each( e, function ( index, val ) {
172
173            if (val.type == 'ukr') {
174                $( "#singerheader" + 0 ).html( val.singer );
175                $( "#songheader" + 0 ).html( val.song );
176            }
177
178            if($(`.chanels-container .hyphen_${val.type}_left`).hasClass('hp-none')) {
179                $(`.chanels-container .hyphen_${val.type}_left`).text(' - ');
180                $(`.chanels-container .hyphen_${val.type}_left`).removeClass('hp-none');
181            }
182
183            //console.log('singer_header: '+val.singer);
184
185        } );
186    }
187}
188
189UpdaterLeft.update = function () {
190    $.getJSON("https://o.tavr.media/nasheradio", null, UpdaterLeft.upup);
191    // $.getJSON("https://www.hitfm.ua/static/o.tavr.media/hit3songs", null, UpdaterLeft.upup);
192    setTimeout( UpdaterLeft.update, 5000 );
193}
194
195UpdaterLeft.upup = function ( e ) {
196    if ( typeof e[ 0 ] === "object" ) {
197        $.each( e, function ( index, val ) {
198
199            if (val.type === 'ukr') {
200                $( "#singer_now_ukr").text( val.singer + ' - ');
201                $( "#song_now_ukr").text( val.song );
202            }
203
204            if (val.type === 'best') {
205                $( "#singer_now_best").text( val.singer + ' - ');
206                $( "#song_now_best").text( val.song );
207            }
208
209            if (val.type === 'top') {
210                $( "#singer_now_top").text( val.singer + ' - ');
211                $( "#song_now_top").text( val.song );
212            }
213            if(val.type === ''){
214                $( "#singer_now_default").text( val.singer + ' - ');
215                $( "#song_now_default").text( val.song );
216            }
217            //console.log('singer_header: '+val.singer);
218
219        } );
220    }
221}

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.