Version Description
- Plugin now degrades gracefully if JS is disabled. Added swaptitle attribute to change the title on expand/collapse.
Download this release
Release Info
Developer | baden03 |
Plugin | Collapse-O-Matic |
Version | 1.3.6 |
Comparing to | |
See all releases |
Code changes from version 1.3.5 to 1.3.6
- collapse-o-matic.php +7 -9
- collapse.js +23 -11
- readme.txt +7 -1
- style.css +2 -2
collapse-o-matic.php
CHANGED
@@ -3,7 +3,7 @@
|
|
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.
|
7 |
Author: Twinpictures
|
8 |
Author URI: http://www.twinpictures.de
|
9 |
License: GPL2
|
@@ -30,11 +30,11 @@ wp_enqueue_script('jquery');
|
|
30 |
$plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
|
31 |
if (!is_admin()){
|
32 |
//collapse script
|
33 |
-
wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.2.
|
34 |
wp_enqueue_script('collapseomatic-js');
|
35 |
|
36 |
//css
|
37 |
-
wp_register_style( 'collapseomatic-css', $plugin_url.'/style.css', array (), '1.
|
38 |
wp_enqueue_style( 'collapseomatic-css' );
|
39 |
}
|
40 |
|
@@ -45,6 +45,7 @@ function collapsTronic($atts, $content=null){
|
|
45 |
|
46 |
extract(shortcode_atts(array(
|
47 |
'title' => '',
|
|
|
48 |
'alt' => '',
|
49 |
'id' => 'id'.$ran,
|
50 |
'tag' => 'span',
|
@@ -58,25 +59,22 @@ function collapsTronic($atts, $content=null){
|
|
58 |
if($alt){
|
59 |
$altatt = 'alt="'.$alt.'"';
|
60 |
}
|
61 |
-
|
62 |
$relatt = '';
|
63 |
if($rel){
|
64 |
$relatt = 'rel="'.$rel.'"';
|
65 |
}
|
66 |
-
$hstyle = 'style="display:none;"';
|
67 |
if($expanded){
|
68 |
$trigclass .= ' close';
|
69 |
-
$hstyle = '';
|
70 |
}
|
71 |
$link = '<'.$tag.' class="collapseomatic '.$trigclass.'" title="';
|
72 |
-
if($
|
73 |
-
$link .= $
|
74 |
}
|
75 |
else{
|
76 |
$link .= $title;
|
77 |
}
|
78 |
$link .= '" id="'.$id.'" '.$relatt.' '.$altatt.'>'.$title.'</'.$tag.'>';
|
79 |
-
$eDiv = '<div id="target-'.$id.'"
|
80 |
return $link . $eDiv;
|
81 |
}
|
82 |
|
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.6
|
7 |
Author: Twinpictures
|
8 |
Author URI: http://www.twinpictures.de
|
9 |
License: GPL2
|
30 |
$plugin_url = trailingslashit( get_bloginfo('wpurl') ).PLUGINDIR.'/'. dirname( plugin_basename(__FILE__) );
|
31 |
if (!is_admin()){
|
32 |
//collapse script
|
33 |
+
wp_register_script('collapseomatic-js', $plugin_url.'/collapse.js', array ('jquery'), '1.2.2' );
|
34 |
wp_enqueue_script('collapseomatic-js');
|
35 |
|
36 |
//css
|
37 |
+
wp_register_style( 'collapseomatic-css', $plugin_url.'/style.css', array (), '1.2' );
|
38 |
wp_enqueue_style( 'collapseomatic-css' );
|
39 |
}
|
40 |
|
45 |
|
46 |
extract(shortcode_atts(array(
|
47 |
'title' => '',
|
48 |
+
'swaptitle' => '',
|
49 |
'alt' => '',
|
50 |
'id' => 'id'.$ran,
|
51 |
'tag' => 'span',
|
59 |
if($alt){
|
60 |
$altatt = 'alt="'.$alt.'"';
|
61 |
}
|
|
|
62 |
$relatt = '';
|
63 |
if($rel){
|
64 |
$relatt = 'rel="'.$rel.'"';
|
65 |
}
|
|
|
66 |
if($expanded){
|
67 |
$trigclass .= ' close';
|
|
|
68 |
}
|
69 |
$link = '<'.$tag.' class="collapseomatic '.$trigclass.'" title="';
|
70 |
+
if($swaptitle){
|
71 |
+
$link .= $swaptitle;
|
72 |
}
|
73 |
else{
|
74 |
$link .= $title;
|
75 |
}
|
76 |
$link .= '" id="'.$id.'" '.$relatt.' '.$altatt.'>'.$title.'</'.$tag.'>';
|
77 |
+
$eDiv = '<div id="target-'.$id.'" class="collapseomatic_content '.$targclass.'">'.do_shortcode($content).'</div>';
|
78 |
return $link . $eDiv;
|
79 |
}
|
80 |
|
collapse.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
/*!
|
2 |
-
* jQuery Collapse-O-Matic v1.2.
|
3 |
* http://www.twinpictures.de/collapse-o-matic/
|
4 |
*
|
5 |
* Copyright 2011, Twinpictures
|
@@ -25,6 +25,13 @@
|
|
25 |
*/
|
26 |
|
27 |
jQuery(document).ready(function() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
jQuery('.collapseomatic').hover(function () {
|
29 |
jQuery(this).addClass("hover");
|
30 |
},
|
@@ -34,12 +41,19 @@ jQuery(document).ready(function() {
|
|
34 |
);
|
35 |
|
36 |
jQuery('.collapseomatic').click(function() {
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43 |
|
44 |
//deal with grouped items if needed
|
45 |
if(jQuery(this).attr('rel') !== undefined){
|
@@ -49,11 +63,9 @@ jQuery(document).ready(function() {
|
|
49 |
}
|
50 |
else{
|
51 |
closeOtherGroups(rel);
|
52 |
-
}
|
53 |
-
|
54 |
}
|
55 |
-
|
56 |
-
});
|
57 |
|
58 |
function closeOtherGroups(rel){
|
59 |
jQuery('.collapseomatic[rel!="' + rel +'"]').each(function(index) {
|
1 |
/*!
|
2 |
+
* jQuery Collapse-O-Matic v1.2.2
|
3 |
* http://www.twinpictures.de/collapse-o-matic/
|
4 |
*
|
5 |
* Copyright 2011, Twinpictures
|
25 |
*/
|
26 |
|
27 |
jQuery(document).ready(function() {
|
28 |
+
|
29 |
+
//inital collapse
|
30 |
+
jQuery('.collapseomatic:not(.close)').each(function(index) {
|
31 |
+
var thisid = jQuery(this).attr('id');
|
32 |
+
jQuery('#target-'+thisid).css('display', 'none');
|
33 |
+
});
|
34 |
+
|
35 |
jQuery('.collapseomatic').hover(function () {
|
36 |
jQuery(this).addClass("hover");
|
37 |
},
|
41 |
);
|
42 |
|
43 |
jQuery('.collapseomatic').click(function() {
|
44 |
+
//alert('phones ringin dude');
|
45 |
+
jQuery(this).toggleClass('close');
|
46 |
+
//check if the title needs to be swapped out
|
47 |
+
var title = jQuery(this).attr('title');
|
48 |
+
var htmlstr = jQuery(this).html();
|
49 |
+
if(title != htmlstr){
|
50 |
+
jQuery(this).attr('title', htmlstr);
|
51 |
+
jQuery(this).html(title);
|
52 |
+
}
|
53 |
+
var id = jQuery(this).attr('id');
|
54 |
+
jQuery('#target-'+id).slideToggle('fast', function() {
|
55 |
+
// Animation complete.
|
56 |
+
});
|
57 |
|
58 |
//deal with grouped items if needed
|
59 |
if(jQuery(this).attr('rel') !== undefined){
|
63 |
}
|
64 |
else{
|
65 |
closeOtherGroups(rel);
|
66 |
+
}
|
|
|
67 |
}
|
68 |
+
});
|
|
|
69 |
|
70 |
function closeOtherGroups(rel){
|
71 |
jQuery('.collapseomatic[rel!="' + rel +'"]').each(function(index) {
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ 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.1
|
8 |
-
Stable tag: 1.3.
|
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 |
|
@@ -44,6 +44,9 @@ No. Not even close.
|
|
44 |
|
45 |
== Changelog ==
|
46 |
|
|
|
|
|
|
|
47 |
= 1.3.5 =
|
48 |
* Random ID's now start with letters, for valid xhtml.
|
49 |
|
@@ -82,6 +85,9 @@ No. Not even close.
|
|
82 |
|
83 |
== Upgrade Notice ==
|
84 |
|
|
|
|
|
|
|
85 |
= 1.3.5 =
|
86 |
Random ID's are now valid xhtml.
|
87 |
|
5 |
Tags: collapse, expand, collapsible, expandable, content, shortcode, hidden, jQuery, javascript, twinpictures
|
6 |
Requires at least: 2.8
|
7 |
Tested up to: 3.1
|
8 |
+
Stable tag: 1.3.6
|
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 |
|
44 |
|
45 |
== Changelog ==
|
46 |
|
47 |
+
= 1.3.6 =
|
48 |
+
* Plugin now degrades gracefully if JS is disabled. Added swaptitle attribute to change the title on expand/collapse.
|
49 |
+
|
50 |
= 1.3.5 =
|
51 |
* Random ID's now start with letters, for valid xhtml.
|
52 |
|
85 |
|
86 |
== Upgrade Notice ==
|
87 |
|
88 |
+
= 1.3.6 =
|
89 |
+
Plugin degrades gracefully when JS is disabled. Title can now have expand/collapse states using swaptitle attribute.
|
90 |
+
|
91 |
= 1.3.5 =
|
92 |
Random ID's are now valid xhtml.
|
93 |
|
style.css
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
background-image: url(images/arrow-up.png) !important;
|
16 |
}
|
17 |
.collapseomatic_content {
|
18 |
-
margin-top:
|
19 |
margin-left: 16px;
|
20 |
-
padding
|
21 |
}
|
15 |
background-image: url(images/arrow-up.png) !important;
|
16 |
}
|
17 |
.collapseomatic_content {
|
18 |
+
margin-top: 0px;
|
19 |
margin-left: 16px;
|
20 |
+
padding: 0px;
|
21 |
}
|