Tags:
rendering1Add my vote for this tag usability1Add my vote for this tag create new tag
view all tags

TwistyPluginDev Discussion: Page for developer collaboration, enhancement requests, patches and improved versions on TwistyPlugin contributed by the TWikiCommunity.
• Please let us know what you think of this extension.
• For support, check the existing questions, or ask a new support question in the Support web!
• Please report bugs below

Development topic for TwistyPlugin

-- RafaelAlvarez - 12 Sep 2005

I have an enhancement request: pass an image to include in the link. Example:

%TWISTYSHOW{id="myid" link="Link Text" img="%ATTACHURLPATH%/toggleopen.gif"}%

then results in:

<span id="myidshow" class="twistyMakeVisible"><a href="#" class="twistyTrigger"><span class="twistyLinkLabel">Link Text"</span><image src="%ATTACHURLPATH%/toggleopen.gif" alt="" /></span>

and shows: Link Text

For Dakar the image syntax would be:

%TWISTYSHOW{id="myid" link="Link Text" img="%ICONPATH{toggleopen}%"}%

(see also inlined css)

This is the patch for image parameter.

The update for twist.css:

.twistyHidden { display:none; }
.twistyMakeVisible { display:none; }
.twistyPlaceholder { /* appearance to be implemented by skin */ }
.twistyLinkLabel { /* appearance to be implemented by skin */ }

-- ArthurClemens - 09 Oct 2005

Thanks Rafael for contributing this Plugin to the TWikiCommunity at large smile

I made some changes (diff, raw diff) to the Plugin topic, feel free to take this back into DEVELOP.

How about measuring and documenting the PluginBenchmarks?

-- PeterThoeny - 02 Nov 2005

Hi Rafael, here's a TwistyPlugin.diff that implements

  • TWISTYBUTTON: shorthand for TWISTYSHOW & TWISTYHIDE
  • TWISTY: shorthand for TWISTYSHOW & TWISTYHIDE & TWISTYTOGGLE
This, for example, comes in handy if you have the same link text in hide and show links, but don't want to "compute" it twice in a TWikiApplication. Additionally, the parameters have been extended to be still able to specify different values for images and links for each mode (showimg, hideimg, showlink, hidelink, etc.) Well and TWISTY...ENDTWISTY is just the all-in-one approach where the link text and the toggled content section are next to each other which is a very common use case. Here's a demo using twisties to fold/unfold threaded comments.

Have a look.

Btw. you should fix the copyright notion in TwistyPlugin.pm. This is still the default copy-pasted one from EmtpyPlugin.pm

-- MichaelDaum - 23 Nov 2005

Feature requests:

  1. Can we have a way to open all twisties of the same id and not only the first one? Thereby "discontinuous" twisties would be possible.
  2. Can we have a way to open all twisties of all ids with an "open all" button?
    • Or even a way to open a set of twisties matching a pattern?
  3. Can we open/close twisties using urlparams?
-- MichaelDaum - 25 Nov 2005

Strictly speaking, shouldn't ID's be unique?

-- SamHasler - 29 Nov 2005

Sure, ids of html tags must be unique. Twisty ids too. But in case a Twisty is made up of a set of (discontinuous) divs all could get a unique id, possibly derived from the Twisty id, and gathered in an js array which is then used to access all elements of a Twisty without the need to itterate over all elemnts of the document, which is btw the main cause of the current slowdown in page initialization, e.g. opening TWikiVariables:

var allObjects = (document.all) ? document.all : document.getElementsByTagName("*");

in pub/TWiki/TWikiJavascripts/twiki.js. Outch. I.e. this is quite extravagant:

function getElementsById(id) {

   var elements = [];
   var allObjects = (document.all) ? document.all : document.getElementsByTagName("*");
   
   for (var i = 0; i < allObjects.length; ++i) {
     if (allObjects.item(i).id.indexOf(id) != -1)
      elements.push(allObjects.item(i));
   }
   return elements;
}

as, like Sam said, ids have to be unique and document.getElementById() is already part of dom 1.0.

-- MichaelDaum - 29 Nov 2005

I've optimized the script a bit, so it doesn't iterate over all elements anymore.

-- ArthurClemens - 29 Nov 2005

You also need to optimise the skin so that it doesn't load the javascript - any javascript - unless the topic is going to make use of it.

-- AntonAylward - 30 Nov 2005

Twisty uses display:none to hide an element. At the page onload one of the buttons is made visible. This gives the undesirable effect that the content below the buttons jumps down one line.

Perhaps you ask: why not make the button visible right away? Answer: because of the fallback mechanism in case the user has javascript off; in that case the toggle buttons should be hidden and the twistable content visible.

I think a better mechanism is to make the buttons hidden with visibility:hidden. That makes that the buttons take up their space on the page as if they were visible, they are just not visible. The content below the buttons is shown at the position they would take up after the page onload, so this gives a more restful page load. In case the user has javascript off, the buttons still take up space, but I think that is less annoying and can be lived with.

There is one complexity. The button that will be displayed after the onload can use visibility:hidden, but the button that is not displayed should still use display:none, otherwise the second button will take up space. What the second button is depends on the cookie setting - it might be the "show" button but it might also be the "hide" button. But I think this complexity can be worked out in the code.

-- ArthurClemens - 16 Dec 2005

