Added 'take-me-home' button to the chrome extension

This commit is contained in:
Leonetienne
2021-03-13 19:15:40 +01:00
parent d1578ac94b
commit 8b31627450
5 changed files with 16 additions and 8 deletions

View File

@@ -1,6 +1,6 @@
body {
width: 300px;
height: 310px;
height: 340px;
margin: 0 !important;
}
body .bgmask {

View File

@@ -14,7 +14,7 @@ button.small {
}
button:hover {
transform: scale(1.075);
transform: scale(1.035);
color: #fff;
background-color: #5954a4;
}

View File

@@ -24,14 +24,16 @@
<div class="flex flex-col align-items-center">
<!-- Download this - button -->
<button class="special" id="button-download" title="Will download this pages URL as a video of highest quality.">
<button class="special" id="button--download" title="Will download this pages URL as a video of highest quality.">
Download!
</button>
<button class="small" id="button--take-me-home" style="margin-top: 0.5em;">Take me to my downloads</button>
<!-- Tubio config form -->
<label for="tubio-address" style="margin-top: 3em;">Where can i reach tubio?</label>
<input type="text" id="tubio-address" class="text-center" />
<button class="small" id="button-save-settings" style="margin-top: 0.5em;">Save settings</button>
<button class="small" id="button--save-settings" style="margin-top: 0.5em;">Save settings</button>
</div>
</div>

View File

@@ -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});
});
});