Skip to content

Commit

Permalink
Add notes to icon tooltip and alert in forum (#160)
Browse files Browse the repository at this point in the history
* Add notes to icon tooltip and alert in forum

* Fix for integrated browser

---------

Co-authored-by: Willy-JL <[email protected]>
  • Loading branch information
FaceCrap and Willy-JL authored May 16, 2024
1 parent aa232cc commit 29ae3c8
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 7 deletions.
Binary file modified extension/chrome.zip
Binary file not shown.
8 changes: 6 additions & 2 deletions extension/chrome/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ const updateIcons = async (tabId) => {
const game = games.find(g => g.id === gameId);
icon.classList.add('mdi');
icon.style.setProperty('--mdi-i', `'${game.icon}'`);
icon.setAttribute('title', 'This game is present in your F95Checker library!');
let tooltiptext = 'This game is present in your F95Checker library!';
if (game.notes) {
tooltiptext += `\n\nNOTES: ${game.notes}`;
}
icon.setAttribute('title', tooltiptext);
icon.addEventListener('click', () =>
alert('This game is present in your F95Checker library!')
alert(tooltiptext)
);
icon.style.color = game.color;
return [icon, game.color];
Expand Down
Binary file modified extension/firefox.zip
Binary file not shown.
8 changes: 6 additions & 2 deletions extension/firefox/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ const updateIcons = async (tabId) => {
const game = games.find(g => g.id === gameId);
icon.classList.add('mdi');
icon.style.setProperty('--mdi-i', `'${game.icon}'`);
icon.setAttribute('title', 'This game is present in your F95Checker library!');
let tooltiptext = 'This game is present in your F95Checker library!';
if (game.notes) {
tooltiptext += `\n\nNOTES: ${game.notes}`;
}
icon.setAttribute('title', tooltiptext);
icon.addEventListener('click', () =>
alert('This game is present in your F95Checker library!')
alert(tooltiptext)
);
icon.style.color = game.color;
return [icon, game.color];
Expand Down
8 changes: 6 additions & 2 deletions extension/integrated.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,13 @@ var updateIcons = async () => {
const game = games.find(g => g.id === gameId);
icon.classList.add('mdi');
icon.style.setProperty('--mdi-i', `'${game.icon}'`);
icon.setAttribute('title', 'This game is present in your F95Checker library!');
let tooltiptext = 'This game is present in your F95Checker library!';
if (game.notes) {
tooltiptext += `\n\nNOTES: ${game.notes}`;
}
icon.setAttribute('title', tooltiptext);
icon.addEventListener('click', () =>
alert('This game is present in your F95Checker library!')
alert(tooltiptext)
);
icon.style.color = game.color;
return [icon, game.color];
Expand Down
3 changes: 2 additions & 1 deletion modules/rpc_thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def do_GET(self):
self.send_json(200, [{
"id": g.id,
"icon": g.tab.icon if g.tab else Tab.first_tab_label[0],
"color": colors.rgba_0_1_to_hex(g.tab.color) if g.tab and g.tab.color else "#FD5555"
"color": colors.rgba_0_1_to_hex(g.tab.color) if g.tab and g.tab.color else "#FD5555",
"notes": g.notes,
} for g in globals.games.values()
])
return
Expand Down

0 comments on commit 29ae3c8

Please sign in to comment.