DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:hiddenswitch

This is an old revision of the document!


hiddenSwitch Plugin

Compatible with DokuWiki

Angua

plugin Made to work with the [[hidden]] plugin: let add buttons to (un)display several blocks

Last updated on
2011-11-01
Provides
Syntax
Repository
Source
Requires
hidden

This extension has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues.

Similar to folded, outliner

Tagged with collapsible, hide

If you use the hidden plugin, you may find it tedious to click on every hidden block to display them, for example before printing. Then this plugin is made for you!

Installation

Please use the plugin manager, using this URL: http://github.com/gturri/hiddenSwitch/zipball/master

Examples/Usage

To create such a switch, you may use :

<hiddenSwitch>

or

<hiddenSwitch Here comes my custom text>

Therefore, to see it in action, you could create such a page:

<hidden>My first hidden block</hidden>
<hidden>My second hidden block</hidden>

<hiddenSwitch>

Please make sure you have a recent (2011-12-03 or higher) version of the hidden plugin!

Change Log

Discussion

There is a couple of bugs here:

  • the first one is in the jQuery implementation of the hiddenSwitch plugin inside the hidden plugin (downloaded today 2012-11-04): in the row 65 of file script.js you wrote
    return jQuery(elem.parentNode).children('div.hiddenBody').style.display === "none";

    instead of

     return jQuery(elem.parentNode).children('div.hiddenBody')[0].style.display === "none";

    .

  • the plugin “eats” all the input to the last '>' in the page. To fix it you need to replace the row 21 in syntax.php file with
        $this->Lexer->addSpecialPattern('<hiddenSwitch.*?>', $mode,'plugin_hiddenSwitch');

    Two replacements here: addSpecialPattern instead of addEntryPattern and the question mark in the regexp (reluctant quantifier).

My improvement proposals:

  • merge hiddenswitch inside hidden plugin, why 2 plugins?
  • central default configuration: for example for texts
  • default images + and -
  • the hiddenswitch button in the hidden bar? The bar should have 2 buttons: the left-aligned display/hide button (as now) and the right-aligned display all/hide all button. Only an idea but I think is a good place where to put the hiddenSwitch button

Congratulations for the plugin, it's nice – Fabrizio Bisi

plugin/hiddenswitch.1352044932.txt.gz · Last modified: 2012-11-04 17:02 by 188.11.50.50