Skip to content

Commit

Permalink
Merge pull request #1 from SystemPatch/master
Browse files Browse the repository at this point in the history
Header icon fix for 4Chan XT
  • Loading branch information
vampiricwulf authored Sep 10, 2024
2 parents ad587bc + 418fe85 commit d61e3b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/display/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ module.exports = {
br.parentNode.insertBefore(document.createTextNode('['), br);
_.element('<a href="#" @click.prevent="display.toggle">Sounds</a>', br, 'beforebegin');
br.parentNode.insertBefore(document.createTextNode(']'), br);
} else if (isChanXT) {
// Add a button in the header for 4chan XT.
_.element(`<span id="shortcut-sounds" class="shortcut brackets-wrap" data-index="0">
<a href="#" @click.prevent="display.toggle" class="settings-link" title="Sounds"><span class="icon--alt-text">Sounds</span><svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 512 512"><path d="M0 256a256 256 0 1 1 512 0 256 256 0 1 1-512 0m188.3-108.9c-7.6 4.2-12.3 12.3-12.3 20.9v176c0 8.7 4.7 16.7 12.3 20.9s16.8 4.1 24.3-.5l144-88c7.1-4.4 11.5-12.1 11.5-20.5s-4.4-16.1-11.5-20.5l-144-88c-7.4-4.5-16.7-4.7-24.3-.5z" fill="currentColor"></path></svg></a>
</span>`, document.getElementById('shortcut-settings'), 'beforebegin');
} else if (isChanX) {
// Add a button in the header for 4chan X.
_.element(`<span id="shortcut-sounds" class="shortcut brackets-wrap" data-index="0">
Expand Down
1 change: 1 addition & 0 deletions src/globals.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ window.ns = 'fcsp';

window.is4chan = location.hostname.includes('4chan.org') || location.hostname.includes('4channel.org');
window.isChanX = document.documentElement && document.documentElement.classList.contains('fourchan-x');
window.isChanXT = document.documentElement && document.documentElement.classList.contains('fourchan-xt');
window.isOneeChan = document.documentElement && document.documentElement.classList.contains('oneechan');
window.Board = location.pathname.split('/')[1];
window.Thread = (location.href.match(/\/thread\/(\d+)/) || [])[1];
Expand Down

0 comments on commit d61e3b9

Please sign in to comment.