NATION

PASSWORD

Does JavaScript have to be used for spoilers?

Bug reports, general help, ideas for improvements, and questions about how things are meant to work.
User avatar
Cekoviu
Post Marshal
 
Posts: 16954
Founded: Oct 18, 2017
Ex-Nation

Does JavaScript have to be used for spoilers?

Postby Cekoviu » Fri Feb 14, 2020 10:28 am

I use NoScript to speed up websites on an old computer I have, but it makes it impossible to view the content of any spoiler here. Is that something tightly integrated into phpBB or can that be fixed somehow?
pro: women's rights
anti: men's rights

User avatar
Trotterdam
Postmaster-General
 
Posts: 10541
Founded: Jan 12, 2012
Left-Leaning College State

Postby Trotterdam » Sat Feb 15, 2020 12:51 am

Which browser? On mine, I can right-click and select "Inspect Element", then remove the "display:none" CSS manually.

There are ways to make spoiler boxes work with just CSS alone, such as:
Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilercheck:checked + div.spoiler { display:block !important }
</style>
<input type="checkbox" class="spoilercheck">Show spoiler
<div class="spoiler">bla bla bla</div>
or:
Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilerpreface:focus + div.spoiler { display:block !important }
</style>
<input type="text" readonly class="spoilerpreface" value="Click to show">
<div class="spoiler">bla bla bla</div>
Although really old browsers still have trouble with these.

The really old-fashioned way to do spoilers is to just set the foreground and background colors to the same value, so that the text is only visible by selecting it, which which NationStates already allows you to do (or you can even make it transparent), but just isn't popular in the community because more dedicated spoiler tags exist.

User avatar
Cekoviu
Post Marshal
 
Posts: 16954
Founded: Oct 18, 2017
Ex-Nation

Postby Cekoviu » Sat Feb 15, 2020 3:44 am

Trotterdam wrote:Which browser? On mine, I can right-click and select "Inspect Element", then remove the "display:none" CSS manually.

There are ways to make spoiler boxes work with just CSS alone, such as:
Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilercheck:checked + div.spoiler { display:block !important }
</style>
<input type="checkbox" class="spoilercheck">Show spoiler
<div class="spoiler">bla bla bla</div>
or:
Code: Select all
<style type="text/css">
div.spoiler { display:none !important }
input.spoilerpreface:focus + div.spoiler { display:block !important }
</style>
<input type="text" readonly class="spoilerpreface" value="Click to show">
<div class="spoiler">bla bla bla</div>
Although really old browsers still have trouble with these.

The really old-fashioned way to do spoilers is to just set the foreground and background colors to the same value, so that the text is only visible by selecting it, which which NationStates already allows you to do (or you can even make it transparent), but just isn't popular in the community because more dedicated spoiler tags exist.

Pale Moon. Can't test this solution right now because the computer is at work, but I'll try on Monday.
pro: women's rights
anti: men's rights


Return to Technical

Who is online

Users browsing this forum: Baharan, Bisofeyr, Caral-Supe, Countriopia, Dimetrodon Empire, Geopolity, Khantin, Libertas Minor, Planetary Soviet Socialist Republics, Shirahime, Xoshen

Advertisement

Remove ads