Collapse-O-Matic - Version 1.4.3

Version Description

  • Added the findme attribute to auto scroll to start of expanded items
Download this release

Release Info

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

Code changes from version 1.4.1 to 1.4.3

Files changed (3) hide show
  1. collapse-o-matic.php +13 -3
  2. collapse.js +36 -9
  3. readme.txt +18 -5
collapse-o-matic.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: jQuery Collapse-O-Matic
4
  Plugin URI: http://plugins.twinpictures.de/plugins/collapse-o-matic/
5
  Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div.
6
- Version: 1.4.1
7
  Author: twinpictures, baden03
8
  Author URI: http://twinpictures.de/
9
  License: GPL2
@@ -32,7 +32,7 @@ function collapsTronicInit() {
32
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
33
  if (!is_admin()){
34
  //collapse script
35
- wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.3.2' );
36
  wp_enqueue_script('collapseomatic-js');
37
 
38
  //css
@@ -70,6 +70,7 @@ function collapsTronic($atts, $content = null){
70
  'excerptpos' => 'below-trigger',
71
  'excerpttag' => 'div',
72
  'excerptclass' => '',
 
73
  ), $atts));
74
 
75
  if($excerpt){
@@ -95,7 +96,16 @@ function collapsTronic($atts, $content = null){
95
  if($expanded){
96
  $trigclass .= ' colomat-close';
97
  }
98
- $link = "<".$tag." class='collapseomatic ".$trigclass."' id='".$id."' ".$relatt." ".$altatt.">".$title."</".$tag.">\n";
 
 
 
 
 
 
 
 
 
99
  if($swaptitle){
100
  $link .= "<".$tag." id='swap-".$id."' style='display:none;'>".$swaptitle."</".$tag.">\n";
101
  }
3
  Plugin Name: jQuery Collapse-O-Matic
4
  Plugin URI: http://plugins.twinpictures.de/plugins/collapse-o-matic/
5
  Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div.
6
+ Version: 1.4.3
7
  Author: twinpictures, baden03
8
  Author URI: http://twinpictures.de/
9
  License: GPL2
32
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
33
  if (!is_admin()){
34
  //collapse script
35
+ wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.3.4' );
36
  wp_enqueue_script('collapseomatic-js');
37
 
38
  //css
70
  'excerptpos' => 'below-trigger',
71
  'excerpttag' => 'div',
72
  'excerptclass' => '',
73
+ 'findme' => '',
74
  ), $atts));
75
 
