Skip to content

Commit

Permalink
Item12683: support html elements to be used as twisty toggles
Browse files Browse the repository at this point in the history
Item12583: revert to simple floats in $VERSION



git-svn-id: http://svn.foswiki.org/trunk/JQTwistyContrib@17140 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
MichaelDaum authored and MichaelDaum committed Dec 11, 2013
1 parent 1d0ce75 commit cd515f3
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 17 deletions.
10 changes: 6 additions & 4 deletions data/System/JQTwistyContrib.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="reprev" date="1339519248" format="1.1" reprev="3" version="3"}%
%META:TOPICINFO{author="micha" comment="reprev" date="1381417193" format="1.1" reprev="3" version="4"}%
---+!! %TOPIC%
%SHORTDESCRIPTION%

Expand Down Expand Up @@ -69,12 +69,13 @@ Iusto suscipiantur at pri. Qui aliquid delenit ad, ex eos porro cotidieque. Wisi
</div>

---+++ Multiple containers

<a class='jqTwisty' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/JQTwistyContrib/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/JQTwistyContrib/toggle.png' data-close-text="%MAKETEXT{"close"}%" data-target='.myTwisty'>%MAKETEXT{"open"}%</a>

<div class="myTwisty" style="width:200px;border:1px solid red;padding:1em;">
Omnis copiosae vix ad, per oratio suscipiantur ad. Est ne congue verear comprehensam. Nec mucius dicunt dignissim te, cu qui laoreet fastidii, iriure propriae appellantur cum eu. Ea vis dicat novum, feugiat tractatos interesset in ius, vel wisi offendit te. Possit feugiat similique per at, viris verear an quo.
</div>

<a class='jqTwisty' data-open-img='%PUBURLPATH%/%SYSTEMWEB%/JQTwistyContrib/toggle-collapse.png' data-close-img='%PUBURLPATH%/%SYSTEMWEB%/JQTwistyContrib/toggle.png' data-close-text="%MAKETEXT{"close"}%" data-target='.myTwisty'>%MAKETEXT{"open"}%</a>

<div class="myTwisty" style="width:200px;border:1px solid red;padding:1em;">
Lorem ipsum dolor sit amet, ius ne dico constituto neglegentur. Vix ornatus platonem in, inermis corpora at has. Ea mucius viderer eligendi vim, quis iuvaret ceteros mea at. Ea vim ullum consequuntur, propriae concludaturque vis ex, cu melius phaedrum vix. Debet possit definitiones eos ea. In mel tibique incorrupte.
</div>
Expand Down Expand Up @@ -161,11 +162,12 @@ jQuery(function($) {
-->

| Author(s): | Michael Daum|
| Copyright: | &copy; 2012 Michael Daum http://michaeldaumconsulting.com |
| Copyright: | &copy; 2012-2013 Michael Daum http://michaeldaumconsulting.com |
| License: | [[http://www.gnu.org/licenses/gpl.html][GPL (Gnu General Public License)]] |
| Release: | %$RELEASE% |
| Version: | %$VERSION% |
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| 13 Dec 2013: | support html elements to be used as twisty toggles |
| 12 Jun 2012: | initial release |
| Dependencies: | %$DEPENDENCIES% |
| Home page: | Foswiki:Extensions/%TOPIC% |
Expand Down
7 changes: 3 additions & 4 deletions lib/Foswiki/Contrib/JQTwistyContrib.pm
@@ -1,6 +1,6 @@
# Plugin for Foswiki - The Free and Open Source Wiki, http://foswiki.org/
#
# JQTwistyContrib is Copyright (C) 2012 Michael Daum http://michaeldaumconsulting.com
# JQTwistyContrib is Copyright (C) 2012-2013 Michael Daum http://michaeldaumconsulting.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
Expand All @@ -24,9 +24,8 @@ use warnings;
=cut


our $VERSION = '$Rev$';
our $RELEASE = '1.00';
our $VERSION = '2.10';
our $RELEASE = '2.10';
our $SHORTDESCRIPTION = 'Lightweight twisty plugin';
our $NO_PREFS_IN_TOPIC = 1;

Expand Down
4 changes: 2 additions & 2 deletions lib/Foswiki/Contrib/JQTwistyContrib/Core.pm
Expand Up @@ -31,7 +31,7 @@ sub new {
$class->SUPER::new(
$session,
name => 'JQTwisty',
version => '1.0',
version => '1.1.0',
author => 'Michael Daum',
homepage => 'http://foswiki.org/Extensions/JQTwistyContrib',
css => ['jquery.twisty.css'],
Expand All @@ -49,7 +49,7 @@ sub new {
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Copyright (C) 2012 Michael Daum http://michaeldaumconsulting.com
Copyright (C) 2012-2013 Michael Daum http://michaeldaumconsulting.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down
4 changes: 2 additions & 2 deletions pub/System/JQTwistyContrib/jquery.twisty.uncompressed.css
@@ -1,6 +1,6 @@
a.jqTwisty {
text-decoration:none;
}
a.jqTwisty img {
vertical-align:bottom;
.jqTwistyContainer {
display:none;
}
16 changes: 11 additions & 5 deletions pub/System/JQTwistyContrib/jquery.twisty.uncompressed.js
@@ -1,9 +1,9 @@
/**
* @preserve
* jquery.twisty v1.0.0
* jquery.twisty 1.1.0
* http://foswiki.org/Extensions/JQTwistyContrib
*
* Copyright (c) 2012 Michael Daum
* Copyright (c) 2012-2013 Michael Daum http://michaeldaumconsulting.com
* Dual licensed under the MIT and GPL licenses, located in
* MIT-LICENSE.txt and GPL-LICENSE.txt respectively.
*
Expand All @@ -28,7 +28,9 @@
self._defaults = defaults;
self.options = $.extend( {}, defaults, self.element.data(), options) ;

self.options.openText = self.options.openText || self.element.text();
if (element.childNodes[0].nodeType == 3) { // a flat text node
self.options.openText = self.options.openText || self.element.text();
}
self.options.closeText = self.options.closeText || self.options.openText;
self.options.closeImg = self.options.closeImg || self.options.openImg;

Expand Down Expand Up @@ -93,7 +95,9 @@
if (self.options.closeText) {
html += self.options.closeText;
}
self.element.html(html);
if (html) {
self.element.html(html);
}

if (immediate) {
self.target.show();
Expand All @@ -112,7 +116,9 @@
if (self.options.openText) {
html += self.options.openText;
}
self.element.html(html);
if (html) {
self.element.html(html);
}

if (immediate) {
self.target.hide();
Expand Down

0 comments on commit cd515f3

Please sign in to comment.