The TwistyPlugin on Dakar seems to break other TWiki default twisty actions such as viewing the attachment table or showing the editing help. Below, the firs two screenshots show how the twisty javascript action is broken, and the third shows it working fine apparently because the TwistyPlugin was used in the topic:

  • TwistyPlugin seems to break other Twisty actions if not used in the topic (no way to toggle formatting help):
    TwistyPlugin seems to break other Twisty actions

  • Breaks attachment twisty action if TwistyPlugin is not used in the topic (no way to toggle attachments):

  • TwistyPlugin and other twisty actions only play fine together only if TwistyPlugin is already called in the topic (all toggling works):
-- RyanKnoll - 04 Mar 2006

I guess a temporary work around for Dakar is putting in the view and edit skin templates.

-- RyanKnoll - 06 Mar 2006

Please file a bug report on Bugs. TWISTYSHOW is not possible because TwistyPlugin is not enabled by default. Perhaps it should.

-- ArthurClemens - 06 Mar 2006

Suggestion: create a TWISTYTOC variable that creates a collapsable TOC.

-- ArthurClemens - 29 Mar 2006

Possibly better with a twisty="on" parameter to TOC.

-- PeterThoeny - 29 Mar 2006

It would be nice if it would be possible to 'tell' a Twisty to open or close. And also specify if it should be opened or closed by default.

Usecase: Display a commentbox in an opened twisty. After submitting a comment, the comment content is placed outside the twisty and the twisty is closed.

-- JosMaccabiani - 03 May 2006

Good idea. This would not be too difficult to implement once javascript has a list of all twisty sections, which is important to get Twisty faster.

-- ArthurClemens - 04 May 2006

A better twisty using Behaviour: A Better Twisty. See also Hierarchical twisty stories.

BTW I was already thinking of adding Behaviour to the TWiki javascript library.

-- ArthurClemens - 28 May 2006

I've updated TwistyPlugin with new features (including the option to tell a Twisty to open or close). This is now in the DEVELOP branch, so should be available in TWiki 4.1. See http://64.38.10.58/~develop/cgi-bin/view/TWiki/TwistyPlugin for demonstration of the new features.

-- ArthurClemens - 11 Jun 2006

Very nice! Thank you!

-- MeredithLesly - 11 Jun 2006

Thanks for the plugin! It makes using the twisty code a lot easier! I'm really looking forward to the new functionality to come in 4.1. I've run into a problem using the TWISTY macro on the same line as a heading. For example:

---++ Section 2 %TWISTY{ id="section2" img="someImage"}%

Splitting it into two lines seems to work, but is a bit cumbersome:

---++ Section 2 %TWISTYBUTTON{ id="section2" img="someImage"}%
%TWISTYTOGGLE{ id="section2" }%

Any workarounds or suggestions? Thanks!

-- ScotNelsen - 12 Sep 2006

I am having problems with TwistyPlugin where both the show and hide link / buttons are displayed when the page is first loaded. When either is clicked, the hidden text is shown and from then on they work as they should until the page is reloaded. This is happening with a clean install of TWikiVMDebianStable 4.04 and the latest TwistyPlugin, using IE, or Firefox, even on the TwistyPlugin page. See:
-- AndrewSpeakman - 25 Oct 2006

I'm having the same problem as AndrewSpeakman: all I get is "ShowHide" and things don't work (Firefox or IE). I get an error in the error console:
Error: TwistyPlugin has no properties
When I look at the page source, I see <div class="twistyPlugin" style="display:inline;"> but nobody defines the class twistyPlugin. I suspect this was overlooked in a .css somewhere. Can somebody clue me in?

-- JerryVanBaren - 25 Oct 2006

Update the latest TwistyContrib.

-- ArthurClemens - 25 Oct 2006

Ahh, the New Improved™ TwistyPlugin requires a New Improved™ TwistyContrib - not the one that comes installed with TWiki 4.04. (It also requires a New BehaviourContrib).

-- JerryVanBaren - 25 Oct 2006

TwistyPlugin is also updated to version 1.2.

-- ArthurClemens - 01 Nov 2006

After installing BlogPlugin and all the related plugins, I am seeing anomolus behavior with the Twisty Plug in. I attempted as well to install all of the Pattern Skin per the information above. In the BlogFactory topic, I see the following text, along with the "Show" and "Hide" links:

TWiki.TwistyPlugin.init("advoptsshow");HideTWiki.TwistyPlugin.init("advoptshide");

The TWiki Web is still using the Pattern Skin.

Any ideas?

-- RaymondLutz - 28 Nov 2006

Looks like a leftover from BlogPlugin.

-- ArthurClemens - 28 Nov 2006

TwistyPlugin do not work correctly when sectionediting. Seems that template used by SectionalEditPlugin editsection.pattern.tmpl were not updated according to upgrade of TwistyPlugin, TwistyContrib.

-- AnnaPapierz - 10 Jan 2007

No, this is not a leftover from BlogPlugin, it is a known and fixed bug in the TwistyPlugin: Bugs:Item3159. The fix is already checked in into svn but it seems so as if there's no new TwistyPlugin been released since then (hint hint).

-- MichaelDaum - 10 Jan 2007

Hi, I want to ask how to integrate twisty into a %_SEARCH_% function.. if for example I want a "show and hide" button for each result from the search button. This button would then show the corresponding comment textfield box for each. Thank you.

-- VergelVillasoto - 21 Jan 2007

I'm confused. I've installed a local, "private" TWiki at the company where I work. Twisty isn't working in that TWiki. Viewing the TwistyPlugin page, it appears as if JavaScript isn't working properly. That is, it's following the documented path of showing everyuthing.

