Collapse-O-Matic - Version 1.4.5

Version Description

  • Added SlideFade/SlideToggle option
  • Visited trigers now have colomat-visited class
Download this release

Release Info

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

Code changes from version 1.3.14 to 1.4.5

collapse-o-matic.php CHANGED
@@ -1,12 +1,13 @@
1
  <?php
2
  /*
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.14
7
- Author: Twinpictures
8
- Author URI: http://www.twinpictures.de
9
  License: GPL2
 
10
  */
11
 
12
  /* Copyright 2012 Twinpictures (www.twinpictures.de)
@@ -31,18 +32,19 @@ function collapsTronicInit() {
31
  $plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
32
  if (!is_admin()){
33
  //collapse script
34
- wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.3.0' );
35
  wp_enqueue_script('collapseomatic-js');
36
 
37
  //css
38
- wp_register_style( 'collapseomatic-css', $plugin_url.'/style.css', array (), '1.5' );
39
  wp_enqueue_style( 'collapseomatic-css' );
40
  }
41
 
42
  add_shortcode('expand', 'collapsTronic');
43
- add_shortcode('expandsub1', 'collapsTronic');
44
- add_shortcode('expandsub2', 'collapsTronic');
45
- add_shortcode('expandsub3', 'collapsTronic');
 
46
 
47
  //add the filter to the sidebar widgets
48
  add_filter('widget_text', 'do_shortcode');
@@ -61,12 +63,14 @@ function collapsTronic($atts, $content = null){
61
  'tag' => 'span',
62
  'trigclass' => '',
63
  'targclass' => '',
 
64
  'rel' => '',
65
  'expanded' => '',
66
  'excerpt' => '',
67
  'excerptpos' => 'below-trigger',
68
  'excerpttag' => 'div',
69
  'excerptclass' => '',
 
70
  ), $atts));
71
 
72
  if($excerpt){
@@ -92,35 +96,60 @@ function collapsTronic($atts, $content = null){
92
  if($expanded){
93
  $trigclass .= ' colomat-close';
94
  }
95
- $link = '<'.$tag.' class="collapseomatic '.$trigclass.'" id="'.$id.'" '.$relatt.' '.$altatt.'>'.$title.'</'.$tag.'>';
 
 
 
 
 
 
 
 
 
96
  if($swaptitle){
97
- $link .= '<'.$tag.' id="swap-'.$id.'" style="display:none;">'.$swaptitle.'</'.$tag.'>';
98
  }
99
  $eDiv = '';
100
- if($content != ' '){
101
- $eDiv = '<div id="target-'.$id.'" class="collapseomatic_content '.$targclass.'">'.do_shortcode($content).'</div>';
102
  }
103
  if($excerpt){
104
  if($excerptpos == 'above-trigger'){
105
- return $nibble . $link . $eDiv;
 
 
 
 
 
106
  }
107
  else if($excerptpos == 'below-trigger'){
108
- return $link . $nibble . $eDiv;
 
 
 
 
 
109
  }
110
  else{
111
- return $link . $eDiv . $nibble;
 
 
 
 
 
112
  }
113
  }
114
  else{
115
- return $link . $eDiv;
 
 
 
 
 
116
  }
 
117
  }
118
 
119
- add_shortcode('expand', 'collapsTronic');
120
- add_shortcode('expandsub1', 'collapsTronic');
121
- add_shortcode('expandsub2', 'collapsTronic');
122
- add_shortcode('expandsub3', 'collapsTronic');
123
-
124
  //add the filter to the sidebar widgets
125
  add_filter('widget_text', 'do_shortcode');
126
  ?>
1
  <?php
2
  /*
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.5
7
+ Author: twinpictures, baden03
8
+ Author URI: http://twinpictures.de/
9
  License: GPL2
10
+
11
  */
12
 
