Simple Spoiler BBCode

longer title? - Simple Spoiler BBCode

longer title?

by leschek » Thu Jun 07, 2018 5:36 pm

Thank you for this BBCode.
I would like to ask if is possible to show longer title? It would be nice to be able to set number of characters in title somewhere.
Thing is that now the spoiler use almost whole width of the post, but longer title is somewhere in middle of spoiler replaced with dots.

Image
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact:

Re: longer title?

by AbaddonOrmuz » Thu Jun 07, 2018 9:04 pm

Hi,

You can edit the BBCode, by default there's a hard-coded limit of 65 (4 places in total to replace) characters but you can increase it to the number you like.

If you want to disable it altogether, just replace the BBCode with the following content:

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:value-of select="normalize-space(@spoiler)"/>
				</xsl:when>
				<!-- deprecated:end -->
				<xsl:when test="@title and string-length(normalize-space(@title)) > 0">
					<xsl:value-of select="normalize-space(@title)"/>
				</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>
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 1002
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: longer title?

by leschek » Fri Jun 08, 2018 4:38 pm

Thanks,
It's working great, but if I have two-line title it moves „show“ and „close“ buttons to the left.

Image
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact:

Re: longer title?

by AbaddonOrmuz » Fri Jun 08, 2018 5:36 pm

Yep, that's one of the reasons for the hard-coded 65 character limit.

I'm actually planning to change the look of the spoiler, it would be fully responsive.
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 1002
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: longer title?

by AbaddonOrmuz » Fri Jun 08, 2018 7:39 pm

leschek wrote:if I have two-line title it moves „show“ and „close“ buttons to the left.
Replace your ext/alfredoramos/simplespoiler/styles/prosilver/theme/css/style.css with the following content:

https://raw.githubusercontent.com/Alfre ... /style.css

Please let me know if it solves the issue.
Some of my phpBB extensions:
Image Imgur | :chart_with_upwards_trend: SEO Metadata | Image Markdown | :lock: Auto-lock Topics
:trophy: Check out all my validated extensions :trophy:

:penguin: Arch Linux user :penguin:
User avatar
AbaddonOrmuz
Recognised Extension Developer
Posts: 1002
Joined: Wed Dec 25, 2013 9:06 pm
Location: /dev/null
Name: Alfredo
Contact:

Re: longer title?

by leschek » Fri Jun 08, 2018 10:28 pm

Thank you for the great support. I didn't test it much, but everything seems to work. Thanks
leschek
Registered User
Posts: 791
Joined: Tue Jul 18, 2006 12:49 pm
Contact: