Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Item1323: Implementing the accordion effect into TwistyPlugin..not re…
…leasing as its an default plugin and we are just before a patch release ( even if the release is done from the branch... ) git-svn-id: http://svn.foswiki.org/trunk@3186 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
- Loading branch information
EugenMayer
authored and
EugenMayer
committed
Mar 19, 2009
1 parent
ef90dc1
commit 49aa07a
Showing
4 changed files
with
136 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
TwistyPlugin/lib/Foswiki/Plugins/TwistyPlugin/Accordion.pm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This script Copyright (c) 2009 Impressive.media ( www.impressive-media.de ) | ||
# and distributed under the GPL (see below) | ||
# | ||
# This program is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU General Public License | ||
# as published by the Free Software Foundation; either version 2 | ||
# of the License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details, published at | ||
# http://www.gnu.org/copyleft/gpl.html | ||
# | ||
# Author: Eugen Mayer | ||
|
||
package Foswiki::Plugins::TwistyPlugin::Accordion; | ||
|
||
use strict; | ||
use warnings; | ||
|
||
sub _accordionStart { | ||
my ( $session, $params, $theTopic, $theWeb ) = @_; | ||
my $id = $params->{'id'}; | ||
$id =~ s/\///go; | ||
|
||
my $settings = "{ fillSpace: false, autoHeight: false, header:'p.accordionSection' }"; | ||
my $output = '<script type="text/javascript">;(function($j) { $j(function() { $j("#'.$id.'").accordion('.$settings.'); }); })(jQuery);</script>'; | ||
$output .= "<div id='$id'>"; | ||
return $output; | ||
} | ||
|
||
sub _accordionEnd { | ||
return '</div>'; | ||
} | ||
|
||
sub _accordionItemStart{ | ||
my ( $session, $params, $theTopic, $theWeb ) = @_; | ||
my $label = $params->{_DEFAULT}; | ||
return "<p class='accordionSection'><a href=\"#\">$label</a></p><div>"; | ||
} | ||
|
||
sub _accordionItemEnd{ | ||
return '</div>'; | ||
} | ||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters