From c9975d65be2310614805d9fd41deb69c9ceacebc Mon Sep 17 00:00:00 2001 From: tconfrey Date: Wed, 11 Dec 2024 16:16:09 -0500 Subject: [PATCH] tweak to dark mode and handle localhost as well as bt.org urls --- extension/popup.css | 12 +++++++----- extension/popup.js | 5 +++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/extension/popup.css b/extension/popup.css index 7206a66..6a9d5ce 100644 --- a/extension/popup.css +++ b/extension/popup.css @@ -20,7 +20,7 @@ --btHeaderBackground: linear-gradient(180deg, #F1F1F1 0%, #C3CBCB 52.6%, #C8CFD0 100%); --btBodyBackground: linear-gradient(180deg, rgba(196, 196, 196, 0.28) 0%, rgba(196, 196, 196, 0.3) 14.58%, rgba(196, 196, 196, 0.1) 100%); --btTextColor: #0C4F6B; - --btBackground: #bed8be; + --btBackground: white; --btHighlightColor: #cec; --btSelected: #7bb07b; @@ -46,8 +46,7 @@ --btInputForeground: white; --awesompleteBackground: #566564; /*linear-gradient(to bottom, black, hsla(0,0%,0%,.6));*/ - --btBackground: #bed8be; - + --btBackground: #c3cac3; } @@ -58,7 +57,7 @@ body { padding-bottom: 30px; overflow: hidden; margin: 0px; - background: white; + background: var(--btBackground); font-family: var(--btFont); font-style: normal; @@ -99,12 +98,14 @@ h2 { font-weight: 700; font-size: 12px; line-height: 14px; + color: #0C4F6B; } h3 { font-weight: 400; font-size: 12px; line-height: 14px; margin-bottom: 6px; + color: #0C4F6B; } .tgPages { display: none; @@ -119,6 +120,7 @@ hr { label { position: relative; top: -3px; + color: #0C4F6B; } #saveSpan { float:left; @@ -188,7 +190,7 @@ input[type=text], textarea { margin-bottom: -5px; margin-right: 15px; font-style: italic; - color: var(--btTextColor); + color: #0C4F6B; display: none; } .awesomplete { diff --git a/extension/popup.js b/extension/popup.js index 210b3ab..4abf371 100644 --- a/extension/popup.js +++ b/extension/popup.js @@ -146,12 +146,13 @@ function openTopicManager(home = 'WINDOW', location) { (tabs => {if (tabs.length) chrome.tabs.remove(tabs.map(tab => tab.id));}) ); - // Get server url from the manifest object. nb manifest needs app/* so need to strip * + // Get server url from the manifest object, add '${version}/app' unless local. nb manifest needs app/* so need to strip * const manifest = chrome.runtime.getManifest(); const contentScripts = manifest.content_scripts; const match = contentScripts[0].matches[0]; + const localhost = match.includes('localhost'); const version = manifest.version; - const url = match.replace(/\*+$/, '') + version + '/app'; + const url = match.replace(/\*+$/, '') + (localhost ? '' : (version + '/app')); console.log('loading from ', url);