76
  if($excerpt){
96
  if($expanded){
97
  $trigclass .= ' colomat-close';
98
  }
99
+ $anchor = '';
100
+ if($findme){
101
+ $trigclass .= ' find-me';
102
+ $offset = '';
103
+ if($findme != 'true' && $findme != 'auto'){
104
+ $offset = $findme;
105
+ }
106
+ $anchor = "<a id='find-".$id."' name='".$offset."'></a>\n";
107
+ }
108
+ $link = "<".$tag." class='collapseomatic ".$trigclass."' id='".$id."' ".$relatt." ".$altatt.">".$title."</".$tag.">".$anchor."\n";
109
  if($swaptitle){
110
  $link .= "<".$tag." id='swap-".$id."' style='display:none;'>".$swaptitle."</".$tag.">\n";
111
  }
collapse.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * jQuery Collapse-O-Matic v1.3.2
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2012, Twinpictures
@@ -24,8 +24,9 @@
24
  * THE SOFTWARE.
25
  */
26
 
 
 
27
  jQuery(document).ready(function() {
28
-
29
  //force collapse
30
  jQuery('.force_content_collapse').each(function(index) {
31
  jQuery(this).css('display', 'none');
@@ -45,6 +46,15 @@ jQuery(document).ready(function() {
45
  }
46
  });
47
 
 
 
 
 
 
 
 
 
 
48
 
49
  //Display the collapse wrapper... use to reverse the show-all on no JavaScript degredation.
50
  jQuery('.content_collapse_wrapper').each(function(index) {
@@ -75,7 +85,7 @@ jQuery(document).ready(function() {
75
  swapTitle(this, id);
76
  }
77
 
78
- jQuery('#target-'+id).slideToggle('fast', function() {
79
  // Animation complete.
80
  });
81
 
@@ -116,7 +126,7 @@ jQuery(document).ready(function() {
116
  swapTitle(this, id);
117
  }
118
 
119
- jQuery('#target-'+id).slideToggle('fast', function() {
120
  // Animation complete.
121
  });
122
 
@@ -144,7 +154,7 @@ jQuery(document).ready(function() {
144
  swapTitle(this, thisid);
145
  }
146
 
147
- jQuery('#target-'+thisid).slideToggle('fast', function() {
148
  // Animation complete.
149
  });
150
 
@@ -181,7 +191,7 @@ jQuery(document).ready(function() {
181
  swapTitle(this, thisid);
182
  }
183
 
184
- jQuery('#target-'+thisid).slideToggle('fast', function() {
185
  // Animation complete.
186
  });
187
  });
@@ -195,7 +205,7 @@ jQuery(document).ready(function() {
195
  swapTitle(this, thisid);
196
  }
197
 
198
- jQuery('#target-'+thisid).slideToggle('fast', function() {
199
  // Animation complete.
200
  });
201
  });
@@ -213,7 +223,7 @@ jQuery(document).ready(function() {
213
  swapTitle(this, thisid);
214
  }
215
 
216
- jQuery('#target-'+thisid).slideToggle('fast', function() {
217
  // Animation complete.
218
  });
219
  });
@@ -227,10 +237,27 @@ jQuery(document).ready(function() {
227
  swapTitle(this, thisid);
228
  }
229
 
230
- jQuery('#target-'+thisid).slideToggle('fast', function() {
231
  // Animation complete.
232
  });
233
  });
234
  }
235
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  });
1
  /*!
2
+ * jQuery Collapse-O-Matic v1.3.4
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2012, Twinpictures
24
  * THE SOFTWARE.
25
  */
26
 
27
+ var durration = 'fast';
28
+
29
  jQuery(document).ready(function() {
 
30
  //force collapse
31
  jQuery('.force_content_collapse').each(function(index) {
32
  jQuery(this).css('display', 'none');
46
  }
47
  });
48
 
49
+ //initial position for find-me feature
50
+ jQuery('.find-me').each(function(index) {
51
+ var thisid = jQuery(this).attr('id');
52
+ if( !jQuery('#find-'+thisid).attr('name') ){
53
+ var target_offset = jQuery(this).offset();
54
+ var target_top_offset = target_offset.top;
55
+ jQuery('#find-'+thisid).attr('name', target_top_offset);
56
+ }
57
+ });
58
 
59
  //Display the collapse wrapper... use to reverse the show-all on no JavaScript degredation.
60
  jQuery('.content_collapse_wrapper').each(function(index) {
85
  swapTitle(this, id);
86
  }
87
 
88
+ jQuery('#target-'+id).slideToggle(durration, function() {
89
  // Animation complete.
90
  });
91
 
126
  swapTitle(this, id);
127
  }
128
 
129
+ jQuery('#target-'+id).slideToggle(durration, function() {
130
  // Animation complete.
131
  });
132
 
154
  swapTitle(this, thisid);
155
  }
156
 
157
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
158
  // Animation complete.
159
  });
160
 
191
  swapTitle(this, thisid);
192
  }
193
 
194
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
195
  // Animation complete.
196
  });
197
  });
205
  swapTitle(this, thisid);
206
  }
207
 
208
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
209
  // Animation complete.
210
  });
211
  });
223
  swapTitle(this, thisid);
224
  }
225
 
226
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
227
  // Animation complete.
228
  });
229
  });
237
  swapTitle(this, thisid);
238
  }
239
 
240
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
241
  // Animation complete.
242
  });
243
  });
244
  }
245
  });
246
+
247
+ //do we have a find me?
248
+ jQuery('.find-me').click(function() {
249
+ //event.preventDefault();
250
+ //get the top offset of the target anchor
251
+ var thisid = jQuery(this).attr('id');
252
+ var offset_top = jQuery('#find-'+thisid).attr('name');
253
+ //alert(offset_top);
254
+ //var target_offset = jQuery(this).offset();
255
+ //var target_position = jQuery(this).position();
256
+ //var target_top_offset = target_offset.top;
257
+ //var target_top_position = target_position.top;
258
+ //alert('target_top_offset: ' + target_top_offset + ' and target_top_position: ' + target_top_position);
259
+ //goto that anchor by setting the body scroll top to anchor top
260
+ jQuery('html, body').animate({scrollTop:offset_top}, 500);
261
+ //alert("please scroll to me");
262
+ });
263
  });
