Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not playing friendly with Oneechan nor Sounds #43

Closed
6 tasks done
vampiricwulf opened this issue Apr 6, 2024 · 25 comments
Closed
6 tasks done

Not playing friendly with Oneechan nor Sounds #43

vampiricwulf opened this issue Apr 6, 2024 · 25 comments

Comments

@vampiricwulf
Copy link

vampiricwulf commented Apr 6, 2024

For reference, running:
https://github.com/vampiricwulf/4chan-sounds-player (structurally the same as the OG script, just with warosu fixes and shorthand for catbox links)
https://github.com/KevinParnell/OneeChan

List of observed issues:

  • Sometimes Sounds (external script, not the embedded version) doesn't load properly (might be something needing change on the external script's end).
  • Neither Sounds nor Oneechan have their icons buttons.
    image
  • Thread stats fucked (Fixed by Not playing friendly with Oneechan nor Sounds #43 (comment))
    image
  • Often the sounds player is not loading with the proper theme.
    image
  • Often (You)/Reply highlight on the side of the post missing
    image
  • New randomize button (and all the other buttons next to them) lack a background so they cannot be seen depending on Oneechan settings.
    image
@TuxedoTako
Copy link
Owner

Neither Sounds nor Oneechan have their icons buttons.

Now that XT doesn't include all of font awesome, this is expected. It can be fixed with some custom CSS: #28 (comment)

Often the sounds player is not loading with the proper theme.

4chan Sounds Player has known issues on XT: #36. This might be part of that.

Often (You)/Reply highlight on the side of the post missing

Can be fixed with adding :not(.oneechan) to XT's selectors from line 9945. This will be in the next release.

Code_ugrm7Eh25G

Thread stats fucked

Weird, mine doesn't look like that.

Oneechan tomorrow: msedge_eyZbvPZoOK

Midnight Caek (is that what you're using?): msedge_LVKMDnNTOl

New randomize button (and all the other buttons next to them) lack a background so they cannot be seen depending on Oneechan settings.

I would say this is a flaw in oneechans "Remove Background" option. The QR dialog has a background without oneechan, and by default "Remove Background" isn't enabled.

@saxamaphone69
Copy link

css

:root.fourchan-xt.shortcut-icons :is(#shortcut-sounds, #OneeChanLink) {
	font-size: 0;
}
:root.fourchan-xt.shortcut-icons .fa-play-circle::after {
	content: '';
	display: inline-block;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='red' d='M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9V344c0 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'/%3E%3C/svg%3E");
	background-size: cover;
	padding-top: 14px;
	padding-right: 14px;
}
:root.fourchan-xt.shortcut-icons .fa-gears::after {
	content: '';
	display: inline-block;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath fill='red' d='M308.5 135.3c7.1-6.3 9.9-16.2 6.2-25c-2.3-5.3-4.8-10.5-7.6-15.5L304 89.4c-3-5-6.3-9.9-9.8-14.6c-5.7-7.6-15.7-10.1-24.7-7.1l-28.2 9.3c-10.7-8.8-23-16-36.2-20.9L199 27.1c-1.9-9.3-9.1-16.7-18.5-17.8C173.9 8.4 167.2 8 160.4 8h-.7c-6.8 0-13.5 .4-20.1 1.2c-9.4 1.1-16.6 8.6-18.5 17.8L115 56.1c-13.3 5-25.5 12.1-36.2 20.9L50.5 67.8c-9-3-19-.5-24.7 7.1c-3.5 4.7-6.8 9.6-9.9 14.6l-3 5.3c-2.8 5-5.3 10.2-7.6 15.6c-3.7 8.7-.9 18.6 6.2 25l22.2 19.8C32.6 161.9 32 168.9 32 176s.6 14.1 1.7 20.9L11.5 216.7c-7.1 6.3-9.9 16.2-6.2 25c2.3 5.3 4.8 10.5 7.6 15.6l3 5.2c3 5.1 6.3 9.9 9.9 14.6c5.7 7.6 15.7 10.1 24.7 7.1l28.2-9.3c10.7 8.8 23 16 36.2 20.9l6.1 29.1c1.9 9.3 9.1 16.7 18.5 17.8c6.7 .8 13.5 1.2 20.4 1.2s13.7-.4 20.4-1.2c9.4-1.1 16.6-8.6 18.5-17.8l6.1-29.1c13.3-5 25.5-12.1 36.2-20.9l28.2 9.3c9 3 19 .5 24.7-7.1c3.5-4.7 6.8-9.5 9.8-14.6l3.1-5.4c2.8-5 5.3-10.2 7.6-15.5c3.7-8.7 .9-18.6-6.2-25l-22.2-19.8c1.1-6.8 1.7-13.8 1.7-20.9s-.6-14.1-1.7-20.9l22.2-19.8zM112 176a48 48 0 1 1 96 0 48 48 0 1 1 -96 0zM504.7 500.5c6.3 7.1 16.2 9.9 25 6.2c5.3-2.3 10.5-4.8 15.5-7.6l5.4-3.1c5-3 9.9-6.3 14.6-9.8c7.6-5.7 10.1-15.7 7.1-24.7l-9.3-28.2c8.8-10.7 16-23 20.9-36.2l29.1-6.1c9.3-1.9 16.7-9.1 17.8-18.5c.8-6.7 1.2-13.5 1.2-20.4s-.4-13.7-1.2-20.4c-1.1-9.4-8.6-16.6-17.8-18.5L583.9 307c-5-13.3-12.1-25.5-20.9-36.2l9.3-28.2c3-9 .5-19-7.1-24.7c-4.7-3.5-9.6-6.8-14.6-9.9l-5.3-3c-5-2.8-10.2-5.3-15.6-7.6c-8.7-3.7-18.6-.9-25 6.2l-19.8 22.2c-6.8-1.1-13.8-1.7-20.9-1.7s-14.1 .6-20.9 1.7l-19.8-22.2c-6.3-7.1-16.2-9.9-25-6.2c-5.3 2.3-10.5 4.8-15.6 7.6l-5.2 3c-5.1 3-9.9 6.3-14.6 9.9c-7.6 5.7-10.1 15.7-7.1 24.7l9.3 28.2c-8.8 10.7-16 23-20.9 36.2L315.1 313c-9.3 1.9-16.7 9.1-17.8 18.5c-.8 6.7-1.2 13.5-1.2 20.4s.4 13.7 1.2 20.4c1.1 9.4 8.6 16.6 17.8 18.5l29.1 6.1c5 13.3 12.1 25.5 20.9 36.2l-9.3 28.2c-3 9-.5 19 7.1 24.7c4.7 3.5 9.5 6.8 14.6 9.8l5.4 3.1c5 2.8 10.2 5.3 15.5 7.6c8.7 3.7 18.6 .9 25-6.2l19.8-22.2c6.8 1.1 13.8 1.7 20.9 1.7s14.1-.6 20.9-1.7l19.8 22.2zM464 304a48 48 0 1 1 0 96 48 48 0 1 1 0-96z'/%3E%3C/svg%3E");
	background-size: contain;
	background-repeat: no-repeat;
	padding-top: 14px;
	padding-right: 14px;
}

Without too much effort, here's a new 2.7.0 friendly version. Those scripts would need to be updated to accommodate for the fact Font Awesome isn't there in its entirety anymore.

sound player issues

I also find it doesn't always run, but unsure if that is an X, XT, or sound player issue.
Either way, it applies the theme by creating a .reply element and then grabbing the colours from that. You get the issue sometimes without XT either, so it nor OneeChan isn't necessarily the reason it fails to apply the theme.

threads stats

image
image

In OneeChan you have to enable "Style Thread Stats" (first option) and it adds that visually obnoxious border. It messes up because XT gives .shortcut a height: 14px; - without playing around I would assume it should be .icon that gets the sizing which might alleviate the issue as #shortcut-updater also has the .shortcut class.

Speaking of generic classes, any chance all those QR icons can get a generic class, either .icon or .qr-icon? They all have IDs but I don't feel like writing bad CSS and using #file-n-submit a when I want to select all of them.

no background for new icon row

OneeChan issue - open a new issue there and in the mean time you can use .row.space > .row { background-color: red; }, I think. Chuck a flex: 1 on there to fill the whole row.

Speaking of the new icons - 'reset filename' maybe should read 'revert filename'? Would also be great if the revert icon only appeared when the filename had been randomised.
image
Could probably add a data attribute or discernible class for other userstyles/userscripts to hook into.

@vampiricwulf
Copy link
Author

vampiricwulf commented Apr 7, 2024

Theme: Midnight Caek (is that what you're using?)

Yeh, Zixa the homie and Midnight Caek much more appealing on dark mode accustomed eyes than Appchan.

sound player issues: Theme

Fair enough, I might look into making the sounds script more dynamic with theme interaction. Probably adding certain classes might just naturally apply the proper colorations.

no background for new icon row: Remove Background toggle

My bad, never had to do it before because nothing escaped the input boxes before now so I forgot I had that was an option I turned on.

threads stats: Style Thread Stats/it adds that visually obnoxious border

I understand where you're coming from, but also the lack of a clear separation between the updater timer and the stats is uglier imo.

custom CSS

That's a very inelegant solution to something that works by default on X, I assumed by the issue being closed it meant that you implemented into the code rather than just left it for people to fix themselves, why not just bake it in?
@saxamaphone69 Also I appreciate your new CSS here, but I prefer your old one as the theme colors properly applied rather than staying red.

Updated OP checkboxes.

@TuxedoTako
Copy link
Owner

In OneeChan you have to enable "Style Thread Stats" (first option) and it adds that visually obnoxious border. It messes up because XT gives .shortcut a height: 14px; - without playing around I would assume it should be .icon that gets the sizing which might alleviate the issue as #shortcut-updater also has the .shortcut class.

I added 14px height to the .shortcut because otherwise the icons wouldn't be aligned correctly, as the enclosing anchor was a bit higher than the icon it contains.
msedge_ugOFuVo3UF msedge_6gaEq8DDYE
I'm not that good with CSS, so suggestions of a better fix are welcome.

Speaking of generic classes, any chance all those QR icons can get a generic class, either .icon or .qr-icon? They all have IDs but I don't feel like writing bad CSS and using #file-n-submit a when I want to select all of them.

The SVG icons have the .icon class, or do you mean the anchor tags around them?

Side note, I'm not a fan of using anchor tags as buttons, but at this point replacing them all with buttons would probably break things. I also noticed none of them were keyboard focusable on edge until I added href="javascript:;".

Could probably add a data attribute or discernible class for other userstyles/userscripts to hook into.

Do you mean an unique one per icon? Or to differentiate from the header icons?

Speaking of the new icons - 'reset filename' maybe should read 'revert filename'? Would also be great if the revert icon only appeared when the filename had been randomised.

You can type a different name in the name input, so it's not only about the randomiser. Also, it's not an undo, it set the name back to the original when the file was selected, no matter how many times you randomised or typed in the input, so I think 'reset' is the better term. But English isn't my first language.


That's a very inelegant solution to something that works by default on X, I assumed by the issue being closed it meant that you implemented into the code rather than just left it for people to fix themselves, why not just bake it in?

Because latest Font Awesome has over 2000 free icons, and at the moment, I'm not even using 20.

@vampiricwulf
Copy link
Author

Because latest Font Awesome has over 2000 free icons, and at the moment, I'm not even using 20.

The custom CSS supplied doesn't use Font Awesome, they're unicode symbols/svg. My point was why not just add that custom CSS into your code rather than requiring people to add custom CSS separately.

@saxamaphone69
Copy link

The new CSS I wrote uses the SVG from the same version of Font Awesome that the other icons XT use. The previous CSS from the other issue is just a unicode character as that was what was being used before being switched. Unfortunately, SVGs that are URL-encoded in CSS do not follow/retain the currentColor for fill. I have entered in red more as a placeholder - if you want #fff, where it says red you'd type %23fff instead (because it has to be escaped). This also means it would need another declaration for :hover state.

In 4chan X before, ccd0 had included the entirety of Font Awesome (4.6 mind you, so an old version) in the CSS. So, for example, even though you would never see the reddit logo, if you gave anything the class fa fa-reddit, you would see the reddit logo appear beside it.

Other userscripts took this to their advantage and "hooked" into it so they did not have to include separate icons themselves and were following the "4chan X standard" (since the majority of users have it installed in addition to OneeChan and sounds player, amongst others).

Now in XT, Font Awesome as it was has been removed. This means any external userscripts that used to rely on "the Font Awesome workaround" would no longer "function as intended" because the "exploit" was removed. Recently in 2.7, Tako has added back Font Awesome (latest version) for specific icons, as inline SVG rather than as the web font. But again, it's only for specific icons, and the rest are unicode still.

The exclusion of the entire Font Awesome webfont saves 25KB, you could argue that gets saved in cache somewhere in some places and in other cases would need to load EVERY page load - when only 20 of those 600 icons are actually used. "Big" time and resource waste. In the same way, no point to include a "fix" for OneeChan or sounds player which everyone would need to load every time but might only affect a small percentage of users. XT is no where near as widely used as X is.

Interestingly, sounds player actually embeds (the old) Font Awesome SVGs for all other iconography in the UI but chose to skip it for the header shortcut. If you're having your own version, you could just grab the SVG for the music icon and add it instead. Then it wouldn't matter if 4chan X or XT is installed, everyone would still see the icon (so long as you drop the fa class and make sure it isn't relied upon elsewhere). You could probably even update any of the other icons to Font Awesome 6 while you're at it.

Can't talk much about OneeChan as it hasn't been meaningly been updated for years and uses pretty legacy JS for something that can pretty much be done in a single userstyle and vanilla CSS nowadays.
image

If 4chan X/XT 3.0 rewrote the entire page to use <article> and other elements instead, and other userscripts that relied on the old code to work suddenly stop, then they should be updated rather than X/XT having to detect old versions and backwards support them.

But, that's my opinion.

@saxamaphone69
Copy link

@vampiricwulf

midnight caek

That's my colour theme from my 2009 userstyle "3 Shades of 4chan"! Zixaphir added it as a theme to App/OneeChan.

sound player theme issues

Honestly, their way of doing it is great. I'd imagine the issue comes when the script runs - if it runs before the CSS from OneeChan is applied and it goes to create an element, it would be the Yotsuba/B theme. I'd add some sort of Promise or check that makes sure the page is fully loaded (and OneeChan or other userstyles have run) before adding/activating sounds player and thus applying the theme (which is done as CSS variables, so even easier to change).

stats issue

#thread-stats { padding-left: 3px; border-left: 1px solid; } or something ;)

@TuxedoTako

icon issues

Yeah, I went into a fair bit of digging with this:
ccd0#1473
ccd0#2395

I'll play around with it on the weekend if I get a chance.

icon classes/anchor tags

Oh wow, I didn't even notice because I was looking at the parent anchor tags with the IDs. Let me get back to you on that one.
I'm not as versed on keyboard accessibility as I should be so not sure of the best practice regarding SVG icons in wrappers when they are interactable and making things keyboard focusable.
I see:

  • Bootstrap seems to have icons that are links wrapped in an a, but those that act as buttons are in button (<button><svg></button>) or even <button><svg> Hello</button>
  • Material also has button wrappers
  • shadcn/ui has button wrappers
  • Bulma has icons that aren't interactable in span

And without actually delving in:
https://www.sarasoueidan.com/blog/accessible-icon-buttons/
https://a11y-101.com/development/icons-and-links
https://www.a11y-collective.com/blog/icon-usability-and-accessibility/
https://docs.fontawesome.com/web/dig-deeper/accessibility

Would it break a few things? Maybe. Does that mean those that are using XT need to update what they're using? Yes. I know I have a normalize+reboot for button which would be caught out, but that's fine. Could even add a icon-button class to discern between normal buttons (which are found in the QR).

In that case I can use #shortcuts .icon or #file-n-submit .icon - not as elegant but much better than checking every a's parent element.

reset/revert

Reset still makes sense. I think either term works.

@vampiricwulf
Copy link
Author

vampiricwulf commented Apr 8, 2024

That's my colour theme

Thank you for your service, I've been using it since it was added.

Promise

Above my code skill, but I think I have a simple solution.

@TuxedoTako
Copy link
Owner

Often (You)/Reply highlight on the side of the post missing

Can be fixed with adding :not(.oneechan) to XT's selectors from line 9945. This will be in the next release.

Released with 2.7.1.

@TuxedoTako
Copy link
Owner

Whoops, didn't mean to close this entire issue from the partial fix.

@TuxedoTako TuxedoTako reopened this Apr 18, 2024
@Yaanu
Copy link

Yaanu commented Jun 18, 2024

I decided to try my own variation of the CSS that Saxamaphone posted a while ago, though there isn't much of a difference besides cutting a few lines and changing the icons:

:root.fourchan-xt.shortcut-icons #header-bar .fa {
	font-size: 0;
}
:root.fourchan-xt.shortcut-icons #header-bar .fa-play-circle::before {
	content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%2368a' d='M0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256zM188.3 147.1c-7.6 4.2-12.3 12.3-12.3 20.9V344c0 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'/%3E%3C/svg%3E");
	padding-top: 14px;
	padding-right: 14px;
}
:root.fourchan-xt.shortcut-icons #header-bar .fa-gears::before {
	content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath fill='%2368a' d='M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z'/%3E%3C/svg%3E");
	padding-top: 14px;
	padding-right: 14px;
}

Now my question is, would it be possible to apply different CSS rules for different boards, specifically between SFW and NSFW boards? I still use OneeChan despite its age because of its theming capabilities and that specific feature, and the "fill" property can obviously only apply to one of the two sites at a time.
It's a minor inconvenience, sure, but I figured I'd ask in case there's a solution.

@saxamaphone69
Copy link

@Yaanu
While not full proof, technically SFW boards use yotsuba-b on :root and yotsuba for NSFW.

So, for SFW boards:

:root.fourchan-xt.shortcut-icons.yotsuba-b #header-bar .fa-gears::before {
 color: BLUE;
}

