From 8b52af374cf0f815fc21f1e7e7a1e89f7d0e6910 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Mon, 13 Apr 2020 20:05:26 +0200 Subject: [PATCH] Started working on settings tab --- public/js/downloadList.js | 7 ++++--- public/js/init.js | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/js/downloadList.js b/public/js/downloadList.js index d795cda..6d66f52 100644 --- a/public/js/downloadList.js +++ b/public/js/downloadList.js @@ -58,8 +58,7 @@ socket.on("startDownload", function(uuid){ }) socket.on("finishDownload", function(uuid){ - console.log(uuid+" finished downloading") - toast(`${queueList[uuid].title} finished downloading.`) + toast(`${queueList[uuid].title} finished downloading.`, 'done') $('#bar_' + uuid).css('width', '100%') let result_icon = $('#download_'+uuid).find('.queue_icon') if (queueList[uuid].failed == 0){ @@ -74,6 +73,9 @@ socket.on("finishDownload", function(uuid){ queue.splice(index, 1) delete queueList[uuid] } + if (queue.length <= 0){ + toast('All downloads completed!', 'all_done') + } }) socket.on("removedAllDownloads", function(){ @@ -84,7 +86,6 @@ socket.on("removedAllDownloads", function(){ socket.on("updateQueue", function(update){ if (update.uuid && queue.indexOf(update.uuid) > -1){ - console.log(update) if (update.downloaded){ queueList[update.uuid].downloaded++ $("#download_"+update.uuid+" .queue_downloaded").text(queueList[update.uuid].downloaded) diff --git a/public/js/init.js b/public/js/init.js index 7479e9d..75b7e5a 100644 --- a/public/js/init.js +++ b/public/js/init.js @@ -160,3 +160,17 @@ socket.on("logged_out", function(){ $("#settings_username").text("Not Logged") $("#settings_picture").attr("src",`https://e-cdns-images.dzcdn.net/images/user/125x125-000000-80-0-0.jpg`) }) + +// settings +var settingsTab = new Vue({ + el: '#settings_tab', + data: { + settings: {} + } +}) + +socket.on("init_settings", function(settings){ + console.log(settings) + settingsTab.settings = settings + toast("Loaded Settings", 'done') +})