Plugin Folded - Discussions

Back to main page

See the plugin in action here. — Pascal Giard 2005-08-25 06:08


2011-07-26 Latest version not working with Rincewind with Embedded HTML enabled. Works fine with Embedded HTML disabled. Any ideas would be greatly appreciated, please email nickjon@gmail.com


The latest version seems semi-broken. The title as it stands is required, and so all older documents will not parse correctly. Also, after the first time you click on the title, the title disappears and does not return. Also, I wonder if having a pipe character is really the best way to delimit the title, assuming the title is intended to be optional. Currently, a pipe is required for smooth parsing. ++| is the minimum opening tag. — ta' Lajzar 2005-09-04 09:01

I agree with ta' Lajzar, it would be nice if the | was optional. — Christopher Smith 2005-09-06 19:11

Would it be better to change the syntax to something like this:

<fold "my title here">
 this is my folded text
</fold>

That way the title could more easily be optional??.. I know this changes the format and breaks existing pages but it may help with the overall issue. I'm not sure how easy it is to handle a title with interesting characters/spaces in the <fold> statement. Anyway, just a thought. — Matt Pascoe 2005-09-13


If you are writing something about C++, you will see how bad it is! Remember to add “nowiki” around your C++ or otherwise, it will be messed up with the folding plugin. — Adrian Sai-wah Tam 2005-10-10 14:16

Yes, you are right. The markup code used for this plugin is incompatible with many, many programming languages. However, I assumed that any actual code would be enclosed in <code> tags, which automatically prevent anything enclosed from being parsed. If you need to have a ++ in your page outside a <code> tag, be sure to enclose it in a pair of percent (%) marks (view source of this paragraph for an example). Really, given that there are two distinct methods already for preventing markup from being parsed, I regard this as a non-issue. — ta' lajzar 2005-10-11 09:59


I'm using the current devel version from darcs (2006-01-07), and the unfolded results have all the spaces stripped out of them. Adding some debug to the handle(), and it appears that each space is coming through as a DOKU_LEXER_UNMATCHED value and the text is just passing through (handle() never sees it). I thought everything from the | to the last ++++ was supposed to show up in handle() as one string… maybe because of some 'bad' interaction of the ++++ or | with the Lexer?

There is a trim() as part of the rendering of DOKU_LEXER_UNMATCHED data. It wasn't there in the original code but was added at some point. Since I have no notes of the reason for it being there and can't think of any myself I have removed it and updated the release packages and darcs. If anyone does recall a reason for it being there please let me know. — Christopher Smith 2006-01-07 15:10

Doesn't appear to work with latest version 2006-03-09, just nothing happens. Apache 1.3.33 w/PHP 4.3.10 installed on Ubuntu Hoary I believe. – bw contact

It still works fine for me (example). When first loading a page do the folded parts appear visible or hidden? Do you get any JavaScript errors? — Christopher Smith 2006-03-22 14:48
Try to add this to your conf/local.php. Solved some problems (JavaScript-errors) for me.
$conf['basedir'] = '';
$conf['baseurl'] = '';

Arne Nickel 2006-04-04 00:02

This doesn't work for me in the new version. Nor does Chris's example. I don't see how the JavaScript and the CSS are being included. Only when I manually include these via main.php do I get it to work. (Brand new versions of Apache and PHP, too.) — 2006-07-18
DokuWiki should automatically take care of the JavaScript and CSS, merging the plugin's files with its own files. For example, if you take a look at my example page and view the JavaScript you should see the JavaScript for the folded plugin merged near the bottom (search on “folded” to locate quickly). I have CSS/JavaScript compression turned off to make it readable, but other than that its standard DokuWiki. Do you have a page link? — Christopher Smith 2006-06-19 12:22
Hmmm… It's working for me now. (I also understand how JavaScript and CSS work in this new version, now. Very cool.) This is actually a problem with my browser—Firefox 1.5 on Mac OS X 10.4.6. Loading a Java applet (nothing to do with JavaScript!!) seems to do terrible things to the browser. I cleared my cache, restarted Firefox, and suddenly both Chris's and my site work. I know this doesn't make much sense, but it is reproducible.
This fix worked for me on 2011-11-2

This is a great plugin but it interferes with printing documentation that is collapsed onscreen. The default state for printing should not be folded.

fixed in development release — Christopher Smith 2006-05-04 18:37

I agree - great plugin! Works very well on one website: http://www.wma-amw.org/wiki/doku.php?id=test_of_outliner_plugin

but not on another website! http://henry.olders.ca/fmpatientdb/dwiki/doku.php?do=show&id=test_page_for_folded_and_outline_plugins

I can't figure out what is the difference between the two. Please help! — Henry Olders 2006-06-28 04:28

The second website isn't picking up the styles and JavaScript for the plugin. There is a bug in March release whereby the CSS and JavaScript caches aren't expired after installation of a plugin. You will need to expire the cache manually. You can do that by updating your local.php to change its last modified date. — Christopher Smith 2006-06-28 10:17

Doesn't work for me. The plugin stop HTML in

    <!-- wikipage start -->

and the page is empty… :-( :?: HELP! Sergio 2006-07-20 11:24

Hi Sergio,
The symptom you have described indicates a fatal php error is occurring. Can you:
(1) Check your PHP error log to determine the cause of the error?
(2) Give some more details about your wiki installation - e.g. Product and version for OS, Webserver & PHP, also what other plugins you are using with your wiki.
Christopher Smith 2006-07-20 15:12

Doesn't work - the JavaScript is not included, and I get a JavaScript error on calls to “fold”. I tried re-starting my server (IIS with PHP), clearing cache (ie6) - no change. Any ideas?

Touch your conf/local.php to update the last modified date and expire all DokuWiki's cache's. DokuWiki should now regenerate the JavaScript it supplies to the browser. Its a known bug and will be fixed on the next release. — Christopher Smith 2006-08-15 09:24

Can you limit level of inclusions of nested folded sections? I have many levels and it takes a lot of time to include all those sub-pages (each folded includes a page). — Borut Jures 2006-11-06 22:41


This (very useful) plugin currently relies on domLib.js, which is not included in the latest release of DokuWiki. In dokuwki/lib/plugins/folded/script.js replace line 55:

var folds = domLib_getElementsByClass('folder');

by:

var folds = getElementsByClass('folder');

Olivier Pichon 2006-11-23 15:18


This is an extremely useful plugin, and is working very well on my installation of DokuWiki, which is 2006-11-06 version. However, ever since I have installed this plugin (from the dev version), On saving a page after edit gives me the warning “Warning: Cannot modify header information - headers already sent by (output started at path_to_DokuWiki-2006-11-06\lib\plugins\folded\syntax\div.php:1) in path_to_DokuWiki-2006-11-06\inc\actions.php on line 287”. On installing the plugin from the tar file given on this page, the plugin simply does not work. I don't know PHP, so I am afraid I cannot provide any more debug information. Any help will be greatly appreciated. Thanks!!

Check the first file mentioned. It sounds like you have some characters outside of the <?php ?> tags. As for the plugin not working, refer to the fix on the comment below. — Christopher Smith 2006-12-10 03:09
I'm running the 2006-11-06 version, also, on WinXP and IIS, and the plugin does absolutely nothing. Doesn't work. Doesn't break anything. I tried clearing the cache and updating my Local.php to include the basedir and baseurl constants. I also edited the Script.js, to remove the “domLib_” prefix. (That's mentioned twice on this page, BTW. Above and below this comment.) None of this makes any difference. Any other suggestions? — DGM2 2007-01-05 01:04
If you are using 2006-11-06 (the current version) you should NOT remove the “domLib_” prefix. The comments above and below refer to users of snapshots or devel version (after 2006-11-10). If you aren't seeing the plugin's syntax in the rendered page then the plugin is functioning. In which case your browser isn't receiving the JavaScript necessary to operate the folding or the JavaScript is causing errors in your browser. What browser are you using? Does the folding work on this test page? That Wiki is running develonly DokuWiki and the latest version of the plugin. If it runs okay you can try a recent snapshot. Otherwise I can set up a test page on a 2006-11-06 wiki with the same plugin version you would be using. — Christopher Smith 2007-01-07 03:39

