Skip to content

Commit

Permalink
version 1.8.2
Browse files Browse the repository at this point in the history
fixed issue with custom css not loading when style is set to none
  • Loading branch information
baden03 committed Nov 14, 2021
1 parent 105a81c commit 86fc35a
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 41 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Donate link: https://plugins.twinpictures.de/plugins/collapse-o-matic/
* 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
* Requires at least: 4.9
* Tested up to: 5.8.1
* Stable tag: 1.8.1
* Tested up to: 5.8.2
* Stable tag: 1.8.2
* Requires PHP: 7.2
* License: GPLv2 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down
28 changes: 18 additions & 10 deletions collapse-o-matic.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Text Domain: jquery-collapse-o-matic
Plugin URI: https://pluginoven.com/plugins/collapse-o-matic/
Description: Collapse-O-Matic adds an [expand] shortcode that wraps content into a lovely, jQuery collapsible div.
Version: 1.8.1
Version: 1.8.2
Author: twinpictures, baden03
Author URI: https://twinpictures.de/
License: GPL2
Expand All @@ -29,7 +29,7 @@ class WP_Collapse_O_Matic {
* Current version
* @var string
*/
var $version = '1.8.1';
var $version = '1.8.2';

/**
* Used as prefix for options entry
Expand Down Expand Up @@ -134,12 +134,15 @@ function collapsTronicInit() {
}

//css
if ($this->options['style'] !== 'none') {
wp_register_style( 'collapseomatic-css', plugins_url('css/'.$this->options['style'].'_style.css', __FILE__) , array (), '1.6' );
if( !empty( $this->options['custom_css'] ) ){
wp_add_inline_style( 'collapseomatic-css', $this->options['custom_css'] );
}
if( empty($this->options['css_check']) ){
wp_register_style( 'collapscore-css', plugins_url('css/core_style.css', __FILE__) , array (), '1.0' );
wp_register_style( 'collapseomatic-css', plugins_url('css/'.$this->options['style'].'_style.css', __FILE__) , array (), '1.6' );
if( !empty( $this->options['custom_css'] ) ){
wp_add_inline_style( 'collapscore-css', $this->options['custom_css'] );
}

if( empty($this->options['css_check'])){
wp_enqueue_style( 'collapscore-css' );
if ($this->options['style'] !== 'none') {
wp_enqueue_style( 'collapseomatic-css' );
}
}
Expand Down Expand Up @@ -193,9 +196,14 @@ function shortcode($atts, $content = null){
if( !empty($this->options['script_check']) ){
wp_enqueue_script('collapseomatic-js');
}
if( !empty($this->options['css_check']) ){
wp_enqueue_style( 'collapseomatic-css' );

if( !empty($this->options['css_check'])){
wp_enqueue_style( 'collapscore-css' );
if ($this->options['style'] !== 'none') {
wp_enqueue_style( 'collapseomatic-css' );
}
}

//find a random number, if no id is assigned
$ran = uniqid();
extract(shortcode_atts(array(
Expand Down
19 changes: 19 additions & 0 deletions css/core_style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
.collapseomatic, .colomat_trigger, .collapseall, .expandall, .setall {
cursor: pointer;
}
.colomat-swap {
display: none;
}
.maptastic {
position: absolute !important;
left: -10000px !important;
display:block !important;
max-width: 9999px;
}
.com_edit_link {
margin: 0;
padding: 0;
font-size: 1.2rem;
width: 100%;
text-align: right;
}
13 changes: 0 additions & 13 deletions css/dark_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
background-image: url(images/arrow-down-dark.png);
background-repeat: no-repeat;
padding: 0 0 10px 16px;
cursor: pointer;
}
.collapseomatic:focus {
outline: 0;
Expand All @@ -21,9 +20,6 @@
.colomat-close {
background-image: url(images/arrow-up-dark.png);
}
.colomat-swap {
display: none;
}
.collapseomatic_excerpt, .collapseomatic_content {
margin-top: 0px;
margin-left: 16px;
Expand All @@ -32,18 +28,9 @@
.content_collapse_wrapper {
position: absolute; left: -999em;
}
.collapseall, .expandall {
cursor: pointer;
}
.collapseall:hover, .expandall:hover, .collapseall:focus, .expandall:focus {
text-decoration: underline;
}
.maptastic {
position: absolute !important;
left: -10000px !important;
display:block !important;
max-width: 9999px;
}
.span_fix {
padding: 0 !important;
margin: 0 !important;
Expand Down
13 changes: 0 additions & 13 deletions css/light_style.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
background-image: url('images/arrow-down.png');
background-repeat: no-repeat;
padding: 0 0 10px 16px;
cursor: pointer;
}
.collapseomatic:focus {
outline: 0;
Expand All @@ -21,9 +20,6 @@
.colomat-close {
background-image: url('images/arrow-up.png');
}
.colomat-swap {
display: none;
}
.collapseomatic_excerpt, .collapseomatic_content {
margin-top: 0px;
margin-left: 16px;
Expand All @@ -32,18 +28,9 @@
.content_collapse_wrapper {
position: absolute; left: -999em;
}
.collapseall, .expandall {
cursor: pointer;
}
.collapseall:hover, .expandall:hover, .collapseall:focus, .expandall:focus {
text-decoration: underline;
}
.maptastic {
position: absolute !important;
left: -10000px !important;
display:block !important;
max-width: 9999px;
}
.span_fix {
padding: 0 !important;
margin: 0 !important;
Expand Down
11 changes: 8 additions & 3 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Contributors: twinpictures, baden03
Donate link: https://plugins.twinpictures.de/plugins/collapse-o-matic/
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
Requires at least: 4.9
Tested up to: 5.8.1
Stable tag: 1.8.1
Tested up to: 5.8.2
Stable tag: 1.8.2
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -51,6 +51,10 @@ No. Not even close.

== Changelog ==

= 1.8.2 =
* custom css now added to new core.css file that is not affected if no default style is loaded.
* fully tested with WordPress version 5.8.2

= 1.8.1 =
* options passed using the preferred wp_add_inline_script

Expand Down Expand Up @@ -399,4 +403,5 @@ Fixed auto-expand of urls with id-anchors
* The plug-in came to be.

== Upgrade Notice ==
* options passed using the preferred wp_add_inline_script
* custom css now added to new core.css file that is not affected if no default style is loaded.
* fully tested with WordPress version 5.8.2

0 comments on commit 86fc35a

Please sign in to comment.