Collapse-O-Matic - Version 1.3.9

Version Description

Download this release

Release Info

Developer baden03
Plugin Icon 128x128 Collapse-O-Matic
Version 1.3.9
Comparing to
See all releases

Code changes from version 1.3.7 to 1.3.9

Files changed (3) hide show
  1. collapse-o-matic.php +7 -5
  2. collapse.js +40 -16
  3. readme.txt +23 -13
collapse-o-matic.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: jQuery Collapse-O-Matic
4
  Plugin URI: http://www.twinpictures.de/jquery-collapse-o-matic-1-3/
5
  Description: Collapse-O-Matic adds an `[expand]` shortcode that wraps content into a lovely, jQuery collapsible div.
6
- Version: 1.3.7
7
  Author: Twinpictures
8
  Author URI: http://www.twinpictures.de
9
  License: GPL2
@@ -30,7 +30,7 @@ wp_enqueue_script('jquery');
30
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
31
  if (!is_admin()){
32
  //collapse script
33
- wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.2.3' );
34
  wp_enqueue_script('collapseomatic-js');
35
 
36
  //css
@@ -39,10 +39,9 @@ if (!is_admin()){
39
  }
40
 
41
 
42
- function collapsTronic($atts, $content=null){
43
  //find a random number, incase there is no id assigned
44
  $ran = rand(1, 10000);
45
-
46
  extract(shortcode_atts(array(
47
  'title' => '',
48
  'swaptitle' => '',
@@ -74,7 +73,10 @@ function collapsTronic($atts, $content=null){
74
  $link .= $title;
75
  }
76
  $link .= '" id="'.$id.'" '.$relatt.' '.$altatt.'>'.$title.'</'.$tag.'>';
77
- $eDiv = '<div id="target-'.$id.'" class="collapseomatic_content '.$targclass.'">'.do_shortcode($content).'</div>';
 
 
 
78
  return $link . $eDiv;
79
  }
80
 
3
  Plugin Name: jQuery Collapse-O-Matic
4
  Plugin URI: http://www.twinpictures.de/jquery-collapse-o-matic-1-3/
5
  Description: Collapse-O-Matic adds an `[expand]` shortcode that wraps content into a lovely, jQuery collapsible div.
6
+ Version: 1.3.9
7
  Author: Twinpictures
8
  Author URI: http://www.twinpictures.de
9
  License: GPL2
30
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
31
  if (!is_admin()){
32
  //collapse script
33
+ wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.2.4' );
34
  wp_enqueue_script('collapseomatic-js');
35
 
36
  //css
39
  }
40
 
41
 
42
+ function collapsTronic($atts, $content = null){
43
  //find a random number, incase there is no id assigned
44
  $ran = rand(1, 10000);
 
45
  extract(shortcode_atts(array(
46
  'title' => '',
47
  'swaptitle' => '',
73
  $link .= $title;
74
  }
75
  $link .= '" id="'.$id.'" '.$relatt.' '.$altatt.'>'.$title.'</'.$tag.'>';
76
+ $eDiv = '';
77
+ if($content != ' '){
78
+ $eDiv = '<div id="target-'.$id.'" class="collapseomatic_content '.$targclass.'">'.do_shortcode($content).'</div>';
79
+ }
80
  return $link . $eDiv;
81
  }
82
 
collapse.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * jQuery Collapse-O-Matic v1.2.3
3
  * http://www.twinpictures.de/collapse-o-matic/
4
  *
5
  * Copyright 2011, Twinpictures
@@ -46,7 +46,7 @@ jQuery(document).ready(function() {
46
  //check if the title needs to be swapped out
47
  var title = jQuery(this).attr('title');
48
  var htmlstr = jQuery(this).html();
49
- if(title != htmlstr){
50
  jQuery(this).attr('title', htmlstr);
51
  jQuery(this).html(title);
52
  }
@@ -101,22 +101,46 @@ jQuery(document).ready(function() {
101
  }
102
 
103
  jQuery('.expandall').click(function() {
104
- jQuery('.collapseomatic:not(.close)').each(function(index) {
105
- jQuery(this).addClass('close');
106
- var thisid = jQuery(this).attr('id');
107
- jQuery('#target-'+thisid).slideToggle('fast', function() {
108
- // Animation complete.
109
- });
110
- });
 
 
 
 
 
 
 
 
 
 
 
 
111
  });
112
 
113
  jQuery('.collapseall').click(function() {
114
- jQuery('.collapseomatic.close').each(function(index) {
115
- jQuery(this).removeClass('close');
116
- var thisid = jQuery(this).attr('id');
117
- jQuery('#target-'+thisid).slideToggle('fast', function() {
118
- // Animation complete.
119
- });
120
- });
 
 
 
 
 
 
 
 
 
 
 
 
121
  });
122
  });
1
  /*!
2
+ * jQuery Collapse-O-Matic v1.2.4
3
  * http://www.twinpictures.de/collapse-o-matic/
4
  *
5
  * Copyright 2011, Twinpictures
46
  //check if the title needs to be swapped out
47
  var title = jQuery(this).attr('title');
48
  var htmlstr = jQuery(this).html();
49
+ if(title != htmlstr && htmlstr.indexOf("<img") == -1 && htmlstr.indexOf("<cufon") == -1){
50
  jQuery(this).attr('title', htmlstr);
51
  jQuery(this).html(title);
52
  }
101
  }
102
 
103
  jQuery('.expandall').click(function() {
104
+ if(jQuery(this).attr('rel') !== undefined){
105
+ var rel = jQuery(this).attr('rel');
106
+ jQuery('.collapseomatic[rel="' + rel +'"].collapseomatic:not(.close)').each(function(index) {
107
+ jQuery(this).addClass('close');
108
+ var thisid = jQuery(this).attr('id');
109
+ jQuery('#target-'+thisid).slideToggle('fast', function() {
110
+ // Animation complete.
111
+ });
112
+ });
113
+ }
114
+ else{
115
+ jQuery('.collapseomatic:not(.close)').each(function(index) {
116
+ jQuery(this).addClass('close');
117
+ var thisid = jQuery(this).attr('id');
118
+ jQuery('#target-'+thisid).slideToggle('fast', function() {
119
+ // Animation complete.
120
+ });
121
+ });
122
+ }
123
  });
124
 
125
  jQuery('.collapseall').click(function() {
126
+ if(jQuery(this).attr('rel') !== undefined){
127
+ var rel = jQuery(this).attr('rel');
128
+ jQuery('.collapseomatic[rel="' + rel +'"].collapseomatic.close').each(function(index) {
129
+ jQuery(this).removeClass('close');
130
+ var thisid = jQuery(this).attr('id');
131
+ jQuery('#target-'+thisid).slideToggle('fast', function() {
132
+ // Animation complete.
133
+ });
134
+ });
135
+ }
136
+ else{
137
+ jQuery('.collapseomatic.close').each(function(index) {
138
+ jQuery(this).removeClass('close');
139
+ var thisid = jQuery(this).attr('id');
140
+ jQuery('#target-'+thisid).slideToggle('fast', function() {
141
+ // Animation complete.
142
+ });
143
+ });
144
+ }
145
  });
146
  });
readme.txt CHANGED
@@ -1,11 +1,11 @@
1
- === jQuery Collapse-O-Matic ===
2
 
3
- Contributors: Twinpictures, DrLebowski
4
  Donate link: http://www.twinpictures.de/collapse-o-matic/
5
  Tags: collapse, expand, collapsible, expandable, content, shortcode, hidden, jQuery, javascript, twinpictures
6
  Requires at least: 2.8
7
- Tested up to: 3.1
8
- Stable tag: 1.3.7
9
 
10
  Collapse-O-Matic adds an `[expand]` shortcode that wraps any object or content--including other shortcodes--into a lovely jQuery collapsible div.
11
 
@@ -28,8 +28,8 @@ Collapse-O-Matic adds an `[expand title="trigger text"]hidden content[/expand]`
28
  = I am a Social Netwookiee, do you have a Facebook page? =
29
  Yes, yes... <a href='http://www.facebook.com/twinpictures'>Twinpictures is on Facebook</a>.
30
 
31
- = Does Twinpictures do the Twiter? =
32
- Ah yes! <a href='twitter.com/switzerbaden'>@SwitzerBaden at Twitter</a> does the tweeting around here.
33
 
34
  = How does one use the shortcode, exactly? =
35
  A <a href='http://www.twinpictures.de/jquery-collapse-o-matic-1-3/'>complete listing of shortcode options</a> has been provided to answer this exact question.
@@ -44,6 +44,13 @@ No. Not even close.
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
 
47
  = 1.3.7 =
48
  * Added expandsub1 - expandsub3 shortcodes for nested expand elements.
49
  * Added collapseall and expandall triggers.
@@ -59,10 +66,10 @@ No. Not even close.
59
  * Changed '-member' to '-highlander' because it sounds better.
60
 
61
  = 1.3.3 =
62
- * Added the ability to have only one member of a group expanded by ading '-member' to the rel attribute value.
63
 
64
  = 1.3.2 =
65
- * Added Expanded attribute that sets the default positon expanded open.
66
  * Added style that moves arrows to the right of the text.
67
 
68
  = 1.3.1 =
@@ -76,21 +83,24 @@ No. Not even close.
76
  = 1.2 =
77
  * Expanded the shortcode to include an optional tag attribute. The system defaults to wrapping the trigger in a span tag.
78
  * Style will support various element tags... span, div, h1, h2... etc.
79
- * Style seperates the arrow icons, so there is no background bleed-over on extra-long trigger titles.
80
 
81
  = 1.1 =
82
  * Optimized Code
83
  * Shortcode now works in Sidebar
84
  * Expand Titles now have title tags that match the title, not just some random number
85
- * Shorcode can include a user-defined ID instead of a generated random number
86
  * Added auto expand feature if an anchor tag is used in the URL
87
 
88
  = 1.0 =
89
  * The plugin came to be.
90
 
91
  == Upgrade Notice ==
 
 
 
92
  = 1.3.7 =
93
- * New expandsub1 - expandsub3 shortcodes for nested expand elements. Collapse/Expand all triggers. Improved arrow icons.
94
 
95
  = 1.3.6 =
96
  Plugin degrades gracefully when JS is disabled. Title can now have expand/collapse states using swaptitle attribute.
@@ -114,10 +124,10 @@ Hover style added.
114
  Collapse-O-Matic has been significantly advanced. Elements can now be grouped together.
115
 
116
  = 1.2 =
117
- Style has been updated for ultimate flexibility. Shorcode can now be written as `[expand title="title goes here" id="optional-id-goes-here" tag="optional-html-tag-goes-here"]content goes here[/expand]`.
118
 
119
  = 1.1 =
120
- Shortcode now works in sidebars. Shorcode must be written as `[expand title="title goes here" id="optional-id-goes-here"]content goes here[/expand]`.
121
 
122
  = 1.0 =
123
  Where once there was not, there now is.
1
+ === jQuery Collapse-O-Matic ===
2
 
3
+ Contributors: Twinpictures
4
  Donate link: http://www.twinpictures.de/collapse-o-matic/
5
  Tags: collapse, expand, collapsible, expandable, content, shortcode, hidden, jQuery, javascript, twinpictures
6
  Requires at least: 2.8
7
+ Tested up to: 3.2
8
+ Stable tag: 1.3.9
9
 
10
  Collapse-O-Matic adds an `[expand]` shortcode that wraps any object or content--including other shortcodes--into a lovely jQuery collapsible div.
11
 
28
  = I am a Social Netwookiee, do you have a Facebook page? =
29
  Yes, yes... <a href='http://www.facebook.com/twinpictures'>Twinpictures is on Facebook</a>.
30
 
31
+ = Does Twinpictures do the Twitter? =
32
+ Ah yes! <a href='twitter.com/twinpictures'>@Twinpictures</a> does the twitter tweeting around here.
33
 
34
  = How does one use the shortcode, exactly? =
35
  A <a href='http://www.twinpictures.de/jquery-collapse-o-matic-1-3/'>complete listing of shortcode options</a> has been provided to answer this exact question.
44
 
45
  == Changelog ==
46
 
47
+ = 1.3.8 =
48
+ * Swaptitle will not be triggered if either <img> or <cufon> tags are used in trigger titles
49
+ * Added rel grouping to the collapseall/expandall tirggers to target only elements of a single group.
50
+
51
+ = 1.3.8 =
52
+ * Expand elements containing content with one empty space will no longer insert empty target elements.
53
+
54
  = 1.3.7 =
55
  * Added expandsub1 - expandsub3 shortcodes for nested expand elements.
56
  * Added collapseall and expandall triggers.
66
  * Changed '-member' to '-highlander' because it sounds better.
67
 
68
  = 1.3.3 =
69
+ * Added the ability to have only one member of a group expanded by adding '-member' to the rel attribute value.
70
 
71
  = 1.3.2 =
72
+ * Added Expanded attribute that sets the default position expanded open.
73
  * Added style that moves arrows to the right of the text.
74
 
75
  = 1.3.1 =
83
  = 1.2 =
84
  * Expanded the shortcode to include an optional tag attribute. The system defaults to wrapping the trigger in a span tag.
85
  * Style will support various element tags... span, div, h1, h2... etc.
86
+ * Style separates the arrow icons, so there is no background bleed-over on extra-long trigger titles.
87
 
88
  = 1.1 =
89
  * Optimized Code
90
  * Shortcode now works in Sidebar
91
  * Expand Titles now have title tags that match the title, not just some random number
92
+ * Shortcode can include a user-defined ID instead of a generated random number
93
  * Added auto expand feature if an anchor tag is used in the URL
94
 
95
  = 1.0 =
96
  * The plugin came to be.
97
 
98
  == Upgrade Notice ==
99
+ = 1.3.8 =
100
+ Expand elements that have content containing only one space will not insert target elements.
101
+
102
  = 1.3.7 =
103
+ New expandsub1 - expandsub3 shortcodes for nested expand elements. Collapse/Expand all triggers. Improved arrow icons.
104
 
105
  = 1.3.6 =
106
  Plugin degrades gracefully when JS is disabled. Title can now have expand/collapse states using swaptitle attribute.
124
  Collapse-O-Matic has been significantly advanced. Elements can now be grouped together.
125
 
126
  = 1.2 =
127
+ Style has been updated for ultimate flexibility. Shortcode can now be written as `[expand title="title goes here" id="optional-id-goes-here" tag="optional-html-tag-goes-here"]content goes here[/expand]`.
128
 
129
  = 1.1 =
130
+ Shortcode now works in sidebars. Shortcode must be written as `[expand title="title goes here" id="optional-id-goes-here"]content goes here[/expand]`.
131
 
132
  = 1.0 =
133
  Where once there was not, there now is.