13
  /* Copyright 2012 Twinpictures (www.twinpictures.de)
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.min.js', array ('jquery'), '1.3.5' );
36
  wp_enqueue_script('collapseomatic-js');
37
 
38
  //css
39
+ wp_register_style( 'collapseomatic-css', $plugin_url.'/style.css', array (), '1.5.1' );
40
  wp_enqueue_style( 'collapseomatic-css' );
41
  }
42
 
43
  add_shortcode('expand', 'collapsTronic');
44
+
45
+ for ($i=1; $i<30; $i++) {
46
+ add_shortcode('expandsub'.$i, 'collapsTronic');
47
+ }
48
 
49
  //add the filter to the sidebar widgets
50
  add_filter('widget_text', 'do_shortcode');
63
  'tag' => 'span',
64
  'trigclass' => '',
65
  'targclass' => '',
66
+ 'trigpos' => 'above',
67
  'rel' => '',
68
  'expanded' => '',
69
  'excerpt' => '',
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
  }
112
  $eDiv = '';
113
+ if($content){
114
+ $eDiv = "<div id='target-".$id."' class='collapseomatic_content ".$targclass."'>".do_shortcode($content)."</div>\n";
115
  }
116
  if($excerpt){
117
  if($excerptpos == 'above-trigger'){
118
+ if($trigpos == 'below'){
119
+ $retStr = $eDiv.$nibble.$link;
120
+ }
121
+ else{
122
+ $retStr = $nibble.$link.$eDiv;
123
+ }
124
  }
125
  else if($excerptpos == 'below-trigger'){
126
+ if($trigpos == 'below'){
127
+ $retStr = $eDiv.$link.$nibble;
128
+ }
129
+ else{
130
+ $retStr = $link.$nibble.$eDiv;
131
+ }
132
  }
133
  else{
134
+ if($trigpos == 'below'){
135
+ $retStr = $eDiv.$link.$nibble;
136
+ }
137
+ else{
138
+ $retStr = $link.$eDiv.$nibble;
139
+ }
140
  }
141
  }
142
  else{
143
+ if($trigpos == 'below'){
144
+ $retStr = $eDiv.$link;
145
+ }
146
+ else{
147
+ $retStr = $link.$eDiv;
148
+ }
149
  }
150
+ return $retStr;
151
  }
152
 
 
 
 
 
 
153
  //add the filter to the sidebar widgets
154
  add_filter('widget_text', 'do_shortcode');
155
  ?>
collapse.js CHANGED
@@ -1,6 +1,6 @@
1
  /*!
2
- * jQuery Collapse-O-Matic v1.3.0
3
- * http://www.twinpictures.de/collapse-o-matic/
4
  *
5
  * Copyright 2012, Twinpictures
6
  *
@@ -25,6 +25,10 @@
25
  */
26
 