I have JS turned on in the browser and Twisties work in the corporate TWiki. My Contrib/TwistyContrib.pm exists and is readable. There are no diaggnostics on the plugins page.

I presume I lost some file along the way. The Formatting help in an Edit window is also not under a Twisty.

Can someone help me fix this?

My TWiki is (as of today) 4.1.1 with Twisty 1.2 Corp TWiki is 2006/12/30 w/ Twiisty 1.1

-- VickiBrown - 07 Feb 2007

Vicki, could you exemplify what "isn't working" means? If you are using Firefox you could see what the Error Console tells you.

-- ArthurClemens - 07 Feb 2007

"isn't working" means "it's following the documented path of showing everything." i.e

Twisty has a fallback mechanism in case JavaScript is not available: all content is displayed and the control buttons are hidden.

The Error console in Firefox says

TWiki.TwistyPlugin has no properties

whatever that means

Here's what's in my page:

%TWISTY{id="t1" showlink="Show" showimg="%ICONURLPATH{toggleopen-small}%" hidelink="Hide" hideimg="%ICONURLPATH{toggleclose-small}%" mode="div"}%

this is content

%ENDTWISTY%

and here's what I see:

this is content

I'm confused.

-- VickiBrown - 09 Feb 2007

Try to update TwistyContrib as well.

-- ArthurClemens - 10 Feb 2007

I have the same problem described by Vicki, and installing the latest (2 Jan 2007) versions of TwistyContrib and TwistyPlugin didn't help. I don't see lines for either pub/TWiki/TWikiJavascripts/twiki.js or pub/TWiki/TwistyContrib/twist.css in my page source.

So, since I'm using QuickMenuSkin, I checked twiki.quickmenu.tmpl and found that the presence or absence of those lines is conditional:

%IF{"context TwistyPluginEnabled" then="" else="<script type='text/javascript' src='%PUBURLPATH%/%TWIKIWEB%/TwistyContrib/twist.js'></script>"}%

%IF{ "context TwistyPluginEnabled" then="" else="
        @import url('%PUBURLPATH%/%TWIKIWEB%/TwistyContrib/twist.css');"}%

Is that correct? TwistyPlugin seems simply to allow users to make their own hideable text, rather than substituting for the built-in functionality (e.g. the formatting help in the edit page). Does the QuickMenuSkin developer need to remove those IF statements?

-- JohnWorsley - 02 Mar 2007

Yes, the lines are no longer necessary. PatternSkin now uses TwistyPlugin instead of TwistyContrib.

-- ArthurClemens - 02 Mar 2007

Okay, but like I said, I'm using QuickMenuSkin, and as I described, something is clearly amiss. Could you re-evaluate my last comment in that light, and answer the question again? Or explain a different way how your answer answers my question :-b ?

-- JohnWorsley - 03 Mar 2007

I see now that QuickMenuSkin uses older syntax from TwistyContrib. I've created a bug entry Bugs:Item3711.

-- ArthurClemens - 03 Mar 2007

I have re-installed both TwistyPlugin and TwistyContrib. No joy. I still see the content; no twiisty.

Source shows

<span class="twistyPlugin"><span id="t1show" class="twistyTrigger twistyMakeVisible"><a href="#">
<span class="twikiLinkLabel">Show</span>
<img src="/vtwiki/pub/TWiki/TWikiDocGraphics/toggleopen-small.gif" border="0" alt="" /></a></span>
<script type="text/javascript">TWiki.TwistyPlugin.init("t1show");</script>
<span id="t1hide" class="twistyTrigger twistyMakeVisible"><a href="#">
<span class="twikiLinkLabel">Hide</span>
<img src="/vtwiki/pub/TWiki/TWikiDocGraphics/toggleclose-small.gif" border="0" alt="" /></a></span>
<script type="text/javascript">TWiki.TwistyPlugin.init("t1hide");</script></span><!-- END twistyPlugin-->
<div class="twistyPlugin" style="display:inline;">
<div id="t1toggle" class="twistyContent twistyMakeHidden">
<script type="text/javascript">TWiki.TwistyPlugin.init("t1toggle");</script>

<p />
this is content
<p />
</div></div><!-- END twistyPlugin-->

  • Screenshot of what I see:
    screenshot-vlb.jpg
-- VickiBrown - 08 Mar 2007

You probably need to update the later version of pub/TWiki/TWikiJavascripts/twiki.js as well. It is attached to PatternSkinDev.

-- ArthurClemens - 08 Mar 2007

I am having problems with TwistyPlugin where both the show and hide link / buttons are displayed when the page is first loaded. When either is clicked, the hidden text is shown and from then on they work as they should until the page is reloaded. This is happening with a clean install of TWikiVMDebianStable? 4.04 and the latest TwistyPlugin, using IE. This is similar to an earlier comment, but I am also using the New and Improved™ TwistyContrib. The plugin page on TWiki.org works fine and my page works in firefox, but not in IE I am going crazy here trying to figure this out........any help very much appreciated

-- BenjaminDalton - 08 Mar 2007

Sorry all, problem solved by updating my twiki.js as recomended to VickBrown above.

-- BenjaminDalton - 08 Mar 2007

All users are urged to download version 1.1 of BehaviourContrib: this brings a major speed enhancement for Windows Explorer users. Most notably on long pages with Twisties or attachments with a show/hide link.

-- ArthurClemens - 08 Mar 2007

As near as I can tell, 'local links' such as:

#LocalLink

don't work from outside the TWISTY. It would be very nice if one could jump to such a link and have the TWISTY context expanded in the process. (I suspect this is impossible, but thought I'd ask...)

