diff --git a/goodies/chrome-extension/popup/css/background.css b/goodies/chrome-extension/popup/css/background.css index 53907ca..c7c55c0 100644 --- a/goodies/chrome-extension/popup/css/background.css +++ b/goodies/chrome-extension/popup/css/background.css @@ -1,6 +1,6 @@ body { width: 300px; - height: 300px; + height: 310px; margin: 0 !important; } body .bgmask { diff --git a/goodies/chrome-extension/popup/css/button.css b/goodies/chrome-extension/popup/css/button.css index 1b32782..1e728cf 100644 --- a/goodies/chrome-extension/popup/css/button.css +++ b/goodies/chrome-extension/popup/css/button.css @@ -9,7 +9,17 @@ button { transform 0.15s ease; } +button.small { + padding: 0.15em 1em; +} + button:hover { + transform: scale(1.075); + color: #fff; + background-color: #5954a4; +} + +button.special:hover { /*background-color: #5954a4;*/ color: #fff; animation: color-cycle; diff --git a/goodies/chrome-extension/popup/css/typography.css b/goodies/chrome-extension/popup/css/typography.css index e079919..3b71db1 100644 --- a/goodies/chrome-extension/popup/css/typography.css +++ b/goodies/chrome-extension/popup/css/typography.css @@ -1,6 +1,6 @@ * { font-family: 'ZillaSlab' !important; - color: #ddd; + color: #dadada; } p, diff --git a/goodies/chrome-extension/popup/index.html b/goodies/chrome-extension/popup/index.html index 9efe69e..ed411c6 100644 --- a/goodies/chrome-extension/popup/index.html +++ b/goodies/chrome-extension/popup/index.html @@ -24,12 +24,14 @@
- + +
diff --git a/goodies/chrome-extension/popup/js/script.js b/goodies/chrome-extension/popup/js/script.js index 107f926..cb1df99 100644 --- a/goodies/chrome-extension/popup/js/script.js +++ b/goodies/chrome-extension/popup/js/script.js @@ -20,3 +20,13 @@ $("#button-download").click(function() { return; }); + +chrome.storage.local.get(['tubio_address'], function(result) { + $("#tubio-address").val(result.tubio_address); +}); + +$("#button-save-settings").click(function() { + chrome.storage.local.set({ + tubio_address: $("#tubio-address").val() + }); +}); diff --git a/goodies/chrome-extension/queueDownload.js b/goodies/chrome-extension/queueDownload.js index 4eab308..056ed2e 100644 --- a/goodies/chrome-extension/queueDownload.js +++ b/goodies/chrome-extension/queueDownload.js @@ -1,21 +1,38 @@ function QueueDownload(url, mode, quality, callback) { - console.log("Queuing '" + url + "'..."); + console.log("Queueing '" + url + "'..."); + + // Fetch tubio address + chrome.storage.local.get(['tubio_address'], function(result) { + + if ((typeof(result.tubio_address) == 'undefined') || + (result.tubio_address.length == 0)) { + alert("Please first set an address to reach Tubio at in the extensions settings! (Click on the extensions icon in the toolbar)."); + return; + } else { + + tubioUrl = result.tubio_address; + if (tubioUrl[tubioUrl.length-1] != '/') { // Has the user not appended a /? + tubioUrl += '/'; + } + + axios.post(tubioUrl + "api", { + request: "queue_download", + video_url: url, + mode: mode, + quality: quality + }).then(function(response){ + console.log("Queued successfully..."); + if (typeof(callback) != 'undefined') callback(true, response); + + }).catch(function(response){ + console.log("Something went wrong..."); + console.log(response); + if (typeof(callback) != 'undefined') callback(false, response); + }); + } + }); - axios.post("http://tub.io/api", { - request: "queue_download", - video_url: url, - mode: mode, - quality: quality - }).then(function(response){ - console.log("Queued successfully..."); - if (typeof(callback) != 'undefined') callback(true, response); - - }).catch(function(response){ - console.log("Something went wrong..."); - console.log(response); - if (typeof(callback) != 'undefined') callback(false, response); - }); return; }