27
  jQuery(document).ready(function() {
 
 
 
 
28
 
29
  //force collapse
30
  jQuery('.force_content_collapse').each(function(index) {
@@ -36,6 +40,24 @@ jQuery(document).ready(function() {
36
  var thisid = jQuery(this).attr('id');
37
  jQuery('#target-'+thisid).css('display', 'none');
38
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  //Display the collapse wrapper... use to reverse the show-all on no JavaScript degredation.
41
  jQuery('.content_collapse_wrapper').each(function(index) {
@@ -50,6 +72,7 @@ jQuery(document).ready(function() {
50
  }
51
  );
52
 
 
53
  jQuery('.collapseomatic').click(function() {
54
  //alert('phones ringin dude');
55
  var id = jQuery(this).attr('id');
@@ -62,21 +85,25 @@ jQuery(document).ready(function() {
62
  }
63
  //check if the title needs to be swapped out
64
  if(jQuery("#swap-"+id).length > 0){
65
- var orightml = jQuery(this).html();
66
- var swaphtml = jQuery("#swap-"+id).html();
67
- jQuery(this).html(swaphtml);
68
- jQuery("#swap-"+id).html(orightml);
69
-
70
- //is cufon involved? if so, do that thing
71
- if(swaphtml.indexOf("<cufon") != -1){
72
- var trigelem = jQuery(this).get(0).tagName;
73
- Cufon.replace(trigelem);
74
- }
75
  }
76
 
77
- jQuery('#target-'+id).slideToggle('fast', function() {
 
 
 
 
 
78
  // Animation complete.
79
- });
 
 
 
 
 
 
 
 
80
 
81
  //deal with grouped items if needed
82
  if(jQuery(this).attr('rel') !== undefined){
@@ -90,44 +117,51 @@ jQuery(document).ready(function() {
90
  }
91
  });
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  function closeOtherGroups(rel){
94
  jQuery('.collapseomatic[rel!="' + rel +'"]').each(function(index) {
95
  //add close class if open
96
  if(jQuery(this).hasClass('colomat-close') && jQuery(this).attr('rel') !== undefined){
97
  jQuery(this).removeClass('colomat-close');
98
  var id = jQuery(this).attr('id');
99
- jQuery('#target-'+id).slideToggle('fast', function() {
100
- // Animation complete.
101
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  //check if there are nested children that need to be collapsed
104
- var child = jQuery('#target-'+id).children('span.collapseomatic');
105
- child.each(function(index) {
106
  jQuery(this).removeClass('colomat-close');
107
  var thisid = jQuery(this).attr('id');
108
- jQuery('#target-'+thisid).slideToggle('fast', function() {
109
- // Animation complete.
110
- });
111
-
112
- //check if there are nested grand children that need to be collapsed
113
- var grandchild = jQuery('#target-'+thisid).children('span.collapseomatic');
114
- grandchild.each(function(index) {
115
- jQuery(this).removeClass('colomat-close');
116
- var thatid = jQuery(this).attr('id');
117
- jQuery('#target-'+thatid).slideToggle('fast', function() {
118
- // Animation complete.
119
- });
120
-
121
- //check if there are nested great grand children that need to be collapsed
122
- var greatgrandchild = jQuery('#target-'+thatid).children('span.collapseomatic');
123
- greatgrandchild.each(function(index) {
124
- jQuery(this).removeClass('colomat-close');
125
- var theotherid = jQuery(this).attr('id');
126
- jQuery('#target-'+theotherid).slideToggle('fast', function() {
127
- // Animation complete.
128
- });
129
- })
130
- })
131
  })
132
  }
133
  });
@@ -140,38 +174,36 @@ jQuery(document).ready(function() {
140
  //collapse the element
141
  jQuery(this).removeClass('colomat-close');
142
  var thisid = jQuery(this).attr('id');
143
- jQuery('#target-'+thisid).slideToggle('fast', function() {
144
- // Animation complete.
145
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
  //check if there are nested children that need to be collapsed
148
- var child = jQuery('#target-'+id).children('span.collapseomatic');
149
- child.each(function(index) {
150
  jQuery(this).removeClass('colomat-close');
151
  var thisid = jQuery(this).attr('id');
152
- jQuery('#target-'+thisid).slideToggle('fast', function() {
153
- // Animation complete.
154
- });
155
-
156
- //check if there are nested grand children that need to be collapsed
157
- var grandchild = jQuery('#target-'+thisid).children('span.collapseomatic');
158
- grandchild.each(function(index) {
159
- jQuery(this).removeClass('colomat-close');
160
- var thatid = jQuery(this).attr('id');
161
- jQuery('#target-'+thatid).slideToggle('fast', function() {
162
- // Animation complete.
163
- });
164
-
165
- //check if there are nested great grand children that need to be collapsed
166
- var greatgrandchild = jQuery('#target-'+thatid).children('span.collapseomatic');
167
- greatgrandchild.each(function(index) {
168
- jQuery(this).removeClass('colomat-close');
169
- var theotherid = jQuery(this).attr('id');
170
- jQuery('#target-'+theotherid).slideToggle('fast', function() {
171
- // Animation complete.
172
- });
173
- })
174
- })
175
  })
176
  }
177
  });
@@ -180,8 +212,10 @@ jQuery(document).ready(function() {
180
  var myFile = document.location.toString();
181
  if (myFile.match('#')) { // the URL contains an anchor
182
  // click the navigation item corresponding to the anchor
183
- var myAnchor = '#' + myFile.split('#')[1];
184
- jQuery(myAnchor).click();
 
 
185
  }
186
 
187
  jQuery('.expandall').click(function() {
@@ -192,21 +226,22 @@ jQuery(document).ready(function() {
192
  var thisid = jQuery(this).attr('id');
193
 
194
  if(jQuery("#swap-"+thisid).length > 0){
195
- var orightml = jQuery(this).html();
196
- var swaphtml = jQuery("#swap-"+thisid).html();
197
- jQuery(this).html(swaphtml);
198
- jQuery("#swap-"+thisid).html(orightml);
199
-
200
- //is cufon involved? if so, do that thing
201
- if(swaphtml.indexOf("<cufon") != -1){
202
- var trigelem = jQuery(this).get(0).tagName;
203
- Cufon.replace(trigelem);
204
- }
205
  }
206
-
207
- jQuery('#target-'+thisid).slideToggle('fast', function() {
 
 
208
  // Animation complete.
209
- });
 
 
 
 
 
 
 
 
210
  });
211
  }
212
  else{
@@ -215,21 +250,22 @@ jQuery(document).ready(function() {
215
  var thisid = jQuery(this).attr('id');
216
 
217
  if(jQuery("#swap-"+thisid).length > 0){
218
- var orightml = jQuery(this).html();
219
- var swaphtml = jQuery("#swap-"+thisid).html();
220
- jQuery(this).html(swaphtml);
221
- jQuery("#swap-"+thisid).html(orightml);
222
-
223
- //is cufon involved? if so, do that thing
224
- if(swaphtml.indexOf("<cufon") != -1){
225
- var trigelem = jQuery(this).get(0).tagName;
226
- Cufon.replace(trigelem);
227
- }
 
 
 
 
 
228
  }
229
-
230
- jQuery('#target-'+thisid).slideToggle('fast', function() {
231
- // Animation complete.
232
- });
233
  });
234
  }
235
  });
@@ -242,21 +278,22 @@ jQuery(document).ready(function() {
242
  var thisid = jQuery(this).attr('id');
243
 
244
  if(jQuery("#swap-"+thisid).length > 0){
245
- var orightml = jQuery(this).html();
246
- var swaphtml = jQuery("#swap-"+thisid).html();
247
- jQuery(this).html(swaphtml);
248
- jQuery("#swap-"+thisid).html(orightml);
249
-
250
- //is cufon involved? if so, do that thing
251
- if(swaphtml.indexOf("<cufon") != -1){
252
- var trigelem = jQuery(this).get(0).tagName;
253
- Cufon.replace(trigelem);
254
- }
255
  }
256
 
257
- jQuery('#target-'+thisid).slideToggle('fast', function() {
 
 
258
  // Animation complete.
259
- });
 
 
 
 
 
 
 
 
260
  });
261
  }
262
  else{
@@ -265,22 +302,31 @@ jQuery(document).ready(function() {
265
  var thisid = jQuery(this).attr('id');
266
 
267
  if(jQuery("#swap-"+thisid).length > 0){
268
- var orightml = jQuery(this).html();
269
- var swaphtml = jQuery("#swap-"+thisid).html();
270
- jQuery(this).html(swaphtml);
271
- jQuery("#swap-"+thisid).html(orightml);
272
-
273
- //is cufon involved? if so, do that thing
274
- if(swaphtml.indexOf("<cufon") != -1){
275
- var trigelem = jQuery(this).get(0).tagName;
276
- Cufon.replace(trigelem);
277
- }
278
  }
279
 
280
- jQuery('#target-'+thisid).slideToggle('fast', function() {
281
- // Animation complete.
282
- });
 
 
 
 
 
 
 
 
 
 
283
  });
284
  }
285
  });
 
 
 
 
 
 
 
 
286
  });
1
  /*!
2
+ * jQuery Collapse-O-Matic v1.3.6
3
+ * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2012, Twinpictures
6
  *
25
  */
26
 
27
  jQuery(document).ready(function() {
28
+ //expand/collapse speed
29
+ var durration = 'fast';
30
+ //slide only (slideToggle) or slide and fade (slideFade)
31
+ var slideEffect = 'slideFade';
32
 
33
  //force collapse
34
  jQuery('.force_content_collapse').each(function(index) {
40
  var thisid = jQuery(this).attr('id');
41
  jQuery('#target-'+thisid).css('display', 'none');
42
  });
43
+
44
+ //inital swaptitle for pre-expanded elements
45
+ jQuery('.collapseomatic.colomat-close').each(function(index) {
46
+ var thisid = jQuery(this).attr('id');
47
+ if(jQuery("#swap-"+thisid).length > 0){
48
+ swapTitle(this, thisid);
49
+ }
50
+ });
51
+
52
+ //initial position for find-me feature
53
+ jQuery('.find-me').each(function(index) {
54
+ var thisid = jQuery(this).attr('id');
55
+ if( !jQuery('#find-'+thisid).attr('name') ){
56
+ var target_offset = jQuery(this).offset();
57
+ var target_top_offset = target_offset.top;
58
+ jQuery('#find-'+thisid).attr('name', target_top_offset);
59
+ }
60
+ });
61
 
62
  //Display the collapse wrapper... use to reverse the show-all on no JavaScript degredation.
63
  jQuery('.content_collapse_wrapper').each(function(index) {
72
  }
73
  );
74
 
75
+
76
  jQuery('.collapseomatic').click(function() {
77
  //alert('phones ringin dude');
78
  var id = jQuery(this).attr('id');
85
  }
86
  //check if the title needs to be swapped out
87
  if(jQuery("#swap-"+id).length > 0){
88
+ swapTitle(this, id);
 
 
 
 
 
 
 
 
 
89
  }
90
 
91
+ //add visited class
92
+ jQuery(this).addClass('colomat-visited');
93
+
94
+ //slideToggle
95
+ if(slideEffect == 'slideToggle'){
96
+ jQuery('#target-'+id).slideToggle(durration, function() {
97
  // Animation complete.
98
+ });
99
+ }
100
+ //slideFade
101
+ else if(slideEffect == 'slideFade'){
102
+ jQuery('#target-'+id).animate({
103
+ height: "toggle",
104
+ opacity: "toggle"
105
+ }, duration);
106
+ }
107
 
108
  //deal with grouped items if needed
109
  if(jQuery(this).attr('rel') !== undefined){
117
  }
118
  });
119
 
120
+ function swapTitle(obj, id){
121
+ var orightml = jQuery(obj).html();
122
+ var swaphtml = jQuery("#swap-"+id).html();
123
+ jQuery(obj).html(swaphtml);
124
+ jQuery("#swap-"+id).html(orightml);
125
+
126
+ //is cufon involved? if so, do that thing
127
+ if(swaphtml.indexOf("<cufon") != -1){
128
+ var trigelem = jQuery(this).get(0).tagName;
129
+ Cufon.replace(trigelem);
130
+ }
131
+ }
132
+
133
  function closeOtherGroups(rel){
134
  jQuery('.collapseomatic[rel!="' + rel +'"]').each(function(index) {
135
  //add close class if open
136
  if(jQuery(this).hasClass('colomat-close') && jQuery(this).attr('rel') !== undefined){
137
  jQuery(this).removeClass('colomat-close');
138
  var id = jQuery(this).attr('id');
139
+
140
+ //check if the title needs to be swapped out
141
+ if(jQuery("#swap-"+id).length > 0){
142
+ swapTitle(this, id);
143
+ }
144
+
145
+ //slideToggle
146
+ if(slideEffect == 'slideToggle'){
147
+ jQuery('#target-'+id).slideToggle(durration, function() {
148
+ // Animation complete.
149
+ });
150
+ }
151
+ //slideFade
152
+ else if(slideEffect == 'slideFade'){
153
+ jQuery('#target-'+id).animate({
154
+ height: "toggle",
155
+ opacity: "toggle"
156
+ }, duration);
157
+ }
158
 
159
  //check if there are nested children that need to be collapsed
160
+ var ancestors = jQuery('.collapseomatic', '#target-'+id);
161
+ ancestors.each(function(index) {
162
  jQuery(this).removeClass('colomat-close');
163
  var thisid = jQuery(this).attr('id');
164
+ jQuery('#target-'+thisid).css('display', 'none');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  })
166
  }
167
  });
174
  //collapse the element
175
  jQuery(this).removeClass('colomat-close');
176
  var thisid = jQuery(this).attr('id');
177
+
178
+ //check if the title needs to be swapped out
179
+ if(jQuery("#swap-"+thisid).length > 0){
180
+ swapTitle(this, thisid);
181
+ }
182
+
183
+ //slideToggle
184
+ if(slideEffect == 'slideToggle'){
185
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
186
+ // Animation complete.
187
+ });
188
+ }
189
+ //slideFade
190
+ else if(slideEffect == 'slideFade'){
191
+ jQuery('#target-'+thisid).animate({
192
+ height: "toggle",
193
+ opacity: "toggle"
194
+ }, duration);
195
+ }
196
 
197
  //check if there are nested children that need to be collapsed
198
+ var ancestors = jQuery('.collapseomatic', '#target-'+id);
199
+ ancestors.each(function(index) {
200
  jQuery(this).removeClass('colomat-close');
201
  var thisid = jQuery(this).attr('id');
202
+ //check if the title needs to be swapped out
203
+ if(jQuery("#swap-"+thisid).length > 0){
204
+ swapTitle(this, thisid);
205
+ }
206
+ jQuery('#target-'+thisid).css('display', 'none');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
207
  })
208
  }
209
  });
212
  var myFile = document.location.toString();
213
  if (myFile.match('#')) { // the URL contains an anchor
214
  // click the navigation item corresponding to the anchor
215
+ var myAnchor = '#' + myFile.split('#');
216
+ if(myAnchor.length > 1 && myAnchor[1] != '#'){
217
+ jQuery(myAnchor).click();
218
+ }
219
  }
220
 
221
  jQuery('.expandall').click(function() {
226
  var thisid = jQuery(this).attr('id');
227
 
228
  if(jQuery("#swap-"+thisid).length > 0){
229
+ swapTitle(this, thisid);
 
 
 
 
 
 
 
 
 
230
  }
231
+
232
+ //slideToggle
233
+ if(slideEffect == 'slideToggle'){
234
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
235
  // Animation complete.
236
+ });
237
+ }
238
+ //slideFade
239
+ else if(slideEffect == 'slideFade'){
240
+ jQuery('#target-'+thisid).animate({
241
+ height: "toggle",
242
+ opacity: "toggle"
243
+ }, duration);
244
+ }
245
  });
246
  }
247
  else{
250
  var thisid = jQuery(this).attr('id');
251
 
252
  if(jQuery("#swap-"+thisid).length > 0){
253
+ swapTitle(this, thisid);
254
+ }
255
+
256
+ //slideToggle
257
+ if(slideEffect == 'slideToggle'){
258
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
259
+ // Animation complete.
260
+ });
261
+ }
262
+ //slideFade
263
+ else if(slideEffect == 'slideFade'){
264
+ jQuery('#target-'+thisid).animate({
265
+ height: "toggle",
266
+ opacity: "toggle"
267
+ }, duration);
268
  }
 
 
 
 
269
  });
270
  }
271
  });
