%META:TOPICINFO{author="TWikiContributor" date="1530865141" format="1.1" version="18"}% ---+!! %TOPIC%
%TOC%
%SHORTDESCRIPTION% ---++ Introduction This contrib packages in a convenient way the !JavaScript library and the CSS file needed to implement Twisty sections. !TwistyContrib is installed by default in TWiki and used by TwistyPlugin. It is recommended to use the !TwistyPlugin as it eases the deployment and use of this contrib. ---++ Usage examples If the contrib is properly installed (and !JavaScript is enabled in your browser) you should see two folding sections below. ---+++ Basic Twisty my twisty content Generates: my twisty content ---+++ Twisty with placeholder text Expand... Hamlet is without question the most famous play in the English language... Collapse... Hamlet is without question the most famous play in the English language. Probably written in 1601 or 1602, the tragedy is a milestone in Shakespeare's dramatic development. Generates: Expand... Hamlet is without question the most famous play in the English language... Collapse... Hamlet is without question the most famous play in the English language. Probably written in 1601 or 1602, the tragedy is a milestone in Shakespeare's dramatic development. Skins can customize the color of the twisty placeholder by modifiying the =.twistyPlaceholder= style. ---++ Twisty made easy Manual written by [[TWiki:Main/HaraldJoerg][Harald Joerg]]. Examples require SpreadSheetPlugin to work (installed by default).
Some of my TWiki users are impressed by the optical effect of what can be done with TwistyPlugin - and they keep asking me: "How do I do that? I don't understand the documentation, and I don't understand the raw text of your topics!" They indeed have a point here. The docs aren't easily understood. It isn't easy to pick all the variables needed from a single example, and just copy&pasting sometimes fails in embarrassing ways if non-unique =id= attributes are present in a topic. Maybe it is easy for a power user, but it surely isn't easy _enough_. There _ought_ to be a way to make it easier. Well, here you are. Just set a couple of site preferences, and your users will immediately understand your examples and start writing their own twisties. And what's more: They'll do so in a _consistent_ way, across all your topics in all webs.
---+++ You Write In your %USERSWEB%.TWikiPreferences write: * Set FLIP = more... close
* Set FLOP =
%T% You can include the text in a verbatim block if you want (like I have done here). Additionally I've added plenty of newlines and spaces to make it readable. This works, and you don't have to care for invalid HTML! ---+++ Your Users Write In any topic, your users can now write things like this: * *Brace and parenthesize in K&R style* %FLIP% When setting out a code block, use the K&R style of bracketing. That is, place the opening brace at the end of the construct that controls the block. ... %FLOP% * *Separate your control keywords from the following opening bracket* %FLIP% Control structures regulate the dynamic behavior of a program, so the keywords of control structures are the most critical components of a program. ... %FLOP% ---+++ You See * *Brace and parenthesize in K&R style* %FLIP% When setting out a code block, use the K&R style of bracketing. That is, place the opening brace at the end of the construct that controls the block. ... %FLOP% * *Separate your control keywords from the following opening bracket* %FLIP% Control structures regulate the dynamic behaviour of a program, so the keywords of control structures are the most critical components of a program. ... %FLOP% ---+++ All on, all off You can toggle all Twisties on or off at once by putting a link or button on the page with class =twistyExpandAll= or =twistyCollapseAll=. Creates these controls: When you want to use links, write: #VarTOGGLE Expand all Collapse all #VarTOGGLE Expand all Collapse all ---++ Settings * Set SHORTDESCRIPTION = Twisty section Javascript library to open/close content dynamically You can also set the global TWiki variable TWISTYCONTRIB_DEBUG to 1 to make the contrib use uncompressed Javascript sources, in the event of problems. ---++ Installation Instructions This module is pre-installed. TWiki administrators can upgrade the module as needed on the TWiki server. %TWISTY{ mode="div" showlink="Show details %ICONURL{toggleopen}% " hidelink="Hide details %ICONURL{toggleclose}% " }% %*INSTALL_INSTRUCTIONS% * !TwistyContrib uses these header includes: %ENDTWISTY% ---++ Contrib Info %TABLE{ tablewidth="100%" columnwidths="170," }% | Authors: | !JavaScript written by TWiki:Main.ArthurClemens; Contrib packaged by TWiki:Main.RafaelAlvarez; original !JavaScript written by TWiki:Main.SamHasler | | Copyright: | © 2005 Sam Hasler and Rafael Alvarez %BR% © 2006-2007 Arthur Clemens %BR% © 2008-2018 Peter Thoeny %BR% © 2005-2018 TWiki:TWiki.TWikiContributor | | License: | [[http://www.gnu.org/copyleft/gpl.html][GPL]] | | Dependencies: |
NameVersionDescription
TWiki::Plugins::BehaviourContrib>=1.000Required
| | Version: | 2018-07-06 | %TWISTY{ mode="div" showlink="Show Change History %ICONURL{toggleopen}%" hidelink="Hide Change History %ICONURL{toggleclose}%" }% %TABLE{ tablewidth="100%" columnwidths="170," }% | 2018-07-06: | TWikibug:Item7841: Copyright update to 2018 | | 2016-01-09: | TWikibug:Item7708: Copyright update to 2016 | | 2015-04-28: | TWikibug:Item7648: Less intrusive Twisty link - no dotted underlines | | 2013-02-16: | TWikibug:Item7123: Use TWISTY in installation instructions and change history | | 2011-07-10: | TWikibug:Item6725: Change global package variables from "use vars" to "our" | | 2010-05-15: | TWikibug:Item6433 - doc improvements; replacing TWIKIWEB with SYSTEMWEB | | 20 Jun 2007 | 1.4 Arthur Clemens - Updated script so TwistyPlugin can work without extra javascript 'init' calls. | | 18 Jun 2007 | 1.3 Arthur Clemens - Updated with TWiki 4 !JavaScript files. | | 25 Oct 2006 | 1.2 Arthur Clemens - Updated !JavaScript to support !TwistyPlugin version 1.2 | | 26 Sep 2006 | 1.010 Arthur Clemens - Complete !JavaScript rewrite | | 12 Sep 2005 | 1.000 Initial version | %ENDTWISTY% %TABLE{ tablewidth="100%" columnwidths="170," }% | Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% | | Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev | | Appraisal: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Appraisal | __Related Topics:__ TwistyPlugin, %SYSTEMWEB%.TWikiPreferences %META:FILEATTACHMENT{name="twist.js" attachment="twist.js" attr="" comment="!JavaScript library" date="1126427179" path="twist.js" size="3441" stream="twist.js" user="TWikiContributor" version="0"}% %META:FILEATTACHMENT{name="twist.css" attachment="twist.css" attr="" comment="Style Sheet" date="1126427224" path="twist.css" size="122" stream="twist.css" user="TWikiContributor" version="0"}%