and then for NSFW

:root.fourchan-xt.shortcut-icons.yotsuba #header-bar .fa-gears::before {
 color: RED;
}

But obviously make whatever changes you need to make properly.

The reason it doesn't work is SVGs inserted with data URI in CSS don't follow fill or currentColor rules.

@Yaanu
Copy link

Yaanu commented Jun 18, 2024

@saxamaphone69
I gave that a try, and while it DOES work when using 4chan XT alone, something in OneeChan and its theming options overrides the selectors (or whatever they're called in CSS) and the icons just outright disappear instead.
Unfortunately, I'm too daft and code-illiterate to figure out what in OneeChan's CSS is overriding it right away, so I'll have to dig into it later to find out what makes it tic.

@saxamaphone69
Copy link

@Yaanu
It's because in OneeChan's code, for whatever reason, they remove the discernible classes from :root.

If you only frequent several boards, and don't care if it doesn't look nice on the occasion you venture outside your usual boards, you could do:

:root.fourchan-xt.shortcut-icons.yotsuba :is(.board_pol, .board_b) #header-bar .fa-gears::before {
 color: RED;
}

and then

:root.fourchan-xt.shortcut-icons.yotsuba :is(.board_g, .board_v) #header-bar .fa-gears::before {
 color: BLUE;
}