-- SteveWampler - 17 Apr 2007

In any case not out of the box, but I suspect there is a way with additional javascript.

-- ArthurClemens - 17 Apr 2007

I am having this behavior... I put TWISTY and ENDTWISTY tags surrounding the "help" text of the attributes (e.g. Priority) of the BugsContrib bug-tracking tool. The help text is within STARTINCUDE and ENDINCLUDE tags. The twisty links work fine, but "TWiki.TwistyPlugin.init("twistyIdPSFM/IT/IssuesCurrentState3show"); and TWiki.TwistyPlugin.init("twistyIdPSFM/IT/IssuesCurrentState3hide");" are displayed on the screen, too. When the content is shown, an additional "toggle" one prints, too.

-- MatthewKoundakjian - 17 Apr 2007

I should add the comment that I'm using it for "Priority" and "CurrentState", "WaitingFor". For Priority, the TWISTY behaves perfectly. It's on the latter two that the extraneous text shows up.

Just for yucks, I updated my BehaviorContrib install. I am not sure what ver it was before, so I pulled the latest.

-- MatthewKoundakjian - 17 Apr 2007

Could you paste the code you used?

-- ArthurClemens - 18 Apr 2007

<!--
Interactive lookup

   * Set PRIORITY = %URLPARAM{"priority" default="Enhancement|Low|Normal|Urgent"}%
-->
<div class="twikiPageForm">
<form name="chooser" action="%SCRIPTURL{"view"}%/%WEB%/%TOPIC%" method="get">
<h3>Active Items with Priority
<select name="priority" onchange="chooser.submit()">
%STARTSECTION{form_options}%
<option %IF{"$priority='Enhancement'" then="selected"}%>Enhancement</option>
<option %IF{"$priority='Low'" then="selected"}%>Low</option>
<option %IF{"$priority='Normal'" then="selected"}%>Normal</option>
<option %IF{"$priority='Urgent'" then="selected"}%>Urgent</option>
<option %IF{"$priority='Show-Stopping'" then="selected"}%>Show-Stopping</option>
%ENDSECTION{form_options}%
</select>
</h3>
%INCLUDE{
   "%WEB%.Tabulator" 
        STATUS="New|Actioning|Waiting for Feedback|Confirmed|Being Worked On|Waiting for Release%IF{"defined closed" then="|Closed|No Action Required"}%"
   SUMMARY=".*"
   DETAIL=".*"
   PRIORITY="%PRIORITY%"
   CLASS=".*"
   REPORTEDBY=".*"
   WAITINGFOR=".*"
   LIMIT=""
   CODEBASE=".*"
}%
<input type="submit" name="%IF{"defined closed" then="other" else="closed"}%" value="%IF{"defined closed" then="Hide" else="Show"}% closed and discarded items" />
</form>
</div>

