Version Description
- added swaptitle capability to extra triggers
- fully tested with WordPress 5.2.1
Download this release
Release Info
Developer | baden03 |
Plugin | Collapse-O-Matic |
Version | 1.7.11 |
Comparing to | |
See all releases |
Code changes from version 1.7.10 to 1.7.11
- collapse-o-matic.php +4 -4
- js/collapse.js +69 -2
- readme.txt +15 -13
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.
|
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.
|
33 |
|
34 |
/**
|
35 |
* Used as prefix for options entry
|
@@ -138,7 +138,7 @@ class WP_Collapse_O_Matic {
|
|
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.
|
142 |
if( empty($this->options['script_check']) ){
|
143 |
wp_enqueue_script('collapseomatic-js');
|
144 |
}
|
@@ -393,7 +393,7 @@ class WP_Collapse_O_Matic {
|
|
393 |
if(!empty($tabindex) || $tabindex == 0 ){
|
394 |
$inexatt = 'tabindex="'.$tabindex.'"';
|
395 |
}
|
396 |
-
if($expanded){
|
397 |
$trigclass .= ' colomat-close';
|
398 |
}
|
399 |
$anchor = '';
|
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.11
|
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.11';
|
33 |
|
34 |
/**
|
35 |
* Used as prefix for options entry
|
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.18', $load_in_footer);
|
142 |
if( empty($this->options['script_check']) ){
|
143 |
wp_enqueue_script('collapseomatic-js');
|
144 |
}
|
393 |
if(!empty($tabindex) || $tabindex == 0 ){
|
394 |
$inexatt = 'tabindex="'.$tabindex.'"';
|
395 |
}
|
396 |
+
if($expanded && $expanded != 'false'){
|
397 |
$trigclass .= ' colomat-close';
|
398 |
}
|
399 |
$anchor = '';
|
js/collapse.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
/*!
|
2 |
-
* Collapse-O-Matic JavaSctipt v1.6.
|
3 |
* http://plugins.twinpictures.de/plugins/collapse-o-matic/
|
4 |
*
|
5 |
-
* Copyright
|
6 |
*
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 |
* of this software and associated documentation files (the "Software"), to deal
|
@@ -44,6 +44,14 @@ function collapse_init() {
|
|
44 |
if(jQuery("#swapexcerpt-"+thisid).length > 0){
|
45 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
46 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47 |
});
|
48 |
}
|
49 |
|
@@ -180,6 +188,16 @@ function closeOtherGroups(rel){
|
|
180 |
swapTitle("#exerpt-"+id, "#swapexcerpt-"+id);
|
181 |
}
|
182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
toggleState (jQuery(this), id, false, false);
|
184 |
|
185 |
//check if there are nested children that need to be collapsed
|
@@ -217,6 +235,16 @@ function closeOtherMembers(rel, id){
|
|
217 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
218 |
}
|
219 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
220 |
//check for snap-shut
|
221 |
if(!jQuery(this).hasClass('colomat-close') && jQuery(this).hasClass('snap-shut')){
|
222 |
jQuery('#target-'+thisid).hide();
|
@@ -271,6 +299,15 @@ function closeOtherMembers(rel, id){
|
|
271 |
if(jQuery("#swapexcerpt-"+thisid).length > 0){
|
272 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
273 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
274 |
jQuery('#target-'+thisid).css('display', 'none');
|
275 |
}
|
276 |
})
|
@@ -295,6 +332,16 @@ function colomat_expandall(loop_items){
|
|
295 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
296 |
}
|
297 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
298 |
toggleState(jQuery(this), thisid, false, false);
|
299 |
});
|
300 |
}
|
@@ -321,6 +368,16 @@ function colomat_collapseall(loop_items){
|
|
321 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
322 |
}
|
323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
324 |
toggleState(jQuery(this), thisid, false, false);
|
325 |
|
326 |
});
|
@@ -468,6 +525,16 @@ jQuery(document).ready(function() {
|
|
468 |
swapTitle("#excerpt-"+id, "#swapexcerpt-"+id);
|
469 |
}
|
470 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
471 |
//add visited class
|
472 |
jQuery(this).addClass('colomat-visited');
|
473 |
|
1 |
/*!
|
2 |
+
* Collapse-O-Matic JavaSctipt v1.6.18
|
3 |
* http://plugins.twinpictures.de/plugins/collapse-o-matic/
|
4 |
*
|
5 |
+
* Copyright 2019, Twinpictures
|
6 |
*
|
7 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 |
* of this software and associated documentation files (the "Software"), to deal
|
44 |
if(jQuery("#swapexcerpt-"+thisid).length > 0){
|
45 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
46 |
}
|
47 |
+
jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
|
48 |
+
if(jQuery(this).data('swaptitle')){
|
49 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
50 |
+
old_title = jQuery(this).html();
|
51 |
+
jQuery(this).html(old_swap_title);
|
52 |
+
jQuery(this).data('swaptitle', old_title);
|
53 |
+
}
|
54 |
+
});
|
55 |
});
|
56 |
}
|
57 |
|
188 |
swapTitle("#exerpt-"+id, "#swapexcerpt-"+id);
|
189 |
}
|
190 |
|
191 |
+
//external triggers
|
192 |
+
jQuery('[id^=extra][id$='+id+']').each( function( index ){
|
193 |
+
if(jQuery(this).data('swaptitle')){
|
194 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
195 |
+
old_title = jQuery(this).html();
|
196 |
+
jQuery(this).html(old_swap_title);
|
197 |
+
jQuery(this).data('swaptitle', old_title);
|
198 |
+
}
|
199 |
+
});
|
200 |
+
|
201 |
toggleState (jQuery(this), id, false, false);
|
202 |
|
203 |
//check if there are nested children that need to be collapsed
|
235 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
236 |
}
|
237 |
|
238 |
+
//external triggers
|
239 |
+
jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
|
240 |
+
if(jQuery(this).data('swaptitle')){
|
241 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
242 |
+
old_title = jQuery(this).html();
|
243 |
+
jQuery(this).html(old_swap_title);
|
244 |
+
jQuery(this).data('swaptitle', old_title);
|
245 |
+
}
|
246 |
+
});
|
247 |
+
|
248 |
//check for snap-shut
|
249 |
if(!jQuery(this).hasClass('colomat-close') && jQuery(this).hasClass('snap-shut')){
|
250 |
jQuery('#target-'+thisid).hide();
|
299 |
if(jQuery("#swapexcerpt-"+thisid).length > 0){
|
300 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
301 |
}
|
302 |
+
//external triggers
|
303 |
+
jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
|
304 |
+
if(jQuery(this).data('swaptitle')){
|
305 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
306 |
+
old_title = jQuery(this).html();
|
307 |
+
jQuery(this).html(old_swap_title);
|
308 |
+
jQuery(this).data('swaptitle', old_title);
|
309 |
+
}
|
310 |
+
});
|
311 |
jQuery('#target-'+thisid).css('display', 'none');
|
312 |
}
|
313 |
})
|
332 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
333 |
}
|
334 |
|
335 |
+
//external triggers
|
336 |
+
jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
|
337 |
+
if(jQuery(this).data('swaptitle')){
|
338 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
339 |
+
old_title = jQuery(this).html();
|
340 |
+
jQuery(this).html(old_swap_title);
|
341 |
+
jQuery(this).data('swaptitle', old_title);
|
342 |
+
}
|
343 |
+
});
|
344 |
+
|
345 |
toggleState(jQuery(this), thisid, false, false);
|
346 |
});
|
347 |
}
|
368 |
swapTitle("#excerpt-"+thisid, "#swapexcerpt-"+thisid);
|
369 |
}
|
370 |
|
371 |
+
//external triggers
|
372 |
+
jQuery('[id^=extra][id$='+thisid+']').each( function( index ){
|
373 |
+
if(jQuery(this).data('swaptitle')){
|
374 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
375 |
+
old_title = jQuery(this).html();
|
376 |
+
jQuery(this).html(old_swap_title);
|
377 |
+
jQuery(this).data('swaptitle', old_title);
|
378 |
+
}
|
379 |
+
});
|
380 |
+
|
381 |
toggleState(jQuery(this), thisid, false, false);
|
382 |
|
383 |
});
|
525 |
swapTitle("#excerpt-"+id, "#swapexcerpt-"+id);
|
526 |
}
|
527 |
|
528 |
+
//external triggers
|
529 |
+
jQuery('[id^=extra][id$='+id+']').each( function( index ){
|
530 |
+
if(jQuery(this).data('swaptitle')){
|
531 |
+
old_swap_title = jQuery(this).data('swaptitle');
|
532 |
+
old_title = jQuery(this).html();
|
533 |
+
jQuery(this).html(old_swap_title);
|
534 |
+
jQuery(this).data('swaptitle', old_title);
|
535 |
+
}
|
536 |
+
});
|
537 |
+
|
538 |
//add visited class
|
539 |
jQuery(this).addClass('colomat-visited');
|
540 |
|
readme.txt
CHANGED
@@ -2,15 +2,15 @@
|
|
2 |
|
3 |
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,
|
6 |
Requires at least: 4.7
|
7 |
-
Tested up to: 5.
|
8 |
-
Stable tag: 1.7.
|
9 |
Requires PHP: 7.0
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
13 |
-
Remove clutter, save space: display and hide additional content in a SEO friendly way by wrapping content in an [expand] shortcode.
|
14 |
|
15 |
== Description ==
|
16 |
|
@@ -51,6 +51,10 @@ No. Not even close.
|
|
51 |
|
52 |
== Changelog ==
|
53 |
|
|
|
|
|
|
|
|
|
54 |
= 1.7.10 =
|
55 |
* target the document.body
|
56 |
* improved random id generation when no id is assigned
|
@@ -71,7 +75,7 @@ No. Not even close.
|
|
71 |
* added Initial Pause option to pause initial collapse of expand elements on page load
|
72 |
* tabindex allows for a value of 0
|
73 |
* if cid is provided and no cid exists, shortcode will return blank
|
74 |
-
* added collapse-commander display id and title options for shortcodes
|
75 |
* merged is_valid_jquery_selector function from csummer on github
|
76 |
* added touchstart to click bindings
|
77 |
* fully tested with WordPress 4.9.0
|
@@ -113,7 +117,7 @@ No. Not even close.
|
|
113 |
|
114 |
= 1.6.14 =
|
115 |
* hash-bang (#!) that are used in urls will not be processed as url anchors
|
116 |
-
* now checks if a url anchor is actually an existing element before trying to process it
|
117 |
* changed language domain to jquery-collapse-o-matic to work with WordPress’ new translation process
|
118 |
* updated tested up to tag to 4.3.1
|
119 |
|
@@ -332,13 +336,13 @@ Fixed auto-expand of urls with id-anchors
|
|
332 |
* Plug-in now degrades gracefully if JS is disabled. Added swaptitle attribute to change the title on expand/collapse.
|
333 |
|
334 |
= 1.3.5 =
|
335 |
-
* Random ID's now start with letters, for valid xhtml.
|
336 |
|
337 |
= 1.3.4 =
|
338 |
-
* Changed '-member' to '-highlander' because it sounds better.
|
339 |
|
340 |
= 1.3.3 =
|
341 |
-
* Added the ability to have only one member of a group expanded by adding '-member' to the rel attribute value.
|
342 |
|
343 |
= 1.3.2 =
|
344 |
* Added Expanded attribute that sets the default position expanded open.
|
@@ -368,7 +372,5 @@ Fixed auto-expand of urls with id-anchors
|
|
368 |
* The plug-in came to be.
|
369 |
|
370 |
== Upgrade Notice ==
|
371 |
-
*
|
372 |
-
*
|
373 |
-
* added colomat shortcode as an alias for expand
|
374 |
-
* added notitle to options page
|
2 |
|
3 |
Contributors: twinpictures, baden03
|
4 |
Donate link: https://plugins.twinpictures.de/plugins/collapse-o-matic/
|
5 |
+
Tags: collapse, expand, read more, collapsible, expandable, expandable content, collapsable content, shortcode, hidden, hide, display, accordion, accordion, jQuery, javascript, roll-your-own, twinpictures, read me, more, plugin oven
|
6 |
Requires at least: 4.7
|
7 |
+
Tested up to: 5.2.2
|
8 |
+
Stable tag: 1.7.11
|
9 |
Requires PHP: 7.0
|
10 |
License: GPLv2 or later
|
11 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
13 |
+
Remove clutter, save space: display and hide additional read more content in a SEO friendly way by wrapping content in an [expand] shortcode.
|
14 |
|
15 |
== Description ==
|
16 |
|
51 |
|
52 |
== Changelog ==
|
53 |
|
54 |
+
= 1.7.11 =
|
55 |
+
* added swaptitle capability to extra triggers
|
56 |
+
* fully tested with WordPress 5.2.1
|
57 |
+
|
58 |
= 1.7.10 =
|
59 |
* target the document.body
|
60 |
* improved random id generation when no id is assigned
|
75 |
* added Initial Pause option to pause initial collapse of expand elements on page load
|
76 |
* tabindex allows for a value of 0
|
77 |
* if cid is provided and no cid exists, shortcode will return blank
|
78 |
+
* added collapse-commander display id and title options for shortcodes
|
79 |
* merged is_valid_jquery_selector function from csummer on github
|
80 |
* added touchstart to click bindings
|
81 |
* fully tested with WordPress 4.9.0
|
117 |
|
118 |
= 1.6.14 =
|
119 |
* hash-bang (#!) that are used in urls will not be processed as url anchors
|
120 |
+
* now checks if a url anchor is actually an existing element before trying to process it
|
121 |
* changed language domain to jquery-collapse-o-matic to work with WordPress’ new translation process
|
122 |
* updated tested up to tag to 4.3.1
|
123 |
|
336 |
* Plug-in now degrades gracefully if JS is disabled. Added swaptitle attribute to change the title on expand/collapse.
|
337 |
|
338 |
= 1.3.5 =
|
339 |
+
* Random ID's now start with letters, for valid xhtml.
|
340 |
|
341 |
= 1.3.4 =
|
342 |
+
* Changed '-member' to '-highlander' because it sounds better.
|
343 |
|
344 |
= 1.3.3 =
|
345 |
+
* Added the ability to have only one member of a group expanded by adding '-member' to the rel attribute value.
|
346 |
|
347 |
= 1.3.2 =
|
348 |
* Added Expanded attribute that sets the default position expanded open.
|
372 |
* The plug-in came to be.
|
373 |
|
374 |
== Upgrade Notice ==
|
375 |
+
* added swaptitle capability to extra triggers
|
376 |
+
* fully tested with WordPress 5.2
|
|
|
|