and if you ever need to really override something, try an !important; at the end.

Though, admittedly, having 4chan XT add a board_nsfw or board_sfw class to either html or body would be pretty handy - it's even there in the inline script, var style_group = "nws_style".

@vampiricwulf
Copy link
Author

Hit the "Edit" button on the theme on Oneechan, use that custom css box to add your fill colors.

@Yaanu
Copy link

Yaanu commented Jun 19, 2024

@vampiricwulf
Well, damn, that worked! I dunno why I didn't think of that before.
Thanks!

@saxamaphone69
I agree; native SFW/NSFW identification would definitely be a good idea for a future build, for example, if you wanted to prevent auto-playing GIFs and WebMs on NSFW boards but let them auto-play on SFW boards.

@vampiricwulf
Copy link
Author

Nah, no thanks necessary, instead I apologize, I woulda helped you within the hour of your first message if I hadn't missed the part after the code block. Oneechan needs a modern code rewrite as well, but no one really has the time nor interest to do that. It's funny to see how many posters still don't even use 4chanX. I personally can't live without X and Oneechan. Nothing feels right without them.

@SystemPatch
Copy link

I've dug out my old fork of Oneechan and added basic support for XT, which should fix the two issues listed in the OP.
https://github.com/SystemPatch/OneeChan