278
  var thisid = jQuery(this).attr('id');
279
 
280
  if(jQuery("#swap-"+thisid).length > 0){
281
+ swapTitle(this, thisid);
 
 
 
 
 
 
 
 
 
282
  }
283
 
284
+ //slideToggle
285
+ if(slideEffect == 'slideToggle'){
286
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
287
  // Animation complete.
288
+ });
289
+ }
290
+ //slideFade
291
+ else if(slideEffect == 'slideFade'){
292
+ jQuery('#target-'+thisid).animate({
293
+ height: "toggle",
294
+ opacity: "toggle"
295
+ }, duration);
296
+ }
297
  });
298
  }
299
  else{
302
  var thisid = jQuery(this).attr('id');
303
 
304
  if(jQuery("#swap-"+thisid).length > 0){
305
+ swapTitle(this, thisid);
 
 
 
 
 
 
 
 
 
306
  }
307
 
308
+ //slideToggle
309
+ if(slideEffect == 'slideToggle'){
310
+ jQuery('#target-'+thisid).slideToggle(durration, function() {
311
+ // Animation complete.
312
+ });
313
+ }
314
+ //slideFade
315
+ else if(slideEffect == 'slideFade'){
316
+ jQuery('#target-'+thisid).animate({
317
+ height: "toggle",
318
+ opacity: "toggle"
319
+ }, duration);
320
+ }
321
  });
