# Plugin for TWiki Collaboration Platform, http://TWiki.org/ # # Copyright (C) 2006-2007 Michael Daum http://wikiring.de # Copyright (c) 2007-2018 TWiki Contributors. All Rights Reserved. # TWiki Contributors are listed in the AUTHORS file in the root of # this distribution. # # 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 3 # of the License, or (at your option) any later version. For # more details read LICENSE in the root of this distribution. # # 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. package TWiki::Plugins::JQueryPlugin::Core; use strict; use constant DEBUG => 0; # toggle me my $tabPaneCounter; my $tabPaneId; my $tabCounter; my $jqPubUrlPath; ############################################################################### sub init { my ( $thePath ) = @_; $tabPaneCounter = 0; $tabPaneId = ''; $tabCounter = 0; $jqPubUrlPath = $thePath; } ############################################################################### sub handleTabPane { my ($session, $params, $theTopic, $theWeb) = @_; my $requires = $tabPaneId; # add previous ID as required, e.g. enforce sorting $tabPaneId = 'jqTabPane'.($tabPaneCounter++); # new ID my $select = $params->{select} || ''; $select =~ s/[^\d]//go; $select ||= 1; TWiki::Func::addToHEAD( $tabPaneId, <<"EOS", $requires ); EOS return "