Author Topic: Expanding & Collapsing Spoiler Tag v3.2a  (Read 2987 times)

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Expanding & Collapsing Spoiler Tag v3.2a
« on: Nov 22, 2014, 02:07:59 PM »

EXPANDING & COLLAPSING SPOILER TAG v3.2
By Dougiefresh -> Link to Mod


Notice
This mod is no longer being supported.  You are strongly encouraged to use Yet Another Spoiler Mod instead...

Introduction
This modification adds a BBCode to the forum that allows the post author to hide a spoiler in the post, which is clickable to display it to the user.

This BBCode takes the forms:
Code: [Select]
[nobbc]
[nobbc][spoiler]{content}[/spoiler][/nobbc]
[nobbc][spoiler {params}]{content}[/spoiler][/nobbc]
[nobbc][spoiler=Some Text]{content goes here}[/spoiler][/nobbc]
[/nobbc]

The {params} section may be any of the following parameters:
o text - Replaces default "Spoiler" text in the header.
o quote - Text that follows the "Spoiler" text in the header.  Must be in quotes.
o show - Replaces default "Show" text in the header.
o hide - Replaces default "Hide" text in the header.
o guests - Flag to show spoiler to guests or not.  May be n, no, false, y, yes, or true.

Note that the form (#3) with the equal sign does not parse other block-level bbcode tags inside the spoiler.  Empty form or form with parameters does not have this restriction.

Admin Settings
This BBCode may be disabled by going into the Admin => Forum => Posts and Topics => Bulletin Board Code and unchecking the bbcodes you don't want to use.  You may also be uninstall this mod in order to disable it.

Compatibility Notes
This mod was tested on SMF 2.0.9, but should work on SMF 2.1 Beta 1, as well as SMF 2.0 and up.  SMF 1.x is not and will not be supported.

Changelog
The changelog has been removed and can be seen at XPtsp.com.

License
Quote
Copyright (c) 2015 - 2017, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
« Last Edit: Jan 09, 2016, 10:18:01 AM by dougiefresh »

dougiefresh

  • Adminstrator
  • Expert Member
  • *****
  • Posts: 261
Re: Expanding & Collapsing Spoiler Tag v2.4
« Reply #1 on: Nov 29, 2014, 03:28:21 PM »

Below are some preview images of what the mod looks like when being used

Download Mod


FileName: Expandable_Spoiler_BBCode_v3.2a.zip
Size: 10 kb (10,073 bytes)
MD5: c6ed8dfc8a4af5f6cb25366b438620a6
Built: Feb 28, 2018, 09:30:22 AM
Downloaded 29 times

Changelog

Uploaded v3.2 - February 10th, 2017
o Added code so that the border underneath the "Spoiler" text could be removed.
o Fixed code where guests are not allowed to view spoilers, but could anyways.
o Fixed code where guests were allowed to view spoilers, but couldn't.

Uploaded v3.1 - April 4th, 2016
o Added Spanish Latin translation by Rock Lee [BC].

Uploaded v3.0 - Febrary 13th, 2016
o Added "expand" parameter to indicate whether or not the spoiler is expanded by default.
o Rewrote spoiler validation function to support new parameter.

Uploaded v2.4 - December 30th, 2015
o Fixed minor visual issue with Spoiler tag without parameters.

Uploaded v2.3 - December 9th, 2015
o Fixed undefined variable error regarding guest needing to login/register.

Uploaded v2.2 - December 9th, 2015
o Added "guests" parameter to show/hide the spoiler to guests.  Accepts n, no, false, y, yes, true.
o Added global default setting to hide spoilers from guests.

Uploaded v2.1 - November 16th, 2015
o Added "show" and "hide" parameters to replace default "show"/"hide" text with user specified text.

Uploaded v2.0 - November 14th, 2015
o Changed all spoiler tags to block-level tags.
o Changed bbcode tag types so that a validation function can be used to parse content inside tags.
o Changed the [spoiler=text]{content}[/spoiler] form to not parse other block-level tags.
o Moved all language modifications to the end of the language file.

Uploaded v1.10 - July 20th, 2015
o Remade Spoiler bbcode button with different font.

Uploaded v1.9 - July 15th, 2015
o Fixed missing BBCode button in editor for SMF 2.1 Beta 1.
o Included Swedish UTF8 language modifications by soderlund
o Included Norwegian UTF8 language modifications by soderlund

Uploaded v1.8 - April 4th, 2015
o Updated for SMF 2.1 Beta 1

Uploaded v1.7 - February 19th, 2015
o Added text parameter so users will see the specified text instead of Spoiler.

Uploaded v1.6 - January 16th, 2015
o License change to Simplified BSD.  No functionality change.

Uploaded v1.5 - December 30th, 2014
o language.xml file renamed to english.xml
o Added new form of the bbcode: [spoiler=Some Text]Content Here[/spoiler]
o Changed bbcode definition code based on bbcodes defined in Sources/Subs.php...

Uploaded v1.4 - December 29th, 2014
o Fixed image install locations within package-info.xml.

Uploaded v1.3 - December 10th, 2014
o Added button for the bbcode.

Uploaded v1.2 - December 6th, 2014
o Added code to disable creation of the validation code if BBCode is disabled.

Uploaded v1.1 - December 5th, 2014
o Made the "show" and "hide" strings localizable.
o Modified code to replace the strings once per page load, instead of every use of the BBCode.

Uploaded v1.0 - November 22th, 2014
o Initial Release of the mod

Translations

Quote
$txt['spoiler'] = "Spoiler";
$txt['debug_hide'] = 'hide';
« Last Edit: Oct 29, 2016, 08:01:06 PM by dougiefresh »