Hi,
I am using the latest version of DokuWiki with latest Monobook template downloaded yesterday (where can I see the versions?) The plugin is from ZIP. It does not unfold, neither block nor inline. I cannot find a line 55 (see above) in dokuwki/lib/plugins/folded/script.js. Can anyone help?
TIA
Peter Stiens 2006-12-07 14:44

One of DokuWiki's JavaScript libraries was changed, its altered the name of a function used by this plugin. Goto to line #55 of lib/plugins/folded/script.js and remove the domLib_ so that the line becomes
 var folds = getElementsByClass('folder');

I will go through all the plugins I'm responsible for as soon as I can to update them for changes in the new version of DokuWiki. — Christopher Smith 2006-12-10 02:59


Nice plugin, I got it working OK on version 2006-03-09 (will be upgrading to current wiki soon), but ideally I'd like actual header sections to be able to display the section name/title but have the content of everything under than header collapsible (with controllable default open/close). I'm not sure if I'm explaining it right but basically display any H1 - H5 header but with the arrow to the right of it and have the header title itself the link to expand / collapse it's own section. Is this possible now or will it be in an upcoming version or is it not possible on the DokuWiki engine at all? Thanks.
No that isn't feasible with this plugin. I'm not likely to attempt to implement it as messing with DokuWiki's headings is messy! If you need to your collapsing based on headings take a look through the templates. I seem to recall someone reworking things so Sections were properly nested (DokuWiki doesn't do that now). If you have properly nested sections, a JavaScript solution is probably easier than a plugin. — Christopher Smith 2007-01-18 09:51

Thanks a lot, its working fine, now. May I place a feature request right here? Have you ever noticed, that many Online-Help-System allow to fold a whole chapter? Can someone please integrate the Folded-Plugin to work with the Chapter headings. S.th. Like

This is example text.

++++ ====== This is a H1-Title ====== |

| This table | is only shown | when you unfold the block |

{{page>some other wiki page}}

++++

Thank you all and of course the author(s) of this plugin in advance. Best regards.
Would be very nice if this would be implemented.
Peter Stiens 2006-02-01 11:30


Thank you for a nice plug-in. I think it very useful for all users.
I made some sentences in Japanese more natural.

I.Obataya 2006-02-10 13:30


Nice Work, but is there anyway to make the plugin compatible with safari??? It appears to work for explorer, Firefox, and Opera. Thanks. Austen Heinz 2007-4-7


I thought that I could put a “discussion” in a fold like so:

++++ Disc fold |
   ~~DISCUSSION~~
++++

but it does not work

any ideas?

fred 2007-05-09


Does anyone know if this works with DokuWiki Release 2007-06-26? It's not for me… as if the JavaScript is not being included ot there is some kind of incorrect link structure being defined. I don't see any comments from people using Release 2007-06-26, so I'm assuming perhaps it's a version conflict? –Ryan

I have the same problem. Hope to hear something from the author. – Albert
maybe you should Ctrl+F5

Hi! I am trying to use this plugin version 2007-06-26 and it doesn't work, then I tried with the other two older versions and nothing, the DokuWiki version I am using is DokuWiki-2007-06-26b.tgz….

please, any ideas?????

-Alejandro 11-14-07


