Skip to content

Commit

Permalink
Merge pull request #394 from freelawproject/feat-update-recap-banners
Browse files Browse the repository at this point in the history
  • Loading branch information
mlissner authored Sep 11, 2024
2 parents 43f6047 + c9074ac commit 5cc7cf4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 40 deletions.
25 changes: 0 additions & 25 deletions src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,31 +47,6 @@ async function addRecapInformation(msg) {
});
}

const options = await getItemsFromStorage('options');
if (
'login_dismiss_new_brand_info' in options &&
options['login_dismiss_new_brand_info']
) {
return;
}

let bannerMessage =
'Get ready for a new chapter! RECAP is getting a ' + 'fresh new look.';
let bannerLink = 'https://free.law/2024/07/05/new-branding-rip-flip';
PACER.addRecapBannerToLoginPage(bannerMessage, bannerLink);

let dismiss_button = document.getElementById('dismiss_recap_info_banner');
dismiss_button.addEventListener('click', async () => {
await PACER.removeBannerFromLoginPage();
return false;
});

let learn_more_btn = document.getElementById('learn_more_btn');
learn_more_btn.addEventListener('click', async () => {
await PACER.removeBannerFromLoginPage(event_from_btn = true);
return true;
});

return;
}

Expand Down
5 changes: 2 additions & 3 deletions src/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
</div>
</div>
<p id="info-banner-message">
<b>Get ready for a new chapter!</b> RECAP is getting a fresh new look.
</p>
<b>RECAP is using Manifest Version 3 now</b>. Enjoy improved features and performance.
<div id="dismiss-banner" class="d-flex align-items-start justify-content-end">
<button type="button" class="close" aria-label="Close">
<span aria-hidden="true">&times;</span>
Expand All @@ -35,7 +34,7 @@
</div>
<div class="input-group-append d-flex justify-content-center">
<a class="btn btn-primary" id="learn-more-button" target="_blank" rel="noopener"
href="https://free.law/2024/07/05/new-branding-rip-flip">
href="https://github.com/freelawproject/recap-chrome/releases/tag/2.8.0">
&nbsp;Learn More
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ async function load_options() {
inputs[i].value = items.options[inputs[i].id] || '';
}
}
if ('option_dismiss_new_brand_info' in items.options) removeInfoBanner();
if ('option_dismiss_new_manifest_info' in items.options) removeInfoBanner();
});
}

Expand All @@ -38,7 +38,7 @@ function save_options() {

let banner = document.getElementById('header-banner');
if (!banner) {
options['option_dismiss_new_brand_info'] = true;
options['option_dismiss_new_manifest_info'] = true;
}

chrome.storage.local.set({ options: options }, function () {
Expand Down
13 changes: 3 additions & 10 deletions src/utils/toolbar_button.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,9 @@ export function updateToolbarButton(tab) {
) {
chrome.action.setBadgeText({ text: '' });
} else {
if (
/Safari/.test(navigator.userAgent) &&
!/Chrome|Chromium/.test(navigator.userAgent)
) {
// Detect Safari engine
chrome.action.setBadgeText({ text: '1' });
} else {
chrome.action.setBadgeText({ text: '🔔' });
chrome.action.setBadgeBackgroundColor({ color: '#404040' });
}
chrome.action.setBadgeText({ text: '1' });
chrome.action.setBadgeTextColor({ color: 'white' });
chrome.action.setBadgeBackgroundColor({ color: 'red' });
}

if (tab === null || tab === undefined) {
Expand Down

0 comments on commit 5cc7cf4

Please sign in to comment.