%STARTINCLUDE%
---+++ Priority
%TWISTY{mode="div" showlink="Show text...&nbsp;" hidelink="Hide Text...&nbsp;" showimgright="%ICONURLPATH{toggleopen-small}%"  hideimgright="%ICONURLPATH{toggleclose-small}%"}%
   * =Enhancement= means the issue describes a WIBNIF (wouldn't it be nice if)
   * =Low= means the issue is non-critical, and is really more of an annoyance than anything else
   * =Normal= means that this is probably a bug, but can be lived with
   * =Urgent= means it really is a bug, and can't be lived with
   * =Show-Stopping= means issue is preventing work from being done
%ENDTWISTY%
%STOPINCLUDE%

| *Name* | *Type* | *ToolTip* |
| Enhancement | option | the issue describes a WIBNIF (wouldn't it be nice if) |
| Low | option | the issue is non-critical, and is really more of an annoyance than anything else |
| Normal | option | this is probably a bug, but can be lived with |
| Urgent | option | really is a bug, and can't be lived with |
| Show-Stopping | option | Work is being prevented |

-- MatthewKoundakjian - 18 Apr 2007

This code looks ok. I've pasted it in LitterTray to check. Could you complete the test there?

-- ArthurClemens - 18 Apr 2007

By the way, Arthur, thanks much for taking the time.

Ok, I made http://develop.twiki.org/~twiki4/cgi-bin/view/LitterTray/CreateNewTopic (taking from the BugsContrib WebLeftBar ..) and also copy-pasted from my setup, WebTopicEditTemplate, TopicTemplate, Tabulator, WaitingFor, AppliesTo, ReportedBy, Summary, Priority, ItemTemplate, CurrentState in the !!LitterTray

Go to that CreateNewTopic in LitterTray web and click on the "create new topic". Scroll down to "current state" and you'll see the strings.

It might be something simple and syntactic or something about % INCLUDE%s that I don't understand. I've been skimming a LOT of pages and there are times, say in a nested SEARCH that you have to use $percnt or something like that.

-- MatthewKoundakjian - 18 Apr 2007

I see it now. The javascript calls are not there. Could it be broken because of the badly broken ItemTemplate form def?

-- ArthurClemens - 18 Apr 2007

is the ItemTemplate badly broken? I don't know if I have a virgin BugsContrib ItemTemplate still.

-- MatthewKoundakjian - 18 Apr 2007

The tables are broken.

-- ArthurClemens - 18 Apr 2007

I did a comparison to BugsContrib/data/Bugs/ItemTemplate.txt to what I have and they match, as far as the tables go, they match. ... the only difference is the original has a few blank lines after the table and mine has a META:TOPICINFO

-- MatthewKoundakjian - 19 Apr 2007

The problem could be that INCLUDE strips javascript. Check VarINCLUDE for parameters that keep the javascript.

-- ArthurClemens - 19 Apr 2007

Doesn't seem to help

---++ This is the TWiki.TWikiForms definition for the structured form based data
see WebTopicEditTemplate for the TopicTemplate

| *Name*       | *Type* | *Size* | *Values* | *Tooltip message* | *Attributes* |
|              | label  |        | %INCLUDE{"Summary" disableremovescript="on"}% | | |
| Summary      | text   | 85     | | | M |
|              | label  |        | %INCLUDE{"ReportedBy" disableremovescript="on"}% | | |
| ReportedBy   | text   | 35     | %WIKIUSERNAME% | | M |
|              | label  |        | %INCLUDE{"AppliesTo" disableremovescript="on"}% | | |
| AppliesTo    | select | 1      | | | M |
|              | label  |        | %INCLUDE{"Priority" disableremovescript="on"}% | | |
| [[Priority]] | select | 1      | | | M |
|              | label  |        | %INCLUDE{"CurrentState" disableremovescript="on"}% | |
| CurrentState | select | 1      |  | | M |
|              | label  |        | %INCLUDE{"WaitingFor" disableremovescript="on"}% |
| WaitingFor   | text   | 35     | | |  |

-- MatthewKoundakjian - 19 Apr 2007

Whoops, forgot to link to the page ... http://develop.twiki.org/~twiki4/cgi-bin/edit/LitterTray/ItemAUTOINC1?templatetopic=WebTopicEditTemplate;formtemplate=ItemTemplate;

-- MatthewKoundakjian - 19 Apr 2007

Also, it doesn't seem to matter what order the included pages are in. Whichever included topic (that has a TWISTY) in it displays ok and subsequent ones have the spurious text.

-- MatthewKoundakjian - 20 Apr 2007

When I print a page with twistys, either IE or Firefox, either Pattern skin or Printable skin, I do not see the twistys on the printout.

-- KirkMartinez - 10 May 2007

I have been trying to find out, why Twisty is breaking my page autocomplete feature in QuickMenuSkin, TWiki 4.1.2. Every time there is a twisty in a page, ajax requests (TWikiAjaxContrib) don't work (they worked in TWiki 4.0.5). Maybe there is some clash of names? Is there a non-compressed version of Twisty somewhere, maybe compression is causing it?

( Moved discussion to TwistyPluginInterferesWithAjax -- MikkoLaakso - 01 Jul 2007 )

I have the same problem as describet bevor by Vicki ! the TwistyContrib claims to be 20 Jun 2007 (version 1.4.1) the TwistyPlugin claims to be 11 Jul 2007 (version 1.4.3)

firefox reports: TwistyPlugin has no properties

excerpt from the html code generated by TWiki

In the <Head> section


<script type="text/javascript" src="/twiki/pub/TWiki/TWikiJavascripts/twiki.js"></script>
<script type="text/javascript" src="/twiki/pub/TWiki/PatternSkin/pattern.js"></script>
[...]

<!--TWISTYPLUGIN_TWISTY--><style type="text/css" media="all">
@import url("http://MyServer.somewhere/twiki/pub/TWiki/TwistyContrib/twist.css");
</style>
<script type="text/javascript" src="http://MyServer.somewhere/twiki/pub/TWiki/TWikiJavascripts/twiki.js"></script>
<script type="text/javascript" src="http://MyServer.somewhere/twiki/pub/TWiki/BehaviourContrib/behaviour.compressed.js"></script>
<script type="text/javascript" src="http://MyServer.somewhere/twiki/pub/TWiki/TwistyContrib/twist.compressed.js"></script>

And then in body

* <strong>Brace and parenthesize in K&amp;R style</strong> 
<span class="twistyPlugin"><span id="twhideshowshow" class="twistyTrigger twistyMakeVisible"><a href="#"><span class="twikiLinkLabel">auf</span></a></span><script type="text/javascript">TWiki.TwistyPlugin.init("twhideshowshow");</script></span><!-- END twistyPlugin-->  <span class="twistyPlugin"><span id="twhideshowhide" class="twistyTrigger twistyMakeVisible"><a href="#"><span class="twikiLinkLabel">zu</span></a></span><script type="text/javascript">TWiki.TwistyPlugin.init("twhideshowhide");</script></span><!-- END twistyPlugin-->
(there may be other things between buttons and content)
<div class="twistyPlugin" style="display:inline;"><span id="twhideshowtoggle" class="twistyContent twistyMakeHidden"><script type="text/javascript">TWiki.TwistyPlugin.init("twhideshowtoggle");</script> my content </span></div><!-- END twistyPlugin-->

-- NorbertZacharias - 18 Jul 2007

I just updated TwistyPlugin, TwistyContrib, and BehaviourContrib, and I'm still getting the following error (I was getting it before, but figured an update might fix it):

twiki.CSS has no properties http://beta.twiki.corp.yahoo.com:8000/pub/TWiki/TwistyContrib/twist.compressed.js Line 1

Is there a file I missed updating?

-- MichelleHedstrom - 18 Jul 2007

The plugins are running ahead of the latest TWiki release. You need these files: Javascript files for TWiki 4.2. Unzip and drop into your pub/TWiki/TWikiJavascripts directory.

-- ArthurClemens - 18 Jul 2007

Hi Arthur
even with this files ( .js) , the errors still the same frown
Something went badly wrong. Is there a complete list of *all
files which are needed for this plugin ?? ( including the plugins on which twisty depends ) ?

-- NorbertZacharias - 19 Jul 2007

Dependencies can be found in the plugin topics. Also look in TwistyContrib.

-- ArthurClemens - 19 Jul 2007

Hi Arthur, i`ve looked at TwistyContrib and see that the examples do not work! May bee i'm not clear enough what i'm asking for is not what plugin has to bee installed as a base for twisty. What i ask for a is complete list of files and the location i should find them on my server. Because i checkt the following files against them from twiki.org and found no differences!

twiki/pub/TWiki/BehaviourContrib/
   behaviour.compressed.js
   behaviour.js
twiki/pub/TWiki/TwistyContrib/
   toggle-optm-jsoff-sep.html   
   twist.compressed.js
   twist.css
   twist.js

So what file is missing ??

-- NorbertZacharias - 19 Jul 2007

Hi Norbert. Strange that the plugin still generates code with javascript tags inserted. The latest version shouldn't do that.

Version 1.4.3 inserts this code in the html head - you can see which files it needs:

<style type="text/css" media="all">
@import url("%PUBURL%/%TWIKIWEB%/TwistyContrib/twist.css");
</style>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/TWikiJavascripts/twikilib.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/TWikiJavascripts/twikiPref.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/TWikiJavascripts/twikiCSS.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/BehaviourContrib/behaviour.compressed.js"></script>
<script type="text/javascript" src="%PUBURL%/%TWIKIWEB%/TwistyContrib/twist.compressed.js"></script>
<script type="text/javascript">
// <![CDATA[
var styleText = '<style type="text/css" media="all">.twikiMakeVisible{display:inline;}.twikiMakeVisibleInline{display:inline;}.twikiMakeVisibleBlock{display:block;}.twikiMakeHidden{display:none;}</style>';
document.write(styleText);
// ]]>
</script>

-- ArthurClemens - 19 Jul 2007

Hi Arthur, thanks so mutch for your patience! At least it was an older Version of TwistyPlugin.pm which causes the problem.
Some times the problem is in front of the screen frown

-- NorbertZacharias - 19 Jul 2007

Sorry Arthur,
its me again. If you try

* [[SHardware][Hardware]]%TWISTY{mode="div" showlink="Zeige mehr" hidelink="Schließen"
       showimgleft="%ICONURLPATH{toggleopen-small}%" 
       hideimgleft="%ICONURLPATH{toggleclose-small}%"}%
      * Komponenten%TWISTY{mode="div" showlink="Zeige mehr" hidelink="Schließen"
         showimgleft="%ICONURLPATH{toggleopen-small}%" 
         hideimgleft="%ICONURLPATH{toggleclose-small}%"}%
         * [[SHwDisplay][Display]]
         * Interface
         * Batterie
         * Speicher
         * [[SHwStecker][Stecker]]
         %ENDTWISTY%
      * Versionen%TWISTY{mode="div" showlink="Zeige mehr" hidelink="Schließen"
         showimgleft="%ICONURLPATH{toggleopen-small}%" 
         hideimgleft="%ICONURLPATH{toggleclose-small}%"}%
         * Version 01
         * Version 02
         * Version 03
         %ENDTWISTY%
      %ENDTWISTY%

The Version line is not hidden as the Komponenten line. This behavior is indipendent from div or span

-- NorbertZacharias - 19 Jul 2007

I am having similar trouble identified above. I have installed the latest BehaviourContrib, TwistyContrib, TwistyPlugin, additional javascripts and othere recommendations made in the posts above. No matter what I've tried, I can not for the life of me get the twisty's to work. Not even on the 'TwistyPlugin' plugin topic page, where it should work first and formost. In all cases, I see both the open and close (show/hide, etc) links...but when I click anything it just sends the page back to itself with a '#' href (i.e., "http://.../cgi-bin/twiki/view/TWiki/TwistyPlugin#"). The biggest problem is it never shows the content hidden by the twistys. So that twisty content is forever lost in the world of javascript. Any help is appreciated...I currently just have your plugin disabled, but its cool and I'd like to use it.

-- TomCoran - 03 Oct 2007

What javascript errors you do see in the browser?

-- ArthurClemens - 03 Oct 2007

I had the same problem, but with lots of patient of Arthur, he helped me to resolve, and it was simple, maybe its your case. He pointed me some missing .js files: (twikiCSS.js, twikiEvent.js, twikiFunction.js, twikiForm.js, twikiHTML.js, and others (can't remember now)), check for this in your site on pub/TWiki/TWikiJavascripts/ , I really don't remember now the exact location of those files, if missing ask Arthur for that. Hope this help.

-- MarcoSilva - 04 Oct 2007

No javascript errors...just nothing happens...I'll post a screenshot with it too. I see both show and hide...look at address bar too...the # sign. Thanks for the JS point...I'll double check and post those as well.

  • No Javascript Errors - See both show/hide:
    TwistyError-TomCoran.gif
-- TomCoran - 04 Oct 2007

Here are the JS files in my TWikiJavascripts dir:

10/3/2007   twikiArray.js
10/24/2006   twiki_attach.js
10/3/2007   twikiCSS.js
10/24/2006   twiki_edit.js
10/3/2007   twikiEvent.js
10/3/2007   twikiForm.js
10/3/2007   twikiFunction.js
10/3/2007   twikiHTML.js
10/3/2007   twiki.js
10/3/2007   twikilib.js
10/3/2007   twikiPref.js
10/24/2006   twiki_renamebase.js
10/24/2006   twiki_renamedelete.js
10/3/2007   twikiString.js
10/3/2007   twikistringPageQuery.js
11/30/2006   twikiStringUnicodeChars.js
12/1/2006   twikiuiToggle.js
10/3/2007   twikiWindow.js
10/24/2006   unicode_chars.js

-- TomCoran - 04 Oct 2007

It looks like you have all necessary javascript files. Which version of the plugin are you running? And can you see which js files are called from the generated html? (look in the page source)

-- ArthurClemens - 04 Oct 2007

TwistyPlugin version 1.4.4

Here is the source from the 'edit' page:

<!--TWISTYPLUGIN_TWISTY--><style type="text/css" media="all"> @import url("http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/TwistyContrib/twist.css"); </style>

<script type="text/javascript" src="http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/TWikiJavascripts/twikilib.js"></script>

<script type="text/javascript" src="http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/TWikiJavascripts/twikiPref.js"></script>

<script type="text/javascript" src="http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/TWikiJavascripts/twikiCSS.js"></script>

<script type="text/javascript" src="http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/BehaviourContrib/behaviour.compressed.js"></script>

<script type="text/javascript" src="http://share.detroitimas.us.na.ey.net/twiki/pub/TWiki06x01/TwistyContrib/twist.compressed.js"></script>

<script type="text/javascript"> // <![CDATA[ var styleText = '<style type="text/css" media="all">.twikiMakeVisible{display:inline;}.twikiMakeVisibleInline{display:inline;}.twikiMakeVisibleBlock{display:block;}.twikiMakeHidden{display:none;}</style>'; document.write(styleText); // ]]> </script>

-- TomCoran - 05 Oct 2007

That looks alright. The only thing left is that your templates are a bit outdated for the plugin. You should either upgrade to 4.1.2 or revert back to TwistyContrib of that release ( 12/09/2005) (TWiki 4.0.1 did not use TwistyPlugin yet).

-- ArthurClemens - 06 Oct 2007

I think I am using 4.1.2...On my WebHome page for TWiki web it says:

  • This site is running TWiki version TWiki-4.1.2, Sat, 03 Mar 2007, build 13046, Plugin API version 1.11
I installed it via a debian package. Is there a way to just download updated templates?

-- TomCoran - 17 Oct 2007

I fixed it! In /usr/share/perl5/TWiki/Plugins/TwistyPlugin.pm the variable being used in the 'addheadertext' function was SYSTEMWEB I changed it to TWIKIWEB and it worked! For some reason, my install doesn't like to recognize systemweb as a variable.

-- TomCoran - 17 Oct 2007

Just installed the latest TwistyPlugin on a TWiki 4.1.2 and got a strange JS-'Behaviour is not defined.' error. I could not find a solution fitting my problem in the Web, so I debugged the error. I seems that in the new TwistyPlugin-Version twist.compressed.js is called before behaviour.compressed.js, where the Object 'Behaviour' is defined. You need to change TwistyPlugin.pm to fix the Problem. The TWiki::Contrib::BehaviourContrib::addHEAD(); needs to be called AFTER TWiki::Func::addToHEAD( 'TWISTYPLUGIN_TWISTY', $header ); that the Behavious-JS-file is included BEFORE the Twists-JS.

-- WolfgangBertl - 28 Oct 2007

thanks WolfgangBertl, that fixed things for me, I've attached the modified TwistyPlugin.pm, I just moved the if else branch containing TWiki::Contrib::BehaviourContrib::addHEAD(); to after TWiki::Func::addToHEAD( 'TWISTYPLUGIN_TWISTY', $header );

-- KeWang - 31 Oct 2007

Fixed the order issue in Bugs:Item4991. Also available for download at TwistyPlugin.

-- ArthurClemens - 19 Nov 2007

If you want to upgrade TwistyPlugin - or have upgraded already - please see UpgradingTwisty for an easy bundle upgrade package.

-- ArthurClemens - 19 Nov 2007

I'm trying to get a twisty to work inside of a SEARCH. I have the following:

%SEARCH{
search="TestTopic[0-5]"
scope="topic"
type="regex"
nonoise="yes"
format="%TWISTY%$text%ENDTWISTY%"
}%

It ends up with this on the page:

<span class= <span class= <span class= <span class= <span class= <span class= <span class=

Any insights? I upgraded BehaviourContrib, TwistyContrib and TwistyPlugin to their latest.

-- GordonTetlow - 15 Jan 2008

Have you tried escaping the % signs with $percnt ?

-- ArthurClemens - 15 Jan 2008

That's got it. I was going down the wrong path trying to do something with ENCODE. Thanks!

-- GordonTetlow - 15 Jan 2008

I don't know if this is a bug in Glue or Twisty, but combining Twisty with Glue loses one </div> in the Twisty HTML output. Support.TwistyPlusGluePlugin

-- VickiBrown - 11 Mar 2008

Here's a patch that illustrates the problem and prevents a "Use of uninitialized value in concatenation" error that you should see in your error logs.

--- lib/TWiki/Plugins/TwistyPlugin.pm   (revision 16405)
+++ lib/TWiki/Plugins/TwistyPlugin.pm   (working copy)
@@ -189,6 +189,10 @@
 sub _ENDTWISTYTOGGLE {
     my ( $session, $params, $theTopic, $theWeb ) = @_;
     my $mode = shift @modes;
+
+    return "<span class='twikiAlert'>woops, ordering error: got an ENDTWISTY before seeing a TWISTY</span>"
+      unless $mode;
+
     my $modeTag = ($mode) ? '</' . $mode . '>' : '';
     return $modeTag . _wrapInContentHtmlClose();
 }

The reason for the error is that TwistyPlugin is depending on a correct ordering of TWISTY and ENDTWISTY tags as they are seen by the plugin. When escaping linebreaks using GluePlugin, the parser will delay part of the twiki markup from being rendered and will do so in the next loop. The example in TwistyPlusGluePlugin shows how to have an ENDTWISTY in the first loop (then GluePlugin does its job) and a TWISTY tag in the second loop. TwistyPlugin has got an internal stack where it keeps track in which "mode" the twisty was created: either in span or div mode. It then tries to create the correct closing markup (</span> or </div>) fetching the correct mode from the top of the stack. Now, if an ENDTWISTY comes first, the stack is empty and the code comes to an "Use of uninitialized variable" situation. Last not least the markup is foo bar'ed as no appropriate closing html tag was created.

-- MichaelDaum - 12 Mar 2008

My page hangs for about 10-12 seconds when I place the following TWISTY on it:

The Twisty is now open, and you can see the information that it contains. Click the link again to close the Twisty.

When I put the TWISTY on a page by itself, it doesn't hang. However, it does hang long pages (e.g., more than 20 printed pages). These pages happen to have a lot of TWiki tables, but I do not know if that's an issue. Using TWiki version 4.2

Please advise.

-- JamieBenjamin - 03 Apr 2008

Update: Nevermind, I was able to fix it. It turned out that my Twisty plugins were out of date, including the BehaviourContrib and the TwistyContrib. Updating these fixed it right away.

-- JamieBenjamin - 03 Apr 2008

In _wrapInButtonHtml, there is a linefeed between the first span/div tag and the text. This makes it impossible to put a Twisty button in a table. Could we change it to a space?

-- BruceParrello - 13 Apr 2008

Would there be a way of using twistys to link two divs or spans so that one is visible when the other is hidden, and vice-versa?

-- JonathanManning - 21 May 2008

I added a tab control to Twistie using Dojo recently - I don't think I've checked it into svn - I'll check later.

btw, the svn version also has pluggable javascript - using Dojo, JQuery and the original custom JS.

-- SvenDowideit - 21 May 2008

That sounds cool. Not really up the the JS tinkering myself....

-- JonathanManning - 21 May 2008

I corrected the version number in the Plugin Info table on the plugin's home topic. I'm only mentioning this because that doesn't show up on the revision delta, in case you were tempted to rollback the change because of that.

-- SeanCMorgan - 26 May 2008

Is there any way to use twisty to do a swap or a tri-state toggle? For example, I'd like to have a page with some db content and a db input panel. Ideally I'd like... %TWISTYPANELS{}% Empty Panel %TWISTYPANELDIVIDER% Data Entry Panel %TWISTYPANELDIVIDER% Data Display Panel %ENDTWISTYPANELS%

The idea being that it defaults to panel one, then each click takes it to the next panel in the list.

-- KeithEalanta - 03 Mar 2009

Since we standardize TWiki on jQuery I think we should do this:

* Retire TwistyContrib * Replace TwistyPlugin with code of JQueryTwistyPlugin * Retire JQueryTwistyPlugin

Thoughts?

-- PeterThoeny - 2010-07-25

I've started having problems with TWISTYPLUGIN after using them for a number of years. I think the problems are with newer browsers (I'm now using FireFox 6.x). The symptom is that multi-line content doesn't work - any empty line seems to terminate the TWISTY. For example:

Press me Thanks This TWISTY works, but

Press me also Thanks again The next non-black line should be in the TWISTY

but this always appears

Any ideas what's happening? Server is Apache2 under Ubuntu 11.04 Linux.

-- SteveWampler - 2011-09-25

This looks like a bug. Could you please file a report at TWikibug:TwistyPlugin?

-- PeterThoeny - 2011-09-25

Topic attachments
I Attachment History Action Size Date Who Comment
Compressed Zip archivezip TWikiJavascripts_to_add.zip r1 manage 58.3 K 2007-07-18 - 20:24 UnknownUser Javascript files for TWiki 4.2
GIFgif TwistyError-TomCoran.gif r1 manage 31.0 K 2007-10-04 - 21:46 UnknownUser No Javascript Errors - See both show/hide
Unknown file formatdiff TwistyPlugin.diff r1 manage 8.2 K 2005-11-23 - 18:51 UnknownUser Micha's TwistyPlugin hack
Compressed Zip archivezip TwistyPlugin_fixes_for_oct-7-2007release.pm.zip r1 manage 4.1 K 2007-10-31 - 07:59 UnknownUser Fixed TwistyPlugin.pm to patch oct-7-2007 release (folders not zipped, unzip inside /twiki/lib/TWiki/Plugins) (btw quick fix was just moving an if branch down)
Unknown file formatdiff Twisty_plugin_img_parameter.diff r2 r1 manage 1.3 K 2005-10-09 - 21:19 UnknownUser Patch for image parameter
JPEGjpg screenshot-vlb.jpg r1 manage 55.9 K 2007-03-08 - 00:26 UnknownUser a screenshot
GIFgif toggleopen.gif r1 manage 0.1 K 2005-10-09 - 20:03 UnknownUser Toggle open image
Edit | Attach | Watch | Print version | History: r102 < r101 < r100 < r99 < r98 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r102 - 2011-09-25 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.