readme.txt CHANGED
@@ -4,14 +4,14 @@ Contributors: twinpictures, baden03
4
  Donate link: http://plugins.twinpictures.de/plugins/collapse-o-matic/
5
  Tags: collapse, expand, collapsible, expandable, expandable content, collapsable content, shortcode, hidden, hide, display, accordion, accordion, jQuery, javascript, roll-your-own, twinpictures
6
  Requires at least: 2.8
7
- Tested up to: 3.3.1
8
- Stable tag: 1.4.1
9
 
10
- Remove clutter, save space: display and hide additional content in a SEO friendly way by warpping content in an [expand] shortcode.
11
 
12
  == Description ==
13
 
14
- Collapse-O-Matic adds an `[expand title="trigger text"]hidden content[/expand]` shortcode that will wrap any content, including other shortcodes, into a lovely jQuery expanding and collapsing div. A <a href='http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/'>complete listing of shortcode options and attribute demos</a> are available, as well as <a href='http://wordpress.org/tags/jquery-collapse-o-matic'>free community</a> and <a href='http://plugins.twinpictures.de/plugins/collapse-o-matic/support/'>premium support</a>. This plug-in was inspired by DrLebowski's Collapsing Objects.
15
 
16
  == Installation ==
17
 
@@ -25,7 +25,7 @@ Collapse-O-Matic adds an `[expand title="trigger text"]hidden content[/expand]`
25
 
26
  == Frequently Asked Questions ==
27
 
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? =
@@ -44,6 +44,12 @@ No. Not even close.
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
47
  = 1.4.1 =
48
  * Autoclose elements will now trigger SwapTitle
49
 
@@ -137,6 +143,13 @@ No. Not even close.
137
  * The plug-in came to be.
138
 
139
  == Upgrade Notice ==
 
 
 
 
 
 
 
140
  = 1.4.1 =
141
  * Swaptitle will be triggered by autoexpand/collapse events such as highlander grouping.
142
 
4
  Donate link: http://plugins.twinpictures.de/plugins/collapse-o-matic/
5
  Tags: collapse, expand, collapsible, expandable, expandable content, collapsable content, shortcode, hidden, hide, display, accordion, accordion, jQuery, javascript, roll-your-own, twinpictures
6
  Requires at least: 2.8
7
+ Tested up to: 3.3.2
8
+ Stable tag: 1.4.3
9
 
10
+ Remove clutter, save space: display and hide additional content in a SEO friendly way by wrapping content in an [expand] shortcode.
11
 
12
  == Description ==
13
 
14
+ Collapse-O-Matic adds an `[expand title="trigger text"]hidden content[/expand]` shortcode that will wrap any content, including other shortcodes, into a lovely jQuery expanding and collapsing div. A <a href='http://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/'>complete listing of shortcode options and attribute demos</a> are available, as well as <a href='http://wordpress.org/tags/jquery-collapse-o-matic'>free community</a> and <a href='http://plugins.twinpictures.de/plugins/collapse-o-matic/support/'>premium support</a>. This plug-in was originally inspired by DrLebowski's Collapsing Objects.
15
 
16
  == Installation ==
17
 
25
 
26
  == Frequently Asked Questions ==
27
 
28
+ = I am a Social Netwookiee, might Twinpictures 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? =
44
 
45
  == Changelog ==
46
 
47
+ = 1.4.3 =
48
+ * Added the findme attribute to auto scroll to start of expanded items
49
+
50
+ = 1.4.2 =
51
+ * Added speed adjustment to the slideToggle
52
+
53
  = 1.4.1 =
54
  * Autoclose elements will now trigger SwapTitle
55
 
143
  * The plug-in came to be.
144
 
145
  == Upgrade Notice ==
146
+
147
+ = 1.4.3 =
148
+ * added findme attribute to autoscroll to expanded elements
149
+
150
+ = 1.4.2 =
151
+ * added speed control to collapse/expand effect
152
+
153
  = 1.4.1 =
154
  * Swaptitle will be triggered by autoexpand/collapse events such as highlander grouping.
155