322
  }
323
  });
324
+
325
+ //do we have a find me?
326
+ jQuery('.find-me').click(function() {
327
+ //get the top offset of the target anchor
328
+ var thisid = jQuery(this).attr('id');
329
+ var offset_top = jQuery('#find-'+thisid).attr('name');
330
+ jQuery('html, body').animate({scrollTop:offset_top}, 500);
331
+ });
332
  });
collapse.min.js ADDED
@@ -0,0 +1 @@
 
1
+ jQuery(document).ready(function(){function c(a,b){var c=jQuery(a).html();var d=jQuery("#swap-"+b).html();jQuery(a).html(d);jQuery("#swap-"+b).html(c);if(d.indexOf("<cufon")!=-1){var e=jQuery(this).get(0).tagName;Cufon.replace(e)}}function d(d){jQuery('.collapseomatic[rel!="'+d+'"]').each(function(d){if(jQuery(this).hasClass("colomat-close")&&jQuery(this).attr("rel")!==undefined){jQuery(this).removeClass("colomat-close");var e=jQuery(this).attr("id");if(jQuery("#swap-"+e).length>0){c(this,e)}if(b=="slideToggle"){jQuery("#target-"+e).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+e).animate({height:"toggle",opacity:"toggle"},duration)}var f=jQuery(".collapseomatic","#target-"+e);f.each(function(a){jQuery(this).removeClass("colomat-close");var b=jQuery(this).attr("id");jQuery("#target-"+b).css("display","none")})}})}function e(d,e){jQuery('.collapseomatic[rel="'+d+'"]').each(function(d){if(jQuery(this).attr("id")!=e&&jQuery(this).hasClass("colomat-close")&&jQuery(this).attr("rel")!==undefined){jQuery(this).removeClass("colomat-close");var f=jQuery(this).attr("id");if(jQuery("#swap-"+f).length>0){c(this,f)}if(b=="slideToggle"){jQuery("#target-"+f).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+f).animate({height:"toggle",opacity:"toggle"},duration)}var g=jQuery(".collapseomatic","#target-"+e);g.each(function(a){jQuery(this).removeClass("colomat-close");var b=jQuery(this).attr("id");if(jQuery("#swap-"+b).length>0){c(this,b)}jQuery("#target-"+b).css("display","none")})}})}var a="fast";var b="slideFade";jQuery(".force_content_collapse").each(function(a){jQuery(this).css("display","none")});jQuery(".collapseomatic:not(.colomat-close)").each(function(a){var b=jQuery(this).attr("id");jQuery("#target-"+b).css("display","none")});jQuery(".collapseomatic.colomat-close").each(function(a){var b=jQuery(this).attr("id");if(jQuery("#swap-"+b).length>0){c(this,b)}});jQuery(".find-me").each(function(a){var b=jQuery(this).attr("id");if(!jQuery("#find-"+b).attr("name")){var c=jQuery(this).offset();var d=c.top;jQuery("#find-"+b).attr("name",d)}});jQuery(".content_collapse_wrapper").each(function(a){jQuery(this).css("display","inline")});jQuery(".collapseomatic").hover(function(){jQuery(this).addClass("colomat-hover")},function(){jQuery(this).removeClass("colomat-hover")});jQuery(".collapseomatic").click(function(){var f=jQuery(this).attr("id");if(f.indexOf("bot-")!="-1"){f=f.substr(4);jQuery("#"+f).toggleClass("colomat-close")}else{jQuery(this).toggleClass("colomat-close")}if(jQuery("#swap-"+f).length>0){c(this,f)}jQuery(this).addClass("colomat-visited");if(b=="slideToggle"){jQuery("#target-"+f).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+f).animate({height:"toggle",opacity:"toggle"},duration)}if(jQuery(this).attr("rel")!==undefined){var g=jQuery(this).attr("rel");if(g.indexOf("-highlander")!="-1"){e(g,f)}else{d(g)}}});var f=document.location.toString();if(f.match("#")){var g="#"+f.split("#");if(g.length>1&&g[1]!="#"){jQuery(g).click()}}jQuery(".expandall").click(function(){if(jQuery(this).attr("rel")!==undefined){var d=jQuery(this).attr("rel");jQuery('.collapseomatic[rel="'+d+'"].collapseomatic:not(.colomat-close)').each(function(d){jQuery(this).addClass("colomat-close");var e=jQuery(this).attr("id");if(jQuery("#swap-"+e).length>0){c(this,e)}if(b=="slideToggle"){jQuery("#target-"+e).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+e).animate({height:"toggle",opacity:"toggle"},duration)}})}else{jQuery(".collapseomatic:not(.colomat-close)").each(function(d){jQuery(this).addClass("colomat-close");var e=jQuery(this).attr("id");if(jQuery("#swap-"+e).length>0){c(this,e)}if(b=="slideToggle"){jQuery("#target-"+e).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+e).animate({height:"toggle",opacity:"toggle"},duration)}})}});jQuery(".collapseall").click(function(){if(jQuery(this).attr("rel")!==undefined){var d=jQuery(this).attr("rel");jQuery('.collapseomatic[rel="'+d+'"].collapseomatic.colomat-close').each(function(d){jQuery(this).removeClass("colomat-close");var e=jQuery(this).attr("id");if(jQuery("#swap-"+e).length>0){c(this,e)}if(b=="slideToggle"){jQuery("#target-"+e).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+e).animate({height:"toggle",opacity:"toggle"},duration)}})}else{jQuery(".collapseomatic.colomat-close").each(function(d){jQuery(this).removeClass("colomat-close");var e=jQuery(this).attr("id");if(jQuery("#swap-"+e).length>0){c(this,e)}if(b=="slideToggle"){jQuery("#target-"+e).slideToggle(a,function(){})}else if(b=="slideFade"){jQuery("#target-"+e).animate({height:"toggle",opacity:"toggle"},duration)}})}});jQuery(".find-me").click(function(){var a=jQuery(this).attr("id");var b=jQuery("#find-"+a).attr("name");jQuery("html, body").animate({scrollTop:b},500)})})
images/arrow-down-dark.png ADDED
Binary file
images/arrow-up-dark.png ADDED
Binary file
images/arrows.psd ADDED
Binary file
readme.txt CHANGED
@@ -1,17 +1,17 @@
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.3.1
8
- Stable tag: 1.3.14
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
 
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 collapsible div. A <a href='http://www.twinpictures.de/jquery-collapse-o-matic-1-3/'>complete listing of shortcode options</a> and attribute demos are available. This plug-in was inspired by DrLebowski's Collapsing Objects.
15
 
