TwistyContrib | |||||||||||||||||
Added: | |||||||||||||||||
> > | <-- Contributions to this TWiki extension are appreciated. Please update the contrib page at http://twiki.org/cgi-bin/view/Plugins/TwistyContrib or provide feedback at http://twiki.org/cgi-bin/view/Plugins/TwistyContribDev. If you are a TWiki contributor please update the extension in the SVN repository. -->Twisty section Javascript library to open/close content dynamically | ||||||||||||||||
Changed: | |||||||||||||||||
< < | This contrib packages in a convenient way the JavaScript library and the CSS file needed to implement Twisty sections. | ||||||||||||||||
> > | Introduction | ||||||||||||||||
Changed: | |||||||||||||||||
< < | TwistyContrib is installed by default in TWiki 4 and used by Twisty Plugin. | ||||||||||||||||
> > | This contrib packages in a convenient way the JavaScript library and the CSS file needed to implement Twisty sections. | ||||||||||||||||
Added: | |||||||||||||||||
> > | 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. | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | This Contrib should work with TWiki 4 and newer. | ||||||||||||||||
Usage examplesIf the contrib is properly installed (and JavaScript is enabled in your browser) you should see two folding sections below.Basic Twisty | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
<span id="demo1show" class="twistyTrigger twistyMakeVisible"><button class="twikiButton"> Unfold </button></span> <span id="demo1hide" class="twistyTrigger twistyHidden"><button class="twikiButton"> Fold </button></span> <span id="demo1toggle" class="twistyContent twistyMakeHidden"> my twisty content </span>Generates: my twisty content Twisty with placeholder text | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
<span id="demo2show" class="twistyTrigger twistyMakeVisible"><a href="#">Expand...</a> <span class="twistyPlaceholder">Hamlet is without question the most famous play in the English language...</span></span> <span id="demo2hide" class="twistyTrigger twistyHidden"><a href="#">Collapse...</a></span> <span id="demo2toggle" class="twistyContent twistyMakeHidden"> 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. </span>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 | |||||||||||||||||
Changed: | |||||||||||||||||
< < | Manual written by Harald Joerg. Examples require Spreadsheet Plugin to work (installed by default). | ||||||||||||||||
> > | Manual written by Harald Joerg. Examples require SpreadSheetPlugin to work (installed by default). | ||||||||||||||||
Changed: | |||||||||||||||||
< < | Some of my TWiki users are impressed by the optical effect of what can be done with TWiki:Plugins.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!" | ||||||||||||||||
> > | 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!" | ||||||||||||||||
Changed: | |||||||||||||||||
< < | 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 copypasting 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. | ||||||||||||||||
> > | 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 | |||||||||||||||||
Changed: | |||||||||||||||||
< < | In your Main.TWikiPreferences write: | ||||||||||||||||
> > | |||||||||||||||||
Added: | |||||||||||||||||
> > | In your Main.TWikiPreferences write: | ||||||||||||||||
* Set FLIP = <span id="twid_%CALC{$SETM(twisty_id, + 1)$GET(twisty_id)}%show" class="twistyTrigger twistyMakeVisible"> <a href="#">more...</a> </span> <span id="twid_%CALC{$GET(twisty_id)}%hide" class="twistyTrigger twistyHidden"> <a href="#">close</a> </span> <div id="twid_%CALC{$GET(twisty_id)}%toggle" class="twistyContent twistyMakeHidden"> * Set FLOP = </div> | |||||||||||||||||
Changed: | |||||||||||||||||
< < | ![]() | ||||||||||||||||
> > | ![]() | ||||||||||||||||
Deleted: | |||||||||||||||||
< < | 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 | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
In any topic, your users can now write things like this: | |||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | That is, place the opening brace at the end of the construct that controls the block. ... | ||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | of control structures are the most critical components of a program. ... | ||||||||||||||||
You See | |||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | of control structures are the most critical components of a program. ... | ||||||||||||||||
All on, all offYou can toggle all Twisties on or off at once by putting a link or button on the page with classtwistyExpandAll or twistyCollapseAll .
<button class="twistyExpandAll twikiButton">Expand all</button> <button class="twistyCollapseAll twikiButton">Collapse all</button>Creates these controls: When you want to use links, write: #VarTOGGLE | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Expand all Collapse all | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Expand all Collapse all | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Settings | |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
Changed: | |||||||||||||||||
< < | 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. | ||||||||||||||||
> > | 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. | ||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Installation Instructions | |||||||||||||||||
Added: | |||||||||||||||||
> > | |||||||||||||||||
%*INSTALL_INSTRUCTIONS% | |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
Changed: | |||||||||||||||||
< < | @import url("https://wiki.ivoa.net/internal/TWiki/TwistyContrib/twist.css"); | ||||||||||||||||
> > | @import url("https://wiki.ivoa.net/internal/TWiki/TwistyContrib/twist.css"); | ||||||||||||||||
Changed: | |||||||||||||||||
< < | |||||||||||||||||
> > | |||||||||||||||||
Deleted: | |||||||||||||||||
< < | |||||||||||||||||
Contrib Info | |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < |
| ||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Added: | |||||||||||||||||
> > |
| ||||||||||||||||
| |||||||||||||||||
Changed: | |||||||||||||||||
< < | Related Topics: TWikiPreferences | ||||||||||||||||
> > | Related Topics: TwistyPlugin, TWikiPreferences | ||||||||||||||||
|