torproject / nyx

Command-line monitor for Tor.
https://nyx.torproject.org/
GNU General Public License v3.0
123 stars 26 forks source link

FAQ webpage unavailable without javascript #21

Closed atagar closed 4 years ago

atagar commented 4 years ago

Our website tries to fall back when JS is unavailable, but our FAQ is entirely missing without JS.

Without JS we can't toggle the visibility of items, but the information should be available in some form.

saizai commented 4 years ago

Simple answer: make it visible by default, use js to close it.

saizai commented 4 years ago

Also, you seemed to not be using current jQuery hooks for some reason — e.g. custom toggle code when jQuery has a function for that which works just fine.

I couldn't tell why. Was I missing something? AFAICT the old toggle code was completely unnecessary, so I just deleted it with the replacement. If there's some scenario I missed that justified the custom stuff please LMK.

I tested my patch by injection / DOM console manipulation. Worked perfectly. You should test the merged version on your own browser, though.

atagar commented 4 years ago

Thanks Sai! Pushed a variant of your fix.

Unfortunately your change had a few small issues...

I couldn't tell why. Was I missing something?

Yes and no. Honestly I don't recall why I used animate() rather than toggle(), but it's important for the url to change when you click an answer (for example, index.html#what_is_nyx), that way you can send a link that answers someone's question.