From e7b1a8c38ee2388d7941895480d308c25b18bd59 Mon Sep 17 00:00:00 2001 From: Guilherme Marmiroli Date: Sun, 25 Aug 2024 18:24:31 -0300 Subject: [PATCH] Cleaned the clutter (again!) =P --- README.md | 13 +++++++------ src/components/peek/peek.css | 1 - src/components/sidebar/sidebar.js | 31 ++++++++++++++----------------- 3 files changed, 21 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 46f0d3e..c7c6650 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ And things that would make it great but are not actually necessary. If you want to contact us, open a issue or use our discord -## Rebuild roadmap +## Our Roadmap ### Essential: @@ -40,6 +40,10 @@ If you want to contact us, open a Full Roadmap for a better understanding of the upcoming features and things we are working on :D

@@ -129,10 +134,6 @@ To install arcfox-theme you need to open your firefox configurations and turn st - Inside the "chrome" folder, drop the "userChrome.css" that you find on the releases. - Restart firefox. -# Roadmap - -ArcFox still have a lot of features to be implemented and you can see our Roadmap for a better understanding of the upcoming features and things we are working on :D - # Removing ArcFox If you have a major issue, or just want a different/default look, here is how to remove ArcFox. diff --git a/src/components/peek/peek.css b/src/components/peek/peek.css index 3447dea..678e82b 100644 --- a/src/components/peek/peek.css +++ b/src/components/peek/peek.css @@ -6,7 +6,6 @@ } /* Peek */ - div#peekpage { height: 100vh; width: 74vw; diff --git a/src/components/sidebar/sidebar.js b/src/components/sidebar/sidebar.js index d480500..399346d 100644 --- a/src/components/sidebar/sidebar.js +++ b/src/components/sidebar/sidebar.js @@ -1,7 +1,6 @@ // Define variables let tabs = []; let activeTab = null; - var favorites = []; var openedFavorites = [] var openedFavoritesIds = []; @@ -9,7 +8,6 @@ var openedFavoritesIds = []; const searchInput = document.getElementById("search-input"); const tabList = document.getElementById("tab-list"); const newTabButton = document.getElementById("new-tab-button"); -const searchIcon = document.querySelector('.address-bar i'); const spaceName = document.querySelector('input#space-name'); // Add event listeners @@ -17,14 +15,7 @@ newTabButton.addEventListener("click", () => newTab() ); -// Get favorites from localstorage -browser.storage.local.get('favorites', function (result) { - favorites = result.favorites || [{ url: 'https://gmail.com', favicon: 'https://mailmeteor.com/logos/assets/PNG/Gmail_Logo_512px.png', id: 0 }, { url: 'https://music.youtube.com', favicon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Youtube_Music_icon.svg/2048px-Youtube_Music_icon.svg.png', id: 1 }]; - console.log(favorites) - loadFavorites() -}); - -// Put space name on localstorage +// Put space name on browser storeage spaceName.addEventListener('change', () => { spaceName.blur() browser.storage.local.set({ 'spaceName': spaceName.value }) @@ -41,13 +32,19 @@ browser.storage.local.get('spaceName', function (result) { }); // Auto-selects address bar on click -document.getElementById('search-input').addEventListener(`click`, () => { +searchInput.addEventListener(`click`, () => { if (document.activeElement.id == 'search-input') { - document.getElementById('search-input').select() + searchInput.select() } }); document.querySelector('div.address-bar').addEventListener(`click`, () => document.getElementById('search-input').select()); +// Loads favorites +browser.storage.local.get('favorites', function (result) { + favorites = result.favorites || [{ url: 'https://gmail.com', favicon: 'https://mailmeteor.com/logos/assets/PNG/Gmail_Logo_512px.png', id: 0 }, { url: 'https://music.youtube.com', favicon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Youtube_Music_icon.svg/2048px-Youtube_Music_icon.svg.png', id: 1 }]; + loadFavorites() +}); + // Update sidebar when a tab changes browser.tabs.onUpdated.addListener((changeInfo) => { if (changeInfo.status === "complete") { @@ -89,6 +86,7 @@ function handleBrowserControl(id) { initTabSidebarControl(); } +// Handle controls const controls = ['back', 'front', 'refresh', 'close', 'size', 'hide', 'back', 'front'] controls.forEach((control) => { document.getElementById(control).addEventListener("click", function () { @@ -216,7 +214,6 @@ function newTab() { } // Sidebar Code -const list = document.getElementById('tab-list'); let base, draggedOver, dragging, activeTabId; const init = (array) => { @@ -229,7 +226,7 @@ const init = (array) => { }; const renderItems = (data) => { - list.innerHTML = ''; + tabList.innerHTML = ''; data.forEach((tab) => { const node = document.createElement('li'); node.draggable = true; @@ -275,7 +272,7 @@ const renderItems = (data) => { } if (!openedFavoritesIds.includes(tab.id)) { - list.appendChild(node); + tabList.appendChild(node); } }); }; @@ -324,11 +321,11 @@ const navigateToTab = (e) => { browser.tabs.update(tabId, { active: true, highlighted: false }); updateSearchBar(); - list.querySelector('.active')?.classList.remove('active'); + tabList.querySelector('.active')?.classList.remove('active'); document.querySelector('[aria-label="favopen"]')?.setAttribute('aria-label', ''); activeTabId = tabId; - list.querySelector(`[data-tab-id="${activeTabId}"]`)?.classList.add('active'); + tabList.querySelector(`[data-tab-id="${activeTabId}"]`)?.classList.add('active'); e.currentTarget.classList.add('current-tab'); };