16
  == Installation ==
17
 
@@ -21,18 +21,18 @@ Collapse-O-Matic adds an `[expand title="trigger text"]hidden content[/expand]`
21
  1. Test that the this plug-in meets your demanding needs.
22
  1. Tweak the CSS to match your flavor.
23
  1. Rate the plug-in and verify if it works at wordpress.org.
24
- 1. Leave a comment regarding bugs, feature request, cocktail recipes at http://www.twinpictures.de/jquery-collapse-o-matic-1-3/
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? =
32
  Ah yes! <a href='http://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.
36
 
37
  = Is Galato the same as Ice Cream? =
38
  No. Not even close.
@@ -44,6 +44,40 @@ No. Not even close.
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  = 1.3.14 =
48
  * Fixed the Enqueue error (thanks pborg & lancehudson)
49
  * Expand All and Collapse All will now also trigger swap titles
@@ -116,6 +150,40 @@ No. Not even close.
116
  * The plug-in came to be.
117
 
118
  == Upgrade Notice ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  = 1.3.14 =
120
  Fixed Enqueue error and swap title on expand/collpase all. Expanded roll-your-own features.
121
 
1
  === jQuery Collapse-O-Matic ===
2
 
3
+ 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.4.1
8
+ Stable tag: 1.4.5
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/support/plugin/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
 
