Spoiler Code?

How do I do spoilers on this forum? I'm used to BBCode Spoilers [spoiler=Spoiler Name]Spoiler Text[/spoiler] but in HTML it seems more complicated.

I tried some variants I found by searching but I didn't get them to work properly.

 

44,613 views 7 replies
Reply #1 Top

type your text....highlight it...click on icon to the right of the font styles above

or type...

[  spoiler  ]text here[  /spoiler  ] ... without spaces in brackets...;)

Reply #2 Top

Oh, yeah that also counts as a spoiler, I should have been more specific. I need a button or link that unfolds or collapses a text. I want to use it to make my giant wall of text of my in depth suggestion more approachable and not immediately overwhelm people looking at it.

 

Reply #3 Top

Edit: NVM just read that you wanted it on Wincustomize this is how you could add it to your own Page.

Not sure if you intend to have some sort of dropdown menu for the text that is marked as "Spoiler"
What one need to do this is a plugin for example WP-Spoiler ( just one example)



You could then even go further and add some simple code refering to it to the style.css and set margins and graphics for it. 

/*Spoiler*/
a.spoiler_link_show,
a.spoiler_link_hide {
background-repeat: no-repeat;

background-position: left center;
padding-left: 20px;
}
a.spoiler_link_show {
background-image: url(images/add.png);
}
a.spoiler_link_hide {
background-image: url(images/delete.png);
}
div.spoiler_div {
background:#00000;
border:2px dotted #dddddd;
font-size:1em;
line-height: 1.2em;
margin: 5px 0 10pt;
padding:10px 10pt 6pt;
}
Something like that ...

Then you would have an image and if you click it it would expand your hidden text


 

Reply #4 Top

I have this giant suggestion post over in the GalCiv3 section, that is already 4 screen lengths long and still growing and I want to make the post more accessable without people just seeing a wall of text and closing the tab before reading anything.

Edit: nevermind what I wanted to say here. With some experimenting I found my problem, the version I found does work

BUT only for unformated text, as soon as I try to format the text inside it stops working.

This is the code I found:

<a id="show_id" onclick="document.getElementById('spoiler_id').style.display=''; document.getElementById('show_id').style.display='none';" class="link">[Show]</a><span id="spoiler_id" style="display: none"><a onclick="document.getElementById('spoiler_id').style.display='none'; document.getElementById('show_id').style.display='';" class="link">[Hide]</a><br>spoiler_content</span>

This is how it works with unformated text:

[Show]

 

This is what happens if I try to put in formated text, it just ends up outside the spoiler:

[Show][Hide]

Split Sensors into two Systems: Vision and Radar

Vision  work similar to Sensors now, but with slightly reduced range and certain countermeasures, see Cloaking, but is uneffected by Radar-Disruption, see Stealth and False Signatures as well as Jamming.

Radar will be capable of larger ranges than Vision but only provides reduced/partial intel/information, Visualisation via new Iconset containing: Unidentified Planet for planets,  Unidentified Resource for Durantium/Thulium/Promethium/Antimatter/Elerium, Unidentified Starbase for starbases and shipyards and artifacts and Unidentified Signatures for Ships and fleets with the Signature Size Indicator. Radar can be disrupted by Jamming.

Signiture Size Indicator The Unidentified Signatures Icon gains one arrow ^ for each 5 Signature Size (rounded up), the Signature of a ship is decided by the default logistic size of its ship class. The Signature Size Indicator can be manipulated by Stealth and False Signatures.

Stealth and False Signatures manipulate the Signature Size Indicator, Stealth will decrease it, while False Signatures are used to increase it. Note that stealth cannot remove the Indicator just reduce it to the minimum of a single arrow ^.

Cloaking prevents visual scouting of ships or even whole fleets. If a fleet is completly cloaked it will only show its Signature Indicator even when in vision range, If there is only some cloaked ships in a fleet, it's displayed the same as now but the display is extended by the Signature Indicator and the cloaked ships wont show in the display.

Visual Distortion ... to be added

Jamming creates a static noise field that's visible on the map, even outside your radar range but blocks radar completly, the origin of the jamming field is also displayed. Ships and Starbases inside a jamming field have 50% radar range penalty regardless of owner.

Interference Penetration has 10% of Radar range, works like radar but is not affected by jamming.

Reply #6 Top

It seems that the editor html parser breaks down when a paragraph enclosure is used within the (spoiler) span section; and thereby generating the wrong code.

A fix is to remove paragraph breaks from your (spoiler) text and replace them by double line breaks. As shown in the example below - between "Different font" and "Bold"

[Show formatted text]

Hopes this helps.

PS:
1) It is not just the generic paragraph tag that bonks out the generator; other tags that break a paragraph also messes it up, like the <hr /> tag.
2) you can use the shift-enter key to insert a line break, instead of just using the enter key to insert a paragraph break.

Reply #7 Top

I'll try shift-enter, but it seems like your example doesn't work? Nevermind works now.

Thanks anyway.