Collapse-O-Matic - Version 1.7.10

Version Description

  • target the document.body
  • improved random id generation when no id is assigned
  • added colomat shortcode as an alias for expand
  • added notitle to options page
Download this release

Release Info

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

Code changes from version 1.7.9 to 1.7.10

Files changed (3) hide show
  1. collapse-o-matic.php +14 -5
  2. js/collapse.js +10 -6
  3. readme.txt +13 -5
collapse-o-matic.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Collapse-O-Matic
4
  Text Domain: jquery-collapse-o-matic
5
  Plugin URI: https://plugins.twinpictures.de/plugins/collapse-o-matic/
6
  Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div.
7
- Version: 1.7.9
8
  Author: twinpictures, baden03
9
  Author URI: https://twinpictures.de/
10
  License: GPL2
@@ -29,7 +29,7 @@ class WP_Collapse_O_Matic {
29
  * Current version
30
  * @var string
31
  */
32
- var $version = '1.7.9';
33
 
34
  /**
35
  * Used as prefix for options entry
@@ -53,6 +53,7 @@ class WP_Collapse_O_Matic {
53
  'trigclass' => '',
54
  'targtag' => 'div',
55
  'targclass' => '',
 
56
  'duration' => 'fast',
57
  'tabindex' => '0',
58
  'slideEffect' => 'slideFade',
@@ -102,6 +103,7 @@ class WP_Collapse_O_Matic {
102
  add_action('wp_head', array( $this, 'colomat_js_vars' ) );
103
  }
104
  add_shortcode('expand', array($this, 'shortcode'));
 
105
 
106
  //add expandsub shortcodes
107
  for ($i=1; $i<30; $i++) {
@@ -136,7 +138,7 @@ class WP_Collapse_O_Matic {
136
  if($this->options['script_location'] == 'footer' ){
137
  $load_in_footer = true;
138
  }
139
- wp_register_script('collapseomatic-js', plugins_url('js/collapse.js', __FILE__), array('jquery'), '1.6.14', $load_in_footer);
140
  if( empty($this->options['script_check']) ){
141
  wp_enqueue_script('collapseomatic-js');
142
  }
@@ -181,7 +183,7 @@ class WP_Collapse_O_Matic {
181
  wp_enqueue_style( 'collapseomatic-css' );
182
  }
183
  //find a random number, if no id is assigned
184
- $ran = rand(1, 10000);
185
  extract(shortcode_atts(array(
186
  'title' => '',
187
  'cid' => $options['cid'],
@@ -189,7 +191,7 @@ class WP_Collapse_O_Matic {
189
  'swaptitle' => '',
190
  'alt' => '',
191
  'swapalt' => '',
192
- 'notitle' => '',
193
  'id' => 'id'.$ran,
194
  'tag' => $options['tag'],
195
  'trigclass' => $options['trigclass'],
@@ -613,6 +615,13 @@ class WP_Collapse_O_Matic {
613
  </td>
614
  </tr>
615
 
 
 
 
 
 
 
 
616
  <tr>
617
  <th><?php _e( 'Add touchstart', 'jquery-collapse-o-matic' ) ?>:</th>
618
  <td><label><input type="checkbox" id="<?php echo $this->options_name ?>[touch_start]" name="<?php echo $this->options_name ?>[touch_start]" value="1" <?php echo checked( $options['touch_start'], 1 ); ?> /> <?php _e('Add touchstart', 'jquery-collapse-o-matic'); ?>
4
  Text Domain: jquery-collapse-o-matic
5
  Plugin URI: https://plugins.twinpictures.de/plugins/collapse-o-matic/
6
  Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div.
7
+ Version: 1.7.10
8
  Author: twinpictures, baden03
9
  Author URI: https://twinpictures.de/
10
  License: GPL2
29
  * Current version
30
  * @var string
31
  */
32
+ var $version = '1.7.10';
33
 
34
  /**
35
  * Used as prefix for options entry
53
  'trigclass' => '',
54
  'targtag' => 'div',
55
  'targclass' => '',
56
+ 'notitle' => '',
57
  'duration' => 'fast',
58
  'tabindex' => '0',
59
  'slideEffect' => 'slideFade',
103
  add_action('wp_head', array( $this, 'colomat_js_vars' ) );
104
  }
105
  add_shortcode('expand', array($this, 'shortcode'));
106
+ add_shortcode('colomat', array($this, 'shortcode'));
107
 
108
  //add expandsub shortcodes
109
  for ($i=1; $i<30; $i++) {
138
  if($this->options['script_location'] == 'footer' ){
139
  $load_in_footer = true;
140
  }
141
+ wp_register_script('collapseomatic-js', plugins_url('js/collapse.js', __FILE__), array('jquery'), '1.6.17', $load_in_footer);
142
  if( empty($this->options['script_check']) ){
143
  wp_enqueue_script('collapseomatic-js');
144
  }
183
  wp_enqueue_style( 'collapseomatic-css' );
184
  }
185
  //find a random number, if no id is assigned
186
+ $ran = uniqid();
187
  extract(shortcode_atts(array(
188
  'title' => '',
189
  'cid' => $options['cid'],
191
  'swaptitle' => '',
192
  'alt' => '',
193
  'swapalt' => '',
194
+ 'notitle' => $options['notitle'],
195
  'id' => 'id'.$ran,
196
  'tag' => $options['tag'],
197
  'trigclass' => $options['trigclass'],
615
  </td>
616
  </tr>
617
 
618
+ <tr>
619
+ <th><?php _e( 'No Title', 'jquery-collapse-o-matic' ) ?>:</th>
620
+ <td><label><input type="checkbox" id="<?php echo $this->options_name ?>[notitle]" name="<?php echo $this->options_name ?>[notitle]" value="1" <?php echo checked( $options['notitle'], 1 ); ?> /> <?php _e('No Title', 'jquery-collapse-o-matic'); ?>
621
+ <br /><span class="description"><?php _e('Do not use title tags by default.', 'jquery-collapse-o-matic'); ?></span></label>
622
+ </td>
623
+ </tr>
624
+
625
  <tr>
626
  <th><?php _e( 'Add touchstart', 'jquery-collapse-o-matic' ) ?>:</th>
627
  <td><label><input type="checkbox" id="<?php echo $this->options_name ?>[touch_start]" name="<?php echo $this->options_name ?>[touch_start]" value="1" <?php echo checked( $options['touch_start'], 1 ); ?> /> <?php _e('Add touchstart', 'jquery-collapse-o-matic'); ?>
js/collapse.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Collapse-O-Matic JavaSctipt v1.6.14
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2018, Twinpictures
@@ -330,11 +330,11 @@ function colomat_collapseall(loop_items){
330
  jQuery(document).ready(function() {
331
  //console.log(colomatduration, colomatslideEffect, colomatpauseInit);
332
  com_binding = 'click';
333
- if(colomattouchstart){
334
  com_binding = 'click touchstart';
335
  }
336
 
337
- if(colomatpauseInit){
338
  init_pause = setTimeout(collapse_init, colomatpauseInit);
339
  }
340
  else{
@@ -379,7 +379,7 @@ jQuery(document).ready(function() {
379
  });
380
 
381
  //the main collapse/expand function
382
- jQuery(document).on(com_binding, '.collapseomatic', function(event) {
383
  var offset_top;
384
 
385
  //alert('phones ringin dude');
@@ -534,7 +534,9 @@ jQuery(document).ready(function() {
534
 
535
  //handle new page loads with anchor
536
  var fullurl = document.location.toString();
537
- hashmaster(fullurl);
 
 
538
 
539
  //handle no-link triggers within the same page
540
  jQuery(document).on('click', 'a.colomat-nolink', function(event) {
@@ -544,7 +546,9 @@ jQuery(document).ready(function() {
544
  //manual hashtag changes in url
545
  jQuery(window).on('hashchange', function (e) {
546
  fullurl = document.location.toString();
547
- hashmaster(fullurl);
 
 
548
  });
549
 
550
  //master url hash funciton
1
  /*!
2
+ * Collapse-O-Matic JavaSctipt v1.6.17
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2018, Twinpictures
330
  jQuery(document).ready(function() {
331
  //console.log(colomatduration, colomatslideEffect, colomatpauseInit);
332
  com_binding = 'click';
333
+ if (typeof colomattouchstart !== 'undefined' && colomattouchstart) {
334
  com_binding = 'click touchstart';
335
  }
336
 
337
+ if (typeof colomatpauseInit !== 'undefined' && colomatpauseInit) {
338
  init_pause = setTimeout(collapse_init, colomatpauseInit);
339
  }
340
  else{
379
  });
380
 
381
  //the main collapse/expand function
382
+ jQuery(document.body).on(com_binding, '.collapseomatic', function(event) {
383
  var offset_top;
384
 
385
  //alert('phones ringin dude');
534
 
535
  //handle new page loads with anchor
536
  var fullurl = document.location.toString();
537
+ if (fullurl.match('#(?!\!)')) {
538
+ hashmaster(fullurl);
539
+ }
540
 
541
  //handle no-link triggers within the same page
542
  jQuery(document).on('click', 'a.colomat-nolink', function(event) {
546
  //manual hashtag changes in url
547
  jQuery(window).on('hashchange', function (e) {
548
  fullurl = document.location.toString();
549
+ if (fullurl.match('#(?!\!)')) {
550
+ hashmaster(fullurl);
551
+ }
552
  });
553
 
554
  //master url hash funciton
readme.txt CHANGED
@@ -4,8 +4,9 @@ Contributors: twinpictures, baden03
4
  Donate link: https://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, read me, read more, more, plugin oven
6
  Requires at least: 4.7
7
- Tested up to: 4.9.4
8
- Stable tag: 1.7.9
 
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -50,6 +51,12 @@ No. Not even close.
50
 
51
  == Changelog ==
52
 
 
 
 
 
 
 
53
  = 1.7.9 =
54
  * jQuery selector for expandanchor no longer needed.
55
  * jQuery selectors look for exact match for targets, preventing multiple targets expanding if the id’s end the same.
@@ -361,6 +368,7 @@ Fixed auto-expand of urls with id-anchors
361
  * The plug-in came to be.
362
 
363
  == Upgrade Notice ==
364
- * jQuery selector for expandanchor expanded to include any element, not just a tags.
365
- * jQuery selectors look for exact match for targets, preventing multiple targets expanding if the id’s end the same.
366
- * alt tag not used unless alt value is provided
 
4
  Donate link: https://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, read me, read more, more, plugin oven
6
  Requires at least: 4.7
7
+ Tested up to: 5.1
8
+ Stable tag: 1.7.10
9
+ Requires PHP: 7.0
10
  License: GPLv2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
 
51
 
52
  == Changelog ==
53
 
54
+ = 1.7.10 =
55
+ * target the document.body
56
+ * improved random id generation when no id is assigned
57
+ * added colomat shortcode as an alias for expand
58
+ * added notitle to options page
59
+
60
  = 1.7.9 =
61
  * jQuery selector for expandanchor no longer needed.
62
  * jQuery selectors look for exact match for targets, preventing multiple targets expanding if the id’s end the same.
368
  * The plug-in came to be.
369
 
370
  == Upgrade Notice ==
371
+ * target the document.body
372
+ * improved random id generation when no id is assigned
373
+ * added colomat shortcode as an alias for expand
374
+ * added notitle to options page