21
  1. Test that the this plug-in meets your demanding needs.
22
  1. Tweak the CSS to match your flavor.
23
  1. Rate the plug-in and verify if it works at wordpress.org.
24
+ 1. Leave a comment regarding bugs, feature request, cocktail recipes at http://wordpress.org/tags/jquery-collapse-o-matic/
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? =
32
  Ah yes! <a href='http://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://plugins.twinpictures.de/plugins/collapse-o-matic/documentation/'>complete listing of shortcode options</a> has been provided to answer this exact question.
36
 
37
  = Is Galato the same as Ice Cream? =
38
  No. Not even close.
44
 
45
  == Changelog ==
46
 
47
+ = 1.4.5 =
48
+ * Added SlideFade/SlideToggle option
49
+ * Visited trigers now have colomat-visited class
50
+
51
+ = 1.4.4 =
52
+ * Minified javascript for faster page loads
53
+
54
+ = 1.4.3 =
55
+ * Added the findme attribute to auto scroll to start of expanded items
56
+
57
+ = 1.4.2 =
58
+ * Added speed adjustment to the slideToggle
59
+
60
+ = 1.4.1 =
61
+ * Autoclose elements will now trigger SwapTitle
62
+
63
+ = 1.4 =
64
+ * Relaunched of plugin page on Twinpictures' Plugin Oven
65
+
66
+ = 1.3.18 =
67
+ * Added alternate style sheet for sites with dark backgrounds.
68
+
69
+ = 1.3.17 =
70
+ * Improved nesting collapse function for sub-levels and added support for nesting 30 levels deep.
71
+
72
+ = 1.3.16.1 =
73
+ * Added noarrows class for better integration of images as triggers.
74
+
75
+ = 1.3.16 =
76
+ * Bug Fix for the new trigpos attribute, stupid, stupid, stupid
77
+
78
+ = 1.3.15 =
79
+ * Added trigpos attribute to position the trigger below the target.
80
+
81
  = 1.3.14 =