I don't know if I'll be able to fix any issues at the moment, but let me know if it works for you and any other feedback.

I added 14px height to the .shortcut because otherwise the icons wouldn't be aligned correctly, as the enclosing anchor was a bit higher than the icon it contains.
I'm not that good with CSS, so suggestions of a better fix are welcome.

Switching from px to em sizing might work, with the added benefit of being able to resize with changes to the font size. With some poking around, I believe these are the optimal values to match the current sizes for the icons:

#header-bar .menu-button i {
    border-top: .45em solid;
    border-right: .3em solid transparent;
    border-left: .3em solid transparent;
    margin: .3em .16em;
}
:root.shortcut-icons #shortcuts .shortcut {
    height: 1em;
}
svg.icon {
    height: 1em;
}

@vampiricwulf
Copy link
Author

I've dug out my old fork of Oneechan and added basic support for XT, which should fix the two issues listed in the OP. https://github.com/SystemPatch/OneeChan

While I get the "updated to version 5.7.0" notification, I don't see any settings menu nor any actual theme applied. Also your OneeChan is branched off an older version, the one currently being used by most is: https://github.com/KevinParnell/OneeChan

@SystemPatch
Copy link

I opted not to use that branch because it's honestly a mess. Many of the changes are done directly to the user.js file instead of in /src, and like 90% of them are adding and removing mascots, with the remaining 10% fixing problems that came up because of all the messing around with mascots.

