support older browsers

pull/52/head
Akhil Gupta 4 years ago
parent 3ed9a8422f
commit cca6d63358

@ -170,7 +170,7 @@
} }
var self = this; var self = this;
self.searching = true; self.searching = true;
let formData = new FormData(); var formData = new FormData();
formData.append("file", currentFile); formData.append("file", currentFile);
axios axios

@ -260,7 +260,7 @@
return false; return false;
} }
function changePlayedStatus(id, status) { function changePlayedStatus(id, status) {
let endpoint = status ? "markPlayed" : "markUnplayed"; var endpoint = status ? "markPlayed" : "markUnplayed";
axios axios
.get("/podcastitems/" + id + "/" + endpoint, { .get("/podcastitems/" + id + "/" + endpoint, {
isPlayed: status, isPlayed: status,
@ -289,7 +289,7 @@
return false; return false;
} }
function changeBookmarkStatus(id, status) { function changeBookmarkStatus(id, status) {
let endpoint = status ? "bookmark" : "unbookmark"; var endpoint = status ? "bookmark" : "unbookmark";
axios axios
.get("/podcastitems/" + id + "/" + endpoint, { .get("/podcastitems/" + id + "/" + endpoint, {
isPlayed: status, isPlayed: status,

@ -261,7 +261,7 @@
this.socket.send(getWebsocketMessage("Enqueue",`{"podcastId":"${id}"}`)) this.socket.send(getWebsocketMessage("Enqueue",`{"podcastId":"${id}"}`))
}, },
sortPodcasts(order){ sortPodcasts(order){
let compareFunction; var compareFunction;
switch(order){ switch(order){
case "dateAdded-asc":compareFunction=(a,b)=>Date.parse(a.CreatedAt)-Date.parse(b.CreatedAt);break; case "dateAdded-asc":compareFunction=(a,b)=>Date.parse(a.CreatedAt)-Date.parse(b.CreatedAt);break;
case "dateAdded-desc":compareFunction=(a,b)=>Date.parse(b.CreatedAt)-Date.parse(a.CreatedAt);break; case "dateAdded-desc":compareFunction=(a,b)=>Date.parse(b.CreatedAt)-Date.parse(a.CreatedAt);break;
@ -298,7 +298,7 @@
this.podcasts.sort(compareFunction) this.podcasts.sort(compareFunction)
}, },
getEpisodeCountTooltip(podcast){ getEpisodeCountTooltip(podcast){
let title=`${podcast.DownloadedEpisodesCount} episodes downloaded out of total ${podcast.AllEpisodesCount} episodes` var title=`${podcast.DownloadedEpisodesCount} episodes downloaded out of total ${podcast.AllEpisodesCount} episodes`
if(podcast.DownloadingEpisodesCount){ if(podcast.DownloadingEpisodesCount){
title+= '\n'+podcast.DownloadingEpisodesCount+' episodes in the queue.' title+= '\n'+podcast.DownloadingEpisodesCount+' episodes in the queue.'
@ -308,7 +308,7 @@
getFormattedLastEpisodeDate(podcast){ getFormattedLastEpisodeDate(podcast){
const options={month:"short", day:"numeric", year:"numeric"} const options={month:"short", day:"numeric", year:"numeric"}
//todo: this is a really dirty hack which needs to be fixed when we work on the episode page //todo: this is a really dirty hack which needs to be fixed when we work on the episode page
let dt=new Date(Date.parse(podcast.LastEpisode.substr(0,10))); var dt=new Date(Date.parse(podcast.LastEpisode.substr(0,10)));
return dt.toDateString() return dt.toDateString()
}, },
downloadAllEpisodes(id) { downloadAllEpisodes(id);}, downloadAllEpisodes(id) { downloadAllEpisodes(id);},

@ -809,7 +809,7 @@ div#large-visualization{
removeSongTime(songId){ removeSongTime(songId){
if(localStorage){ if(localStorage){
let songTimes=localStorage.songTimes; var songTimes=localStorage.songTimes;
if(!songTimes){ if(!songTimes){
songTimes={}; songTimes={};
}else{ }else{
@ -825,7 +825,7 @@ div#large-visualization{
,saveSongTime(songId,time){ ,saveSongTime(songId,time){
if(localStorage){ if(localStorage){
let songTimes=localStorage.songTimes; var songTimes=localStorage.songTimes;
if(!songTimes){ if(!songTimes){
songTimes={}; songTimes={};
}else{ }else{
@ -840,8 +840,8 @@ div#large-visualization{
getSavedSongTime(){ getSavedSongTime(){
if(localStorage){ if(localStorage){
let song=Amplitude.getActiveSongMetadata(); var song=Amplitude.getActiveSongMetadata();
let songTimes=localStorage.songTimes; var songTimes=localStorage.songTimes;
if(!songTimes){ if(!songTimes){
songTimes={}; songTimes={};
}else{ }else{
@ -855,8 +855,8 @@ div#large-visualization{
return 0; return 0;
}, },
changeSpeed(){ changeSpeed(){
let currentSpeedIndex= this.speedOptions.indexOf(this.speed); var currentSpeedIndex= this.speedOptions.indexOf(this.speed);
let nextIndex=0; var nextIndex=0;
if(currentSpeedIndex===-1 || currentSpeedIndex===this.speedOptions.length-1){ if(currentSpeedIndex===-1 || currentSpeedIndex===this.speedOptions.length-1){
nextIndex=0; nextIndex=0;
}else{ }else{
@ -867,7 +867,7 @@ div#large-visualization{
}, },
getSongsFromItems(items){ getSongsFromItems(items){
return items.map(x=>{ return items.map(x=>{
let toReturn= { var toReturn= {
id:x.ID, id:x.ID,
name:x.Title, name:x.Title,
url:x.DownloadPath, url:x.DownloadPath,
@ -882,7 +882,7 @@ div#large-visualization{
}); });
}, },
getFormattedLastEpisodeDate(item){ getFormattedLastEpisodeDate(item){
let dt=new Date(Date.parse(item.PubDate.substr(0,10))); var dt=new Date(Date.parse(item.PubDate.substr(0,10)));
return dt.toDateString() return dt.toDateString()
}, },
formatDuration(total) { formatDuration(total) {
@ -933,7 +933,7 @@ div#large-visualization{
}); });
}, },
mounted(){ mounted(){
let volume=50; var volume=50;
if(localStorage?.playerVolume){ if(localStorage?.playerVolume){
volume=parseInt(localStorage.playerVolume) volume=parseInt(localStorage.playerVolume)
} }
@ -961,7 +961,7 @@ div#large-visualization{
// }, // },
'timeupdate':function(){ 'timeupdate':function(){
let secs=Math.floor(Amplitude.getSongPlayedSeconds()); var secs=Math.floor(Amplitude.getSongPlayedSeconds());
if(secs%10===0){ if(secs%10===0){
song=Amplitude.getActiveSongMetadata(); song=Amplitude.getActiveSongMetadata();
if(Amplitude.getSongPlayedPercentage()>20){ if(Amplitude.getSongPlayedPercentage()>20){
@ -1025,7 +1025,7 @@ div#large-visualization{
let songElements = document.getElementsByClassName('song'); var songElements = document.getElementsByClassName('song');
for( var i = 0; i < songElements.length; i++ ){ for( var i = 0; i < songElements.length; i++ ){
songElements[i].addEventListener('click', function(){ songElements[i].addEventListener('click', function(){
@ -1033,11 +1033,11 @@ for( var i = 0; i < songElements.length; i++ ){
}); });
} }
let markedAsPlayed=[]; var markedAsPlayed=[];
function markSongAsPlayed(id) { function markSongAsPlayed(id) {
let endpoint = "markPlayed"; var endpoint = "markPlayed";
if(markedAsPlayed.indexOf(id)!==-1){ if(markedAsPlayed.indexOf(id)!==-1){
return; return;
} }

Loading…
Cancel
Save