82
  * Fixed the Enqueue error (thanks pborg & lancehudson)
83
  * Expand All and Collapse All will now also trigger swap titles
150
  * The plug-in came to be.
151
 
152
  == Upgrade Notice ==
153
+
154
+ = 1.4.5 =
155
+ * Added SlideFade/SlideToggle option and visited trigers now have colomat-visited class
156
+
157
+ = 1.4.4 =
158
+ * JavaScript has been minified for faster page loads
159
+
160
+ = 1.4.3 =
161
+ * added findme attribute to autoscroll to expanded elements
162
+
163
+ = 1.4.2 =
164
+ * added speed control to collapse/expand effect
165
+
166
+ = 1.4.1 =
167
+ * Swaptitle will be triggered by autoexpand/collapse events such as highlander grouping.
168
+
169
+ = 1.4 =
170
+ * Improved support and FAQs on Plugin Oven support page
171
+
172
+ = 1.3.18 =
173
+ * Added alternate style sheet for sites with dark backgrounds.
174
+
175
+ = 1.3.17 =
176
+ * Improved nesting collapse function for sub-levels and added support for nesting 30 levels deep.
177
+
178
+ = 1.3.16.1 =
179
+ * Added noarrows class for better integration of images as triggers.
180
+
181
+ = 1.3.16 =
182
+ * Bug Fix for the new trigpos attribute, stupid, stupid, stupid
183
+
184
+ = 1.3.15 =
185
+ Added trigpos attribute to position the trigger below the target.
186
+
187
  = 1.3.14 =
188
  Fixed Enqueue error and swap title on expand/collpase all. Expanded roll-your-own features.
189
 
style-dark.css ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .collapseomatic {
2
+ background-image: url(images/arrow-down-dark.png);
3
+ background-repeat: no-repeat;
4
+ padding: 0 0 10px 16px;
5
+ /*border: 1px dotted blue;*/
6
+ cursor: pointer;
7
+ }
8
+ .arrowright {
9
+ background-position: top right;
10
+ padding: 0 16px 10px 0;
11
+ }
12
+ .noarrow {
13
+ background-image: none !important;
14
+ padding: 0 0 10px 0;
15
+ }
16
+ .colomat-hover {
17
+ text-decoration: underline;
18
+ }
19
+ .colomat-close {
20
+ background-image: url(images/arrow-up-dark.png);
21
+ }
22
+ .collapseomatic_excerpt, .collapseomatic_content {
23
+ margin-top: 0px;
24
+ margin-left: 16px;
25
+ padding: 0px;
26
+ }
27
+ .content_collapse_wrapper {
28
+ display: none;
29
+ }
30
+ .collapseall, .expandall {
31
+ cursor: pointer;
32
+ }
33
+ .collapseall:hover, .expandall:hover {
34
+ text-decoration: underline;
35
+ }
style.css CHANGED
@@ -2,12 +2,17 @@
2
  background-image: url(images/arrow-down.png);
3
  background-repeat: no-repeat;
4
  padding: 0 0 10px 16px;
 
5
  cursor: pointer;
6
  }
7
  .arrowright {
8
  background-position: top right;
9
  padding: 0 16px 10px 0;
10
  }
 
 
 
 
11
  .colomat-hover {
12
  text-decoration: underline;
13
  }
2
  background-image: url(images/arrow-down.png);
3
  background-repeat: no-repeat;
4
  padding: 0 0 10px 16px;
5
+ /*border: 1px dotted blue;*/
6
  cursor: pointer;
7
  }
8
  .arrowright {
9
  background-position: top right;
10
  padding: 0 16px 10px 0;
11
  }
12
+ .noarrow {
13
+ background-image: none !important;
14
+ padding: 0 0 10px 0;
15
+ }
16
  .colomat-hover {
17
  text-decoration: underline;
18
  }