Alejandro: modify last line of /folded/script.js as follows:

 ...folder .indicator { **display: block;** visibility: visible;

I had to change these lines in script.js

function folded_toggle(evt)
...
evt.preventDefault();

to

function folded_toggle(e)
...
e.preventDefault();

so that it did not give an error when there was a header such as

===== E =====

defined. I think an actual object named “e” was causing it to fail.

Is this the correct solution, and will it be OK on other browsers?

todd [at] rollerorgans [dot] com 2007/12/22


Text does not unfold for me. Also, I don't see any fold/unfold arrows. DokuWiki 20080505, Firefox 3.0.0. Also does not unfold on the test page. Help? Thanks—

Andrew 2008/07/16

Use the suggestion above proposed by Arne Nickel, add $conf[basedir]… stuffs in your local.php. It works for m

How do I move the arrow icon to the other side of the text? I've had a look at the code but I'm not up on JavaScript and I can't see what to do. Laurence


FYI If you want to update automatically and get “Unable to download the plugin file: http://www.cdsmith.plus.com/dokuwiki/plugin-folded-2006-11-06.zip” it is because you did not update quite some time, the referred site has been removed. You have to update manually to latest version.

:-( I can not download the plugin, I have tried many days to download. Ping of the “www.cdsmith.plus.com” is ””. I need other download link!!! Could any one help me? VERY thanks. endlesslove@zju.edu.cn 2009-04-19

:!: There is a problem when JavaScript is disabled! (DokuWiki 2009-02-14, Folded-plugin 2008-08-13) The class ”.hidden” is defined by the template or any other plugin's CSS file. Therefore the folded content is NOT displayed when JavaScript is disabled. Solution: in all folded-plugin-files rename all mentions of the “hidden”-class with for example “fhidden”. — F. 2009-03-03


(Un)folding doesn't seem to work with latest version of include plugin (2009-03-26) in DokuWiki version 2009-02-14. E.g. ++++Test title|{{page>testpage}}++++ shows always the included page (no folding) — wide 2009-04-08


thank you F. for the tip. thank you author for the plugin.

cd lib/plugins/folded
echo "converting all instances of hidden to fhidden"  
for item in `find . -type f`
do     
    echo "doing $item ..."
    sudo sed -i -e "s/hidden/fhidden/g" $item
done

(I had to run sudo because the wiki is owned by www-data) — Ivan 2009-05-08


It works on my local test installation, but not the on the hosted server. Any Ideas? — Bernd M. Radowicz 2009/06/14 05:47

This worked fine for me with the latest version of the include plugin - until I updated those couple files needed to run the sync plugin. After i did that I had to disable the include plugin to get it working again.–kurt


Can anybody tell me why my wiki doesn't correctly work??
I don’t see the SQL code under the folder, only some buttons!
<box>

++++ show folder text|
  <code sql>
  void unknown()
  </code>
++++

</box>

Thank you for the support!
Tom 2009/09/29


This is a way to unfold / fold all

<html>
<script type="text/javascript"><!--
function parseAll( expend ) {
	var cpt = 1;
	var obj = document.getElementById("folded_" + cpt++);
	while ( obj != null ) {
		if ( expend == "true" )	obj.className = obj.className.replace( "hidden", "" );
		else obj.className = obj.className + " hidden";
		obj = document.getElementById("folded_" + cpt++);
	}
}
//--></script>
<input type="button" onClick="parseAll('true')" value="Expend All"/> <input type="button" onClick="parseAll()" value="Collapse All"/>
</html>

Strangely the plugin doesn't seem to work with the include plugin (latest version) when trying ++++somepage|{{page>somepage}}++++ it shows the include page always

and when trying with ++somepage|{{page>somepage}}++ it gets even stranger; it works flawless in the preview mode, but when published it doesn't work anymore… (this happens in IE)

does anyone know how to fix this problem??

Theo – 28-12-09

I have the similar problem - if there is some included piece and a folded piece after it (no nesting) then the folded piece can't be expanded and remains hidden. The include plugin breaks the rendering somewhat


This plugin would make more sense to allow paragraphs in (++++) mode and disallow block elements such as <code> in (++) mode. I made the following modifies:

syntax/div.php

Old:

function getAllowedTypes() { return array('container','substition','protected','disabled','formatting'); }

New:

function getAllowedTypes() { return array('container','substition','protected','disabled','formatting','paragraphs'); }

syntax/span.php

Old:

function getAllowedTypes() { return array('substition','protected','disabled','formatting'); }

New:

function getAllowedTypes() { return array('substition','disabled','formatting'); }

Test the following codes with old and new scripts respectively and you'll know why:

++++ Title|
Paragraph 1

Paragraph 2

Paragraph 3

<code>
Code Line 1
Code Line 2
Code Line 3
</code>
++++

++ Title| My idea is
<code>
Code Line 1
Code Line 2
Code Line 3
</code>
++

danny0838danny0838

2011/01/23 16:33

plugin/folded/discussion.txt · Last modified: 2011/10/03 00:38 by 108.15.117.11
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
WikiForumIRCBugsGitXRefTranslate