[SOLVED] Spoilers doesn't work

Extensions, styles and support for everything else about phpBB
Post Reply
User avatar
jan_2017
Distinguished Donor
Posts: 120
Joined: 13 May 2017, 18:07

[SOLVED] Spoilers doesn't work

#1

Post by jan_2017 » 29 Aug 2018, 15:01

Hello,i want to use a spoiler function in the forum.there are a lot of working templates.unfortunately i can't show it in a post two or three spoiler.it always opens the spoiler of the first text field but not the one i click.has to do with javascript?

Bye Jan
Last edited by jan_2017 on 29 Aug 2018, 23:39, edited 1 time in total.

User avatar
kasimi
mChat developer
Posts: 738
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Spoilers doesn't work

#2

Post by kasimi » 29 Aug 2018, 15:59

Hi Jan,

it's impossible to help you without seeing any code. What spoiler BBCode are you using exactly? What's the BBCode and what's the HTML replacement?

User avatar
jan_2017
Distinguished Donor
Posts: 120
Joined: 13 May 2017, 18:07

Re: Spoilers doesn't work

#3

Post by jan_2017 » 29 Aug 2018, 17:14

kasimi wrote:
29 Aug 2018, 15:59
Hi Jan,

it's impossible to help you without seeing any code. What spoiler BBCode are you using exactly? What's the BBCode and what's the HTML replacement?
Opps i did it again :lol:

Code: Select all

[Spoiler1]{TEXT}[/Spoiler1]

Code: Select all

<div style="margin-right: 10px;"><input value="Aufklappen" style="margin-left: 8px; padding-left: 3px; padding-right: 3px; padding-top: 1px; padding-bottom: 1px; width: 75px; font-size: 10px;border-color:#bf0000;border-radius: 4px;background: #bf0000;color: #ffffff;font-weight: bold;" onclick="if(this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != 'inline') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'inline'; this.innerText = ''; this.value = 'Zuklappen'; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value='Aufklappen' }" type="button"> </div> <div style="border: 0px inset; padding: 3px;"> <div style="display: none;">{TEXT}</div> </div>
And an Extension: alfredoramos/simplespoiler

Version 1.2.1.

Code: Select all

[spoiler title={TEXT2;optional}]{TEXT1}[/spoiler]

Code: Select all

<div class="spoiler">
	<div class="spoiler-header spoiler-trigger">
		<span class="spoiler-title">
			<xsl:choose>
				<!-- deprecated:start -->
				<!-- kept just for backward compatibility -->
				<xsl:when test="@spoiler and string-length(normalize-space(@spoiler)) > 0">
					<xsl:choose>
						<xsl:when test="string-length(normalize-space(@spoiler)) > 65">
							<xsl:value-of select="concat(normalize-space(substring(normalize-space(@spoiler), 0, 65)), '…')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="normalize-space(@spoiler)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:when>
				<!-- deprecated:end -->
				<xsl:when test="@title and string-length(normalize-space(@title)) > 0">
					<xsl:choose>
						<xsl:when test="string-length(normalize-space(@title)) > 65">
							<xsl:value-of select="concat(normalize-space(substring(normalize-space(@title), 0, 65)), '…')"/>
						</xsl:when>
						<xsl:otherwise>
							<xsl:value-of select="normalize-space(@title)"/>
						</xsl:otherwise>
					</xsl:choose>
				</xsl:when>
				<xsl:otherwise>{L_SPOILER}</xsl:otherwise>
			</xsl:choose>
		</span>
		<span class="spoiler-status">{L_SPOILER_SHOW}</span>
	</div>
	<div class="spoiler-body">{TEXT1}</div>
</div>

User avatar
kasimi
mChat developer
Posts: 738
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: Spoilers doesn't work

#4

Post by kasimi » 29 Aug 2018, 18:47

This should work as HTML replacement for your Spoiler1:

Code: Select all

<div style="margin-right:10px"><input value="Aufklappen" style="margin-left:8px;padding-left:3px;padding-right:3px;padding-top:1px;padding-bottom:1px;width:75px;font-size:10px;border-color:#bf0000;border-radius:4px;background:#bf0000;color:#fff;font-weight:bold" onclick="this.innerText=this.value=$(this).parent().next().children().toggle().is(':visible')?'Zuklappen':'Aufklappen';return false;" type="button"></div><div style="border:0 inset;padding:3px"><div style="display:none">{TEXT}</div></div>
Regarding the extension, you will need to ask the author.

User avatar
jan_2017
Distinguished Donor
Posts: 120
Joined: 13 May 2017, 18:07

Re: Spoilers doesn't work

#5

Post by jan_2017 » 29 Aug 2018, 21:30

Thanks ... i will ask the author.

User avatar
jan_2017
Distinguished Donor
Posts: 120
Joined: 13 May 2017, 18:07

Re: [SOLVED] Spoilers doesn't work

#6

Post by jan_2017 » 29 Aug 2018, 23:40

I find another solution.

(i am using a pdf bbcode to display the content)

Thanks fpr help

Bye Jan

User avatar
kasimi
mChat developer
Posts: 738
Joined: 06 Oct 2016, 09:56
Location: Germany
Contact:

Re: [SOLVED] Spoilers doesn't work

#7

Post by kasimi » 30 Aug 2018, 08:22

Did you even test the HTML of your Spoiler1 BBCode that I posted? Did you run into any problems?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests