From 8b31627450b237cfd2dc00bca492d8f385e36f25 Mon Sep 17 00:00:00 2001 From: Leonetienne Date: Sat, 13 Mar 2021 19:15:40 +0100 Subject: [PATCH] Added 'take-me-home' button to the chrome extension --- goodies/chrome-extension/popup/css/background.css | 2 +- goodies/chrome-extension/popup/css/button.css | 2 +- goodies/chrome-extension/popup/index.html | 6 ++++-- goodies/chrome-extension/popup/js/script.js | 12 +++++++++--- goodies/chrome-extension/readme.md | 2 +- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/goodies/chrome-extension/popup/css/background.css b/goodies/chrome-extension/popup/css/background.css index c7c55c0..263527e 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: 310px; + height: 340px; margin: 0 !important; } body .bgmask { diff --git a/goodies/chrome-extension/popup/css/button.css b/goodies/chrome-extension/popup/css/button.css index 1e728cf..5f4797a 100644 --- a/goodies/chrome-extension/popup/css/button.css +++ b/goodies/chrome-extension/popup/css/button.css @@ -14,7 +14,7 @@ button.small { } button:hover { - transform: scale(1.075); + transform: scale(1.035); color: #fff; background-color: #5954a4; } diff --git a/goodies/chrome-extension/popup/index.html b/goodies/chrome-extension/popup/index.html index ed411c6..7ab8280 100644 --- a/goodies/chrome-extension/popup/index.html +++ b/goodies/chrome-extension/popup/index.html @@ -24,14 +24,16 @@
- + + - +
diff --git a/goodies/chrome-extension/popup/js/script.js b/goodies/chrome-extension/popup/js/script.js index cb1df99..cec6d7a 100644 --- a/goodies/chrome-extension/popup/js/script.js +++ b/goodies/chrome-extension/popup/js/script.js @@ -1,6 +1,6 @@ -$("#button-download").click(function() { +$("#button--download").click(function() { - $("#button-download").addClass("lock"); + $("#button--download").addClass("lock"); // Query active tab in active window... chrome.windows.getCurrent(function(w) { @@ -25,8 +25,14 @@ chrome.storage.local.get(['tubio_address'], function(result) { $("#tubio-address").val(result.tubio_address); }); -$("#button-save-settings").click(function() { +$("#button--save-settings").click(function() { chrome.storage.local.set({ tubio_address: $("#tubio-address").val() }); }); + +$("#button--take-me-home").click(function() { + chrome.storage.local.get(['tubio_address'], function(result) { + chrome.tabs.create({url: result.tubio_address}); + }); +}); diff --git a/goodies/chrome-extension/readme.md b/goodies/chrome-extension/readme.md index cf9d5e3..daaead4 100644 --- a/goodies/chrome-extension/readme.md +++ b/goodies/chrome-extension/readme.md @@ -1,5 +1,5 @@ # Chrome Extension for Tubio Adds a context-menu and a popup to download videos instantly. -It does not open tubio for you. It just downloads the videos. +It does not open Tubio for you. It just downloads the videos. But you can click a button in the extensions popup that takes you to Tubio. For now this is not on the chrome store, but you can easily install unlisted extensions from source as shown [here](https://developer.chrome.com/docs/extensions/mv2/faq/#:~:text=Click%20the%20Chrome%20menu%20icon,a%20packaged%20extension%2C%20and%20more.).