Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var stream = $('#UpBeatStream')[0];
- var volume = $('#volume')[0];
- var playable = false;
- homepageScrolling = false;
- currentIndex = 0;
- beatPlaying = false;
- stopBeatAuto = false;
- reloadPlayer = null;
- attempts = 0;
- streamState = false;
- streamPrevState = false;
- streamURL = 'https://live.upbeat.pw';
- notifications = [];
- searchTimeout = null;
- fullscreen = false;
- windowFocus = true;
- visualizerVisible = true;
- document['fullscreenEnabled'] = document['fullscreenEnabled'] || document['mozFullScreenEnabled'] || document['documentElement']['webkitRequestFullScreen'];
- var artistDisabled = '<span class="text-light">UpBeat</span>';
- var songDisabled = '<span class="text-light">Song name unavailable</span>';
- var DJDisabled = '<span class="text-light">Unavailable</span>';
- var likesDisabled = '0';
- var likedTrue = '<i class="fas fa-fw fa-heart" aria-hidden="true"></i>';
- var likedFalse = '<i class="far fa-fw fa-heart" aria-hidden="true"></i>';
- var likedDisabled = '<i class="fas fa-fw fa-times" aria-hidden="true"></i>';
- var followTrueIcon = '<i class="fas fa-fw fa-bell"></i>';
- var followFalseIcon = '<i class="far fa-fw fa-bell"></i>';
- var songLikedFalse = '<i class="far fa-fw fa-thumbs-up"></i>';
- var songLikedTrue = '<i class="fas fa-fw fa-thumbs-up"></i>';
- var songDislikedFalse = '<i class="far fa-fw fa-thumbs-down"></i>';
- var songDislikedTrue = '<i class="fas fa-fw fa-thumbs-down"></i>';
- var songFavouriteFalse = '<i class="far fa-fw fa-star"></i>';
- var songFavouriteTrue = '<i class="fas fa-fw fa-star"></i>';
- var rateDisabled = '<i class="fas fa-fw fa-times" aria-hidden="true"></i>';
- var avatarDisabled = '/staff/_assets/_avatarImages/default/default.png';
- var avatarError = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
- function empty(_0xba26x17) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- if (_0xba26x17 === '') {
- return true
- };
- return false
- }
- function setCookie(_0xba26x19, _0xba26x1a, _0xba26x1b) {
- var _0xba26x1c = '';
- if (_0xba26x1b) {
- var _0xba26x1d = new Date();
- _0xba26x1d['setTime'](_0xba26x1d['getTime']() + (_0xba26x1b * 24 * 60 * 60 * 1000));
- _0xba26x1c = '; expires=' + _0xba26x1d['toUTCString']()
- };
- document['cookie'] = _0xba26x19 + '=' + (_0xba26x1a || '') + _0xba26x1c + '; path=/'
- }
- function getCookie(_0xba26x19) {
- var _0xba26x1f = _0xba26x19 + '=';
- var _0xba26x20 = document['cookie']['split'](';');
- for (var _0xba26x21 = 0; _0xba26x21 < _0xba26x20['length']; _0xba26x21++) {
- var _0xba26x22 = _0xba26x20[_0xba26x21];
- while (_0xba26x22['charAt'](0) == ' ') {
- _0xba26x22 = _0xba26x22['substring'](1, _0xba26x22['length'])
- };
- if (_0xba26x22['indexOf'](_0xba26x1f) == 0) {
- return _0xba26x22['substring'](_0xba26x1f['length'], _0xba26x22['length'])
- }
- };
- return null
- }
- function eraseCookie(_0xba26x19) {
- document['cookie'] = _0xba26x19 + '=; Max-Age=-99999999;'
- }
- function reloadNav(_0xba26x25) {
- $['ajax']({
- url: '_scripts_/ajax.php',
- dataType: 'text',
- method: 'POST',
- cache: false,
- data: {
- request: 'reloadNav'
- }
- })['done'](function(_0xba26x17) {
- obj = JSON['parse'](_0xba26x17);
- if (obj['response'] !== null && obj['response'] === true) {
- $('.navbar')['html'](obj['html']);
- navHover();
- _0xba26x25()
- }
- })
- }
- function ValidEmail(_0xba26x27) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- var _0xba26x28 = /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i;
- return _0xba26x28['test'](_0xba26x27)
- }
- function ValidDiscord(_0xba26x2a) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- var _0xba26x28 = /.*#[0-9][0-9][0-9][0-9]/i;
- return _0xba26x28['test'](_0xba26x2a)
- }
- function userLogin() {
- $('body')['attr']('loggedIn', 'true');
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- reloadNav(function() {
- reloadNotifications(true);
- if (!$('#mobileDetect')['is'](':visible')) {
- $('#navCollapse')['addClass']('in')['attr']('style', '')
- }
- });
- reloadStats();
- urlRoute['refresh']()
- }
- function userLogout() {
- $('body')['attr']('loggedIn', 'false');
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- reloadNav(function() {
- if (!$('#mobileDetect')['is'](':visible')) {
- $('#navCollapse')['addClass']('in')['attr']('style', '')
- }
- });
- urlRoute['refresh']()
- }
- $('body .nav')['on']('click', '.login input', function() {
- $('.loginDropdown')['addClass']('open')
- });
- $('body .nav')['on']('click', '.login .form-group', function() {
- $('.form-group')['removeClass']('active');
- $(this)['removeClass']('red')['addClass']('active')
- });
- function navHover() {
- if ($('#mobileDetect')['is'](':visible')) {
- $('.navbar-nav li')['hover'](function() {
- $(this)['addClass']('navHover')
- }, function() {
- $(this)['removeClass']('navHover')
- })
- }
- }
- $('.visualizerToggle .checkbox')['click'](function() {
- if (getCookie('visualizer') == undefined) {
- setCookie('visualizer', 1)
- };
- if (getCookie('visualizer') == true) {
- $(this)['removeClass']('checked');
- $('input', this)['removeAttr']('checked');
- setCookie('visualizer', 0)
- } else {
- $(this)['addClass']('checked');
- $('input', this)['attr']('checked', 'checked');
- setCookie('visualizer', 1)
- };
- resetViz()
- });
- function toggleFullscreen() {
- if (fullscreen) {
- disableFullscreen()
- } else {
- enableFullscreen()
- }
- }
- function enableFullscreen() {
- if (document['fullscreenEnabled']) {
- page = document['documentElement'];
- if (page['requestFullscreen']) {
- page['requestFullscreen']()
- } else {
- if (page['webkitRequestFullscreen']) {
- page['webkitRequestFullscreen']()
- } else {
- if (page['mozRequestFullScreen']) {
- page['mozRequestFullScreen']()
- } else {
- if (page['msRequestFullscreen']) {
- page['msRequestFullscreen']()
- }
- }
- }
- };
- fullscreen = true
- }
- }
- function disableFullscreen() {
- if (document['fullscreenEnabled']) {
- if (document['exitFullscreen']) {
- document['exitFullscreen']()
- } else {
- if (document['webkitExitFullscreen']) {
- document['webkitExitFullscreen']()
- } else {
- if (document['mozCancelFullScreen']) {
- document['mozCancelFullScreen']()
- } else {
- if (document['msExitFullscreen']) {
- document['msExitFullscreen']()
- }
- }
- }
- };
- fullscreen = false
- }
- }
- function openPopout() {
- if (!$('body')['hasClass']('popout')) {
- $('body')['delay'](100)['queue'](function() {
- $(this)['addClass']('popout')['dequeue']();
- $('html, body')['animate']({
- scrollTop: 0
- }, 300)['queue'](function() {
- $(this)['scrollTop'](0)['dequeue']()
- })
- })
- }
- }
- function closePopout() {
- if ($('body')['hasClass']('popout')) {
- $('body')['delay'](100)['queue'](function() {
- $(this)['removeClass']('popout')['dequeue']()
- })
- }
- }
- function captchaLoading() {
- if (!$('#mainContent #UBCaptcha')['hasClass']('success')) {
- $('#mainContent #UBCaptcha')['attr']('response', '');
- $('#mainContent #UBCaptcha')['attr']('class', 'loading')
- }
- }
- function captchaSuccess(_0xba26x35) {
- $('#mainContent #UBCaptcha')['attr']('response', _0xba26x35);
- $('#mainContent #UBCaptcha')['attr']('class', 'success')
- }
- function captchaError() {
- $('#mainContent #UBCaptcha')['attr']('response', '');
- $('#mainContent #UBCaptcha')['attr']('class', 'error')
- }
- $('body .UBCopy')['click'](function() {
- data = $(this)['attr']('data-copy-data');
- UBCopy(data)
- });
- function UBCopy(_0xba26x17) {
- if (_0xba26x17 != null) {
- tempInput = $('<input>');
- $('body')['append'](tempInput);
- tempInput['val'](_0xba26x17)['select']();
- document['execCommand']('Copy');
- tempInput['remove']();
- sideNotif('Copied!', 'Data has sucessfully been copied to your clipboard.', 'info', 'fas fa-info-circle')
- }
- }
- function updateBG(_0xba26x39, _0xba26x3a) {
- if (!_0xba26x39) {
- _0xba26x39 = 'hidden'
- };
- if (_0xba26x3a == true) {
- opacity = 0.2
- } else {
- opacity = 0.3
- };
- if ($('#contentBG img')['attr']('src') == _0xba26x39) {
- return
- };
- if (!($('#contentBG img')['attr']('src') == null && _0xba26x39 == 'hidden')) {
- if (_0xba26x39 == 'hidden') {
- $('#contentBG')['animate']({
- opacity: 0
- }, 200, function() {
- $(this)['css']('opacity', 0);
- $('#contentBG img')['removeAttr']('src')
- })
- } else {
- $('#contentBG img')['attr']('src', _0xba26x39);
- $('#contentBG')['css']('opacity', 0)['animate']({
- opacity: opacity
- }, 500, function() {
- $(this)['css']('opacity', opacity)
- })
- }
- }
- }
- function avatarCropBackground() {
- setTimeout(function() {
- $('.slim-popover .slim-editor-bg')['remove']();
- $('.slim-popover')['append']('<div class="blurBG slim-editor-bg b50 bg-black"><img src=""></div>');
- $('.slim-editor-bg img')['attr']('src', $('.slim-crop-mask img')['attr']('src'))
- }, 10)
- }
- $('.popoutButton')['click'](function() {
- if ($('body')['hasClass']('popout')) {
- closePopout();
- disableFullscreen()
- } else {
- openPopout()
- };
- $(this)['delay'](500)['queue'](function() {
- refreshMarquee();
- $(this)['dequeue']()
- })
- });
- $('.fullscreenButton')['click'](function() {
- toggleFullscreen()
- });
- function radioLoading() {
- $('#radioPlayer .toggler')['attr']('class', 'toggler fas fa-fw fa-compact-disc fa-spin loading');
- $('.playerContainer')['addClass']('paused');
- $('.playerFixed')['addClass']('paused');
- $('#header > .bottom')['addClass']('paused')
- }
- function radioPlaying() {
- $('#radioPlayer .toggler')['attr']('class', 'toggler fas fa-fw fa-pause');
- $('#visualizer')['removeClass']('paused');
- $('.playerContainer')['removeClass']('paused');
- $('.playerFixed')['removeClass']('paused');
- $('#header > .bottom')['removeClass']('paused')
- }
- function radioPaused() {
- $('#radioPlayer .toggler')['attr']('class', 'toggler fas fa-fw fa-play animated infinite pulseBig');
- $('#visualizer')['addClass']('paused');
- $('.playerContainer')['addClass']('paused');
- $('.playerFixed')['addClass']('paused');
- $('#header > .bottom')['addClass']('paused')
- }
- function fadeRadio(_0xba26x40) {
- if (!_0xba26x40 && _0xba26x40 != '0') {
- _0xba26x40 = volume['value']
- };
- $(stream)['animate']({
- volume: _0xba26x40
- }, 1000)['queue'](function() {
- stream['volume'] = _0xba26x40;
- $(this)['dequeue']()
- })
- }
- function toggleRadio() {
- if (streamState == 'paused') {
- if ($('.UBPlayable.active')['length'] > 0) {
- stopBeat()
- };
- playRadio()
- } else {
- if (streamState == 'muted') {
- if ($('.UBPlayable.active')['length'] > 0) {
- stopBeat()
- };
- fadeRadio();
- streamState = 'playing'
- } else {
- pauseRadio()
- }
- }
- }
- function playRadio(_0xba26x43) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- if (stream['src'] != streamURL) {
- stream['src'] = streamURL
- };
- radioLoading();
- streamState = 'loading';
- clearInterval(reloadPlayer);
- reloadPlayer = null;
- stream['volume'] = 0;
- stream['crossOrigin'] = 'anonymous';
- stream['play']()['then'](function() {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- initViz();
- streamState = 'playing';
- fadeRadio();
- reloadStats();
- radioPlaying();
- if (notifications['playbackFailure']) {
- notifications['playbackFailure']['remove']();
- notifications['playbackFailure'] = null
- };
- if (notifications['connectionlost']) {
- notifications['connectionlost']['remove']();
- notifications['connectionlost'] = null
- };
- clearInterval(reloadPlayer);
- reloadPlayer = null;
- setTimeout(function() {
- autoRefreshRadio()
- }, 10000)
- })['catch'](function(_0xba26x44) {
- if (streamState != 'paused' && streamState != 'muted') {
- pauseRadio();
- if (notifications['playbackFailure'] == null && _0xba26x43 != true) {
- if (notifications['connectionlost']) {
- notifications['connectionlost']['remove']();
- notifications['connectionlost'] = null
- };
- sideNotif('Playback Failure', '<span class="noAStyle" onclick="playRadio();">Click <b>here</b> to proceed.</span>', 'info', 'fas fa-exclamation-circle', 'playbackFailure')
- }
- }
- })
- }
- function pauseRadio(_0xba26x46) {
- clearInterval(playable);
- playable = null;
- if (_0xba26x46 != true) {
- streamState = 'paused';
- $(stream)['animate']({
- volume: 0
- }, 1000, function() {
- stream['pause']();
- stream['src'] = ''
- })
- } else {
- streamState = 'muted';
- $(stream)['animate']({
- volume: 0
- }, 1000)
- };
- radioPaused()
- }
- function muteRadio() {
- pauseRadio(true)
- }
- stream['onpause'] = function() {
- pauseRadio()
- };
- function autoRefreshRadio() {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- var _0xba26x49 = 0;
- clearInterval(reloadPlayer);
- reloadPlayer = null;
- (function() {
- var _0xba26x4a = new Date();
- _0xba26x49 = _0xba26x4a['getTime']();
- stream['ontimeupdate'] = function() {
- var _0xba26x4b = new Date();
- _0xba26x49 = _0xba26x4b['getTime']()
- };
- reloadPlayer = setInterval(function() {
- var _0xba26x4c = new Date();
- var _0xba26x4d = _0xba26x4c['getTime']() - _0xba26x49;
- if (_0xba26x4d > 5000 && streamState == 'playing') {
- stream['src'] = '';
- playRadio();
- console['log'](1);
- sideNotif('Connection Lost', 'It looks like you lost connection to the radio stream. Reconnecting...', 'info', 'fas fa-compact-disc fa-spin', 'connectionlost');
- _0xba26x49 = _0xba26x4c
- }
- }, 2000)
- })()
- }
- volume['oninput'] = function() {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- stream['volume'] = volume['value'];
- setCookie('volume', volume['value'])
- };
- function sideNotif(_0xba26x4f, _0xba26x50, _0xba26x51, _0xba26x52, _0xba26x53) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- if (!_0xba26x53) {
- _0xba26x53 = false
- };
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- if (_0xba26x53 !== false) {
- notifications[_0xba26x53] = new PNotify({
- title: _0xba26x4f,
- text: _0xba26x50,
- icon: _0xba26x52,
- addclass: 'notif-' + _0xba26x51,
- hide: false,
- buttons: {
- closer: false,
- sticker: false
- }
- });
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- }
- } else {
- new PNotify({
- title: _0xba26x4f,
- text: _0xba26x50,
- icon: _0xba26x52,
- addclass: 'notif-' + _0xba26x51,
- buttons: {
- sticker: false
- }
- });
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- }
- }
- }
- function textColour(_0xba26x55) {
- var _0xba26x56 = document['createElement']('img');
- _0xba26x56['src'] = _0xba26x55;
- _0xba26x56['style']['display'] = 'none';
- document['body']['appendChild'](_0xba26x56);
- var _0xba26x57 = 0;
- var _0xba26x58 = _0xba26x56['onload'] = function() {
- var _0xba26x59 = document['createElement']('canvas');
- _0xba26x59['width'] = _0xba26x56['width'];
- _0xba26x59['height'] = _0xba26x56['height'];
- var _0xba26x5a = _0xba26x59['getContext']('2d');
- _0xba26x5a['drawImage'](_0xba26x56, 0, 0);
- var _0xba26x5b = _0xba26x5a['getImageData'](0, 0, _0xba26x59['width'], _0xba26x59['height']);
- var _0xba26x17 = _0xba26x5b['data'];
- var _0xba26x5c, _0xba26x5d, _0xba26x5e, _0xba26x5f;
- for (var _0xba26x60 = 0, _0xba26x61 = _0xba26x17['length']; _0xba26x60 < _0xba26x61; _0xba26x60 += 4) {
- _0xba26x5c = _0xba26x17[_0xba26x60];
- _0xba26x5d = _0xba26x17[_0xba26x60 + 1];
- _0xba26x5e = _0xba26x17[_0xba26x60 + 2];
- _0xba26x5f = Math['floor']((_0xba26x5c + _0xba26x5d + _0xba26x5e) / 3);
- _0xba26x57 += _0xba26x5f
- };
- var _0xba26x62 = Math['floor'](_0xba26x57 / (_0xba26x56['width'] * _0xba26x56['height']));
- return _0xba26x62
- }();
- if (_0xba26x58 > 153) {
- return '#000000'
- } else {
- return '#FFFFFF'
- }
- }
- $('.modal-backdrop')['click'](function() {
- $('.modal-backdrop')['remove']()
- });
- $('.modal')['on']('click', function(_0xba26x63) {
- if (_0xba26x63['target'] !== this) {
- return
- };
- $('.modal-backdrop')['remove']()
- });
- function forumToggle(_0xba26x65, _0xba26x66) {
- if (getCookie('node' + _0xba26x65) == 1) {
- $(_0xba26x66)['html']('<i class="fas fa-minus"></i>');
- $('#node' + _0xba26x65)['collapse']('show');
- setCookie('node' + _0xba26x65, 0)
- } else {
- $(_0xba26x66)['html']('<i class="fas fa-plus"></i>');
- $('#node' + _0xba26x65)['collapse']('hide');
- setCookie('node' + _0xba26x65, 1)
- }
- }
- $(document)['on']('click', '[data-toggle="ajaxModal"]', function(_0xba26x63) {
- _0xba26x63['preventDefault']();
- $('#modal' + $(this)['attr']('id'))['remove']();
- var _0xba26x67 = $(this),
- _0xba26x68 = _0xba26x67['data']('remote') || _0xba26x67['attr']('href'),
- _0xba26x69 = $('<div class="modal" id="modal' + _0xba26x67['attr']('id') + '"><div class="modal-body"></div></div>');
- $('body')['append'](_0xba26x69);
- _0xba26x69['modal']();
- _0xba26x69['load'](_0xba26x68)
- });
- function showModal(_0xba26x65, _0xba26x6b) {
- $('#modal' + _0xba26x65)['remove']();
- var _0xba26x69 = $('<div class="modal" id="modal' + _0xba26x65 + '"><div class="modal-body"></div></div>');
- $('body')['append'](_0xba26x69);
- _0xba26x69['modal']();
- _0xba26x69['load'](_0xba26x6b)
- }
- function loadSlider() {
- homepageScroll = 0;
- items = $('#imageSliderContainer .slider .slide');
- itemAmt = items['length'];
- for (var _0xba26x21 = 0; _0xba26x21 < itemAmt; _0xba26x21++) {
- $('#imageSliderContainer .sliderSelection')['append']('<div class="hidden-sm hidden-xs"></div>')
- };
- function _0xba26x6d(_0xba26x6e) {
- if (_0xba26x6e != null) {
- currentIndex = _0xba26x6e
- };
- var _0xba26x6f = $('#imageSliderContainer:hover')['length'];
- var _0xba26x70 = $('#imageSliderContainer .sliderSelection:hover')['length'];
- if (_0xba26x6f === 0 || _0xba26x70 === 1) {
- item = $('#imageSliderContainer .slider .slide')['eq'](currentIndex);
- items['css']('z-index', '0');
- $('#imageSliderContainer .sliderSelection div')['removeClass']('active');
- $('#imageSliderContainer .sliderSelection div')['eq'](currentIndex)['addClass']('active');
- item['css']('z-index', '5')['addClass']('active')['delay'](500)['queue'](function() {
- items['removeClass']('active')['queue'](function() {
- item['addClass']('active')['css']('z-index', '0')['dequeue']()
- })['dequeue']()
- });
- currentIndex = currentIndex + 1;
- if (currentIndex == itemAmt) {
- currentIndex = 0
- }
- };
- clearTimeout(homepageScroll);
- homepageScroll = setTimeout(function() {
- _0xba26x6d()
- }, 6000)
- }
- $('#imageSliderContainer .sliderSelection div')['click'](function() {
- if (!$(this)['hasClass']('active')) {
- _0xba26x6d($(this)['index']())
- }
- });
- _0xba26x6d(0);
- homepageScrolling = true
- }
- function reloadSlider() {
- stopSlider();
- loadSlider()
- }
- function stopSlider() {
- clearTimeout(homepageScroll);
- homepageScrolling = false
- }
- function refreshMarquee() {
- if ($('.artist .marquee')['width']() < $('.artist .marquee span')['width']()) {
- $('.artist .marquee')['addClass']('active')
- } else {
- $('.artist .marquee')['removeClass']('active')
- };
- if ($('.song .marquee')['width']() < $('.song .marquee span')['width']()) {
- $('.song .marquee')['addClass']('active')
- } else {
- $('.song .marquee')['removeClass']('active')
- };
- if ($('.dj .marquee')['width']() < $('.dj .marquee span')['width']()) {
- $('.dj .marquee')['addClass']('active')
- } else {
- $('.dj .marquee')['removeClass']('active')
- };
- if ($('.djsays')['width']() < $('.djsays .marquee span')['width']()) {
- $('.djsays .marquee')['addClass']('active')
- } else {
- $('.djsays .marquee')['removeClass']('active')
- }
- }
- function statsError() {
- $('.stats-djAvatar')['attr']('src', avatarError);
- $('#header .stats-songImage')['attr']('src', avatarError);
- $('#header .stats-artist')['html'](artistDisabled);
- $('#header .stats-song')['html'](songDisabled);
- $('#header .stats-djName')['html'](DJDisabled);
- $('#stats .left')['removeClass']('a');
- $('#stats .right')['removeClass']('a show');
- $('#header .stats-likeAmount')['html'](likesDisabled);
- $('#header .stats-likeIcon')['html'](likedDisabled);
- $('#header .stats-likeButton')['addClass']('disabled');
- $('#header .stats-requestButton')['addClass']('disabled');
- $('#header .stats-followButton')['addClass']('disabled');
- $('#header .songPoll')['attr']('song-id', '-1');
- $('#header .stats-songLikeIcon')['html'](songLikedFalse);
- $('#header .stats-songLikeAmount')['html'](rateDisabled);
- $('#header .stats-songLikeButton')['addClass']('disabled');
- $('#header .stats-songDislikeIcon')['html'](songDislikedFalse);
- $('#header .stats-songDislikeAmount')['html'](rateDisabled);
- $('#header .stats-songDislikeButton')['addClass']('disabled');
- $('#header .stats-songFaveButton')['addClass']('disabled');
- refreshMarquee()
- }
- function reloadStats() {
- $['ajax']({
- url: '_scripts_/ajax.php',
- dataType: 'text',
- method: 'POST',
- cache: false,
- data: {
- request: 'refreshStats',
- streamPlaying: !stream['paused']
- },
- error: function() {
- statsError()
- }
- })['done'](function(_0xba26x17) {
- obj = JSON['parse'](_0xba26x17);
- if (obj['response'] !== null && obj['response'] === true) {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- $('#header .stats-requestButton')['removeClass']('disabled');
- currentSongID = obj['songID'];
- if (obj['artist'] === false) {
- $('#header .stats-artist')['html'](artistDisabled)
- } else {
- $('#header .stats-artist')['html'](obj['artist'])
- };
- if (obj['song'] === false) {
- $('#header .stats-song')['html'](songDisabled)
- } else {
- $('#header .stats-song')['html'](obj['song'])
- };
- if (obj['songID'] === undefined) {
- $('.stats-songImage')['attr']('src', avatarDisabled);
- $('.stats-fullSong')['attr']('data-copy-data', '');
- $('#stats .left')['removeClass']('a')['removeAttr']('songID');
- $('#header .songPoll')['attr']('song-id', '-1')
- } else {
- $('#stats .left')['addClass']('a')['attr']('onclick', 'urlRoute.loadPage(\'Radio.SongProfile?song=' + obj['songID'] + '\')');
- if (obj['songimage'] === false) {
- $('.stats-songImage')['attr']('src', avatarDisabled)
- } else {
- $('.stats-songImage')['attr']('src', obj['songimage'])
- };
- $('.stats-fullSong')['attr']('data-copy-data', obj['artist'] + ' - ' + obj['song'])
- };
- if (obj['avatar'] === false) {
- $('.stats-djAvatar')['attr']('src', avatarError)
- } else {
- $('.stats-djAvatar')['attr']('src', obj['avatar'])
- };
- if (obj['dj'] === false) {
- $('#header .stats-djName')['html'](DJDisabled)
- } else {
- $('#header .stats-djName')['html'](obj['dj'])
- };
- if (obj['social'] === false) {
- $('#header #stats .right')['removeClass']('social');
- $('#header .stats-social')['html']('')
- } else {
- $('#header #stats .right')['addClass']('social');
- $('#header .stats-social')['html'](obj['social'])
- };
- if (obj['likes']) {
- $('#header .stats-likeAmount')['html'](obj['likes'])
- } else {
- $('#header .stats-likeAmount')['html'](likesDisabled)
- };
- if (obj['liked'] === true) {
- $('#header .stats-likeButton')['addClass']('active');
- $('#header .stats-likeIcon')['html'](likedTrue)
- } else {
- $('#header .stats-likeButton')['removeClass']('active');
- $('#header .stats-likeIcon')['html'](likedFalse)
- };
- if (obj['following'] === true) {
- $('#header .stats-followIcon')['html'](followTrueIcon)
- } else {
- $('#header .stats-followIcon')['html'](followFalseIcon)
- };
- if (obj['livedj'] === false) {
- $('#stats .right')['removeClass']('a')['removeAttr']('onclick');
- $('#header .stats-likeButton')['addClass']('disabled');
- $('#header .stats-followButton')['addClass']('disabled')
- } else {
- if (obj['show'] === true) {
- $('#stats .right')['addClass']('a')['attr']('onclick', 'urlRoute.loadPage(\'Radio.Show?id=' + obj['livedj'] + '\')')
- } else {
- $('#stats .right')['addClass']('a')['attr']('onclick', 'urlRoute.loadPage(\'Account.Profile?user=' + obj['dj'] + '.' + obj['livedj'] + '\')')
- };
- $('#header .stats-likeButton')['removeClass']('disabled');
- $('#header .stats-followButton')['removeClass']('disabled')
- };
- if (obj['songliked'] != true) {
- $('#header .stats-songLikeButton')['removeClass']('active');
- $('#header .stats-songLikeIcon')['html'](songLikedFalse)
- } else {
- $('#header .stats-songLikeButton')['addClass']('active');
- $('#header .stats-songLikeIcon')['html'](songLikedTrue)
- };
- if (obj['songdisliked'] != true) {
- $('#header .stats-songDislikeButton')['removeClass']('active');
- $('#header .stats-songDislikeIcon')['html'](songDislikedFalse)
- } else {
- $('#header .stats-songDislikeButton')['addClass']('active');
- $('#header .stats-songDislikeIcon')['html'](songDislikedTrue)
- };
- if (obj['songfavourited'] != true) {
- $('#header .stats-songFaveButton')['removeClass']('active');
- $('#header .stats-songFaveIcon')['html'](songFavouriteFalse)
- } else {
- $('#header .stats-songFaveButton')['addClass']('active');
- $('#header .stats-songFaveIcon')['html'](songFavouriteTrue)
- };
- if (obj['songlikes'] === false || obj['songdislikes'] === false) {
- $('#header .stats-songLikeButton')['addClass']('disabled');
- $('#header .stats-songLikeAmount')['html'](rateDisabled);
- $('#header .stats-songDislikeButton')['addClass']('disabled');
- $('#header .stats-songDislikeAmount')['html'](rateDisabled);
- $('#header .stats-songFaveButton')['addClass']('disabled');
- $('#header .songPoll')['attr']('song-id', '-1')
- } else {
- $('#header .stats-songLikeButton')['removeClass']('disabled');
- $('#header .stats-songLikeAmount')['html'](obj['songlikes']);
- $('#header .stats-songDislikeButton')['removeClass']('disabled');
- $('#header .stats-songDislikeAmount')['html'](obj['songdislikes']);
- $('#header .stats-songFaveButton')['removeClass']('disabled');
- $('#header .songPoll')['attr']('song-id', obj['songID'])
- };
- if (obj['showAsset'] === true) {
- $('#stats .right')['addClass']('show')
- } else {
- $('#stats .right')['removeClass']('show')
- };
- refreshMarquee();
- if ((urlRoute['currentUrl'] == 'UpBeat.Home' || urlRoute['currentUrl'] == 'Radio.RecentlyPlayed') && obj['songHTML'] !== null) {
- if ($('.recentlyPlayed tbody')['children']('.item')['first']()['attr']('songID') !== obj['songID'] && obj['songID']) {
- $('.recentlyPlayed tbody')['prepend'](obj['songHTML']);
- $('.recentlyPlayed tbody')['children']('.item')['last']()['remove']();
- $('.recentlyPlayed.scrollbar-inner')['scrollTop'](60)['animate']({
- scrollTop: 0
- }, 1000)
- }
- }
- } else {
- statsError();
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- }
- }
- })
- }
- function playBeat(_0xba26x77) {
- clearTimeout(stopBeatAuto);
- stopBeatAuto = false;
- $('.UBPlayable.active')['each'](function() {
- stopAudio = $(this)['children']('audio')[0];
- $(stopAudio)['animate']({
- volume: 0
- }, 1000, function() {
- stopAudio['pause']();
- stopAudio['currentTime'] = 0;
- stopAudio['oncanplaythrough'] = null
- })
- });
- $('.UBPlayable.active .control')['html']('<i class="fas fa-fw fa-play"></i>');
- $('.UBPlayable.active')['addClass']('stopping')['delay'](1100)['queue'](function() {
- $(this)['removeClass']('stopping active')['dequeue']()
- });
- if (streamState == 'loading') {
- streamPrevState = 'loading';
- streamState = 'paused';
- pauseRadio()
- } else {
- if (streamState == 'playing') {
- streamPrevState = 'playing';
- streamState = 'muted';
- muteRadio()
- }
- };
- if (_0xba26x77['attr']('UB-Playable')) {
- var _0xba26x78 = (_0xba26x77['attr']('UB-Playable') * 1000) - 1000
- } else {
- var _0xba26x78 = 29000
- };
- audio = _0xba26x77['children']('audio')[0];
- _0xba26x77['addClass']('active');
- _0xba26x77['children']('.control')['html']('<i class="fas fa-fw fa-pause"></i>');
- audio['volume'] = 0;
- audio['play']();
- $(audio)['animate']({
- volume: volume['value']
- }, 1000);
- stopBeatAuto = setTimeout(function() {
- stopBeat()
- }, _0xba26x78)
- }
- function stopBeat() {
- clearTimeout(stopBeatAuto);
- stopBeatAuto = false;
- $('.UBPlayable.active')['each'](function() {
- that = $(this);
- that['addClass']('stopping')['children']('.control')['html']('<i class="fas fa-fw fa-play"></i>');
- audio = $(this)['children']('audio')[0];
- $(audio)['animate']({
- volume: 0
- }, 1000, function() {
- audio['pause']();
- audio['currentTime'] = 0;
- audio['oncanplaythrough'] = null;
- that['removeClass']('stopping active')
- })
- });
- if ((streamPrevState == 'loading' || streamPrevState == 'paused') && streamState != 'paused') {
- playRadio()
- } else {
- if (streamPrevState == 'playing') {
- fadeRadio();
- radioPlaying();
- streamState = 'playing'
- }
- };
- streamPrevState = false
- }
- $(document)['on']('click', 'body .UBPlayable', function() {
- if ($(this)['attr']('UB-Playable')) {
- if ($(this)['hasClass']('active')) {
- stopBeat()
- } else {
- playBeat($(this))
- }
- }
- });
- $(document)['scroll'](function() {
- scrollOffset = $(this)['scrollTop']();
- if (scrollOffset >= 217) {
- $('.playerFixed')['addClass']('active')
- } else {
- $('.playerFixed')['removeClass']('active')
- };
- if (scrollOffset >= 150) {
- visualizerVisible = false
- } else {
- if (visualizerVisible == false) {
- initViz()
- };
- visualizerVisible = true
- };
- if (scrollOffset < 6) {
- $('.navbar')['attr']('class', 'navbar navbar-inverse navbar-fixed-top navtop top')
- } else {
- $('.navbar')['attr']('class', 'navbar navbar-inverse navbar-fixed-top navtop')
- }
- });
- $(window)['resize'](function() {
- refreshMarquee()
- });
- $('#requestFormModal')['on']('hidden.bs.modal', function() {
- $('#requestFormModal')['remove']()
- });
- $(document)['on']('submit', '.profilePage form', function(_0xba26x7a) {
- _0xba26x7a['preventDefault']();
- commentInput = $(this)['find']('[name=newComment]');
- comment = commentInput['val']();
- reply_id = $(this)['find']('[name=newComment]')['attr']('reply_id');
- postVisitorMessage(commentInput, comment, reply_id)
- });
- $(document)['on']('click', '.profilePage .menu .reply', function() {
- that = $(this);
- commentID = that['attr']('comment_id');
- $('.commentsItem[comment_id=\'' + commentID + '\'] .replies')['html']('<form><input type="text" class="glassBox editable comment p-sm viga" name="newComment" reply_id="' + commentID + '" placeholder="Write a reply..."></form>');
- that['remove']()
- });
- $(document)['on']('submit', '.articlePage form', function(_0xba26x7a) {
- _0xba26x7a['preventDefault']();
- commentInput = $(this)['find']('[name=newComment]');
- comment = commentInput['val']();
- reply_id = $(this)['find']('[name=newComment]')['attr']('reply_id');
- postComment(commentInput, comment, reply_id)
- });
- $(document)['on']('click', '.articlePage .menu .reply', function() {
- that = $(this);
- commentID = that['attr']('comment_id');
- $('.commentsItem[comment_id=\'' + commentID + '\'] .replies')['html']('<form><input type="text" class="glassBox editable comment p-sm viga" name="newComment" reply_id="' + commentID + '" placeholder="Write a reply..."></form>');
- that['remove']()
- });
- $(window)['focus'](function() {
- windowFocus = true;
- initViz();
- reloadStats()
- })['blur'](function() {
- windowFocus = false;
- initViz()
- });
- $(document)['ready'](function() {
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- reloadStats();
- navHover();
- reloadNotifications(true);
- if (!$('#mobileDetect')['is'](':visible')) {
- volume['value'] = 1
- };
- playRadio(true);
- if (streamURL !== 'https://live.upbeat.pw') {
- window['location']['href'] = 'https://upbeatradio.net/'
- };
- scrollOffset = $(this)['scrollTop']();
- if (scrollOffset >= 150) {
- visualizerVisible = false
- } else {
- visualizerVisible = true
- };
- PNotify['prototype']['options']['styling'] = 'fontawesome';
- setInterval(reloadStats, 30000);
- setInterval(reloadNotifications, 10000);
- setInterval(reloadMiniTimetable, 60000)
- });
- $('body')['on']('hidden.bs.modal', '.modal', function() {
- $(this)['delay'](1)['queue'](function() {
- $(this)['data']('bs.modal', null)['remove']()
- })
- });
- Modernizr['addTest']('backgroundclip', function() {
- var _0xba26x7b = document['createElement']('div');
- if ('backgroundClip' in _0xba26x7b['style']) {
- return true
- };
- 'Webkit Moz O ms Khtml' ['replace'](/([A-Za-z]*)/g, function(_0xba26x7c) {
- if (_0xba26x7c + 'BackgroundClip' in _0xba26x7b['style']) {
- return true
- }
- })
- });
- Modernizr['addTest']('firefox', function() {
- return !!navigator['userAgent']['match'](/firefox/i)
- });
- Modernizr['addTest']('safari', function() {
- return !!(navigator['userAgent']['indexOf']('Safari') && !navigator['userAgent']['match'](/chrome/i) && !navigator['userAgent']['match'](/firefox/i))
- })
Add Comment
Please, Sign In to add comment