Collapse-O-Matic - Version 1.7.8

Version Description

  • touchstart binding now an option
Download this release

Release Info

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

Code changes from version 1.7.7 to 1.7.8

Files changed (3) hide show
  1. collapse-o-matic.php +12 -3
  2. js/collapse.js +11 -6
  3. readme.txt +6 -9
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.7
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.7';
33
 
34
  /**
35
  * Used as prefix for options entry
@@ -66,6 +66,7 @@ class WP_Collapse_O_Matic {
66
  'pauseinit' => '',
67
  'cc_display_id' => '',
68
  'cc_display_title' => '',
 
69
  );
70
 
71
  var $license_group = 'colomat_licenseing';
@@ -117,6 +118,7 @@ class WP_Collapse_O_Matic {
117
  echo "var colomatduration = '".$this->options['duration']."';\n";
118
  echo "var colomatslideEffect = '".$this->options['slideEffect']."';\n";
119
  echo "var colomatpauseInit = '".$this->options['pauseinit']."';\n";
 
120
  echo "</script>";
121
  if( !empty( $this->options['custom_css'] ) ){
122
  echo "\n<style>\n";
@@ -134,7 +136,7 @@ class WP_Collapse_O_Matic {
134
  if($this->options['script_location'] == 'footer' ){
135
  $load_in_footer = true;
136
  }
137
- wp_register_script('collapseomatic-js', plugins_url('js/collapse.js', __FILE__), array('jquery'), '1.6.9', $load_in_footer);
138
  if( empty($this->options['script_check']) ){
139
  wp_enqueue_script('collapseomatic-js');
140
  }
@@ -607,6 +609,13 @@ class WP_Collapse_O_Matic {
607
  </td>
608
  </tr>
609
 
 
 
 
 
 
 
 
610
  <tr>
611
  <th><?php _e( 'Initial Pause', 'jquery-collapse-o-matic' ) ?>:</th>
612
  <td><label><input type="number" id="<?php echo $this->options_name ?>[pauseinit]" name="<?php echo $this->options_name ?>[pauseinit]" value="<?php echo $options['pauseinit']; ?>" />
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.8
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.8';
33
 
34
  /**
35
  * Used as prefix for options entry
66
  'pauseinit' => '',
67
  'cc_display_id' => '',
68
  'cc_display_title' => '',
69
+ 'touch_start' => '',
70
  );
71
 
72
  var $license_group = 'colomat_licenseing';
118
  echo "var colomatduration = '".$this->options['duration']."';\n";
119
  echo "var colomatslideEffect = '".$this->options['slideEffect']."';\n";
120
  echo "var colomatpauseInit = '".$this->options['pauseinit']."';\n";
121
+ echo "var colomattouchstart = '".$this->options['touch_start']."';\n";
122
  echo "</script>";
123
  if( !empty( $this->options['custom_css'] ) ){
124
  echo "\n<style>\n";
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.10', $load_in_footer);
140
  if( empty($this->options['script_check']) ){
141
  wp_enqueue_script('collapseomatic-js');
142
  }
609
  </td>
610
  </tr>
611
 
612
+ <tr>
613
+ <th><?php _e( 'Add touchstart', 'jquery-collapse-o-matic' ) ?>:</th>
614
+ <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'); ?>
615
+ <br /><span class="description"><?php _e('Add jQuery touchstart binding to triggers.', 'jquery-collapse-o-matic'); ?></span></label>
616
+ </td>
617
+ </tr>
618
+
619
  <tr>
620
  <th><?php _e( 'Initial Pause', 'jquery-collapse-o-matic' ) ?>:</th>
621
  <td><label><input type="number" id="<?php echo $this->options_name ?>[pauseinit]" name="<?php echo $this->options_name ?>[pauseinit]" value="<?php echo $options['pauseinit']; ?>" />
js/collapse.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * Collapse-O-Matic JavaSctipt v1.6.9
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2017, Twinpictures
@@ -328,6 +328,11 @@ function colomat_collapseall(loop_items){
328
 
329
  jQuery(document).ready(function() {
330
  //console.log(colomatduration, colomatslideEffect, colomatpauseInit);
 
 
 
 
 
331
  if(colomatpauseInit){
332
  init_pause = setTimeout(collapse_init, colomatpauseInit);
333
  }
@@ -383,7 +388,7 @@ jQuery(document).ready(function() {
383
  });
384
 
385
  //the main collapse/expand function
386
- jQuery(document).on('click touchstart', '.collapseomatic', function(event) {
387
  var offset_top;
388
 
389
  //alert('phones ringin dude');
@@ -504,7 +509,7 @@ jQuery(document).ready(function() {
504
  });
505
 
506
 
507
- jQuery(document).on('click touchstart', '.expandall', function(event) {
508
  if(jQuery(this).attr('rel') !== undefined){
509
  var rel = jQuery(this).attr('rel');
510
  var loop_items = jQuery('.collapseomatic:not(.colomat-close)[rel="' + rel +'"]');
@@ -520,7 +525,7 @@ jQuery(document).ready(function() {
520
  colomat_expandall(loop_items);
521
  });
522
 
523
- jQuery(document).on('click touchstart', '.collapseall', function(event) {
524
  if(jQuery(this).attr('rel') !== undefined){
525
  var rel = jQuery(this).attr('rel');
526
  var loop_items = jQuery('.collapseomatic.colomat-close[rel="' + rel +'"]');
@@ -575,7 +580,7 @@ jQuery(document).ready(function() {
575
  }
576
 
577
  //handle anchor links within the same page
578
- jQuery(document).on('click touchstart', 'a.expandanchor', function(event) {
579
  //event.preventDefault();
580
  var fullurl = jQuery(this).attr('href');
581
  // the URL contains an anchor but not a hash-bang
@@ -609,7 +614,7 @@ jQuery(document).ready(function() {
609
  }
610
  });
611
 
612
- jQuery(document).on('click touchstart', 'a.colomat-nolink', function(event) {
613
  event.preventDefault();
614
  });
615
  });
1
  /*!
2
+ * Collapse-O-Matic JavaSctipt v1.6.10
3
  * http://plugins.twinpictures.de/plugins/collapse-o-matic/
4
  *
5
  * Copyright 2017, Twinpictures
328
 
329
  jQuery(document).ready(function() {
330
  //console.log(colomatduration, colomatslideEffect, colomatpauseInit);
331
+ com_binding = 'click';
332
+ if(colomattouchstart){
333
+ com_binding = 'click touchstart';
334
+ }
335
+
336
  if(colomatpauseInit){
337
  init_pause = setTimeout(collapse_init, colomatpauseInit);
338
  }
388
  });
389
 
390
  //the main collapse/expand function
391
+ jQuery(document).on(com_binding, '.collapseomatic', function(event) {
392
  var offset_top;
393
 
394
  //alert('phones ringin dude');
509
  });
510
 
511
 
512
+ jQuery(document).on(com_binding, '.expandall', function(event) {
513
  if(jQuery(this).attr('rel') !== undefined){
514
  var rel = jQuery(this).attr('rel');
515
  var loop_items = jQuery('.collapseomatic:not(.colomat-close)[rel="' + rel +'"]');
525
  colomat_expandall(loop_items);
526
  });
527
 
528
+ jQuery(document).on(com_binding, '.collapseall', function(event) {
529
  if(jQuery(this).attr('rel') !== undefined){
530
  var rel = jQuery(this).attr('rel');
531
  var loop_items = jQuery('.collapseomatic.colomat-close[rel="' + rel +'"]');
580
  }
581
 
582
  //handle anchor links within the same page
583
+ jQuery(document).on(com_binding, 'a.expandanchor', function(event) {
584
  //event.preventDefault();
585
  var fullurl = jQuery(this).attr('href');
586
  // the URL contains an anchor but not a hash-bang
614
  }
615
  });
616
 
617
+ jQuery(document).on(com_binding, 'a.colomat-nolink', function(event) {
618
  event.preventDefault();
619
  });
620
  });
readme.txt CHANGED
@@ -4,8 +4,8 @@ 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.5
7
- Tested up to: 4.9.0
8
- Stable tag: 1.7.7
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -50,6 +50,9 @@ No. Not even close.
50
 
51
  == Changelog ==
52
 
 
 
 
53
  = 1.7.7 =
54
  * added check for a callback function: colomat_callback on any expand element state change
55
  * added Initial Pause option to pause initial collapse of expand elements on page load
@@ -352,10 +355,4 @@ Fixed auto-expand of urls with id-anchors
352
  * The plug-in came to be.
353
 
354
  == Upgrade Notice ==
355
- * added check for a callback function: colomat_callback on any expand element state change
356
- * added Initial Pause option to pause initial collapse of expand elements on page load
357
- * tabindex allows for a value of 0
358
- * if cid is provided and no cid exists, shortcode will return blank
359
- * added collapse-commander display id and title options for shortcodes
360
- * merged is_valid_jquery_selector function from csummer on github
361
- * fully tested with WordPress 4.9.0
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.5
7
+ Tested up to: 4.9.1
8
+ Stable tag: 1.7.8
9
  License: GPLv2 or later
10
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
11
 
50
 
51
  == Changelog ==
52
 
53
+ = 1.7.8 =
54
+ * touchstart binding now an option
55
+
56
  = 1.7.7 =
57
  * added check for a callback function: colomat_callback on any expand element state change
58
  * added Initial Pause option to pause initial collapse of expand elements on page load
355
  * The plug-in came to be.
356
 
357
  == Upgrade Notice ==
358
+ * touchstart binding now an option