aftown.com Ads.txt file
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Title -->
<title>Home</title>
<!-- Required Meta Tags Always Come First -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Favicon -->
<link rel="shortcut icon" href="https://aftown.com/themes/soundify/img/icon.png" />
<meta name="title" content="Home">
<meta name="description" content="Buy &amp; Download High-Quality African Music - Afrobeats, Highlife, Exclusive Releases">
<meta name="keywords" content="Music Downloads, Buy Music Online, African Music, Download Songs, Digital Music Store, Afrobeats, Highlife, African Artists, MP3 Downloads, Music Albums, Exclusive Tracks, Aftown Music, Independent Artists, Music Sales, Music Marketplace">
<link rel="canonical" href="https://aftown.com" /><link rel="home" href="https://aftown.com" /><link rel="alternate" href="https://aftown.com?lang=arabic" hreflang="ar" /><link rel="alternate" href="https://aftown.com?lang=bengali" hreflang="bn" /><link rel="alternate" href="https://aftown.com?lang=dutch" hreflang="nl" /><link rel="alternate" href="https://aftown.com?lang=english" hreflang="en" /><link rel="alternate" href="https://aftown.com?lang=french" hreflang="fr" /><link rel="alternate" href="https://aftown.com?lang=german" hreflang="de" /><link rel="alternate" href="https://aftown.com?lang=hebrew" hreflang="he" /><link rel="alternate" href="https://aftown.com?lang=hindi" hreflang="hi" /><link rel="alternate" href="https://aftown.com?lang=spanish" hreflang="es" /><link rel="alternate" href="https://aftown.com?lang=turkish" hreflang="tr" /><link rel="alternate" href="https://aftown.com?lang=urdu" hreflang="ur" /><meta property="og:title" content="Buy & Download African Music"><meta property="og:image" content="https://aftown.com/themes/soundify/img/logo.png"><meta property="og:image:width" content="500"><meta property="og:image:height" content="500"><meta property="og:description" content="Buy & Download High-Quality African Music - Afrobeats, Highlife, Exclusive Releases"><meta property="og:url" content="https://aftown.com" />
<!-- Google Fonts -->
<link href="//fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet">
<script src="https://aftown.com/themes/soundify/js/jquery.min.js"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/jquery-ui.css">
<script src="https://aftown.com/themes/soundify/js/jquery-ui.min.js"></script>
<!-- CSS -->
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/bootstrap.min.css">
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/owl.carousel.min.css">
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/style.css?v=1.5.2">
<script src="https://aftown.com/themes/soundify/js/wavesurfer.min.js"></script>
<script type="text/javascript" src="https://aftown.com/themes/soundify/js/tag-it.min.js"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/jquery.tagit.css">
<script type="text/javascript" src="https://aftown.com/themes/soundify/js/fastclick.js"></script>
<script src="https://accounts.google.com/gsi/client" async defer></script>
<!-- Scripts-->
<script>
function ajaxUrl() {
return 'https://aftown.com/endpoints';
}
function siteUrl() {
return 'https://aftown.com/';
}
</script>
<!-- <script src="https://unpkg.com/wavesurfer.js"></script> -->
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<script src="https://aftown.com/themes/soundify/js/emojionearea.min.js"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/emojionearea.min.css">
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-60173540-2"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-60173540-2');
</script>
<!-- Pixel Code for https://fomo.technationgh.com/ -->
<script defer src="https://fomo.technationgh.com/pixel/gtqn6k1hd3xjb6hugfp2yvuzk5i47hzh"></script>
<!-- END Pixel Code -->
<script>
window.run_station = null;
$(document).ready(function() {
window.init_emojioneArea = function() {
$(".comment_input").emojioneArea({
useInternalCDN: true,
events: {
keyup: function (editor, event) {
id = $( $(this)[0].source[0]).attr('data-audio-id');
$($(".comment_input")).limit("1280", '#charsLeft_'+id);
c_id = $( $(this)[0].source[0]).attr('data-comment-id');
if ($('#write_comment_'+c_id).length) {
$($('#write_comment_'+c_id)).limit("1280", '#charsLeft_r_'+c_id);
}
let emojioneArea = this; //this is instance of EmojioneArea
if (event.which === 13 && !event.shiftKey) {
// $scope.onPressKeyTextarea(event);
var audioid = $( $(this)[0].source[0]).attr('data-audio-id');
var commentid = $( $(this)[0].source[0]).attr('data-comment-id');
if(typeof commentid !== 'undefined'){
registerCommentreplay(emojioneArea.getText(), audioid, commentid, event, $(this));
}else{
registerComment(emojioneArea.getText(), audioid, event, $(this));
}
emojioneArea.setText('');
emojioneArea.hidePicker();
emojioneArea.editor.focus();
event.preventDefault();
}
}
},
search: false,
recentEmojis: false,
filtersPosition: "bottom",
tones: false,
autocomplete: false,
filters: {animals_nature: false, food_drink: false, activity: false, travel_places: false, objects: false, symbols: false, flags: false}
});
}
window.init_emojioneArea();
window.init_emojioneArea_replay = function(id) {
$('#write_comment_'+id).emojioneArea({
useInternalCDN: true,
events: {
keyup: function (editor, event) {
let _emojioneArea = this; //this is instance of EmojioneArea
if (event.which === 13 && !event.shiftKey) {
var _audioid = $( $(this)[0].source[0]).attr('data-audio-id');
var _commentid = $( $(this)[0].source[0]).attr('data-comment-id');
registerCommentreplay(_emojioneArea.getText(), _audioid, _commentid, event, $(this));
_emojioneArea.setText('');
_emojioneArea.hidePicker();
_emojioneArea.editor.focus();
event.preventDefault();
}
}
},
search: false,
recentEmojis: false,
filtersPosition: "bottom",
tones: false,
autocomplete: false,
filters: {animals_nature: false, food_drink: false, activity: false, travel_places: false, objects: false, symbols: false, flags: false}
});
}
window.init_blogemojioneArea = function() {
$(".blog_comment_input").emojioneArea({
useInternalCDN: true,
events: {
keyup: function (editor, event) {
let emojioneArea = this; //this is instance of EmojioneArea
if (event.which === 13 && !event.shiftKey) {
// $scope.onPressKeyTextarea(event);
var audioid = $( $(this)[0].source[0]).attr('data-article-id');
registerBlogComment(emojioneArea.getText(), audioid, event, $(this));
emojioneArea.setText('');
emojioneArea.hidePicker();
emojioneArea.editor.focus();
event.preventDefault();
}
}
},
search: false,
recentEmojis: false,
filtersPosition: "bottom",
tones: false,
autocomplete: false,
filters: {animals_nature: false, food_drink: false, activity: false, travel_places: false, objects: false, symbols: false, flags: false}
});
}
window.init_blogemojioneArea();
});
</script>
<script>
$(document).ready(function() {
$.ajaxSetup({
data: {
hash_id: getHashID()
},
cache: false
});
});
window.addEventListener("popstate", function(e) {
window.location.href = location.href;
});
window.search_url = 'https://aftown.com/search/songs/';
window.chatfetch = false;
window.UpdateChatU = 0;
$(document).on('click', '[data-load]', function(event) {
$('.xzoom-source').remove();
$('#buy_ticket_modal').modal('hide');
if ($(this).attr('data-load') == '') {
window.open($(this).attr('href'), '_blank');
if (parseInt($('.ss_track_play_pause').attr('data_is_ad')) > 0) {
is_sent = 1;
song_id = $('#current-track').attr('value');
onTimesUp(song_id);
return false;
}
return false;
}
$('#bar_loading').show().animate({width:20 + 80 * Math.random() + "%"}, 200);
$('.sections li').removeClass('active');
$('body').removeClass('sidebar_open');
event.preventDefault();
var url = $(this).attr('data-load');
$.ajax({
url: siteUrl() + '/ajax-load.php?path=' + url,
type: 'GET',
dataType: 'html'
})
.done(function(data_html, textStatus, request) {
if (request.status == 201) {
$('#login_box').modal('show');
} else {
if(window.run_station !== null){
window.run_station.pause();
}
data = JSON.parse($(data_html).filter('#json-data').val());
window.history.pushState({state:'new', ajax_url: url},'', data.url);
if(data.page_name == 'messages'){
window.chatfetch = true;
}else{
window.chatfetch = false;
}
if(data.page_name !== 'search'){
$('#search_keyword').val('');
}
if (data.page_name == 'new_music') {
$('#new_music_nav').addClass('active');
}
if (data.page_name == 'albums') {
$('#albums_nav').addClass('active');
}
if (data.page_name == 'spotlight') {
$('#spotlight_nav').addClass('active');
}
if (data.page_name == 'genres') {
$('#genres_nav').addClass('active');
}
if (data.page_name == 'playlists') {
$('#playlists_nav').addClass('active');
}
if (data.page_name == 'stations') {
$('#stations_nav').addClass('active');
}
if (data.page_name == 'store') {
$('#store_nav').addClass('active');
}
if (data.page_name == 'purchased') {
$('#purchased_nav').addClass('active');
}
if (data.page_name == 'recently_played') {
$('#recently_played_nav').addClass('active');
}
if (data.page_name == 'my_playlists') {
$('#my_playlists_nav').addClass('active');
}
if (data.page_name == 'favourites') {
$('#favourites_nav').addClass('active');
}
$('#container_content').html(data_html);
$('meta[name=title]').attr('content', data.site_title);
$('#page').attr('data-page', data.page_name);
$('meta[name=description]').attr('content', data.description);
$('meta[name=keywords]').attr('content', data.keyword);
$('title').html(data.site_title);
if (data.page_name) {
setTimeout(function () {
updateWaves = false;
if ($('#current-track').val()) {
if (Amplitude.getActiveSongMetadata().id == $('#current-track').val()) {
updateWaves = true;
} else {
$('body').removeClass('player_running');
}
} else {
updateWaves = true;
}
if (updateWaves == true) {
var getCurrentPlaying = Number($('.amplitude-song-played-progress').attr('value')) * 100;
$('#light-wave').width(getCurrentPlaying + '%');
updateWaveForm();
}
}, 100);
if( data.page_name == 'blogs' ){
window.search_url = 'https://aftown.com/blogs/tag/';
}
}
if (Amplitude.getActiveSongMetadata().id && $('#page').attr('data-page') == 'track') {
if (Amplitude.getActiveSongMetadata().id == $('#current-track').val()) {
$('body').addClass('player_running');
}
}
if (Amplitude.getActiveSongMetadata().u_id && $('#page').attr('data-page') != 'track') {
$('.playlist-list-song[data-id=' + Amplitude.getActiveSongMetadata().u_id + ']').addClass('playing');
$('.list-recommended[data-id=' + Amplitude.getActiveSongMetadata().u_id + ']').addClass('playlist-list-song playing');
if ($('.feed_post[data-id="' + Amplitude.getActiveSongMetadata().u_id + '"]').length > 0) {
$.get('https://aftown.com/endpoints/get-song-info', {id: Amplitude.getActiveSongMetadata().id}, function(data) {
if (data.status == 200) {
$('body').attr('song-duration', data.duration);
if (data.songWaves.length > 0) {
$('.feed_post[data-id="' + data.songID + '"]:first').find('.waveform-small').html(data.songWaves);
$('#light-wave img').width($('#dark-wave').width() + 'px');
$('.feed_post[data-id="' + data.songID + '"]:first').find('.post-actions').removeClass('hidden');
$('.feed_post[data-id="' + data.songID + '"]:first').find('.ssong_comments').removeClass('hidden');
$('.feed_post[data-id="' + data.songID + '"]:first').find('.art-info').removeClass('hidden');
$('.feed_post[data-id="' + data.songID + '"]:first').find('.comment_list').html(data.comments);
$('.feed_post[data-id="' + data.songID + '"]:first').find('.comment-waves').html(data.waves);
var getCurrentPlaying = Number($('.amplitude-song-played-progress').attr('value')) * 100;
$('#light-wave').width(getCurrentPlaying + '%');
updateWaveForm();
}
}
});
}
}
$('#music-user-ads-table').find('[type="checkbox"]').each(function(index, el) {
$(el).bootstrapToggle();
});
if( data.page_name === 'station'){
setTimeout(function () {
$('body').addClass('player_running');
}, 100);
}
}
})
.fail(function() {
window.location.href = siteUrl()+'/404';
})
.always(function() {
if (typeof data !== 'undefined') {
if (data.page_name == 'user' && data.scroll == true) {
$('html,body').animate({
scrollTop: $('#myTab').offset().top - 350
});
} else {
$('html,body').animate({
scrollTop: $('body').offset().top
});
}
window.init_emojioneArea();
}
$('#bar_loading').animate({width:"100%"}, 200).fadeOut(300, function() {
$(this).width("0");
});
});
});
window.artist_sell = 'on';
var video_player;
</script>
<script src="https://aftown.com/themes/soundify/js/header.js?3449"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/day.style.css" id="night-mode-css">
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/custom.style.css?2184" id="custom.style.css">
<link href="https://gitcdn.github.io/bootstrap-toggle/2.2.2/css/bootstrap-toggle.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://aftown.com/themes/soundify/js/lib/sweetalert2/dist/sweetalert2.min.css">
<link rel="stylesheet" type="text/css" href="https://aftown.com/themes/soundify/css/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/bootstrap-select.min.css">
<script src="https://aftown.com/themes/soundify/js/range.js"></script>
<style>
</style>
<style>
:root {
--main: #fa2d2f;
--main-hover: #fc4d14;
}
.ui-menu-item img { padding-right: 10px; width: 32px; height: 32px; }
.ui-menu-item span { color: #444; font-size: 12px; vertical-align: top }
</style>
<script type="text/javascript" src="https://aftown.com/themes/soundify/js/xzoom.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/html2pdf.bundle.js"></script>
<script src="https://aftown.com/themes/soundify/js/qrcode.js"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/lightbox.min.css">
<script src="https://aftown.com/themes/soundify/js/lightbox.min.js"></script>
<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/flatpickr.min.css">
<script src="https://aftown.com/themes/soundify/js/flatpickr.js"></script>
</head>
<body class=" side_open" data-lang="ltr">
<div class="music_app">
<div class="ma_container" id="page" data-page="404">
<!-- Start Sidebar -->
<div class="ma_sidebar">
<div class="sidebar">
<div class="logo_container">
<a href="https://aftown.com" >
<img src="https://aftown.com/themes/soundify/img/logo.png?cache=201" alt="">
</a>
</div>
<div class="dropdown sfy_search">
<form class="search_cont" data-toggle="dropdown" data-display="static" role="button" onSubmit="event.preventDefault();window.location = window.search_url + $('#search_keyword').val();">
<!--action="https://aftown.com/search/songs" method="POST" >-->
<input name="search_keyword" id="search_keyword" value="" type="search" class="form-control" placeholder="Search for artists, tracks" autocomplete="off"/>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z" /></svg>
</form>
</div>
<div class="sidebar_innr" data-simplebar>
<ul class="sections sfy_side_mobi_links">
<li class="">
<a href="https://aftown.com/discover" data-load="discover"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M19,5V7H15V5H19M9,5V11H5V5H9M19,13V19H15V13H19M9,17V19H5V17H9M21,3H13V9H21V3M11,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z"></path><path class="active_path" fill="currentColor" d="M4 13h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1zm0 8h6c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm10 0h6c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1zM13 4v4c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1z"></path></svg> Discover</a>
</li>
<li class="">
<a href="https://aftown.com/top_music" data-load="top_music"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4.406 14.523l3.402-3.402 2.828 2.829 3.157-3.157L12 9h5v5l-1.793-1.793-4.571 4.571-2.828-2.828-2.475 2.474a8 8 0 1 0-.927-1.9zm-1.538 1.558l-.01-.01.004-.004A9.965 9.965 0 0 1 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10c-4.07 0-7.57-2.43-9.132-5.919z"></path><path class="active_path" fill="currentColor" d="M3.897 17.86l3.91-3.91 2.829 2.828 4.571-4.57L17 14V9h-5l1.793 1.793-3.157 3.157-2.828-2.829-4.946 4.946A9.965 9.965 0 0 1 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10a9.987 9.987 0 0 1-8.103-4.14z"></path></svg> Top Downloads</a>
</li>
</ul>
<ul class="sections">
<h3 class="sfy_side_mobi_links">Explore</h3>
<li class="" id="new_music_nav">
<a href="https://aftown.com/new_music" data-load="new_music" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M20 3v14a4 4 0 1 1-2-3.465V5H9v12a4 4 0 1 1-2-3.465V3h13zM5 19a2 2 0 1 0 0-4 2 2 0 0 0 0 4zm11 0a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/><path d="M20 3v14a4 4 0 1 1-2-3.465V6H9v11a4 4 0 1 1-2-3.465V3h13z" class="active_path" fill="currentColor"></path></svg> New Music</a>
</li>
<li class="" id="albums_nav">
<a href="https://aftown.com/albums" data-load="albums" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M15 4.582V12a3 3 0 1 1-2-2.83V2.05c5.053.501 9 4.765 9 9.95 0 5.523-4.477 10-10 10S2 17.523 2 12c0-5.185 3.947-9.449 9-9.95v2.012A8.001 8.001 0 0 0 12 20a8 8 0 0 0 3-15.418z"/><path d="M13 9.17A3 3 0 1 0 15 12V2.458c4.057 1.274 7 5.064 7 9.542 0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2c.337 0 .671.017 1 .05v7.12z" class="active_path" fill="currentColor"></path></svg> Albums</a>
</li>
<li class="" id="spotlight_nav">
<a href="https://aftown.com/spotlight" data-load="spotlight" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M12.506 3.623l-1.023 1.772c-2.91-.879-5.514-.45-6.411 1.105-1.178 2.04.79 5.652 4.678 7.897s8 2.142 9.178.103c.898-1.555-.033-4.024-2.249-6.105l1.023-1.772c3.082 2.709 4.463 6.27 2.958 8.877-1.86 3.222-7.189 3.355-11.91.63C4.029 13.402 1.48 8.721 3.34 5.5c1.505-2.607 5.28-3.192 9.166-1.877zm3.378-1.85l1.732 1-5 8.66-1.732-1 5-8.66zM6.732 20H17v2H5.017a.995.995 0 0 1-.883-.5 1.005 1.005 0 0 1 0-1l2.25-3.897 1.732 1L6.732 20z"/><path d="M14.368 4.398l-3.484 6.035 1.732 1L16.1 5.398c4.17 2.772 6.306 7.08 4.56 10.102-1.86 3.222-7.189 3.355-11.91.63C4.029 13.402 1.48 8.721 3.34 5.5c1.745-3.023 6.543-3.327 11.028-1.102zm1.516-2.625l1.732 1-1.5 2.598-1.732-1 1.5-2.598zM6.732 20H17v2H5.017a.995.995 0 0 1-.883-.5 1.005 1.005 0 0 1 0-1l2.25-3.897 1.732 1L6.732 20z" class="active_path" fill="currentColor"></path></svg> Spotlight</a>
</li>
<li class="" id="genres_nav">
<a href="https://aftown.com/genres" data-load="genres" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M20.083 15.2l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zm0-4.7l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm-7.569-9.191l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0zM12 3.332L5.887 7 12 10.668 18.113 7 12 3.332z"/><path d="M20.083 10.5l1.202.721a.5.5 0 0 1 0 .858L12 17.65l-9.285-5.571a.5.5 0 0 1 0-.858l1.202-.721L12 15.35l8.083-4.85zm0 4.7l1.202.721a.5.5 0 0 1 0 .858l-8.77 5.262a1 1 0 0 1-1.03 0l-8.77-5.262a.5.5 0 0 1 0-.858l1.202-.721L12 20.05l8.083-4.85zM12.514 1.309l8.771 5.262a.5.5 0 0 1 0 .858L12 13 2.715 7.429a.5.5 0 0 1 0-.858l8.77-5.262a1 1 0 0 1 1.03 0z" class="active_path" fill="currentColor"></path></svg> Genres</a>
</li>
<!--<li class="" id="playlists_nav">-->
<!-- <a href="https://aftown.com/playlists" data-load="playlists" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M2 18h10v2H2v-2zm0-7h14v2H2v-2zm0-7h20v2H2V4zm17 11.17V9h5v2h-3v7a3 3 0 1 1-2-2.83zM18 19a1 1 0 1 0 0-2 1 1 0 0 0 0 2z"/><path d="M2 18h10v2H2v-2zm0-7h14v2H2v-2zm0-7h20v2H2V4zm17 11.17V9h5v2h-3v7a3 3 0 1 1-2-2.83z" class="active_path" fill="currentColor"></path></svg> Playlists</a>-->
<!--</li>-->
</ul>
<ul class="sections">
<h3>Store</h3>
<li class="" id="store_nav">
<a href="https://aftown.com/store/songs" data-load="store/songs" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M21 13v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7H2v-2l1-5h18l1 5v2h-1zM5 13v6h14v-6H5zm-.96-2h15.92l-.6-3H4.64l-.6 3zM6 14h8v3H6v-3zM3 3h18v2H3V3z"/><path d="M21 13v7a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-7H2v-2l1-5h18l1 5v2h-1zM5 13v6h14v-6H5zm1 1h8v3H6v-3zM3 3h18v2H3V3z" class="active_path" fill="currentColor"></path></svg> Browse</a>
</li>
<li class="" id="purchased_nav">
<a href="https://aftown.com/purchased" data-load="purchased" class="valign"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24"><path fill="currentColor" d="M12 2a6 6 0 0 1 6 6v1h4v2h-1.167l-.757 9.083a1 1 0 0 1-.996.917H4.92a1 1 0 0 1-.996-.917L3.166 11H2V9h4V8a6 6 0 0 1 6-6zm6.826 9H5.173l.667 8h12.319l.667-8zM13 13v4h-2v-4h2zm-4 0v4H7v-4h2zm8 0v4h-2v-4h2zm-5-9a4 4 0 0 0-3.995 3.8L8 8v1h8V8a4 4 0 0 0-3.8-3.995L12 4z"/><path d="M12 2a6 6 0 0 1 6 6v1h4v2h-1.167l-.757 9.083a1 1 0 0 1-.996.917H4.92a1 1 0 0 1-.996-.917L3.166 11H2V9h4V8a6 6 0 0 1 6-6zm1 11h-2v4h2v-4zm-4 0H7v4h2v-4zm8 0h-2v4h2v-4zm-5-9a4 4 0 0 0-3.995 3.8L8 8v1h8V8a4 4 0 0 0-3.8-3.995L12 4z" class="active_path" fill="currentColor"></path></svg> Purchased</a>
</li>
</ul>
<ul class="sections">
<h3>Your Music</h3>
<li class="" id="recently_played_nav"><a href="https://aftown.com/recently_played" data-load="recently_played">Recently Played</a></li>
<li class="" id="my_playlists_nav"><a href="https://aftown.com/my_playlists" data-load="my_playlists">My Playlists</a></li>
<li class="" id="favourites_nav"><a href="https://aftown.com/favourites" data-load="favourites">Favourites</a></li>
</ul>
<!-- New section for Aftown Francophone -->
<ul class="sections">
<h3>Explore</h3>
<li id="francophone_nav"><a href="/fr">Aftown Francophone</a></li>
</ul>
<!-- Existing content here -->
<div class="ma_footer">
<div class="ma_footer_cright">
© 2025 Aftown <div class="lang_select dropup">
<button type="button" class="btn dropdown-toggle" data-toggle="modal" data-target="#select-language">English</button>
</div>
</div>
<div class="ma_footer_links">
<a href="https://facebook.com/aftownmusic" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M12.001 2.002c-5.522 0-9.999 4.477-9.999 9.999 0 4.99 3.656 9.126 8.437 9.879v-6.988h-2.54v-2.891h2.54V9.798c0-2.508 1.493-3.891 3.776-3.891 1.094 0 2.24.195 2.24.195v2.459h-1.264c-1.24 0-1.628.772-1.628 1.563v1.875h2.771l-.443 2.891h-2.328v6.988C18.344 21.129 22 16.992 22 12.001c0-5.522-4.477-9.999-9.999-9.999z"></path></svg>
</a> •
<a href="https://x.com/aftownmusic" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M19.633 7.997c.013.175.013.349.013.523 0 5.325-4.053 11.461-11.46 11.461-2.282 0-4.402-.661-6.186-1.809.324.037.636.05.973.05a8.07 8.07 0 0 0 5.001-1.721 4.036 4.036 0 0 1-3.767-2.793c.249.037.499.062.761.062.361 0 .724-.05 1.061-.137a4.027 4.027 0 0 1-3.23-3.953v-.05c.537.299 1.16.486 1.82.511a4.022 4.022 0 0 1-1.796-3.354c0-.748.199-1.434.548-2.032a11.457 11.457 0 0 0 8.306 4.215c-.062-.3-.1-.611-.1-.923a4.026 4.026 0 0 1 4.028-4.028c1.16 0 2.207.486 2.943 1.272a7.957 7.957 0 0 0 2.556-.973 4.02 4.02 0 0 1-1.771 2.22 8.073 8.073 0 0 0 2.319-.624 8.645 8.645 0 0 1-2.019 2.083z"></path></svg>
</a> •
<a href="https://instagram.com/aftownmusic" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24"><path fill="currentColor" d="M20.283 10.356h-8.327v3.451h4.792c-.446 2.193-2.313 3.453-4.792 3.453a5.27 5.27 0 0 1-5.279-5.28 5.27 5.27 0 0 1 5.279-5.279c1.259 0 2.397.447 3.29 1.178l2.6-2.599c-1.584-1.381-3.615-2.233-5.89-2.233a8.908 8.908 0 0 0-8.934 8.934 8.907 8.907 0 0 0 8.934 8.934c4.467 0 8.529-3.249 8.529-8.934 0-.528-.081-1.097-.202-1.625z"></path></svg>
</a> •
<a href="https://aftown.com/terms/dmca" data-load="terms/dmca">DMCA</a> •
<a href="https://aftown.com/blogs" data-load="blogs">Blogs</a> •
<a href="https://aftown.com/terms/about" data-load="terms/about">About Us</a> •
<a href="https://aftown.com/terms/terms" data-load="terms/terms">Terms</a> •
<a href="https://aftown.com/contact" data-load="contact">Contact</a> •
<a href="https://aftown.com/terms/privacy" data-load="terms/privacy">Privacy Policy</a> •
<a href="https://aftown.com/terms/faqs" data-load="terms/faqs">Faqs</a>
• <span class="dropup">
<button type="button" class="btn dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">More</button>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="https://aftown.com/site_pages/Data_Deletion_Policy">Data Deletion</a></li>
</ul>
</span>
</div>
</div>
</div>
</div>
</div>
<script>
function OpenStoreMenu(self) {
$(self).find('span').find('svg').remove();
if ($(".mystore_menu").is(":visible")) {
$(".mystore_menu").slideUp();
$(self).find('span').append('<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>');
}
else{
$(".mystore_menu").slideDown();
$(self).find('span').append('<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="15" height="15" preserveAspectRatio="xMidYMid meet" viewBox="0 0 1024 1024"><path d="M872 474H152c-4.4 0-8 3.6-8 8v60c0 4.4 3.6 8 8 8h720c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" fill="currentColor"/></svg>');
}
}
</script>
<!-- End Sidebar -->
<!-- Header -->
<div id="main-header">
<header class="valign sfy_hdr_trans">
<div class="head_menu" onclick="$('body').addClass('sidebar_open');">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z" /></svg>
</div>
<div class="head_logo">
<a href="https://aftown.com/">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" /></svg>
<img src="https://aftown.com/themes/soundify/img/logo.png?cache=201" alt="">
</a>
</div>
<div class="head_user not_loggd_hdrr">
<span class="dropdown">
<svg data-display="static" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,19.2C9.5,19.2 7.29,17.92 6,16C6.03,14 10,12.9 12,12.9C14,12.9 17.97,14 18,16C16.71,17.92 14.5,19.2 12,19.2M12,5A3,3 0 0,1 15,8A3,3 0 0,1 12,11A3,3 0 0,1 9,8A3,3 0 0,1 12,5M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"></path></svg>
<ul class="dropdown-menu dropdown-menu-right">
<li><a href="#" data-toggle="modal" data-target="#login_box">Login</a></li>
<li><a href="#" data-toggle="modal" data-target="#signup_box">Register</a></li>
</ul>
</span>
</div>
</header>
</div>
<div id="bar_loading"></div>
<!-- End Header -->
<!-- Content -->
<div id="container_content">
<div class="ma_page_content sfy_pc_padd">
<div class="ma_pc_inner">
<ul class="list-unstyled valign sfy_home_tabs">
<li class=""><a href="https://aftown.com/discover" data-load="discover"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M4 13h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1zm0 8h6c.55 0 1-.45 1-1v-4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1zm10 0h6c.55 0 1-.45 1-1v-8c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1v8c0 .55.45 1 1 1zM13 4v4c0 .55.45 1 1 1h6c.55 0 1-.45 1-1V4c0-.55-.45-1-1-1h-6c-.55 0-1 .45-1 1z"></path></svg> Discover</a></li>
<li class=""><a href="https://aftown.com/top_music" data-load="top_music"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M3.897 17.86l3.91-3.91 2.829 2.828 4.571-4.57L17 14V9h-5l1.793 1.793-3.157 3.157-2.828-2.829-4.946 4.946A9.965 9.965 0 0 1 2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10a9.987 9.987 0 0 1-8.103-4.14z"></path></svg> Top Downloads</a></li>
</ul> <div class="content">
<div class="text-center ma_404">
<h3 class="light">Sorry, page not found!</h3>
<section>
<span class="four">4</span>
<span class="zero"><svg height="112px" viewBox="0 0 512 512" width="112px" xmlns="http://www.w3.org/2000/svg"><path d="m256 130.300781-75 24.898438v181.800781c-8.699219-3.601562-18.898438-6-30-6-33.601562 0-60 19.800781-60 45s26.398438 45 60 45 60-19.800781 60-45v-139.199219l45-15 105-35.101562v90.300781c-8.699219-3.601562-18.898438-6-30-6-33.601562 0-60 19.800781-60 45s26.398438 45 60 45 60-19.800781 60-45v-230.699219zm0 0" fill="#5a5a5a"/><path d="m391 85.300781v230.699219c0 25.199219-26.398438 45-60 45s-60-19.800781-60-45 26.398438-45 60-45c11.101562 0 21.300781 2.398438 30 6v-90.300781l-105 35.101562v-91.5zm0 0" fill="#444"/><path d="m256 0c-141 0-256 115-256 256s115 256 256 256 256-115 256-256-115-256-256-256zm0 482c-124.199219 0-226-101.5-226-226 0-55.199219 20.800781-107.101562 56.800781-147.898438l317.097657 317.097657c-40.796876 36-92.699219 56.800781-147.898438 56.800781zm169.199219-78.101562-317.097657-317.097657c40.796876-36 92.699219-56.800781 147.898438-56.800781 124.199219 0 226 101.5 226 226 0 55.199219-20.800781 107.101562-56.800781 147.898438zm0 0" fill="#ffa342"/><path d="m512 256c0 141-115 256-256 256v-30c55.199219 0 107.101562-20.800781 147.898438-56.800781l-147.898438-147.898438v-42.601562l169.199219 169.199219c36-40.796876 56.800781-92.699219 56.800781-147.898438 0-124.5-101.800781-226-226-226v-30c141 0 256 115 256 256zm0 0" fill="#f98f1d"/></svg></span>
<span class="four">4</span>
</section>
<p>The page you are looking for could not be found. Please check the link you followed to get here and try again.</p>
<a href="https://aftown.com/discover" class="btn btn-primary btn-mat">Home</a>
</div>
</div>
</div>
</div>
</div>
<!-- End Content -->
</div>
<!-- Player -->
<div class="ma_player closed">
<div class="valign player">
<div class="player-video-preview" id="my_video_player_container">
<div class="y_player_cover"></div>
<div class="plyr__video-embed" id="my_video_player_">
<iframe
src=""
allowfullscreen
allowtransparency
allow="autoplay"
></iframe>
</div>
</div>
<div class="song_prog_mobi">
<div class="progress_container">
<input type="range" class="amplitude-song-slider" amplitude-main-song-slider="true"/>
<progress id="song-played-progress" class="audio-progress audio-progress--played amplitude-song-played-progress" amplitude-main-song-played-progress="true"></progress>
<progress id="song-buffered-progress" class="audio-progress audio-progress--buffered amplitude-buffered-progress" value="0"></progress>
</div>
</div>
<div class="song_details">
<div class="song_details_inner">
<div class="song_art">
<a href="#" class="player-song-url" data-load=""><img amplitude-song-info="cover_art_url" amplitude-main-song-info="true"/></a>
</div>
<div class="song_title">
<a href="#" class="player-song-url" data-load=""><h3 amplitude-song-info="name" amplitude-main-song-info="true" class="song_name"></h3></a>
</div>
<div class="song_fav" id="song-fav-button"></div>
<div class="song_time">
<span class="current_time">
<span class="amplitude-current-hours" amplitude-main-current-hours="true"></span>:<span class="amplitude-current-minutes" amplitude-main-current-minutes="true"></span>:<span class="amplitude-current-seconds" amplitude-main-current-seconds="true"></span>
</span>
<span class="duration_seperate">/</span>
<span class="duration_time">
<span class="amplitude-duration-hours" amplitude-main-duration-hours="true"></span>:<span class="amplitude-duration-minutes" amplitude-main-duration-minutes="true"></span>:<span class="amplitude-duration-seconds" amplitude-main-duration-seconds="true"></span>
</span>
</div>
</div>
</div>
<div class="valign song_progress">
<div class="valign song_controls">
<div class="amplitude-shuffle amplitude-shuffle-off" id="shuffle" title="Shuffle">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="21" height="21"><path fill="currentColor" d="M18 17.883V16l5 3-5 3v-2.09a9 9 0 0 1-6.997-5.365L11 14.54l-.003.006A9 9 0 0 1 2.725 20H2v-2h.725a7 7 0 0 0 6.434-4.243L9.912 12l-.753-1.757A7 7 0 0 0 2.725 6H2V4h.725a9 9 0 0 1 8.272 5.455L11 9.46l.003-.006A9 9 0 0 1 18 4.09V2l5 3-5 3V6.117a7 7 0 0 0-5.159 4.126L12.088 12l.753 1.757A7 7 0 0 0 18 17.883z"/></svg>
</div>
<div class="amplitude-prev" id="previous">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M7 6c.55 0 1 .45 1 1v10c0 .55-.45 1-1 1s-1-.45-1-1V7c0-.55.45-1 1-1zm3.66 6.82l5.77 4.07c.66.47 1.58-.01 1.58-.82V7.93c0-.81-.91-1.28-1.58-.82l-5.77 4.07c-.57.4-.57 1.24 0 1.64z" /></svg>
</div>
<div class="btn-mat amplitude-play-pause" amplitude-main-play-pause="true" id="play-pause"></div>
<div class="amplitude-next" id="next">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><path fill="currentColor" d="M7.58 16.89l5.77-4.07c.56-.4.56-1.24 0-1.63L7.58 7.11C6.91 6.65 6 7.12 6 7.93v8.14c0 .81.91 1.28 1.58.82zM16 7v10c0 .55.45 1 1 1s1-.45 1-1V7c0-.55-.45-1-1-1s-1 .45-1 1z" /></svg>
</div>
<div class="amplitude-repeat amplitude-repeat-on" id="repeat" title="Repeat">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="21" height="21"><path fill="currentColor" d="M8 20v1.932a.5.5 0 0 1-.82.385l-4.12-3.433A.5.5 0 0 1 3.382 18H18a2 2 0 0 0 2-2V8h2v8a4 4 0 0 1-4 4H8zm8-16V2.068a.5.5 0 0 1 .82-.385l4.12 3.433a.5.5 0 0 1-.321.884H6a2 2 0 0 0-2 2v8H2V8a4 4 0 0 1 4-4h10z"/></svg>
</div>
</div>
</div>
<div class="valign song_progress_right">
<div class="valign volume_controls">
<div class="amplitude-mute amplitude-not-muted"></div>
<div class="plyr_vol_mobi">
<input type="range" class="amplitude-volume-slider"/>
<div class="ms-range-fix"></div>
</div>
</div>
<div class="dropup song_queue">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" data-display="static" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true"><path fill="currentColor" d="M5 10h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm0-4h10c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm0 8h6c.55 0 1 .45 1 1s-.45 1-1 1H5c-.55 0-1-.45-1-1s.45-1 1-1zm9 .88v4.23c0 .39.42.63.76.43l3.53-2.12c.32-.19.32-.66 0-.86l-3.53-2.12c-.34-.19-.76.05-.76.44z"/></svg>
<ul class="dropdown-menu dropdown-menu-right ma_player_playlist">
<div class="valign queue_head">
<h4>Queue</h4>
<span onclick="clearQueues();">Clear</span>
</div>
<div class="queue_list" id="queue-list">
</div>
</ul>
</div>
<button class="btn" onclick="$('body').toggleClass('expand_plr');"><svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 24 24"><path fill="currentColor" d="M10,21V19H6.41L10.91,14.5L9.5,13.09L5,17.59V14H3V21H10M14.5,10.91L19,6.41V10H21V3H14V5H17.59L13.09,9.5L14.5,10.91Z"/><path fill="currentColor" d="M19.5,3.09L15,7.59V4H13V11H20V9H16.41L20.91,4.5L19.5,3.09M4,13V15H7.59L3.09,19.5L4.5,20.91L9,16.41V20H11V13H4Z" class="active_path" /></svg></button>
</div>
</div>
</div>
<script>
for(let i = 0, element; element = document.querySelectorAll('.amplitude-volume-slider')[i++];) {
rangeSlider.create(element, {
polyfill: true
});
}
</script>
<!-- End Player -->
</div>
<!-- Login Modal -->
<!-- Modal -->
<div class="modal" id="login_box" tabindex="-1" role="dialog" aria-labelledby="login_box" aria-hidden="true">
<div class="modal-dialog auth_box" role="document">
<div class="modal-content">
<button class="btn btn-mat" data-dismiss="modal"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 80 80" width="24"><path fill="currentColor" d="M43.533 40l21.567-21.567c0.416-0.445 0.671-1.045 0.671-1.704 0-1.381-1.119-2.5-2.5-2.5-0.659 0-1.259 0.255-1.706 0.672l0.001-0.001-21.567 21.567-21.567-21.567c-0.445-0.416-1.045-0.671-1.704-0.671-1.381 0-2.5 1.119-2.5 2.5 0 0.659 0.255 1.259 0.672 1.706l-0.001-0.001 21.567 21.567-21.567 21.567c-0.452 0.452-0.731 1.077-0.731 1.767s0.279 1.314 0.731 1.767v0c0.452 0.452 1.077 0.731 1.767 0.731s1.314-0.279 1.767-0.731v0l21.567-21.567 21.567 21.567c0.452 0.452 1.077 0.731 1.767 0.731s1.314-0.279 1.767-0.731v0c0.452-0.452 0.731-1.077 0.731-1.767s-0.279-1.314-0.731-1.767v0z"/></svg></button>
<h2>Login</h2>
<p>Get access to your music, playlists and account</p>
<div class="ma_social_login">
<div id="buttonDiv"></div>
</div>
<div class="valign u_divider">OR</div>
<div class="alert alert-danger alert-empty" id="output-errors"></div>
<form method="post" action="" method="POST" id="login-form">
<div class="sfy_mat_input">
<input type="text" name="username" id="username" placeholder="Username" required autofocus>
<label for="username">Username</label>
</div>
<div class="sfy_mat_input">
<input type="password" name="password" id="password" placeholder="Password" required>
<label for="password">Password</label>
</div>
<div class="sfy_custm_rdo">
<input type="checkbox" name="remember_device" id="remember_device" checked>
<label for="remember_device">
Remember this device
</label>
</div>
<input type="hidden" name="last_url" class="login_last_url">
<div class="valign sfy_auth_btns">
<button type="submit" class="btn btn-primary btn-mat" id="btn-submit">Login</button>
<a href="https://aftown.com/forgot-password">Forgot your password?</a>
</div>
</form>
<div class="signup_">
<span>Don't have an account?</span> <a href="#" data-dismiss="modal" data-toggle="modal" data-target="#signup_box">Sign Up</a>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
function handleCredentialResponse(response) {
var id_token = response.credential;
$.post("https://aftown.com/endpoints/auth/google_login?hash_id=" + getHashID(), {id_token: id_token}, function(data, textStatus, xhr) {
if (data.status == 200) {
setTimeout(function () {
window.location.href = data.location;
}, 1000);
}
else{
$('#output-errors').html(data.message);
}
});
}
window.onload = function () {
google.accounts.id.initialize({
client_id: "300414392583-3eofe9uss1v13dhvop3erp9abmuvq9sq.apps.googleusercontent.com",
callback: handleCredentialResponse
});
google.accounts.id.renderButton(
document.getElementById("buttonDiv"),
{ theme: "outline", size: "large" } // customization attributes
);
google.accounts.id.prompt(); // also display the One Tap dialog
}
var options = {
url: "https://aftown.com/endpoints/auth/login?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-errors').empty();
$("#btn-submit").text("Please wait..");
},
success: function (data) {
$("#btn-submit").text("Login");
if (data.status == 200) {
if (data.last_url) {
window.location.href = data.last_url;
return false;
}
if ($('#page').attr('data-page') != 'home' && $('#page').attr('data-page') != 'forgot' && $('#page').attr('data-page') != 'reset') {
$('#main-header').html(data.header);
$('#login_box').modal('hide');
if (Amplitude.getActiveSongMetadata().price > 0) {
location.href = window.location.href;
} else {
location.href = window.location.href;
}
} else {
location.href = window.location.href;
}
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-errors').html(errros);
} else if (data.status == 600) {
location.href = data.location;
}
}
};
$('#login-form').ajaxForm(options);
});
</script>
<!-- End Login Modal -->
<!-- Signup Modal -->
<!-- Modal -->
<div class="modal" id="signup_box" tabindex="-1" role="dialog" aria-labelledby="signup_box" aria-hidden="true">
<div class="modal-dialog auth_box" role="document">
<div class="modal-content">
<button class="btn btn-mat" data-dismiss="modal"><svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 80 80" width="24"><path fill="currentColor" d="M43.533 40l21.567-21.567c0.416-0.445 0.671-1.045 0.671-1.704 0-1.381-1.119-2.5-2.5-2.5-0.659 0-1.259 0.255-1.706 0.672l0.001-0.001-21.567 21.567-21.567-21.567c-0.445-0.416-1.045-0.671-1.704-0.671-1.381 0-2.5 1.119-2.5 2.5 0 0.659 0.255 1.259 0.672 1.706l-0.001-0.001 21.567 21.567-21.567 21.567c-0.452 0.452-0.731 1.077-0.731 1.767s0.279 1.314 0.731 1.767v0c0.452 0.452 1.077 0.731 1.767 0.731s1.314-0.279 1.767-0.731v0l21.567-21.567 21.567 21.567c0.452 0.452 1.077 0.731 1.767 0.731s1.314-0.279 1.767-0.731v0c0.452-0.452 0.731-1.077 0.731-1.767s-0.279-1.314-0.731-1.767v0z"/></svg></button>
<h2>Signup</h2>
<p>Get access to your music, playlists and account</p>
<div class="alert alert-danger alert-empty" id="output-singup-errors"></div>
<form method="post" action="POST" id="signup-form">
<div class="sfy_mat_input">
<input type="text" name="first_name" placeholder="First Name" autofocus>
<label for="username">First Name</label>
</div>
<div class="sfy_mat_input">
<input type="text" name="last_name" placeholder="Last Name">
<label for="username">Last Name</label>
</div>
<div class="sfy_mat_input">
<input type="email" name="email" id="email" placeholder="Email address" required>
<label for="email">Email address</label>
</div>
<div class="sfy_mat_input">
<input type="password" name="password" id="password" placeholder="Password" required>
<label for="password">Password</label>
</div>
<div class="sfy_mat_input">
<input type="password" name="c_password" id="c_password" placeholder="Confirm Password" required>
<label for="c_password">Confirm Password</label>
</div>
<div class="recaptcha">
<div class="g-recaptcha" data-sitekey="6LcxLxsUAAAAAAS4S9-O7F0EFye-dG0NCOds3Jkc"></div>
</div>
<div class="valign sfy_auth_btns">
<button type="submit" class="btn btn-primary btn-mat" id="btn-singup-submit">Signup</button>
<div class="terms_check">
<span>By signing up, you agree to our</span> <a href="https://aftown.com/terms/terms">Terms</a> <span>and</span> <a href="https://aftown.com/terms/privacy">Privacy Policy</a>
</div>
</div>
</form>
<div class="signup_">
<span>Already have an account?</span> <a href="#" data-dismiss="modal" data-toggle="modal" data-target="#login_box">Login</a>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/auth/signup?hash_id=" + getHashID()+ '',
beforeSubmit: function () {
$('#output-singup-errors').removeClass("alert-success").addClass('alert-danger');
$('#output-singup-errors').empty();
$("#btn-singup-submit").text("Please wait..");
},
success: function (data) {
$("#btn-singup-submit").text("Signup");
if (data.status == 200) {
if( typeof data.link !== "undefined" ){
location.href = 'https://aftown.com';
}
if ($('#page').attr('data-page') != 'home' && $('#page').attr('data-page') != 'forgot' && $('#page').attr('data-page') != 'reset') {
$('#main-header').html(data.header);
$('#signup_box').modal('hide');
if (Amplitude.getActiveSongMetadata().price > 0) {
location.href = 'https://aftown.com/interest';//window.location.href;
} else {
ajaxRedirect('interest');
}
} else {
location.href = 'https://aftown.com/interest';//window.location.href;
}
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-singup-errors').html(errros);
} else if (data.status == 403) {
$('#output-singup-errors').removeClass("alert-danger").addClass('alert-success');
$('#output-singup-errors').html(data.message);
}
}
};
$('#signup-form').ajaxForm(options);
});
</script>
<!-- End Signup Modal -->
<!-- Modals -->
<div class="modal fade" id="delete-song" tabindex="-1" role="dialog" aria-labelledby="delete-song" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete your track</h5>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this track?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" onclick="deleteSong();">Delete</button>
</div>
</div>
</div>
</div> <div class="modal fade" id="delete-comment" tabindex="-1" role="dialog" aria-labelledby="delete-comment" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete comment</h5>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this comment?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" onclick="deleteComment();">Delete</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="delete-comment-replay" tabindex="-1" role="dialog" aria-labelledby="delete-comment-replay" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete comment</h5>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this comment?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" onclick="deleteCommentReplay(this);">Delete</button>
</div>
</div>
</div>
</div> <div class="modal fade" id="delete-post" tabindex="-1" role="dialog" aria-labelledby="delete-post" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete your post</h5>
</div>
<div class="modal-body">
<p>Are you sure you want to delete this post?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" onclick="deletePost();">Delete</button>
</div>
</div>
</div>
</div> <div class="modal fade" id="reposted" tabindex="-1" role="dialog" aria-labelledby="reposted" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg> The song was successfully shared on your timeline.</div>
</div>
</div>
</div>
</div> <div class="modal fade" id="purchase-song" role="dialog" aria-labelledby="purchase-song" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Purchase Required</h5>
</div>
<div class="modal-body">
<p>To continue listening to this track, you need to purchase the song.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-mat btn-mat-purchase-song" onclick="purchaseTrack($(this));">Buy ₵<span class="price"></span></button>
</div>
</div>
</div>
</div> <div class="modal fade" id="age-restricted" role="dialog" aria-labelledby="age-restricted" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Age restricted track</h5>
</div>
<div class="modal-body">
<p>This track is age restricted for viewers under 18, Create an account or login to confirm your age.</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div> <div class="modal fade" id="create_copyright_box" tabindex="-1" role="dialog" aria-labelledby="create_copyright_box" aria-hidden="true">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Create DMCA take down notice</h5>
</div>
<form method="post" action="" id="copyright-form">
<div class="modal-body">
<div class="alert alert-danger alert-empty" id="output-copyright-errors"></div>
<div class="sfy_mat_input">
<textarea name="description" id="description" placeholder="DMCA" rows="4"></textarea>
<label for="description">DMCA</label>
<small class="form-text">Please describe your request carefully and as much as you can, note that false DMCA requests can lead to account termination.</small>
</div>
<hr>
<div class="sfy_custm_rdo">
<input type="checkbox" id="confirm_1" name="confirm_1">
<label for="confirm_1">I have a good faith belief that use of the copyrighted work described above is not authorized by the copyright owner, its agent or the law</label>
</div>
<div class="sfy_custm_rdo">
<input type="checkbox" id="confirm_2" name="confirm_2">
<label for="confirm_2">I confirm that I am the copyright owner or am authorised to act on behalf of the owner of an exclusive right that is allegedly infringed.</label>
</div>
</div>
<input type="hidden" id="song-copyright-id" name="id">
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat" id="btn-copyright-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/copyright-create?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-copyright-errors').removeClass('alert-success').addClass('alert-danger');
$('#output-copyright-errors').empty();
$("#btn-copyright-submit").text("Please wait..");
},
success: function (data) {
$("#btn-copyright-submit").text("Submit");
if (data.status == 200) {
$('#output-copyright-errors').addClass('alert-success').removeClass('alert-danger');
$('#output-copyright-errors').text("Thanks for your submission, we will review your request shortly.");
setTimeout(function () {
$('#copyright-form')[0].reset();
$('#create_copyright_box').modal('hide');
closeModal();
$('#output-copyright-errors').empty();
}, 3000);
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-copyright-errors').html(errros);
}
}
};
$('#copyright-form').ajaxForm(options);
});
</script> <div class="modal fade" id="comment_unreported" tabindex="-1" role="dialog" aria-labelledby="comment_unreported" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg> The comment report was successfully deleted.</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="report_comment" tabindex="-1" role="dialog" aria-labelledby="report_comment" aria-hidden="true">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Report Comment</h5>
</div>
<form method="post" action="" id="comment-report-form">
<div class="modal-body">
<div class="alert alert-danger alert-empty" id="output-report-comment-errors"></div>
<div class="sfy_mat_input">
<textarea name="comment_description" id="comment_description" placeholder="Report comment." rows="4"></textarea>
<label for="comment_description">Report comment.</label>
<small class="form-text">Please describe whey you want to report this comment.</small>
</div>
</div>
<input type="hidden" id="comment_id" name="id">
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat" id="btn-report-comment-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/report-comment?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-report-comment-errors').removeClass('alert-success').addClass('alert-danger');
$('#output-report-comment-errors').empty();
$("#btn-report-comment-submit").text("Please wait..");
},
success: function (data) {
$("#btn-report-comment-submit").text("Submit");
if (data.status == 200) {
$('#output-report-comment-errors').addClass('alert-success').removeClass('alert-danger');
$('#output-report-comment-errors').text("Thanks for your submission, we will review your request shortly.");
setTimeout(function () {
$('#comment-report-form')[0].reset();
$('#report_comment').modal('hide');
closeModal();
var comment_id = $('#comment_id').val();
$('.comment_report[data-comment-id="'+comment_id+'"]').hide();
$('.comment_unreport[data-comment-id="'+comment_id+'"]').css({'visibility':'inherit'});
$('.comment_unreport[data-comment-id="'+comment_id+'"]').show();
$('#output-report-comment-errors').empty();
}, 3000);
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-report-comment-errors').html(errros);
}
}
};
$('#comment-report-form').ajaxForm(options);
});
</script> <div class="modal fade" id="blog_comment_unreported" tabindex="-1" role="dialog" aria-labelledby="comment_unreported" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg> The comment report was successfully deleted.</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="blog_report_comment" tabindex="-1" role="dialog" aria-labelledby="blog_report_comment" aria-hidden="true">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Report comment.</h5>
</div>
<form method="post" action="" id="blog-comment-report-form">
<div class="modal-body">
<div class="alert alert-danger alert-empty" id="output-blog-report-comment-errors"></div>
<div class="sfy_mat_input">
<textarea name="comment_description" id="blog_comment_description" placeholder="Report comment." rows="4"></textarea>
<label for="comment_description">Report comment.</label>
<small class="form-text">Please describe whey you want to report this comment.</small>
</div>
</div>
<input type="hidden" id="blog_comment_id" name="id">
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat" id="btn-blog-report-comment-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/blog-report-comment?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-blog-report-comment-errors').removeClass('alert-success').addClass('alert-danger');
$('#output-blog-report-comment-errors').empty();
$("#btn-blog-report-comment-submit").text("Please wait..");
},
success: function (data) {
$("#btn-blog-report-comment-submit").text("Submit");
if (data.status == 200) {
$('#output-blog-report-comment-errors').addClass('alert-success').removeClass('alert-danger');
$('#output-blog-report-comment-errors').text("Thanks for your submission, we will review your request shortly.");
setTimeout(function () {
$('#blog-comment-report-form')[0].reset();
$('#blog_report_comment').modal('hide');
closeModal();
var comment_id = $('#blog_comment_id').val();
$('.blog_comment_report[data-comment-id="'+comment_id+'"]').hide();
$('.blog_comment_unreport[data-comment-id="'+comment_id+'"]').css({'visibility':'inherit'});
$('.blog_comment_unreport[data-comment-id="'+comment_id+'"]').show();
$('#output-blog-report-comment-errors').empty();
}, 3000);
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-blog-report-comment-errors').html(errros);
}
}
};
$('#blog-comment-report-form').ajaxForm(options);
});
</script> <div class="modal fade" id="track_unreported" tabindex="-1" role="dialog" aria-labelledby="track_unreported" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg> The track report was successfully deleted.</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="report_track" tabindex="-1" role="dialog" aria-labelledby="report_track" aria-hidden="true">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Report track.</h5>
</div>
<form method="post" action="" id="track-report-form">
<div class="modal-body">
<div class="alert alert-danger alert-empty" id="output-report-track-errors"></div>
<div class="sfy_mat_input">
<textarea name="track_description" id="track_description" placeholder="Report track." rows="4"></textarea>
<label for="track_description">Report track.</label>
<small class="form-text">Please describe whey you want to report this track.</small>
</div>
</div>
<input type="hidden" id="report_track_id" name="id">
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat" id="btn-report-track-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/report-track?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-report-track-errors').removeClass('alert-success').addClass('alert-danger');
$('#output-report-track-errors').empty();
$("#btn-report-track-submit").text("Please wait..");
},
success: function (data) {
$("#btn-report-track-submit").text("Submit");
if (data.status == 200) {
$('#output-report-track-errors').addClass('alert-success').removeClass('alert-danger');
$('#output-report-track-errors').text("Thanks for your submission, we will review your request shortly.");
setTimeout(function () {
$('#track-report-form')[0].reset();
$('#report_track').modal('hide');
closeModal();
var track_id = $('#report_track_id').val();
$('.track_report[data-track-id="'+track_id+'"]').hide();
$('.track_unreport[data-track-id="'+track_id+'"]').css({'visibility':'inherit'});
$('.track_unreport[data-track-id="'+track_id+'"]').show();
$('#output-report-track-errors').empty();
}, 3000);
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-report-track-errors').html(errros);
}
}
};
$('#track-report-form').ajaxForm(options);
});
</script> <div class="modal fade" id="track_unreported" tabindex="-1" role="dialog" aria-labelledby="track_unreported" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"></path></svg> The track report was successfully deleted.</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="review_track" tabindex="-1" role="dialog" aria-labelledby="report_track" aria-hidden="true">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Review track.</h5>
</div>
<form method="post" action="" id="track-review-form">
<div class="modal-body">
<div class="alert alert-danger alert-empty" id="output-review-track-errors"></div>
<div class='rating-stars'>
<ul class="list-unstyled" id='stars'>
<li class='star' title='Poor' data-value='1'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,17.27l4.15,2.51c0.76,0.46,1.69-0.22,1.49-1.08l-1.1-4.72l3.67-3.18c0.67-0.58,0.31-1.68-0.57-1.75l-4.83-0.41 l-1.89-4.46c-0.34-0.81-1.5-0.81-1.84,0L9.19,8.63L4.36,9.04c-0.88,0.07-1.24,1.17-0.57,1.75l3.67,3.18l-1.1,4.72 c-0.2,0.86,0.73,1.54,1.49,1.08L12,17.27z" /></svg></li>
<li class='star' title='Fair' data-value='2'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,17.27l4.15,2.51c0.76,0.46,1.69-0.22,1.49-1.08l-1.1-4.72l3.67-3.18c0.67-0.58,0.31-1.68-0.57-1.75l-4.83-0.41 l-1.89-4.46c-0.34-0.81-1.5-0.81-1.84,0L9.19,8.63L4.36,9.04c-0.88,0.07-1.24,1.17-0.57,1.75l3.67,3.18l-1.1,4.72 c-0.2,0.86,0.73,1.54,1.49,1.08L12,17.27z" /></svg></li>
<li class='star' title='Good' data-value='3'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,17.27l4.15,2.51c0.76,0.46,1.69-0.22,1.49-1.08l-1.1-4.72l3.67-3.18c0.67-0.58,0.31-1.68-0.57-1.75l-4.83-0.41 l-1.89-4.46c-0.34-0.81-1.5-0.81-1.84,0L9.19,8.63L4.36,9.04c-0.88,0.07-1.24,1.17-0.57,1.75l3.67,3.18l-1.1,4.72 c-0.2,0.86,0.73,1.54,1.49,1.08L12,17.27z" /></svg></li>
<li class='star' title='Excellent' data-value='4'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,17.27l4.15,2.51c0.76,0.46,1.69-0.22,1.49-1.08l-1.1-4.72l3.67-3.18c0.67-0.58,0.31-1.68-0.57-1.75l-4.83-0.41 l-1.89-4.46c-0.34-0.81-1.5-0.81-1.84,0L9.19,8.63L4.36,9.04c-0.88,0.07-1.24,1.17-0.57,1.75l3.67,3.18l-1.1,4.72 c-0.2,0.86,0.73,1.54,1.49,1.08L12,17.27z" /></svg></li>
<li class='star' title='WOW!!!' data-value='5'><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,17.27l4.15,2.51c0.76,0.46,1.69-0.22,1.49-1.08l-1.1-4.72l3.67-3.18c0.67-0.58,0.31-1.68-0.57-1.75l-4.83-0.41 l-1.89-4.46c-0.34-0.81-1.5-0.81-1.84,0L9.19,8.63L4.36,9.04c-0.88,0.07-1.24,1.17-0.57,1.75l3.67,3.18l-1.1,4.72 c-0.2,0.86,0.73,1.54,1.49,1.08L12,17.27z" /></svg></li>
</ul>
</div>
<div class="sfy_mat_input">
<textarea name="track_review_description" id="track_review_description" placeholder="Please enter your review." rows="4"></textarea>
<label for="track_review_description">Please enter your review.</label>
</div>
</div>
<input type="hidden" id="review_track_id" name="id">
<input type="hidden" id="review_track_oid">
<input type="hidden" id="track_stars" name="track_stars" value="0">
<div class="modal-footer">
<button type="button" class="btn btn-mat btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat" disabled="disabled" id="btn-review-track-submit">Submit</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function(){
/* 1. Visualizing things on Hover - See next part for action on click */
$('#stars li').on('mouseover', function(){
var onStar = parseInt($(this).data('value'), 10); // The star currently mouse on
// Now highlight all the stars that's not after the current hovered star
$(this).parent().children('li.star').each(function(e){
if (e < onStar) {
$(this).addClass('hover');
}
else {
$(this).removeClass('hover');
}
});
}).on('mouseout', function(){
$(this).parent().children('li.star').each(function(e){
$(this).removeClass('hover');
});
});
$('#track_review_description').bind('input propertychange', function() {
if(this.value.length){
var ratingValue = parseInt($('#stars li.selected').last().data('value'), 10);
if (ratingValue > 1) {
$('#btn-review-track-submit').removeAttr('disabled');
}
}
});
/* 2. Action to perform on click */
$('#stars li').on('click', function(){
var onStar = parseInt($(this).data('value'), 10); // The star currently selected
var stars = $(this).parent().children('li.star');
for (i = 0; i < stars.length; i++) {
$(stars[i]).removeClass('selected');
}
for (i = 0; i < onStar; i++) {
$(stars[i]).addClass('selected');
}
// JUST RESPONSE (Not needed)
var ratingValue = parseInt($('#stars li.selected').last().data('value'), 10);
var msg = "";
if (ratingValue > 1) {
$('#track_stars').val(ratingValue);
if( $('#track_review_description').val() !== '' ) {
$('#btn-review-track-submit').removeAttr('disabled');
}
msg = "Thanks! You rated this " + ratingValue + " stars.";
}
else {
msg = "We will improve ourselves. You rated this " + ratingValue + " stars.";
}
});
});
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/review-track?hash_id=" + getHashID(),
beforeSubmit: function () {
$('#output-review-track-errors').removeClass('alert-success').addClass('alert-danger');
$('#output-review-track-errors').empty();
$("#btn-review-track-submit").text("Please wait..");
},
success: function (data) {
$("#btn-review-track-submit").text("Submit");
if (data.status == 200) {
$('#output-review-track-errors').addClass('alert-success').removeClass('alert-danger');
$('#output-review-track-errors').text("Thanks for your submission.");
setTimeout(function () {
$('#track-review-form')[0].reset();
$('#review_track').modal('hide');
closeModal();
goToAjaxLink('track/'+$('#review_track_oid').val());
$('#output-review-track-errors').empty();
}, 3000);
} else if (data.status == 400) {
var errros = data.errors.join("<br>");
$('#output-review-track-errors').html(errros);
}
}
};
$('#track-review-form').ajaxForm(options);
});
</script>
<div class="modal fade" id="bank_transfer_modal_response" tabindex="-1" role="dialog" aria-labelledby="bank_transfer_modal_response" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="no-track-found" style="padding: 30px 0px;">
<span id="bank_transfer_modal_response_txt"></span>
</div>
</div>
</div>
</div>
</div>
<div class="bank_transfer_modal modal fade" tabindex="-1" role="dialog" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content dt_bank_trans_modal">
<div class="modal-header">
<h5 class="modal-title">Bank Transfer</h5>
</div>
<div class="modal-body">
<div class="bank_info"><div class="dt_settings_header bg_gradient"> <div class="bank_info_innr"> <h4 class="bank_name">Stanbic Bank</h4> <div class="row"> <div class="col-md-12"> <div class="bank_account"> <p>9040007089044</p> <span class="help-block">Account number / IBAN</span> </div> </div> <div class="col-md-12"> <div class="bank_account_holder"> <p>Aftown Music Limited</p> <span class="help-block">Account name</span> </div> </div> <div class="col-md-6"> <div class="bank_account_code"> <p>Ring Road</p> <span class="help-block">Branch</span> </div> </div> <div class="col-md-6"> <div class="bank_account_country"> <p>Ghana</p> <span class="help-block">Country</span> </div> </div> </div> </div></div></div>
<ul class="list-unstyled hide_alert_info_bank_trans">
<li id="bank_note">In order to confirm the bank transfer, you will need to upload a receipt or take a screenshot of your transfer within 1 day from your payment date. If a bank transfer is made but no receipt is uploaded within this period, your order will be cancelled. We will verify and confirm your receipt within 3 working days from the date you upload it.</li>
</ul>
<div class="upload_bank_receipts">
<div class="valign" onclick="document.getElementById('receipt_img').click(); return false">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z"></path></svg>
<p>Upload Receipt</p>
<img id="receipt_img_preview" src="">
</div>
</div>
<input type="file" id="receipt_img" class="hide" accept="image/x-png, image/gif, image/jpeg, image/webp" name="receipt_img">
</div>
<!--<span style="display: block;text-align: center;" id="receipt_img_path"></span>-->
<div class="bank_transfr_progress hide" id="img_upload_progress">
<div class="progress">
<div id="img_upload_progress_bar" class="determinate progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%"></div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-mat btn-default" data-dismiss="modal">Close</button>
<button class="btn btn-primary btn-mat" disabled id="btn-upload-receipt" data-selected="" data-mode="" data-id="" data-title="" data-price="">Confirm</button>
</div>
</div>
</div>
</div>
<script>
document.getElementById('receipt_img').removeEventListener("change", handleReceiptImgChange, true);
document.getElementById('receipt_img').addEventListener('change', handleReceiptImgChange, { passive: false });
function handleReceiptImgChange(){
let imgPath = $(this)[0].files[0].name;
if (typeof(FileReader) != "undefined") {
let reader = new FileReader();
reader.onload = function(e) {
$('#receipt_img_preview').attr('src', e.target.result);
};
reader.readAsDataURL(this.files[0]);
}
$('#receipt_img_path').html(imgPath);
$('.bank_transfer_modal').addClass('up_rec_img_ready');
$('#btn-upload-receipt').removeAttr('disabled');
$('#btn-upload-receipt').removeClass('btn-flat').addClass('btn-success');
}
document.getElementById('btn-upload-receipt').addEventListener('click', function(e) {
e.preventDefault();
let bar = $('#img_upload_progress');
let percent = $('#img_upload_progress_bar');
let id = $(this).attr("data-id");
if (!id) {
return false;
}
let title = $(this).attr("data-title");
let price = $(this).attr("data-price");
let mode = $(this).attr("data-mode");
let formData = new FormData();
formData.append("hash_id",'d45479e1c9d5a14f59f46a124824e2591cecb3d5');
formData.append("description",title);
formData.append("price", price);
formData.append("mode", mode);
formData.append("track_id", id);
formData.append("receipt_img", $("#receipt_img")[0].files[0], $("#receipt_img")[0].files[0].value);
bar.removeClass('hide');
$.ajax({
xhr: function() {
let xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
let percentComplete = evt.loaded / evt.total;
percentComplete = parseInt(percentComplete * 100);
//status.html( percentComplete + "%");
percent.width(percentComplete + '%');
percent.html(percentComplete + '%');
if (percentComplete === 100) {
bar.addClass('hide');
percent.width('0%');
percent.html('0%');
}
}
}, false);
return xhr;
},
url: ajaxUrl() + '/upload-receipt',
type: "POST",
async: true,
enctype: 'multipart/form-data',
processData: false,
contentType: false,
cache: false,
timeout: 60000,
dataType: false,
data: formData,
success: function(result) {
if( result.status == 200 ){
$('#payment_modal').modal('hide');
$('#paymentpro_modal').modal('hide');
$('.bank_transfer_modal').modal('hide');
$('#bank_transfer_modal_response_txt').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M0.41,13.41L6,19L7.41,17.58L1.83,12M22.24,5.58L11.66,16.17L7.5,12L6.07,13.41L11.66,19L23.66,7M18,7L16.59,5.58L10.24,11.93L11.66,13.34L18,7Z" /></svg>Your receipt has been uploaded successfully.');
$('#bank_transfer_modal_response').modal('show');
setTimeout(function () {
$('#bank_transfer_modal_response').modal('hide');
},2000);
return false;
}
}
});
});
</script> <div class="modal fade mat_box" id="logged-out-modal" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Session Expired</h4>
</div>
<div class="modal-body">
<p>Your Session has been expired, please login again.</p>
</div>
<div class="modal-footer">
<a href="https://aftown.com/discover" class="btn btn-mat btn-default">Login</a>
</div>
</div>
</div>
</div> <div class="modal fade mat_box" id="verify_code" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="two_factor_title">
A confirmation email has been sent. </h5>
</div>
<form id="confirmation_code_form" class="confirmation_code_form" method="POST">
<div class="modal-body">
<div id="confirmation_code_form_alert"></div>
<p id="two_factor_desc">
We have sent an email that contains the confirmation code to enable Two-factor authentication. </p>
<div class="form-group">
<input type="text" class="sfy_confrm_code_input" name="code" placeholder="Confirmation code">
</div>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-mat btn-default">Cancel</button>
<button id="confirmation_code_form_btn" type="submit" class="btn btn-primary btn-mat">Save</button>
</div>
<input type="hidden" id="confirmation_code_form_user_id" name="user_id" value="">
</form>
</div>
</div>
</div>
<div class="modal fade mat_box" id="verify_email_phone" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="verify_email_phone_title">
</h5>
</div>
<form id="verify_email_phone_form" class="verify_email_phone_form" method="POST">
<div class="modal-body">
<div id="verify_email_phone_form_alert"></div>
<p id="verify_email_phone_desc">
</p>
<div class="form-group">
<input type="text" class="sfy_confrm_code_input" name="code" placeholder="Confirmation code">
</div>
</div>
<div class="modal-footer">
<button data-dismiss="modal" class="btn btn-mat btn-default">Cancel</button>
<button id="verify_email_phone_form_btn" type="submit" class="btn btn-primary btn-mat">Save</button>
</div>
</form>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('.sfy_confrm_code_input').codeInput({
number: 6
});
});
jQuery.fn.codeInput = function(options) {
var defaults = {
number: 4,
length: 1
};
var settings = $.extend({}, defaults, options);
return this.each(function() {
var self = $(this);
var placeholder = self.attr('placeholder');
var div = $('<div />').addClass('sfy_confrm_code');
div.append($('<span />').text(placeholder));
self.replaceWith(div);
div.append(self);
var inputDiv = $('<div />').addClass('inputs');
for(var i = 1; i <= settings.number; i++) {
inputDiv.append($('<input />').attr({
maxlength: settings.length
}));
}
div.prepend(inputDiv);
div.on('click touchstart', function(e) {
if(!div.hasClass('active')) {
div.addClass('active');
setTimeout(function() {
div.find('.inputs input:first-child').focus();
}, 100);
}
});
div.find('.inputs').on('keyup input', 'input', function(e) {
if($(this).val().toString().length >= settings.length || e.keyCode == 39) {
$(this).next().focus();
}
if(e.keyCode == 8 || e.keyCode == 37) {
$(this).prev().focus();
}
var value = '';
div.find('.inputs input').each(function() {
value = value + $(this).val().toString();
});
self.attr({
value: value
});
});
$(document).on('click touchstart', function(e) {
if(!$(e.target).parent().is(div) && !$(e.target).parent().parent().is(div)) {
var hide = true;
div.find('.inputs input').each(function() {
if($(this).val().toString().length) {
hide = false;
}
});
if(hide) {
div.removeClass('active');
div.find('.inputs input').blur();
} else {
div.addClass('active');
}
}
});
});
}
</script>
<div class="modal fade" id="refund_order" tabindex="-1" role="dialog" aria-labelledby="refund_order" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Request a Refund</h5>
</div>
<form class="refund_order_form" method="post">
<div class="modal-body">
<div class="modal_refund_order_modal_alert"></div>
<div class="form-group mat_input">
<div class="col-md-12">
<textarea placeholder="Please explain the reason" name="message" id="refund_order_message"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat">Request</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="add_address_modal" tabindex="-1" role="dialog" aria-labelledby="add_address_modal" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Add New Address</h5>
</div>
<form class="address_form" method="post">
<div class="modal-body">
<div class="modal_add_address_modal_alert"></div>
<div class="form-group mat_input">
<div class="col-md-12">
<input type="text" name="name" id="name" autofocus placeholder="Name">
</div>
</div>
<div class="form-group mat_input">
<div class="col-md-12">
<input type="text" name="phone" id="phone" autofocus placeholder="Phone">
</div>
</div>
<div class="form-group mat_input">
<div class="col-md-12">
<input type="text" name="country" id="country" autofocus placeholder="Country">
</div>
</div>
<div class="form-group mat_input">
<div class="col-md-12">
<input type="text" name="city" id="city" autofocus placeholder="City">
</div>
</div>
<div class="form-group mat_input">
<div class="col-md-12">
<input type="text" name="zip" id="zip" autofocus placeholder="Postcode / Zip">
</div>
</div>
<div class="form-group mat_input">
<div class="col-md-12">
<textarea placeholder="Address" name="address"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary btn-mat">Add</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="delete-address" tabindex="-1" role="dialog" aria-labelledby="delete-address" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete your address</h5>
</div>
<div class="modal-body">
Are you sure you want to delete this address?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="buy_product_modal" tabindex="-1" role="dialog" aria-labelledby="buy_product" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Payment Alert</h5>
</div>
<div class="modal-body">
<div class="modal_product_pay_alert"></div>
You are about to purchase the items, do you want to proceed?
</div>
<div class="modal-footer">
<input type="hidden" id="product_id">
<input type="hidden" id="product_price">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-mat">Pay</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="delete-product" tabindex="-1" role="dialog" aria-labelledby="delete-product" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete your product</h5>
</div>
<div class="modal-body">
Are you sure you want to delete this product?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="story_pay" tabindex="-1" role="dialog" aria-labelledby="story_pay" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Pay for story</h5>
</div>
<div class="modal-body">
<div class="modal_story_pay_alert"></div>
Are you sure you want to pay for create story?
</div>
<div class="modal-footer">
<input type="hidden" id="story_pay_id">
<input type="hidden" id="story_pay_file">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-mat" onclick="PayForStory()">Pay ₵0</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="wallet_to_pay" tabindex="-1" role="dialog" aria-labelledby="wallet_to_pay" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Pay from wallet</h5>
</div>
<div class="modal-body">
<div class="modal_wallet_pay_alert"></div>
<div id="wallet_to_pay_text"></div>
</div>
<div class="modal-footer">
<input type="hidden" id="wallet_to_pay_price">
<input type="hidden" id="wallet_to_pay_type">
<input type="hidden" id="wallet_to_pay_id">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-mat" onclick="PayFromWallet()">Pay ₵0</button>
</div>
</div>
</div>
</div>
<div class="modal fade buy_event_ticket" id="buy_ticket_modal" tabindex="-1" role="dialog" aria-labelledby="buy_ticket_modal" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="buy_event_ticket_top">
<h5 class="modal-title">Buy a ticket</h5>
<p class="subtitle">Are you sure you want to buy a ticket?</p>
<div class="ticket-img"></div>
<div class="d-flex justify-content-between buy_event_ticket_top_mid">
<div class="avail_ticket">
<b>Available Tickets</b>
<p></p>
</div>
<div class="avail_ticket_price text-right">
<b>Price</b>
<p></p>
</div>
</div>
</div>
<div class="buy_event_ticket_mid"></div>
<div class="buy_event_ticket_bottom">
<div class="modal-body-alert"></div>
<div class="row mx-0">
<div class="col-6 px-1">
<button type="button" class="btn btn-default btn-mat btn-block" data-dismiss="modal">Cancel</button>
</div>
<div class="col-6 px-1">
<button type="button" class="btn btn-primary btn-mat btn-block">Buy</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="unjoin-event" tabindex="-1" role="dialog" aria-labelledby="unjoin-event" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Leave event</h5>
</div>
<div class="modal-body">
Are you sure you want to leave this event?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-primary btn-mat" data-dismiss="modal">Leave</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="delete-event" tabindex="-1" role="dialog" aria-labelledby="delete-event" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Delete your event</h5>
</div>
<div class="modal-body">
Are you sure you want to delete this event?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="button" class="btn btn-danger btn-mat" data-dismiss="modal">Delete</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="albums_success" role="dialog" aria-labelledby="albums" aria-hidden="true" data-id="{{t_id}}">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content add_to_plist">
<div class="modal-body" style="background: #1b711e;">
<!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 512 512" xml:space="preserve" width="50" height="50">
<g>
<g>
<path fill="currentColor" d="M449.716,239.842c-0.543-7.535-7.082-13.191-14.628-12.661c-7.536,0.543-13.204,7.092-12.662,14.628
c0.337,4.655,0.506,9.431,0.506,14.191c0,109.061-88.726,197.787-197.786,197.787C116.086,453.787,27.36,365.06,27.36,256
S116.086,58.214,225.147,58.214c43.191,0,84.21,13.668,118.62,39.525c6.041,4.538,14.615,3.321,19.154-2.718
c4.54-6.04,3.323-14.616-2.717-19.154c-39.189-29.447-85.891-45.012-135.058-45.012C101.001,30.854,0,131.855,0,256
s101.001,225.145,225.147,225.145S450.292,380.146,450.292,256C450.292,250.586,450.097,245.15,449.716,239.842z"/>
</g>
</g>
<g>
<g>
<path fill="currentColor" d="M496.395,61.77c-20.808-20.807-54.666-20.807-75.474,0l-197.11,197.108l-69.874-69.875
c-20.808-20.807-54.666-20.807-75.474,0c-20.808,20.808-20.808,54.666,0,75.474l120.341,120.341
c6.895,6.895,15.951,10.342,25.007,10.342c9.057,0,18.113-3.447,25.008-10.342l247.576-247.576
C517.201,116.435,517.201,82.579,496.395,61.77z M477.049,117.897L229.472,365.475c-3.12,3.12-8.2,3.12-11.32,0L97.811,245.133
c-10.141-10.141-10.141-26.64,0-36.781c5.07-5.072,11.729-7.606,18.39-7.606s13.321,2.535,18.39,7.606l71.882,71.882
c4.632,4.631,10.791,7.181,17.339,7.181c6.551,0,12.71-2.551,17.341-7.182L440.268,81.116c10.138-10.141,26.64-10.141,36.781,0
C487.189,91.257,487.189,107.756,477.049,117.897z"/>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
<br><br>
<b>The track has been moved to following album.</b>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ShowAlert" tabindex="-1" role="dialog" aria-labelledby="ShowAlert" aria-hidden="true" data-id="0">
<div class="modal-dialog mat_box" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title"></h5>
</div>
<div class="modal-body ShowAlertText">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
</div>
</div>
</div>
</div>
<div class="modal fade" id="select-language" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg mat_box lang_select_modal" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="row">
<div class="col-md-4">
<div class="language_info">
<h3>Language</h3>
<svg enable-background="new 0 0 512 512" height="512" viewBox="0 0 512 512" width="512" xmlns="http://www.w3.org/2000/svg"><g><path d="m164.061 1.765c89.491 0 164.061 30.492 164.061 123.688 0 39.307-13.272 67.453-35.329 86.867-4.005 3.525-5.715 8.976-4.326 14.127 3.903 14.48 9.536 29.7 17.262 43.91 5.927 10.9-2.075 24.048-14.477 23.702-30.009-.836-62.771-14.812-87.325-41.505-2.922-3.177-7.103-4.882-11.405-4.53-9.262.757-18.773 1.118-28.462 1.118-89.49 0-164.06-30.493-164.06-123.689s74.57-123.688 164.061-123.688z" fill="#b0da87"/><g><g fill="#fff"><ellipse cx="55.409" cy="104.463" rx="29.792" ry="23.725"/><ellipse cx="216.893" cy="104.463" rx="29.792" ry="23.725"/></g><g fill="#4e5660"><path d="m86.952 86.146c-4.143 0-7.5-3.357-7.5-7.5 0-3.684-2.996-6.681-6.68-6.681s-6.681 2.997-6.681 6.681c0 4.143-3.357 7.5-7.5 7.5s-7.5-3.357-7.5-7.5c0-11.955 9.726-21.681 21.681-21.681 11.954 0 21.68 9.726 21.68 21.681 0 4.143-3.357 7.5-7.5 7.5z"/><path d="m213.711 86.146c-4.143 0-7.5-3.357-7.5-7.5 0-3.684-2.997-6.681-6.681-6.681s-6.68 2.997-6.68 6.681c0 4.143-3.357 7.5-7.5 7.5s-7.5-3.357-7.5-7.5c0-11.955 9.726-21.681 21.68-21.681 11.955 0 21.681 9.726 21.681 21.681 0 4.143-3.357 7.5-7.5 7.5z"/><path d="m136.151 109.573c-7.933 0-15.476-3.436-20.696-9.425-2.722-3.123-2.396-7.86.727-10.582 3.122-2.721 7.859-2.396 10.582.727 2.37 2.72 5.792 4.28 9.388 4.28s7.018-1.561 9.388-4.28c2.722-3.123 7.459-3.447 10.582-.727 3.123 2.722 3.448 7.459.727 10.582-5.222 5.99-12.765 9.425-20.698 9.425z"/></g></g><path d="m347.939 96.356c89.491 0 164.061 30.492 164.061 123.688 0 39.308-13.272 67.453-35.329 86.867-4.005 3.525-5.715 8.976-4.326 14.127 3.903 14.48 9.536 29.7 17.262 43.91 5.927 10.9-2.075 24.048-14.477 23.702-30.009-.836-62.771-14.812-87.325-41.505-2.922-3.177-7.103-4.882-11.405-4.53-9.262.757-18.773 1.118-28.462 1.118-89.491 0-164.061-30.492-164.061-123.688.002-93.197 74.572-123.689 164.062-123.689z" fill="#8daee1"/><path d="m296.422 218.871c-27.969-18.07-64.598-28.515-109.1-31.162-2.253 9.825-3.443 20.58-3.443 32.335 0 93.196 74.57 123.688 164.061 123.688 3.718 0 7.401-.071 11.062-.179.006-.645.024-1.283.024-1.931 0-53.841-21.648-96.288-62.604-122.751z" fill="#6a95d6"/><path d="m401.315 262.7-43.695-115.784c-.025-.068-.053-.137-.08-.204-1.573-3.826-5.262-6.297-9.398-6.297h-.009c-4.141.004-7.829 2.482-9.396 6.314-.023.057-.046.113-.067.171l-44.098 115.78c-1.475 3.87.469 8.203 4.34 9.678 3.866 1.474 8.203-.468 9.678-4.34l9.142-24.004h60.498l9.051 23.983c1.133 3.003 3.987 4.853 7.017 4.853.88 0 1.775-.156 2.647-.485 3.876-1.462 5.832-5.789 4.37-9.665zm-77.87-33.686 24.675-64.786 24.449 64.786z" fill="#fff"/><path d="m164.061 217.934c-89.491 0-164.061 30.493-164.061 123.689 0 39.307 13.272 67.453 35.329 86.867 4.005 3.525 5.715 8.976 4.326 14.127-3.903 14.48-9.536 29.7-17.262 43.909-5.927 10.9 2.075 24.048 14.477 23.702 30.009-.836 62.771-14.812 87.325-41.505 2.922-3.177 7.103-4.882 11.405-4.53 9.262.757 18.773 1.118 28.462 1.118 89.491 0 164.061-30.492 164.061-123.688-.002-93.196-74.572-123.689-164.062-123.689z" fill="#fbf1cf"/><path d="m98.158 224.732c-57.403 13.375-98.158 47.997-98.158 116.891 0 39.307 13.272 67.453 35.329 86.867 4.005 3.525 5.715 8.976 4.326 14.127-3.903 14.48-9.536 29.7-17.262 43.909-5.927 10.9 2.075 24.048 14.477 23.702 30.009-.836 62.771-14.812 87.325-41.505 2.922-3.177 7.103-4.882 11.405-4.53 9.262.757 18.773 1.118 28.461 1.118 9.979 0 19.771-.382 29.296-1.185-109.038-33.437-126.653-188.039-95.199-239.394z" fill="#fae0bd"/><path d="m215.939 289.092h-44.267v-19.954c0-4.143-3.357-7.5-7.5-7.5s-7.5 3.357-7.5 7.5v19.954h-44.267c-4.143 0-7.5 3.357-7.5 7.5s3.357 7.5 7.5 7.5h73.205c-1.638 18.399-10.545 38.587-23.975 56.243-7.491-6.699-13.58-14.368-17.432-21.597-1.947-3.654-6.487-5.039-10.146-3.092-3.655 1.948-5.039 6.49-3.092 10.146 4.554 8.546 11.825 17.845 20.986 25.993-8.01 8.521-17.087 16.084-26.839 22.069-3.53 2.167-4.636 6.785-2.47 10.315 1.416 2.307 3.878 3.578 6.399 3.578 1.338 0 2.692-.357 3.916-1.108 11.003-6.753 21.527-15.56 30.892-25.717 8.934 5.854 18.992 10.334 29.679 12.277.453.083.905.122 1.351.122 3.555 0 6.712-2.537 7.37-6.159.741-4.075-1.962-7.979-6.037-8.721-7.906-1.438-15.595-4.733-22.631-9.119 2.391-3.137 4.675-6.357 6.821-9.658 12.049-18.525 18.971-37.605 20.252-55.574h15.285c4.143 0 7.5-3.357 7.5-7.5s-3.358-7.498-7.5-7.498z" fill="#4e5660"/></g></svg>
</div>
</div>
<div class="col-md-8">
<ul class="lang_modal">
<li class="language_select"><a href="?lang=arabic">Arabic</a></li>
<li class="language_select"><a href="?lang=bengali">Bengali</a></li>
<li class="language_select"><a href="?lang=dutch">Dutch</a></li>
<li class="language_select"><a href="?lang=english">English</a></li>
<li class="language_select"><a href="?lang=french">French</a></li>
<li class="language_select"><a href="?lang=german">German</a></li>
<li class="language_select"><a href="?lang=hebrew">Hebrew</a></li>
<li class="language_select"><a href="?lang=hindi">Hindi</a></li>
<li class="language_select"><a href="?lang=spanish">Spanish</a></li>
<li class="language_select"><a href="?lang=turkish">Turkish</a></li>
<li class="language_select"><a href="?lang=urdu">Urdu</a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sidenav_overlay" onclick="javascript:$('body').removeClass('sidebar_open');"></div>
<script>
$(document).on('click', '#follow-user', function(event) {
$(this).toggleClass('btn-primary btn-success');
$(this).text("Following");
$(this).attr("id", "unfollow-user");
$.post('https://aftown.com/endpoints/follow-user/add', {id: $(this).attr('data-user-id')});
});
$(function () {
setTimeout(function () {
Fingerprint2.get(function (components) {
$.post(ajaxUrl() + '/set-finger-print', {components: components});
})
}, 500);
});
$(document).on('click', '.comment_input', function(event){
$('#login_box').modal('show');
});
// unfollow user
$(document).on('click', '#unfollow-user', function(event) {
$(this).toggleClass('btn-success btn-primary');
$(this).text("Follow");
$(this).attr("id", "follow-user");
$.post('https://aftown.com/endpoints/follow-user/remove', {id: $(this).attr('data-user-id')});
});
function likeSong(id, type, element) {
if (!id || !type) {
return false;
}
if (type == 'track-page') {
if (element.attr('liked')) {
element.removeClass('track-liked').removeAttr('liked', 'true');
element.find('span').html("Like");
$('#track_likes_count').attr('data-count',parseInt($('#track_likes_count').attr('data-count')) - 1);
$('#track_likes_count').html(parseInt($('#track_likes_count').attr('data-count')));
if( $('#dislike-track').hasClass('track-disliked') ){
$('#dislike-track-text').html("Disliked");
$('#dislike-track').addClass('track-disliked');
}
// $('#like-track').removeAttr('liked');
// $('#dislike-track').attr('disliked', 'true');
} else {
element.addClass('track-liked').attr('liked', 'true');
$('#dislike-track').removeAttr('disliked');
element.find('span').html("Liked");
$('#track_likes_count').attr('data-count',parseInt($('#track_likes_count').attr('data-count')) + 1);
$('#track_likes_count').html(parseInt($('#track_likes_count').attr('data-count')));
if( $('#dislike-track').hasClass('track-disliked') ){
$('#dislike-track').removeClass('track-disliked');
$('#dislike-track-text').html("Dislike");
$('#track_dislikes_count').attr('data-count',parseInt($('#track_dislikes_count').attr('data-count')) - 1);
$('#track_dislikes_count').html(parseInt($('#track_dislikes_count').attr('data-count')));
}
}
}
$.get('https://aftown.com/endpoints/like-track', {id: id, type: type});
}
function dislikeSong(id, type, element) {
if (!id || !type) {
return false;
}
if (type == 'track-page') {
if (element.attr('disliked')) {
element.removeClass('track-disliked').removeAttr('disliked', 'true');
element.find('span').html("Dislike");
$('#track_dislikes_count').attr('data-count',parseInt($('#track_dislikes_count').attr('data-count')) - 1);
$('#track_dislikes_count').html(parseInt($('#track_dislikes_count').attr('data-count')));
if( $('#like-track').hasClass('track-liked') ){
$('#like-track-text').html("Liked");
$('#like-track').addClass('track-liked');
}
// $('#like-track').attr('liked', 'true');
// $('#dislike-track').removeAttr('disliked');
} else {
element.addClass('track-disliked').attr('disliked', 'true');
$('#like-track').removeAttr('liked');
element.find('span').html("Disliked");
$('#track_dislikes_count').attr('data-count',parseInt($('#track_dislikes_count').attr('data-count')) + 1);
$('#track_dislikes_count').html(parseInt($('#track_dislikes_count').attr('data-count')));
if( $('#like-track').hasClass('track-liked') ){
$('#like-track').removeClass('track-liked');
$('#like-track-text').html("Like");
$('#like-track svg path').attr('fill','currentColor');
$('#track_likes_count').attr('data-count',parseInt($('#track_likes_count').attr('data-count')) - 1);
$('#track_likes_count').html(parseInt($('#track_likes_count').attr('data-count')));
}
}
}
$.get('https://aftown.com/endpoints/dislike-track', {id: id, type: type});
}
function loadMore(type, get_data) {
element = $("#load-more-button");
$default_text = element.html();
$track_id = 0;
views = 0;
product_id = 0;
let v_ids = [];
if (type == 'songs') {
$last_id = $('.feed_post:last-child').attr('data-id');
$append_div = '#user-feed-data';
} else if (type == 'recently_played') {
$last_id = $('.track_list:last').attr('data-time');
$append_div = '#recently_played';
} else if (type == 'comments') {
$last_id = $('.comment_item:last').attr('comment-id');
$append_div = '.comment_list';
$track_id = $('.comment_item:last').attr('comment-song-id')
} else if (type == 'blog_comments') {
$last_id = $('.comment_item:last').attr('comment-id');
$append_div = '.comment_list';
$track_id = $('.comment_item:last').attr('comment-song-id')
} else if (type == 'latest_music' || type == 'top_music') {
$last_id = $('#new-music .track_list:last').attr('data-id');
$append_div = '#new-music';
} else if (type == 'categories') {
$last_id = $('.list-recommended:last').attr('data-id');
$append_div = 'ul.s_list_songs';
} else if (type == 'followers') {
$last_id = $('.follower_list:last-child').attr('data-id');
$append_div = '#followers';
} else if (type == 'followings') {
$last_id = $('.following_list:last-child').attr('data-id');
$append_div = '#followings';
} else if (type == 'songs_search') {
$last_id = $('.song_search_list:last-child').attr('data-id');
$append_div = '#songs_search_result';
} else if (type == 'artists_search') {
$last_id = $('.artist_list:last-child').attr('data-id');
$append_div = '#artists_search_result';
} else if (type == 'albums_search') {
$last_id = $('.track_list:last-child').attr('data-id');
$append_div = '#albums_search_result';
} else if (type == 'playlists_search') {
$last_id = $('.playlist-p-list:last-child').attr('data-id');
$append_div = '#playlists_search_result';
} else if (type == 'store_albums') {
$last_id = $('.track_list:last-child').attr('data-id');
$append_div = '.store_albums';
} else if (type == 'store_songs') {
$last_id = $('.song_list:last-child').attr('data-id');
$append_div = '.store_songs';
} else if (type == 'blogs') {
$last_id = $('.blog_list').last().attr('data-id');
$append_div = '.sfy_blog_articles';
} else if (type == 'stations') {
$last_id = $('#new-music .track_list:last').attr('data-id');
$append_div = '#new-music';
}
else if(type == 'fame_page'){
$last_id = $('#fame_page_result .artist_lists:last').attr('data-id');
views = $('#fame_page_result .artist_lists:last').attr('data_views');
$append_div = '#fame_page_result';
$('.artist_lists').each(function(i, obj) {
v_ids.push($(obj).attr('data_v_id'));
});
}
else if(type == 'products_search'){
$last_id = $('.events-list-wrapper:last').attr('data-product');
$append_div = '#products_search_result';
}
else if(type == 'events_search'){
$last_id = $('.events-list-wrapper:last').attr('data-event');
$append_div = '#events_search_result';
}
else if(type == 'events'){
$last_id = $('.events-list-wrapper:last').attr('data-event');
$append_div = '#events_search_result';
}
else if(type == 'manage_events'){
$last_id = $('.events-list-wrapper:last').attr('data-event');
$append_div = '#manage_events_result';
}
else if(type == 'joined_events'){
$last_id = $('.events-list-wrapper:last').attr('data-event');
$append_div = '#events_search_result';
}
else if(type == 'purchased_events'){
$last_id = $('.events-list-wrapper:last').attr('data-event');
$append_div = '#events_search_result';
}
else if(type == 'products'){
$last_id = $('.events-list-wrapper:last').attr('data-product');
$append_div = '#store_result';
}
else if(type == 'manage_products'){
$last_id = $('.events-list-wrapper:last').attr('data-product');
$append_div = '#products_result';
}
else if(type == 'reviews'){
$last_id = $('.review_list:last').attr('id');
$append_div = '.reviews_section';
product_id = $('#product_page_id').val();
}
else if(type == 'orders'){
$last_id = $('.song_list:last').attr('data-order');
$append_div = '.store_songs';
}
if (get_data == 'all' || get_data == 'liked' || get_data == 'spotlight' || get_data == 'events') {
$last_id = $('.feed_post:last-child').attr('data-a-id');
type = 'activities';
}
if (get_data == 'playlists') {
$last_id = $('.playlist-p-list:last-child').attr('data-id');
type = 'playlists';
}
if (get_data == 'albums') {
$last_id = $('.album-p-list:last-child').attr('data-id');
type = 'albums';
}
if (get_data == 'stations') {
$last_id = $('.track_list:last-child').attr('data-id');
type = 'stations';
}
if (get_data == 'store') {
$last_id = $('.feed_post:last-child').attr('a_id');
}
element.text("Please wait..");
let geners = [];
let price = [];
let filter_type = null;
let current_tag = null;
if($('#current_tag').length > 0){
current_tag = $('#current_tag').val();
}
if($('#filter_search_tag').length > 0){
current_tag = $('#filter_search_tag').val();
}
if($('#filter_type').length > 0){
filter_type = $('#filter_type').val();
}
if($('.song_category').length > 0){
$('.song_category').each(function(i, obj) {
if(this.checked){
geners.push($(obj).attr('data-category'));
}
});
}
if($( "#slider-range" ).length > 0){
price = $("#slider-range").slider("option").values;
}
let params = {'geners': geners, 'filter_type': filter_type,'current_tag': current_tag, 'price': price };
$.get(ajaxUrl() + '/load-more/' + type, {id: $last_id, userID: $('#user-id').val(), track_id: $track_id, get_data: get_data,params: params,views:views,v_ids:v_ids,product_id:product_id}, function(data) {
if (data.status == 200 && data.html.length > 0) {
$($append_div).append(data.html);
} else {
$default_text = "No more tracks found";
if (type == 'comments' || type == 'blog_comments') {
$default_text = "No more comments found";
}
if (type == 'all') {
$default_text = "No more activities found";
}
if (type == 'playlists' || type == 'playlists_search') {
$default_text = "No more playlists found";
}
if (type == 'followers') {
$default_text = "No more followers found";
}
if (type == 'followings') {
$default_text = "No more following found";
}
if (type == 'artists_search' || type == 'fame_page') {
$default_text = "No more artists found";
}
if (type == 'albums_search' || type == 'store_albums') {
$default_text = "No more albums found";
}
if (type == 'blogs_search' || type == 'blogs') {
$default_text = "No more articles found";
}
if (type == 'stations' ) {
$default_text = "No more stations found";
}
if (type == 'events_search' || type == 'events' || type == 'joined_events' || type == 'manage_events') {
$default_text = "No more events found";
}
if (type == 'purchased_events') {
$default_text = "No more tickets found";
}
if (type == 'products' || type == 'manage_products' || type == 'products_search') {
$default_text = "No more products found";
}
if (type == 'reviews') {
$default_text = "No more reviews found";
}
if (type == 'orders') {
$default_text = "No more orders found";
}
}
element.html($default_text);
});
}
$(document).on('click', '.amplitude-next', function(event) {
console.log($('#current-track').val());
});
var is_sent = 0;
var is_video_checked = 0;
var is_paused = 0;
$(function () {
var songsObject = [{
"name": "",
"artist": "",
"album": "",
"url": "",
"cover_art_url": "",
"youtube_url": "",
}];
Amplitude.init({
"songs": songsObject,
"callbacks": {
'after_next': function(){
setTimeout(function () {
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && !Amplitude.audio().paused && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
$('#my_video_player_container').html('<div class="y_player_cover"></div><span class="player_exit" onclick="HidePlayer()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span><div class="plyr__video-embed" id="my_video_player_"><iframe src="'+Amplitude.getActiveSongMetadata().youtube_url+'?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency ></iframe> </div>')
$('#my_video_player_container').slideDown();
video_player = new Plyr('#my_video_player_',{muted: true,controls: []});
video_player.on('ready', event => {
video_player.play();
});
}
},500);
},
'after_prev': function(){
setTimeout(function () {
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && !Amplitude.audio().paused && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
$('#my_video_player_container').html('<div class="y_player_cover"></div><span class="player_exit" onclick="HidePlayer()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span><div class="plyr__video-embed" id="my_video_player_"><iframe src="'+Amplitude.getActiveSongMetadata().youtube_url+'?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency ></iframe> </div>')
$('#my_video_player_container').slideDown();
video_player = new Plyr('#my_video_player_',{muted: true,controls: []});
video_player.on('ready', event => {
video_player.play();
});
}
},500);
},
'time_update': function(songPlayedInSeconds){
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
if ((Amplitude.audio().duration - Amplitude.audio().currentTime) > 1) {
video_player.currentTime = Amplitude.audio().currentTime;
// if (video_player.paused && !Amplitude.audio().paused) {
video_player.play();
// }
}
if (Amplitude.audio().paused) {
is_paused = 1;
video_player.pause();
}
}
},
'after_play': function(){
var song_seconds = Amplitude.getSongDuration();
if (song_seconds) {
$('body').attr('song-duration', song_seconds);
}
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && !$('#my_video_player_container').is(":visible") && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
$('#my_video_player_container').html('<div class="y_player_cover"></div><span class="player_exit" onclick="HidePlayer()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span><div class="plyr__video-embed" id="my_video_player_"><iframe src="'+Amplitude.getActiveSongMetadata().youtube_url+'?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency ></iframe> </div>')
$('#my_video_player_container').slideDown();
video_player = new Plyr('#my_video_player_',{muted: true,controls: []});
video_player.on('ready', event => {
video_player.play();
});
}
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && $('#my_video_player_container').is(":visible") && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
video_player.play();
}
setTimeout(function () {
$('body').addClass('audio_playing');
$('body').addClass('player_running');
$('#play-pause').addClass('amplitude-playing');
}, 100);
},
'after_pause': function(){
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
video_player.pause();
}
$('body').removeClass('audio_playing');
$('#play-pause').removeClass('amplitude-playing');
$('body').removeClass('player_running');
},
'after_stop': function(){
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
$('#my_video_player_container').slideUp();
$('#my_video_player_container').html('');
}
if (parseInt($('.ss_track_play_pause').attr('data_is_ad')) > 0 && is_sent == 0) {
is_sent = 1;
song_id = $('#current-track').attr('value');
onTimesUp(song_id);
return false;
}
$('body').removeClass('audio_playing');
$('#play-pause').removeClass('amplitude-playing');
$('body').removeClass('player_running');
$('#light-wave').width('0px');
// console.log("Stopped..");
// $('.song_details').hide();
}
}
});
});
const FULL_DASH_ARRAY = 283;
const WARNING_THRESHOLD = 10;
const ALERT_THRESHOLD = 5;
const TIME_LIMIT = 10;
let timePassed = 0;
let timeLeft = TIME_LIMIT;
let timerInterval = null;
function onTimesUp(song_id) {
if (typeof wavesurfer != "undefined") {
wavesurfer.pause();
}
if (typeof Amplitude != "undefined") {
Amplitude.pause();
Amplitude.removeSong(0);
}
$('#queue-' + song_id).remove();
$(".song_controls").css("pointer-events","auto");
$(".song_progress").css("pointer-events","auto");
$(".song_progress_right").css("pointer-events","auto");
$(".ma_player_playlist").css("pointer-events","auto");
$("#waveform").css("pointer-events","auto");
playSong(song_id,0,'yes');
$('body').removeClass('player_running');
clearInterval(timerInterval);
goToAjaxLink('track/' + song_id);
}
function startTimer(song_id) {
$(".song_controls").css("pointer-events","none");
$(".song_progress").css("pointer-events","none");
$(".song_progress_right").css("pointer-events","none");
$(".ma_player_playlist").css("pointer-events","none");
$("#waveform").css("pointer-events","none");
timerInterval = setInterval(() => {
timePassed = timePassed += 1;
timeLeft = TIME_LIMIT - timePassed;
if (timeLeft >= 0) {
document.getElementById("base-timer-label").innerHTML = formatTime(
timeLeft
);
setCircleDasharray();
}
if (timeLeft === 0) {
song_id = "'"+song_id+"'";
$(".pause_btn").replaceWith('<div class="btn btn-primary btn-mat btn-mat-raised pause_btn" onclick="onTimesUp('+song_id+')"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M8,8L13,12L8,16M14,8H16V16H14"/></svg></div>');
}
}, 1000);
}
function formatTime(time) {
const minutes = Math.floor(time / 60);
let seconds = time % 60;
if (seconds < 10) {
seconds = `0${seconds}`;
}
return `${minutes}:${seconds}`;
}
function calculateTimeFraction() {
const rawTimeFraction = timeLeft / TIME_LIMIT;
return rawTimeFraction - (1 / TIME_LIMIT) * (1 - rawTimeFraction);
}
function setCircleDasharray() {
const circleDasharray = `${(
calculateTimeFraction() * FULL_DASH_ARRAY
).toFixed(0)} 283`;
document
.getElementById("base-timer-path-remaining")
.setAttribute("stroke-dasharray", circleDasharray);
}
var songIndex = [];
function playSong(id,audio_ad_id = 0,skip = '') {
if (typeof setPlayerInterval != 'undefined') {
clearInterval(setPlayerInterval);
}
if (!$('body').attr('first-play')) {
//Amplitude.removeSong(0);
$('body').attr('first-play', "true");
}
if (Amplitude.getActiveSongMetadata().id && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
if (Amplitude.getActiveSongMetadata().id == id) {
Amplitude.play();
if ($('#page').attr('data-page') != 'track') {
goToAjaxLink('track/' + Amplitude.getActiveSongMetadata().id);
}
// $('#container_content').append('<a href="#" id="redirect-user" data-load="track/' + Amplitude.getActiveSongMetadata().id + '"></a>');
// $('#redirect-user').trigger('click');
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && ($('#audio_ad_id').length == 0 || ($('#audio_ad_id').length != 0 && parseInt($('#audio_ad_id').val()) == 0))) {
console.log(Amplitude)
video_player.play();
if (!$('#my_video_player_container').is(":visible")) {
$('#my_video_player_container').slideDown();
}
}
if ($('body').attr('first-play')) {
if (skip != 'yes') {
return false;
}
}
}
}
$('#bar_loading').show().animate({width:20 + 80 * Math.random() + "%"}, 200);
$.get('https://aftown.com/endpoints/get-song-info', {id: id,audio_ad_id: audio_ad_id}, function(data) {
if (data.age == true) {
$('#age-restricted').modal('show');
$('#bar_loading').animate({width:"100%"}, 200).fadeOut(300, function() {
$(this).width("0");
});
return false;
}
$("#light-wave").stop(true);
//$('.waveform-small').html("");
$('.ssong_comments.small-waves').addClass('hidden');
if (data.status == 200) {
$('body').attr('song-duration', data.duration);
if ($('.feed_post[data-id="' + data.songID + '"]:first').length > 0) {
if (data.songWaves.length > 0) {
$('.feed_post[data-id="' + data.songID + '"]:first').find('.waveform-small').html(data.songWaves);
$('#light-wave img').width($('#dark-wave').width() + 'px');
}
$('.feed_post[data-id="' + data.songID + '"]:first').find('.ssong_comments').removeClass('hidden');
$('.feed_post[data-id="' + data.songID + '"]:first').find('.comment_list').html(data.comments);
$('.feed_post[data-id="' + data.songID + '"]:first').find('.comment-waves').html(data.waves);
$('html,body').animate({
scrollTop: $('.feed_post[data-id="' + data.songID + '"]:first').offset().top
}, 'slow');
}
$('body').addClass('player_running');
if ($('.amplitude-song-container').length == 0) {
Amplitude.removeSong(0)
}
if ($('#queue-' + id).length == 0 || data.is_ad == 'yes') {
var songObject = {
"name": data.songTitle,
"artist": data.artistName,
"album": data.albumName,
"url": data.songURL,
"cover_art_url": data.coverURL,
"youtube_url": data.youtube_url,
"id": id,
"u_id": data.songID,
"data_load": 'track/' + id,
"href": data.songPageURL,
"duration": data.songDuration,
"purchase": data.purchase,
'price': data.price,
"is_favoriated": data.is_favoriated,
"showDemo": data.showDemo
};
var songIndex = Amplitude.addSong(songObject);
data.qID = songIndex;
songObject.qID = songIndex;
Amplitude.playSongAtIndex(songIndex);
if (data.is_ad != 'yes') {
addToQueue(data, songObject, false);
addView(data.songID);
}
$('.amplitude-song-container').removeClass('amplitude-playing');
//$('.amplitude-song-container[amplitude-song-index="' + songIndex + '"]').addClass('amplitude-playing');
$('#queue-list').find('.amplitude-song-container').last().addClass('amplitude-playing');
} else {
songIndex = $('#queue-' + id).attr('amplitude-song-index');
Amplitude.playSongAtIndex(songIndex);
}
setTimeout(function () {
if (Amplitude.getActiveSongMetadata().youtube_url != '' && typeof Amplitude.getActiveSongMetadata().youtube_url !== 'undefined' && data.is_ad != 'yes') {
$('#my_video_player_container').html('<div class="y_player_cover"></div><span class="player_exit" onclick="HidePlayer()"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></span><div class="plyr__video-embed" id="my_video_player_"><iframe src="'+Amplitude.getActiveSongMetadata().youtube_url+'?origin=https://plyr.io&iv_load_policy=3&modestbranding=1&playsinline=1&showinfo=0&rel=0&enablejsapi=1" allowfullscreen allowtransparency ></iframe> </div>')
$('#my_video_player_container').slideDown();
video_player = new Plyr('#my_video_player_',{muted: true,controls: []});
video_player.on('ready', event => {
video_player.play();
});
}
},500);
$('.player-song-url').attr('href', data.songPageURL);
if (data.data_load != '') {
Amplitude.getActiveSongMetadata().data_load = '';
$('.player-song-url').attr('data-load', '');
}
else{
$('.player-song-url').attr('data-load', 'track/' + id);
}
$('#song-fav-button').html(data.favorite_button);
$('.ma_player').removeClass('closed');
if (data.is_ad == 'yes') {
document.querySelector(".pause_btn").innerHTML = `
<div class="base-timer">
<svg class="base-timer__svg" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"><g class="base-timer__circle"><circle class="base-timer__path-elapsed" cx="50" cy="50" r="45"></circle><path id="base-timer-path-remaining" stroke-dasharray="283" class="base-timer__path-remaining" d="M 50, 50 m -45, 0 a 45,45 0 1,0 90,0 a 45,45 0 1,0 -90,0"></path></g></svg>
<span id="base-timer-label" class="base-timer__label">${formatTime(
timeLeft
)}</span><p>to Skip Ad</p>
</div>
`;
startTimer(id);
$('.ss_track_play_pause').attr('data_is_ad', 1);
}
} else {
alert("Can't load the song, please try again later.")
}
$('#bar_loading').animate({width:"100%"}, 200).fadeOut(300, function() {
$(this).width("0");
});
});
}
function addToQueue(data, object, fetch) {
if (fetch == false) {
html = '<div class="song amplitude-song-container amplitude-play-pause" id="queue-' + object.id + '" onclick="playSong(\'' + object.id + '\')" amplitude-song-index="' + object.qID + '"><div class="song_icon_container"><img class="now-playing" src="'+ object.cover_art_url+'"/></div><span class="song_duration">' + object.duration + '</span><div class="song_meta_data"><span class="song_title">' + object.name + '</span><span class="song_artist">' + object.artist + '</span></div></div>';
$('#queue-list').append(html);
}
setTimeout(function () {
$.post('https://aftown.com/endpoints/add-queue', {qdata: object});
}, 2000);
}
function registerBlogComment(value, id, event, element) {
if (!value || !id) {
return false;
}
if(event.which == 13) {
element.attr('disabled', "true");
$.post('https://aftown.com/endpoints/register-blog-comment', {id: id, value: value}, function(data) {
if (data.status == 300) {
$('#login_box').modal('show');
}
if (data.status == 200) {
$('.no-comments-found').remove();
$('.no-track-found').remove();
element.val("");
$('.comment-list-' + id).prepend(data.html);
}
element.removeAttr('disabled');
});
}
}
function registerCommentreplay(value, id, commentid, event, element) {
if (!value || !id || !commentid) {
return false;
}
//fix
if(event.which == 13) {
element.attr('disabled', "true");
$.post('https://aftown.com/endpoints/register-comment-replay', {id: id, value: value, cid:commentid}, function(data) {
if (data.status == 300) {
$('#login_box').modal('show');
}
if (data.status == 200) {
$('.no-comments-found').remove();
$('.no-track-found').remove();
element.val("");
$('.comment-replay-list-' + commentid).append(data.html);
//window.init_emojioneArea();
}
element.removeAttr('disabled');
});
}
}
function registerComment(value, id, event, element) {
if (!value || !id) {
return false;
}
if(event.which == 13) {
element.attr('disabled', "true");
time = "";
timeSeconds = "";
if (Amplitude.getActiveSongMetadata().id == id) {
time = Amplitude.audio().currentTime;
timeSeconds = $('.amplitude-song-played-progress').val();
}
wave = 0;
if ($('#light-wave').val()) {
wave = $('#light-wave').val();
}
$.post('https://aftown.com/endpoints/register-comment', {id: id, value: value, timePercentage: timeSeconds, time: time, wave: wave}, function(data) {
if (data.status == 300) {
$('#login_box').modal('show');
}
if (data.status == 200) {
$('.no-comments-found').remove();
$('.no-track-found').remove();
element.val("");
$('.comment-waves').append(data.comment_wave);
$('.comment-list-' + id).prepend(data.html);
//window.init_emojioneArea();
}
element.removeAttr('disabled');
});
}
}
$(document).on('mouseover', '.comment-on-wave', function(event) {
$(this).find('.comment-on-wave-data').css({
display: 'block',
});
});
$(document).on('mouseleave', '.comment-on-wave', function(event) {
$(this).find('.comment-on-wave-data').css({
display: 'none',
});
});
$('.comment-on-wave-data').on('hover', function(event) {
});
function goToWave(secnods) {
setTimeout(function () {
Amplitude.skipTo(secnods, Amplitude.getActiveSongMetadata().qID);
}, 200);
}
function goTo(element) {
mainElement = element.parents('li');
if (Amplitude.getActiveSongMetadata().id != mainElement.attr('comment-song-id')) {
playSong(mainElement.attr('song-id'));
}
setTimeout(function () {
Amplitude.skipTo(mainElement.attr('comment-seconds'), Amplitude.getActiveSongMetadata().qID);
}, 200);
}
function deleteComment(element) {
mainElement = $('#delete-comment');
comment_id = mainElement.attr('data-id');
mode = mainElement.attr('data-mode');
if (!comment_id) {
return false;
}
$('#delete-comment').modal('hide');
$('.comment-' + comment_id).slideUp('200', function () {
$(this).remove();
});
if(mode == 'blog'){
$.get('https://aftown.com/endpoints/delete-blog-comment', {id: comment_id});
}else{
$.get('https://aftown.com/endpoints/delete-comment', {id: comment_id});
}
}
function deleteCommentReplay(element) {
mainElement = $('#delete-comment-replay');
comment_id = mainElement.attr('data-id');
mode = mainElement.attr('data-mode');
if (!comment_id) {
return false;
}
$('#delete-comment-replay').modal('hide');
$('.comment-replay-' + comment_id).slideUp('200', function () {
$(this).remove();
});
$.get('https://aftown.com/endpoints/delete-comment-replay', {id: comment_id});
}
function likeComment(comment_id) {
if (!comment_id) {
return false;
}
var clickval = $('.comment_like[data-comment-id="'+comment_id+'"]').attr("onclick");
$('.comment_like[data-comment-id="'+comment_id+'"]').attr('onclick',clickval.replace('likeComment', 'UnlikeComment') );
$('.comment_like[data-comment-id="'+comment_id+'"] path').attr('fill','#e62117');
$.get('https://aftown.com/endpoints/like-comment', {id: comment_id});
let c = parseInt($('#comment_like_'+comment_id).html());
$('#comment_like_'+comment_id).html( c + 1);
}
function UnlikeComment(comment_id) {
if (!comment_id) {
return false;
}
var clickval = $('.comment_like[data-comment-id="'+comment_id+'"]').attr("onclick");
$('.comment_like[data-comment-id="'+comment_id+'"]').attr('onclick',clickval.replace('UnlikeComment', 'likeComment') );
$('.comment_like[data-comment-id="'+comment_id+'"] path').attr('fill','currentColor');
$.get('https://aftown.com/endpoints/unlike-comment', {id: comment_id});
let c = parseInt($('#comment_like_'+comment_id).html());
$('#comment_like_'+comment_id).html( c - 1);
}
function UnReportComment(comment_id,user_id) {
if (!comment_id) {
return false;
}
$('.comment_report[data-comment-id="'+comment_id+'"]').show();
$('.comment_report[data-comment-id="'+comment_id+'"]').css({'visibility':'inherit'});
$('.comment_unreport[data-comment-id="'+comment_id+'"]').hide();
$.get(ajaxUrl() + '/unreport-comment', {id: comment_id,uid: user_id}, function (data) {
if (data.status == 200) {
$('#comment_unreported').modal('show');
setTimeout(function () {
$('#comment_unreported').modal('hide');
}, 3000);
}
});
}
function BloglikeComment(comment_id) {
if (!comment_id) {
return false;
}
var clickval = $('.comment_like[data-comment-id="'+comment_id+'"]').attr("onclick");
$('.comment_like[data-comment-id="'+comment_id+'"]').attr('onclick',clickval.replace('likeComment', 'UnlikeComment') );
$('.comment_like[data-comment-id="'+comment_id+'"] path').attr('fill','#e62117');
$.get('https://aftown.com/endpoints/like-blog-comment', {id: comment_id});
let c = parseInt($('#comment_like_'+comment_id).html());
$('#comment_like_'+comment_id).html( c + 1);
}
function BlogUnlikeComment(comment_id) {
if (!comment_id) {
return false;
}
var clickval = $('.comment_like[data-comment-id="'+comment_id+'"]').attr("onclick");
$('.comment_like[data-comment-id="'+comment_id+'"]').attr('onclick',clickval.replace('UnlikeComment', 'likeComment') );
$('.comment_like[data-comment-id="'+comment_id+'"] path').attr('fill','currentColor');
$.get('https://aftown.com/endpoints/unlike-blog-comment', {id: comment_id});
let c = parseInt($('#comment_like_'+comment_id).html());
$('#comment_like_'+comment_id).html( c - 1);
}
function BlogUnReportComment(comment_id,user_id) {
if (!comment_id) {
return false;
}
$('.blog_comment_report[data-comment-id="'+comment_id+'"]').show();
$('.blog_comment_report[data-comment-id="'+comment_id+'"]').css({'visibility':'inherit'});
$('.blog_comment_unreport[data-comment-id="'+comment_id+'"]').hide();
$.get(ajaxUrl() + '/blog-unreport-comment', {id: comment_id,uid: user_id}, function (data) {
if (data.status == 200) {
$('#blog_comment_unreported').modal('show');
setTimeout(function () {
$('#blog_comment_unreported').modal('hide');
}, 3000);
}
});
}
function UnReportTrack(track_id,user_id) {
if (!track_id) {
return false;
}
$('.track_report[data-track-id="'+track_id+'"]').show();
$('.track_report[data-track-id="'+track_id+'"]').css({'visibility':'inherit'});
$('.track_unreport[data-track-id="'+track_id+'"]').hide();
$.get(ajaxUrl() + '/unreport-track', {'id': track_id,'uid': user_id}, function (data) {
if (data.status == 200) {
$('#track_unreported').modal('show');
setTimeout(function () {
$('#track_unreported').modal('hide');
}, 3000);
}
});
}
function PayFromWallet() {
$('#wallet_to_pay').find('.btn-mat').attr('disabled', 'true');
$(".modal_story_pay_alert").html('');
price = $('#wallet_to_pay_price').val();
type = $('#wallet_to_pay_type').val();
id = $('#wallet_to_pay_id').val();
$.post('https://aftown.com/endpoints/wallet/pay', {price: price,type: type,id: id}, function(data, textStatus, xhr) {
$('#wallet_to_pay').find('.btn-mat').removeAttr('disabled');
if (data.status == 200) {
clearQueues(false);
$(".modal_wallet_pay_alert").html('<div class="alert alert-success bg-success"><i class="fa fa-check"></i> payment successfully done</div>');
setTimeout(function () {
location.href = data.url;
},3000);
}
else{
$(".modal_wallet_pay_alert").html('<div class="alert alert-danger bg-danger"><i class="fa fa-info-circle"></i> '+data.error+'</div>');
}
});
}
function purchaseTrack(id, element,type,price) {
$('#login_box').modal('show');
}
function TrackReadMore() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getElementById("btn-track-load-more");
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.innerHTML = "Read more";
moreText.style.display = "none";
} else {
dots.style.display = "none";
btnText.innerHTML = "Read less";
moreText.style.display = "inline";
}
}
function getUrl() {
var url = window.location.href;
return url.replace("https://aftown.com", "");
}
function ajaxRedirect(url) {
if (!url) {
url = getUrl();
}
goToAjaxLink(url);
}
function favorite(id, element) {
if (element.hasClass('is_favoriated')) {
element.html('<path fill="currentColor" d="M19.66 3.99c-2.64-1.8-5.9-.96-7.66 1.1-1.76-2.06-5.02-2.91-7.66-1.1-1.4.96-2.28 2.58-2.34 4.29-.14 3.88 3.3 6.99 8.55 11.76l.1.09c.76.69 1.93.69 2.69-.01l.11-.1c5.25-4.76 8.68-7.87 8.55-11.75-.06-1.7-.94-3.32-2.34-4.28zM12.1 18.55l-.1.1-.1-.1C7.14 14.24 4 11.39 4 8.5 4 6.5 5.5 5 7.5 5c1.54 0 3.04.99 3.57 2.36h1.87C13.46 5.99 14.96 5 16.5 5c2 0 3.5 1.5 3.5 3.5 0 2.89-3.14 5.74-7.9 10.05z" />');
element.removeClass("is_favoriated");
if (Amplitude.getActiveSongMetadata()) {
Amplitude.getActiveSongMetadata().is_favoriated = false;
}
} else {
element.addClass("is_favoriated");
element.html('<path fill="#F44336" d="M13.35 20.13c-.76.69-1.93.69-2.69-.01l-.11-.1C5.3 15.27 1.87 12.16 2 8.28c.06-1.7.93-3.33 2.34-4.29 2.64-1.8 5.9-.96 7.66 1.1 1.76-2.06 5.02-2.91 7.66-1.1 1.41.96 2.28 2.59 2.34 4.29.14 3.88-3.3 6.99-8.55 11.76l-.1.09z" />');
if (Amplitude.getActiveSongMetadata()) {
Amplitude.getActiveSongMetadata().is_favoriated = true;
}
}
$.get('https://aftown.com/endpoints/favorite-track', {id: id});
}
function addToLists(id) {
getID = $('#playlists').attr('data-id');
if (!getID) {
return false;
}
var playlists = "";
$(".select-playlist-list").each(function (index, item) {
if ($(this).hasClass('active')) {
playlists += $(this).attr('data-id') + ",";
}
});
if (playlists) {
$('#playlists').find('.btn-mat').text("Please wait..");
$.get(ajaxUrl() + "/playlist/add-to-playlist", {playlists: playlists, id: getID}, function (data) {
if (data.status == 200) {
$('#playlists').modal('hide');
setTimeout(function () {
$('#playlists').remove();
}, 200);
} else if (data.status == 300) {
alert("Please select which playlist you want to add this song to.")
} else {
$('#playlists').modal('hide');
setTimeout(function () {
$('#playlists').remove();
}, 200);
}
});
}
}
function addToAlbum(id) {
getID = $('#albums').attr('data-id');
if (!getID) {
return false;
}
var playlists = "";
$(".select-albums-list").each(function (index, item) {
if ($(this).hasClass('active')) {
var albums = $(this).attr('data-id');
$('#playlists').find('.btn-mat').text("Please wait..");
$.get(ajaxUrl() + "/album/add-to-album", {album: albums, id: getID}, function (data) {
if (data.status == 200) {
$('#albums_success').modal('show');
$('#albums').modal('hide');
setTimeout(function () {
$('#albums').remove();
}, 200);
setTimeout(function () {
$('#albums_success').modal('hide');
}, 3000);
} else if (data.status == 300) {
alert("Please select which album you want to add this song to.")
} else {
$('#albums').modal('hide');
setTimeout(function () {
$('#albums').remove();
}, 200);
}
});
}
});
}
function blockUser(id, username, type) {
if (!id || !username) {
return false;
}
if (!confirm("Are you sure you want to block this user")) {
return false;
}
$.get('https://aftown.com/endpoints/block-user/' + type, {id: id}, function (data) {
goToAjaxLink(username);
});
}
$(document).on('click', '#night_mode_toggle', function(event) {
mode = $(this).attr('data-mode');
$.post('https://aftown.com/endpoints/?mode=' + mode, {}, function(data, textStatus, xhr) { /* pass */ });
if (mode !== 'night') {
$('body').append('<link rel="stylesheet" href="https://aftown.com/themes/soundify/css/day.style.css" id="night-mode-css">');
$('#night_mode_toggle').attr('data-mode', 'night');
$('.switch .txt').text('Night mode');
$('.logo_container img').attr('src', 'https://aftown.com/themes/soundify/img/logo-white.png?cache=201');
if($('#dark-wave').length > 0){
$('#dark-wave').attr('src',$('#dark-wave').attr('src').replace('_dark.png','_day.png'));
}
if($('#light-wave').length > 0){
$('#light-wave').css({'border-right':'1px solid rgb(191, 191, 191)'});
}
} else {
$('#night-mode-css').remove();
$('#night_mode_toggle').attr('data-mode', 'day');
$('.switch .txt').text('Day mode');
$('.logo_container img').attr('src', 'https://aftown.com/themes/soundify/img/logo.png?cache=201');
if($('#dark-wave').length > 0){
$('#dark-wave').attr('src',$('#dark-wave').attr('src').replace('_day.png','_dark.png'));
}
if($('#light-wave').length > 0){
$('#light-wave').css({'border-right':'1px solid rgb(71, 71, 71)'});
}
}
});
$(document).ready(function() {
FastClick.attach(document.body);
});
function hide_announcement(id){
if (!id) { return false; }
$("#announcement-"+id).slideUp('fast',function(){
$(this).remove();
$.post('https://aftown.com/endpoints/user/hide-announcement', {id: id}, function(data, textStatus, xhr) { /* pass */ });
})
}
function AddEventInterested(id,self,type = 'interest') {
if (type == 'interest') {
$(self).html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M0.41,13.41L6,19L7.41,17.58L1.83,12M22.24,5.58L11.66,16.17L7.5,12L6.07,13.41L11.66,19L23.66,7M18,7L16.59,5.58L10.24,11.93L11.66,13.34L18,7Z"></path></svg> <span class="button-text"> Interested</span>')
$(self).attr('onclick', "AddEventInterested('"+id+"',this,'uninterest')");
}
else{
$(self).html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M16.5,5C15,5 13.58,5.91 13,7.2V17.74C17.25,13.87 20,11.2 20,8.5C20,6.5 18.5,5 16.5,5M16.5,3C19.58,3 22,5.41 22,8.5C22,12.27 18.6,15.36 13.45,20.03L12,21.35L10.55,20.03C5.4,15.36 2,12.27 2,8.5C2,5.41 4.42,3 7.5,3C9.24,3 10.91,3.81 12,5.08C13.09,3.81 14.76,3 16.5,3Z"></path></svg> <span class="button-text"> Interested</span>')
$(self).attr('onclick', "AddEventInterested('"+id+"',this,'interest')");
}
$.post('https://aftown.com/endpoints/event/interest', {id: id,type: type}, function(data, textStatus, xhr) {});
}
function JoinEvent(id,self,type = 'join') {
if (type == 'join') {
$('#going-'+id).find('button').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M0.41,13.41L6,19L7.41,17.58L1.83,12M22.24,5.58L11.66,16.17L7.5,12L6.07,13.41L11.66,19L23.66,7M18,7L16.59,5.58L10.24,11.93L11.66,13.34L18,7Z"></path></svg> <span class="button-text"> Joined</span>')
$('#going-'+id).find('button').attr('onclick', "JoinEvent('"+id+"',this,'unjoin')");
}
else{
$('#going-'+id).find('button').html('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M10.74,11.72C11.21,12.95 11.16,14.23 9.75,14.74C6.85,15.81 6.2,13 6.16,12.86L10.74,11.72M5.71,10.91L10.03,9.84C9.84,8.79 10.13,7.74 10.13,6.5C10.13,4.82 8.8,1.53 6.68,2.06C4.26,2.66 3.91,5.35 4,6.65C4.12,7.95 5.64,10.73 5.71,10.91M17.85,19.85C17.82,20 17.16,22.8 14.26,21.74C12.86,21.22 12.8,19.94 13.27,18.71L17.85,19.85M20,13.65C20.1,12.35 19.76,9.65 17.33,9.05C15.22,8.5 13.89,11.81 13.89,13.5C13.89,14.73 14.17,15.78 14,16.83L18.3,17.9C18.38,17.72 19.89,14.94 20,13.65Z"></path></svg> <span class="button-text"> Join</span>')
$('#going-'+id).find('button').attr('onclick', "JoinEvent('"+id+"',this,'join')");
}
$.post('https://aftown.com/endpoints/event/join', {id: id,type: type}, function(data, textStatus, xhr) {});
}
function BuyTicket(id,self,type = 'join',price = 0,show_type = 'show',available_tickets = 0, image = '') {
$('#buy_ticket_modal').find('.modal-body-alert').html('');
$('#buy_ticket_modal').find('.btn-primary').removeAttr('disabled');
$('#buy_ticket_modal').find('.btn-primary').text("Buy");
if (parseInt(price) > parseInt("{{ME org_wallet}}")) {
$('#buy_ticket_modal').find('.modal-body-alert').html(`<div class="alert alert-info"><a href="https://aftown.com/settings/{{ME username/wallet}}" data-load="settings/{{ME username}}/wallet">Please top up your wallet.</a></div>`);
$('#buy_ticket_modal').find('.btn-primary').attr('disabled', 'true');
$('#buy_ticket_modal').modal('show');
return false;
}
if(parseInt(price) > 0 && show_type == 'hide'){
$('#buy_ticket_modal').find('.btn-primary').attr('onclick', "BuyTicket('"+id+"',this,'"+type+"','"+price+"','show','"+available_tickets+"')");
$('#buy_ticket_modal').find('.avail_ticket p').html(""+available_tickets+"");
$('#buy_ticket_modal').find('.avail_ticket_price p').html("₵"+price);
$('#buy_ticket_modal').find('.ticket-img').html("<img src='" + image + "' alt='Picture'>");
$('#buy_ticket_modal').modal('show');
return false;
}
$('#buy_ticket_modal').find('.btn-primary').attr('disabled', 'true');
$('#buy_ticket_modal').find('.btn-primary').text("Please wait..");
$.post('https://aftown.com/endpoints/event/buy', {id: id,price: price}, function(data, textStatus, xhr) {
$('#buy_ticket_modal').find('.btn-primary').removeAttr('disabled');
$('#buy_ticket_modal').find('.btn-primary').text("Buy");
if (data.status == 200) {
$('#buy_ticket_modal').find('.modal-body-alert').html(`<div class="alert alert-success bg-success"><i class="fa fa-check"></i> ${data.message}</div>`);
setTimeout(function () {
$('#buy_ticket_modal').find('.modal-body-alert').html('');
$('#buy_ticket_modal').modal('hide');
location.href = 'https://aftown.com/purchased';
},2000);
}
else{
$('#buy_ticket_modal').find('.modal-body-alert').html(`<div class="alert alert-danger bg-danger"><i class="fa fa-check"></i> ${data.message}</div>`);
}
});
}
function DeleteEvent(id,type = 'show') {
if (type == 'hide') {
$('#delete-event').find('.btn-mat').attr('onclick', "DeleteEvent('"+id+"')");
$('#delete-event').modal('show');
return false;
}
$('[data-event="'+id+'"').slideUp();
$('[data-event="'+id+'"').remove();
$.post('https://aftown.com/endpoints/event/delete', {id: id}, function(data, textStatus, xhr) {});
}
function StartStories(user_id,story_id) {
$('#container_content').append('<div class="lightbox-container"><div class="lightbox-backgrond" onclick="Wo_CloseLightbox();"></div><div class="lb-preloader" style="display:block"><svg width="50px" height="50px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><circle cx="50" cy="50" r="40" stroke="#676d76" fill="none" stroke-width="6" stroke-linecap="round"><animate attributeName="stroke-dashoffset" dur="1.5s" repeatCount="indefinite" from="0" to="502"></animate><animate attributeName="stroke-dasharray" dur="1.5s" repeatCount="indefinite" values="150.6 100.4;1 250;150.6 100.4"></animate></circle></svg></div></div>');
$.post('https://aftown.com/endpoints/story/start', {user_id: user_id,story_id:story_id}, function(data, textStatus, xhr) {
if (data.status == 200) {
if (!Amplitude.audio().paused) {
Amplitude.pause();
window.playAudio = 'yes';
}
else{
window.playAudio = 'no';
}
$('.lightbox-container').html(data.html);
}
else{
if (window.playAudio && window.playAudio == 'yes') {
Amplitude.play();
window.playAudio = 'no';
}
CloseLightbox();
}
});
}
function NextStory(user_id,story_id,next_user_id,next_story_id) {
CloseLightbox();
$('#container_content').append('<div class="lightbox-container"><div class="lightbox-backgrond" onclick="Wo_CloseLightbox();"></div><div class="lb-preloader" style="display:block"><svg width="50px" height="50px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><circle cx="50" cy="50" r="40" stroke="#676d76" fill="none" stroke-width="6" stroke-linecap="round"><animate attributeName="stroke-dashoffset" dur="1.5s" repeatCount="indefinite" from="0" to="502"></animate><animate attributeName="stroke-dasharray" dur="1.5s" repeatCount="indefinite" values="150.6 100.4;1 250;150.6 100.4"></animate></circle></svg></div></div>');
$.post('https://aftown.com/endpoints/story/next', {user_id: user_id,story_id:story_id,next_user_id:next_user_id,next_story_id:next_story_id}, function(data, textStatus, xhr) {
if (data.status == 200) {
if (!Amplitude.audio().paused) {
Amplitude.pause();
window.playAudio = 'yes';
}
$('.lightbox-container').html(data.html);
}
else{
if (window.playAudio && window.playAudio == 'yes') {
Amplitude.play();
window.playAudio = 'no';
}
CloseLightbox();
}
});
}
function PreviousStory(user_id,story_id,pre_user_id,pre_story_id) {
CloseLightbox();
$('#container_content').append('<div class="lightbox-container"><div class="lightbox-backgrond" onclick="Wo_CloseLightbox();"></div><div class="lb-preloader" style="display:block"><svg width="50px" height="50px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid"><rect x="0" y="0" width="100" height="100" fill="none" class="bk"></rect><circle cx="50" cy="50" r="40" stroke="#676d76" fill="none" stroke-width="6" stroke-linecap="round"><animate attributeName="stroke-dashoffset" dur="1.5s" repeatCount="indefinite" from="0" to="502"></animate><animate attributeName="stroke-dasharray" dur="1.5s" repeatCount="indefinite" values="150.6 100.4;1 250;150.6 100.4"></animate></circle></svg></div></div>');
$.post('https://aftown.com/endpoints/story/previous', {user_id: user_id,story_id:story_id,pre_user_id:pre_user_id,pre_story_id:pre_story_id}, function(data, textStatus, xhr) {
if (data.status == 200) {
if (!Amplitude.audio().paused) {
Amplitude.pause();
window.playAudio = 'yes';
}
$('.lightbox-container').html(data.html);
}
else{
if (window.playAudio && window.playAudio == 'yes') {
Amplitude.play();
window.playAudio = 'no';
}
CloseLightbox();
}
});
}
function CloseLightbox() {
$('.lightbox-container').remove();
document.body.style.overflow = 'auto';
}
function GetMoreStoryViews(story_id,self) {
$('.lightpost-'+story_id).addClass('dont_close')
last_view = $('.story_views_').last().attr('id');
$(self).addClass('dont_close_story_'+story_id);
$(self).find('span').html("please_wait");
$.post('https://aftown.com/endpoints/story/story_views', {last_view:last_view,story_id:story_id}, function(data, textStatus, xhr) {
if (data.status == 200) {
$(self).find('button').html('<svg xmlns="http://www.w3.org/2000/svg" width="19" height="19" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather"><polyline points="6 9 12 15 18 9"></polyline></svg> Load More');
$('.views_container_').append(data.html);
}
else{
$(self).find('button').html("No More Views");
}
});
}
function checkForSongStatus(songID, form_id = false, local_id = false) {
$.post('https://aftown.com/endpoints/check-track', {id: songID}, function(dataSecond, textStatus, xhr) {
if (dataSecond.status == 300) {
setTimeout(function() {
checkForSongStatus(songID, form_id, local_id);
}, 2000);
} else if (dataSecond.status == 200) {
if (local_id !== false && form_id) {
$('#song-form-' + form_id + '-'+local_id).html('<div class="hidden submitted-song" data-id="' + songID + '"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M17,18H7V16H17V18M10.3,14L7,10.7L8.4,9.3L10.3,11.2L15.6,5.9L17,7.3L10.3,14Z"></path></svg> ' + $('#title-' + form_id + '-'+local_id).val() + ' Successfully uploaded');
$('#song-form-' + form_id + '-'+local_id).addClass('no-padding-form submitted');
publish();
$('#song-form-' + form_id + '-'+local_id+' .btn-save-songs').addClass('submitted');
} else if (form_id && local_id === false) {
$('#song-form-' + form_id).html('<div class="hidden submitted-song" data-id="' + songID + '"></div><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" d="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M17,18H7V16H17V18M10.3,14L7,10.7L8.4,9.3L10.3,11.2L15.6,5.9L17,7.3L10.3,14Z"></path></svg> ' + $('#title-' + form_id + '').val() + ' Successfully uploaded');
$('#song-form-' + form_id).addClass('no-padding-form submitted');
publish();
$('#song-form-' + form_id + ' .btn-save-songs').addClass('submitted');
} else {
goToAjaxLink('track/' + songID);
}
}
});
}
function DeleteStory(id) {
if (!id || !confirm("Are you sure you want to delete your story?")) {
return false;
}
$.ajax({
url: 'https://aftown.com/endpoints/story/delete',
type: 'POST',
dataType: 'json',
data: {id:id},
})
.done(function(data) {
if (data.status == 200) {
location.reload();
}
})
.fail(function() {
console.log("error");
})
}
function DeleteProduct(id,type = 'show') {
if (type == 'hide') {
$('#delete-product').find('.btn-mat').attr('onclick', "DeleteProduct('"+id+"')");
$('#delete-product').modal('show');
return false;
}
$('[data-product="'+id+'"').slideUp();
$('[data-product="'+id+'"').remove();
$.post('https://aftown.com/endpoints/product/delete', {id: id}, function(data, textStatus, xhr) {});
}
function AddProductToCart(self,id,type) {
if (type == 'add') {
$(self).text("Remove From Cart");
$(self).attr('onclick', "AddProductToCart(this,'"+id+"','remove')");
}
else{
$(self).text("Add To Cart");
$(self).attr('onclick', "AddProductToCart(this,'"+id+"','add')");
}
qty = 1;
if ($('#cart_product_qty').length > 0) {
qty = $('#cart_product_qty').val();
}
$.post('https://aftown.com/endpoints/product/add_cart', {product_id: id,qty:qty}, function(data, textStatus, xhr) {
if (data.status == 200) {
$('.unread_cart_count').html(data.count);
}
});
}
function GetCart() {
$.post('https://aftown.com/endpoints/product/get_cart', {param1: 'value1'}, function(data, textStatus, xhr) {
if (data.status == 200 && data.html != '') {
$('#cart-list').html(data.html);
}
else{
$('#cart-list').html('<div class="no-track-found"><svg xmlns="http://www.w3.org/2000/svg" data-display="static" data-toggle="dropdown" aria-haspopup="true" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shopping-cart"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>Your cart is empty.</div>');
}
});
}
function RemoveProductFromCart(id) {
$('#cart_product_'+id).remove();
$('#checkout_product_'+id).remove();
$.post('https://aftown.com/endpoints/product/remove_cart', {product_id: id}, function(data, textStatus, xhr) {
if (data.status == 200) {
$('.unread_cart_count').html(data.count);
}
});
}
function LoadCheckout() {
$('#load_checkout').click();
}
$(document).ready(function() {
var options = {
url: "https://aftown.com/endpoints/address/add?hash_id=" + getHashID(),
beforeSubmit: function () {
$('.modal_add_address_modal_alert').empty();
$("#add_address_modal").find('.btn-mat').attr('disabled', 'true');
$("#add_address_modal").find('.btn-mat').text("Please wait..");
},
success: function (data) {
$("#add_address_modal").find('.btn-mat').text("Add");
$("#add_address_modal").find('.btn-mat').removeAttr('disabled')
if (data.status == 200) {
$('.modal_add_address_modal_alert').html('<div class="alert alert-success bg-success"><i class="fa fa-check"></i> '+
data.message
+'</div>');
if (data.url && data.url != '') {
if ($('#load_checkout').length < 1) {
setTimeout(function () {
/*location.href = data.url;*/
$('.modal_add_address_modal_alert').empty();
$("#add_address_modal").find('.btn-mat').removeAttr('disabled')
$("#add_address_modal").find('.btn-mat').text("Add");
$('#add_address_modal').modal('hide');
$('.address_form')[0].reset();
load_page = 'feed';
if ($('#json-data').length > 0) {
json_data = JSON.parse($('#json-data').val());
load_page = json_data.ajax_url;
}
else{
load_page = "feed";
}
goToAjaxLink(load_page);
},2000);
}
else{
setTimeout(function () {
$('.modal_add_address_modal_alert').empty();
$("#add_address_modal").find('.btn-mat').removeAttr('disabled')
$("#add_address_modal").find('.btn-mat').text("Add");
$('#add_address_modal').modal('hide');
$('#load_checkout').click();
},2000);
}
}
} else {
$('.modal_add_address_modal_alert').html('<div class="alert alert-danger bg-danger"><i class="fa fa-check"></i> '+
data.message
+'</div>');
}
}
};
$('.address_form').ajaxForm(options);
});
function NewAddress() {
$('.modal_add_address_modal_alert').empty();
$("#add_address_modal").find('.btn-mat').removeAttr('disabled')
$("#add_address_modal").find('.btn-mat').text("Add");
$('#add_address_modal').modal('show');
}
function BuyProducts(type = 'show',price) {
if ($('.payment_address').length < 1) {
$('.checkout_alert').html("<div class='alert alert-danger bg-danger'><i class='fa fa-info-circle'></i> Please add a new address</div>");
return false;
}
if ($('input[name=choose-address]:checked').length < 1) {
$('.checkout_alert').html("<div class='alert alert-danger bg-danger'><i class='fa fa-info-circle'></i> Please select address</div>");
return false;
}
address_id = $('input[name=choose-address]:checked').val();
if (type == 'hide') {
$('#buy_product_modal').find('.btn-mat').html("Pay ₵"+price);
$('#buy_product_modal').find('.btn-mat').attr('onclick', "BuyProducts('show','"+price+"')");
$('#buy_product_modal').modal('show');
return false;
}
$('#buy_product_modal').find('.btn-mat').html("Please wait..");
$('#buy_product_modal').find('.btn-mat').attr('disabled', "true");
$.post('https://aftown.com/endpoints/product/buy',{address_id: address_id}, function(data, textStatus, xhr) {
$('#buy_product_modal').find('.btn-mat').removeAttr('disabled');
$('#buy_product_modal').find('.btn-mat').text("Pay ₵"+price);
if (data.status == 200) {
$('#buy_product_modal').find('.modal_product_pay_alert').html("<div class='alert alert-success bg-success'><i class='fa fa-check'></i> "+data.message+"</div>");
setTimeout(function () {
$('#buy_product_modal').find('.modal_product_pay_alert').html("");
location.href = "https://aftown.com/purchased";
},2000);
}
else{
$('#buy_product_modal').find('.modal_product_pay_alert').html("<div class='alert alert-danger bg-danger'><i class='fa fa-info-circle'></i> "+data.message+"</div>");
}
});
}
function ChangeQty(self,product_id) {
qty = $(self).val();
$.post('https://aftown.com/endpoints/product/change_qty', {product_id: product_id,qty: qty}, function(data, textStatus, xhr) {
LoadCheckout();
});
}
function ChangeStatus(self,hash_id) {
status = $(self).val();
$.post('https://aftown.com/endpoints/product/change_status', {hash_order: hash_id,status: status}, function(data, textStatus, xhr) {
$('#load_order').click();
});
}
function RefundOrder(hash_id,type = 'show') {
if (type == 'hide') {
$('#refund_order').find('.btn-mat').attr('onclick', "RefundOrder('"+hash_id+"')");
$('#refund_order').modal('show');
return false;
}
$('#refund_order').find('.btn-mat').html("Please wait..");
$('#refund_order').find('.btn-mat').attr('disabled', "true");
message = $('#refund_order_message').val();
$.post('https://aftown.com/endpoints/product/refund', {hash_order: hash_id,message: message}, function(data, textStatus, xhr) {
$('#refund_order').find('.btn-mat').removeAttr('disabled');
$('#refund_order').find('.btn-mat').text("Request");
if (data.status == 200) {
$('#refund_order').find('.modal_refund_order_modal_alert').html("<div class='alert alert-success bg-success'><i class='fa fa-check'></i> "+data.message+"</div>");
setTimeout(function () {
$('#refund_order').modal('hide');
$('#refund_order').find('.modal_refund_order_modal_alert').html("");
$('#load_order').click();
},2000);
}
else{
$('#refund_order').find('.modal_refund_order_modal_alert').html("<div class='alert alert-danger bg-danger'><i class='fa fa-info-circle'></i> "+data.message+"</div>");
}
});
}
function DownloadPurchased(id,type = 'event') {
url = 'event/download';
if (type == 'order') {
url = 'product/download';
}
$.post('https://aftown.com/endpoints/'+url,{id,id}, function(data, textStatus, xhr) {
$('.ma_page_content').append(data.html);
setTimeout(function () {
$('.ticket_card_'+id).remove();
},10000);
});
}
function HidePlayer() {
$('#my_video_player_container').slideUp();
}
function OpenWriteReview(product_id) {
$('#write_product_review_product_id').val(product_id)
$('#write_product_review').modal('show');
}
function showResponseAlert(item,alert_class,message,time = 0) {
$(item).html('<div class="alert alert-'+alert_class+'">'+message+'</div>');
if (time > 0) {
setTimeout(() => {
$(item).html('');
},time);
}
}
</script> <script src="https://aftown.com/themes/soundify/js/fingerprint2.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/jquery.form.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/popper.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/bootstrap.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/owl.carousel.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/simplebar.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/amplitude.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/script.js?v=1.5.2"></script>
<script src="https://aftown.com/themes/soundify/js/Chart.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/highcharts/highcharts.js"></script>
<script src="https://aftown.com/themes/soundify/js/footer.js?v=1.5.2"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-colorpicker/3.2.0/js/bootstrap-colorpicker.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/bootstrap-select.min.js"></script>
<script type="text/javascript" language="javascript" src="https://aftown.com/themes/soundify/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="https://aftown.com/themes/soundify/js/dataTables.bootstrap4.min.js"></script>
<script src="https://aftown.com/themes/soundify/js/lib/sweetalert2/dist/sweetalert2.js"></script>
<script src="https://aftown.com/themes/soundify/js/bootstrap-toggle.min.js"></script>
<input type="hidden" class="main_session" value="9e8c4fde5db7fbe8974a79ae93838aed010b5642">
<script type="text/javascript">
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['jquery'], factory);
} else {
// Browser globals
factory(jQuery);
}
}(function ($) {
$.timeago = function(timestamp) {
if (timestamp instanceof Date) {
return inWords(timestamp);
} else if (typeof timestamp === "string") {
return inWords($.timeago.parse(timestamp));
} else if (typeof timestamp === "number") {
return inWords(new Date(timestamp));
} else {
return inWords($.timeago.datetime(timestamp));
}
};
var $t = $.timeago;
$.extend($.timeago, {
settings: {
refreshMillis: 60000,
allowPast: true,
allowFuture: false,
localeTitle: false,
cutoff: 0,
strings: {
prefixAgo: null,
prefixFromNow: null,
suffixAgo: "ago",
suffixFromNow: "from now",
inPast: "any moment now",
seconds: "Just now",
minute: "about a minute ago",
minutes: "%d minutes ago",
hour: "about an hour ago",
hours: "%d hours ago",
day: "a day ago",
days: "%d days ago",
month: "about a month ago",
months: "%d months ago",
year: "about a year ago",
years: "%d years ago",
wordSeparator: " ",
numbers: []
}
},
inWords: function(distanceMillis) {
if(!this.settings.allowPast && ! this.settings.allowFuture) {
throw 'timeago allowPast and allowFuture settings can not both be set to false.';
}
var $l = this.settings.strings;
var prefix = $l.prefixAgo;
var suffix = $l.suffixAgo;
if (this.settings.allowFuture) {
if (distanceMillis < 0) {
prefix = $l.prefixFromNow;
suffix = $l.suffixFromNow;
}
}
if(!this.settings.allowPast && distanceMillis >= 0) {
return this.settings.strings.inPast;
}
var seconds = Math.abs(distanceMillis) / 1000;
var minutes = seconds / 60;
var hours = minutes / 60;
var days = hours / 24;
var years = days / 365;
function substitute(stringOrFunction, number) {
var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction;
var value = ($l.numbers && $l.numbers[number]) || number;
return string.replace(/%d/i, value);
}
var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) ||
seconds < 90 && substitute($l.minute, 1) ||
minutes < 45 && substitute($l.minutes, Math.round(minutes)) ||
minutes < 90 && substitute($l.hour, 1) ||
hours < 24 && substitute($l.hours, Math.round(hours)) ||
hours < 42 && substitute($l.day, 1) ||
days < 30 && substitute($l.days, Math.round(days)) ||
days < 45 && substitute($l.month, 1) ||
days < 365 && substitute($l.months, Math.round(days / 30)) ||
years < 1.5 && substitute($l.year, 1) ||
substitute($l.years, Math.round(years));
var separator = $l.wordSeparator || "";
if ($l.wordSeparator === undefined) { separator = " "; }
return $.trim([prefix, words].join(separator));
},
parse: function(iso8601) {
var s = $.trim(iso8601);
s = s.replace(/\.\d+/,""); // remove milliseconds
s = s.replace(/-/,"/").replace(/-/,"/");
s = s.replace(/T/," ").replace(/Z/," UTC");
s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400
s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900
return new Date(s);
},
datetime: function(elem) {
var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title");
return $t.parse(iso8601);
},
isTime: function(elem) {
// jQuery's `is()` doesn't play well with HTML5 in IE
return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time");
}
});
// functions that can be called via $(el).timeago('action')
// init is default when no action is given
// functions are called with context of a single element
var functions = {
init: function(){
var refresh_el = $.proxy(refresh, this);
refresh_el();
var $s = $t.settings;
if ($s.refreshMillis > 0) {
this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis);
}
},
update: function(time){
var parsedTime = $t.parse(time);
$(this).data('timeago', { datetime: parsedTime });
if($t.settings.localeTitle) $(this).attr("title", parsedTime.toLocaleString());
refresh.apply(this);
},
updateFromDOM: function(){
$(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) });
refresh.apply(this);
},
dispose: function () {
if (this._timeagoInterval) {
window.clearInterval(this._timeagoInterval);
this._timeagoInterval = null;
}
}
};
$.fn.timeago = function(action, options) {
var fn = action ? functions[action] : functions.init;
if(!fn){
throw new Error("Unknown function name '"+ action +"' for timeago");
}
// each over objects here and call the requested function
this.each(function(){
fn.call(this, options);
});
return this;
};
function refresh() {
var data = prepareData(this);
var $s = $t.settings;
if (!isNaN(data.datetime)) {
if ( $s.cutoff == 0 || Math.abs(distance(data.datetime)) < $s.cutoff) {
$(this).text(inWords(data.datetime));
}
}
return this;
}
function prepareData(element) {
element = $(element);
if (!element.data("timeago")) {
element.data("timeago", { datetime: $t.datetime(element) });
var text = $.trim(element.text());
if ($t.settings.localeTitle) {
element.attr("title", element.data('timeago').datetime.toLocaleString());
} else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) {
element.attr("title", text);
}
}
return element.data("timeago");
}
function inWords(date) {
return $t.inWords(distance(date));
}
function distance(date) {
return (new Date().getTime() - date.getTime());
}
// fix for IE6 suckage
document.createElement("abbr");
document.createElement("time");
}));
$(function () {
setInterval(function () {
if ( $('.ajax-time').length > 0) {
$('.ajax-time').timeago()
.removeClass('.ajax-time');
}
},
500);
});
</script>
<script>
$('#rmjs-1').readmore({
speed: 75,
collapsedHeight: 190,
moreLink: '<a href="#" class="hash">Read more</a>',
lessLink: '<a href="#" class="hash">Read less</a>',
afterToggle: function(trigger, element, expanded) {
//if(! expanded) {
// The "Close" link was clicked
$('html, body').animate({scrollTop: element.offset().top}, {duration: 100});
//}
}
});
var running = false;
$( document ).on( 'change', '#chat_message_upload_media_file', function(e){
if( running === true ){
running = false;
return false;
}
running = true;
var countFiles = $(this)[0].files.length;
var imgPath = $(this)[0].value;
var extn = imgPath.substring(imgPath.lastIndexOf('.') + 1).toLowerCase();
if(countFiles > 1) {
M.toast({html: 'Please select Four Images only.'});
} else if (extn == "gif" || extn == "png" || extn == "jpg" || extn == "jpeg") {
let from = $( '#user-id' ).val();
let formData = new FormData();
formData.append( "media", $(this)[0].files[0],$(this)[0].files[0].value );
formData.append( 'to' , $('#user-id').val() );
formData.append( 'message_id' , window.message_id );
var img = $('<img style="width: 300px;border-radius: 20px;">');
//if (typeof(FileReader) != "undefined") {
let reader = new FileReader();
reader.onload = function(e) {
img.attr('src', e.target.result);
};
reader.readAsDataURL($(this)[0].files[0]);
//}
$('.lds-facebook').removeClass('hide');
$('#btn_chat_f_send').addClass('hide');
$( '.chat_message_upload_media_imgprogress' ).removeClass( 'hide' );
$( '.chat_message_upload_media_imgstatus' ).removeClass( 'hide' );
$.ajax({
xhr: function() {
let xhr = new window.XMLHttpRequest();
xhr.upload.addEventListener("progress", function(evt){
if (evt.lengthComputable) {
let percentComplete = evt.loaded / evt.total;
percentComplete = parseInt(percentComplete * 100);
//console.log( 'prog: ' + percentComplete + '%');
$( '#chat_message_upload_media_imgstatus' ).html( percentComplete + '%');
$( '.chat_message_upload_media_imgdeterminate' ).css({'width': percentComplete + '%'});
if (percentComplete === 100) {
$( '.chat_message_upload_media_imgprogress' ).addClass( 'hide' );
$( '.chat_message_upload_media_imgstatus' ).addClass( 'hide' );
$( '#chat_message_upload_media_imgstatus' ).html( '' );
}
}
}, false);
return xhr;
},
beforeSend: function() {
$('.messages').append('<div class="data_message" data-id="' + window.message_id + '"><div class="message to-user pull-right" data-id=""><div class="user-message"></div><div class="clear"></div></div><div class="clear"></div></div>');
img.appendTo($('.data_message[data-id="' + window.message_id + '"]').find('.user-message'));
$('.user-messages').scrollTop($('.user-messages')[0].scrollHeight);
window.message_id = makeid();
},
url: 'https://aftown.com/endpoints/messages/upload_media?hash_id=' + $('.main_session').val(),
type: "POST",
async: true,
data: formData,
cache: false,
contentType: false,
processData: false,
timeout: 60000,
dataType: false,
success: function(data) {
$('.data_message[data-id="' + data.message_id + '"]').replaceWith(data.message);
running = false;
}
});
}else{
M.toast({html: 'Please select only Images.'});
}
});
// update user last seen
function getRandomBetween(min, max) {
return min + Math.random() * (max - min);
}
function UpdateLastSeen() {
$.get('https://aftown.com/endpoints/user/update_lastseen', { }, function () {
setTimeout(UpdateLastSeen, getRandomBetween(60000, 120000));
});
}
setTimeout(UpdateLastSeen, getRandomBetween(60000, 120000));
function GetArtist(key,form = '') {
$.post('https://aftown.com/endpoints/tag_artist/tag', {key: key}, function(data, textStatus, xhr) {
if (data.html) {
if (form != '') {
$('#group_chat_mbr_list_'+form).html(data.html);
}
else{
$('.group_chat_mbr_list').html(data.html);
}
}
});
}
function ApproveRequest(id) {
$.post('https://aftown.com/endpoints/tag_artist/approve', {id: id}, function(data, textStatus, xhr) {});
}
function DeclineRequest(id) {
$.post('https://aftown.com/endpoints/tag_artist/decline', {id: id}, function(data, textStatus, xhr) {});
}
function count_char(self,id) {
$(self).limit("1280", id);
}
</script>
<script src="https://aftown.com/themes/soundify/js/footer.js?3168"></script>
<div class="modal fade" id="paystack_fund_modal" role="dialog" data-keyboard="false" >
<div class="modal-dialog mat_box">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Paystack</h5>
</div>
<form class="form form-horizontal" method="post" id="paystack_fund_form" action="#">
<div class="modal-body twocheckout_modal">
<div id="paystack_fund_alert"></div>
<div class="clear"></div>
<div class="form-group">
<input id="paystack_fund_email" type="text" class="form-control" autocomplete="off" placeholder="Email">
</div>
<div class="clear"></div>
</div>
<div class="clear"></div>
<input type="hidden" name="paystack_type" id="paystack_type">
<div class="modal-footer">
<div class="ball-pulse"><div></div><div></div><div></div></div>
<button class="btn btn-default" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary btn-mat" id="paystack_btn" onclick="InitializePaystack()">Pay</button>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript">
function paystack_pay(self,type) {
$("#paystack_fund_alert").html('');
$('#buy_album_modal').modal('hide');
$('#paystack_type').val(type);
$('#paystack_fund_modal').modal({
show: true
});
}
function InitializePaystack() {
$('#paystack_btn').html("Please wait..");
$('#paystack_btn').attr('disabled','true');
type = $('#paystack_type').val();
email = $('#paystack_fund_email').val();
id = $('#buy_album_modal').attr('data-id');
amount = $('#buy_album_modal').attr('data_price');
if ($('#paystack_type').val() == 'buy_song') {
id = $('#payment_modal').attr('data-id');
}
if ($('#paystack_type').val() == 'wallet') {
amount = $('#wallet_payment_modal').attr('data_price');
}
$.post('https://aftown.com/endpoints/paystack/initialize', {type:type,email:email,amount:amount,id:id}, function(data) {
if (data.status == 200) {
window.location.href = data.url;
} else {
$('#paystack_fund_alert').html("<div class='alert alert-danger'>"+data.error+"</div>");
setTimeout(function () {
$('#paystack_fund_alert').html("");
},3000);
}
$('#paystack_btn').html("Pay");
$('#paystack_btn').removeAttr('disabled');
});
}
</script>
</body>
</html>