I'll likely make some pull requests soon to clean up that mess and port over my changes once I can confirm things work. In the meantime, I've ported over the mascot fixes to my fork, since I think that's why it's breaking when updating. Give it an update and see if it works now.

@vampiricwulf
Copy link
Author

vampiricwulf commented Sep 8, 2024

Yep, that works! Thank you~ Are you going to add a fix for the "Sounds" svg as well, or should I just leave in the custom CSS that adds it?

@SystemPatch
Copy link

Are you going to add a fix for the "Sounds" svg as well, or should I just leave in the custom CSS that adds it?

I've submitted a pull request to your fork of sounds player, which should add the SVG icon from the CSS above to the header. I did a build to test it out, and it seems to be working.

That said, I'm having some issues between sounds player and XT specifically. It seems to be breaking somewhere in reading the replies, and when it does, the icon fails to embed in the header. It's hard to nail down, since it's very inconsistant and there's no error in the console. The sound player also still works in this state, and some detected sound filenames will still have a play button embed next to them, but somewhere around 30-50 replies, the script seems to stop. This behavior is only happening in XT, as the script seems to complete both with just Sounds and Sounds + X.

@vampiricwulf
Copy link
Author

My bad, didn't notice the notification. Copying over what I said there:

It sometimes requires another refresh or two.
I believe the problem lies with load order.
If I knew of a way to keep 4CSP from loading until after Oneechan and XT finished loading, I think that might fix the issue.
Further, XT has a sounds player built-in and I believe enabled by default, so you would have to turn it off to avoid conflict.

@SystemPatch
Copy link

SystemPatch commented Sep 11, 2024

Got ya. I'm nowhere near compent enough in Javascript to really figure it out, but going by what you said and looking at the code for sounds player, it seems like XT might be handling "4chanXInitFinished" differently enough from X that it takes longer to trigger in larger threads. Setting the timeout value higher in sounds player for document.addEventListener("4chanXInitFinished", e) up from 0 to 1000 makes the sounds player much more consistant for me.

Edit: Wrong value, that's a function call, not the timeout

@vampiricwulf
Copy link
Author

Well, with that, everything is checked off! Thank you all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants