From 5f9237bddcf8504e294b3ab4c4aeb001f8a6a578 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Thu, 2 Apr 2020 03:42:35 +0300 Subject: [PATCH 1/6] Fixed manifest init --- manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/manifest.json b/manifest.json index 6fa796b..d2e141b 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,6 @@ "manifest_version": 2, "description": "Classic Microsoft Edge \"Tabs Aside\" feature for Chromium browsers", "author": "Michael \"XFox\" Gordeev", - "default_locale": "en", "permissions": [ "tabs", From c7a7d4e40d13dc52f695364a0deceadcdb202ba2 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Thu, 2 Apr 2020 03:43:44 +0300 Subject: [PATCH 2/6] Added "Restore without removing" feature --- css/style.css | 9 ++------- css/style.generic.css | 1 + js/aside-script.js | 19 ++++++++++++++----- js/background.js | 7 +++++-- 4 files changed, 22 insertions(+), 14 deletions(-) diff --git a/css/style.css b/css/style.css index 050b6b1..ccfc97b 100644 --- a/css/style.css +++ b/css/style.css @@ -162,15 +162,10 @@ line-height: initial !important; } - .tabsAside.pane > section > div > div:first-child > div - { - display: none !important; /* TODO: Implement this menu */ - } - .tabsAside.pane > section > div > div:first-child > div > nav { - width: 200px !important; - margin-top: 10px !important; + width: 250px !important; + margin-top: 40px !important; right: 50px !important; } diff --git a/css/style.generic.css b/css/style.generic.css index 18447f1..4685aab 100644 --- a/css/style.generic.css +++ b/css/style.generic.css @@ -108,6 +108,7 @@ cursor: pointer !important; background-color: transparent !important; border: none !important; + box-sizing: border-box !important; font-size: medium !important; text-align: start !important; diff --git a/js/aside-script.js b/js/aside-script.js index 22f8331..d8d71d3 100644 --- a/js/aside-script.js +++ b/js/aside-script.js @@ -141,8 +141,9 @@ function AddCollection(collection) "
" + "" + "" + "
" + "" + @@ -156,6 +157,11 @@ function AddCollection(collection) i.onclick = function () { RestoreTabs(i.parentElement.parentElement) }; }); + list.querySelectorAll("nav button:first-child").forEach(i => + { + i.onclick = function () { RestoreTabs(i.parentElement.parentElement.parentElement.parentElement, false) }; + }); + list.querySelectorAll("div > div:last-child > div > span").forEach(i => { i.onclick = function () { @@ -173,14 +179,14 @@ function AddCollection(collection) i.onclick = function () { RemoveTabs(i.parentElement.parentElement) }; }); - document.querySelectorAll(".tabsAside.pane > section > div > div:first-child > div > nav > button:first-child").forEach(i => + /*document.querySelectorAll(".tabsAside.pane > section > div > div:first-child > div > nav > button:first-child").forEach(i => { i.onclick = function () { AddToFavorites(i.parentElement.parentElement.parentElement.parentElement) }; }); document.querySelectorAll(".tabsAside.pane > section > div > div:first-child > div > nav > button:last-child").forEach(i => { i.onclick = function () { ShareTabs(i.parentElement.parentElement.parentElement.parentElement) }; - }); + });*/ document.querySelectorAll(".tabsAside.pane > section > div > div:last-child > div > div > button").forEach(i => { @@ -193,7 +199,7 @@ function SetTabsAside() chrome.runtime.sendMessage({ command: "saveTabs" }); } -function RestoreTabs(collectionData) +function RestoreTabs(collectionData, removeCollection = true) { chrome.runtime.sendMessage( { @@ -202,6 +208,9 @@ function RestoreTabs(collectionData) }, function () { + if (!removeCollection) + return; + if (collectionData.parentElement.children.length < 3) { RemoveElement(collectionData); diff --git a/js/background.js b/js/background.js index 47118ef..f502723 100644 --- a/js/background.js +++ b/js/background.js @@ -129,7 +129,7 @@ chrome.runtime.onMessage.addListener(function (message, sender, sendResponse) SaveCollection(); break; case "restoreTabs": - RestoreCollection(message.collectionIndex); + RestoreCollection(message.collectionIndex, message.removeCollection); sendResponse(); break; case "deleteTabs": @@ -211,7 +211,7 @@ function DeleteCollection(collectionIndex) UpdateTheme(); } -function RestoreCollection(collectionIndex) +function RestoreCollection(collectionIndex, removeCollection) { collections[collectionIndex].links.forEach(i => { @@ -222,6 +222,9 @@ function RestoreCollection(collectionIndex) }); }); + if (!removeCollection) + return; + collections = collections.filter(i => i != collections[collectionIndex]); localStorage.setItem("sets", JSON.stringify(collections)); From e39ec058811fd8ad0550854f73bf34f8a9183647 Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Thu, 2 Apr 2020 23:11:59 +0300 Subject: [PATCH 3/6] Hardcoded links font weight --- css/style.generic.css | 1 + 1 file changed, 1 insertion(+) diff --git a/css/style.generic.css b/css/style.generic.css index 4685aab..7c14a2d 100644 --- a/css/style.generic.css +++ b/css/style.generic.css @@ -35,6 +35,7 @@ { font-family: 'Segoe UI', 'Segoe MDL2 Assets' !important; color: #0078d7 !important; + font-weight: 400 !important; } .tabsAside a:hover { From aa94820ac34197cb97188422243244215088159d Mon Sep 17 00:00:00 2001 From: Michael Gordeev Date: Thu, 2 Apr 2020 23:33:36 +0300 Subject: [PATCH 4/6] Updated extension link on standalone pane page --- TabsAside.html | 30 +----------------------------- 1 file changed, 1 insertion(+), 29 deletions(-) diff --git a/TabsAside.html b/TabsAside.html index 59f2927..ddc45c8 100644 --- a/TabsAside.html +++ b/TabsAside.html @@ -33,7 +33,7 @@