diff --git a/README.md b/README.md index 3ba18d2..8c14e9d 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/collapse-o-matic.php b/collapse-o-matic.php index 433d6a0..407de09 100755 --- a/collapse-o-matic.php +++ b/collapse-o-matic.php @@ -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 @@ -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 @@ -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' ); } } @@ -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( diff --git a/css/core_style.css b/css/core_style.css new file mode 100644 index 0000000..ae034c0 --- /dev/null +++ b/css/core_style.css @@ -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; +} diff --git a/css/dark_style.css b/css/dark_style.css index d0c4351..f2c6b75 100755 --- a/css/dark_style.css +++ b/css/dark_style.css @@ -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; @@ -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; @@ -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; diff --git a/css/light_style.css b/css/light_style.css index 8c76451..ae671e2 100755 --- a/css/light_style.css +++ b/css/light_style.css @@ -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; @@ -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; @@ -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; diff --git a/readme.txt b/readme.txt index de1e47a..ff42965 100644 --- a/readme.txt +++ b/readme.txt @@ -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 @@ -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 @@ -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 \ No newline at end of file +* 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 \ No newline at end of file