diff --git a/css/admin.css b/css/d12mb-admin.css old mode 100644 new mode 100755 similarity index 100% rename from css/admin.css rename to css/d12mb-admin.css diff --git a/css/d12mb-mobile.css b/css/d12mb-mobile.css new file mode 100755 index 0000000..1a44538 --- /dev/null +++ b/css/d12mb-mobile.css @@ -0,0 +1,4 @@ +.d12-block { + margin: 0.5rem 0; + width: 100%; +} diff --git a/css/style.css b/css/style.css new file mode 100755 index 0000000..0e9abac --- /dev/null +++ b/css/style.css @@ -0,0 +1,213 @@ +.d12-block { + margin: 10px auto; + width: 85%; + border: solid 2px #000; + border-radius: 4px; + padding: 10px 10px 10px 54px; + } +.d12-block p:first-child { + margin-top: 0px; + border-bottom: solid 1px #000; + padding-bottom: 5px; + margin-bottom: 5px; + font-size: 1.2em; + } +.d12-block ul { + margin-left: 14px !important; + } + +/* + Don't need this class right now, but let's save it. + We can use it in future updates. + Plugin adopters can also style this text using a child theme. +*/ +.d12-sc-text { + } + +/* Nutshell */ +.d12-nutshell { + border-color: #8C4815; + background: #FFEFCF url(../images/acorn.png) no-repeat 10px 10px; + } +.d12-nutshell p:first-child { + color: #8c4815; + border-color: #8C4815; + } + +/* Updates */ +.d12-update { + border-color: #4282B6; + background: #EFF6FA url(../images/update.png) no-repeat 10px 10px; + } +.d12-update p:first-child { + color: #4282B6; + border-color: #4282B6; + } + +/* Attachments */ +.d12-attach { + border-color: #404777; + background: #F6F7F8 url(../images/attach.png) no-repeat 10px 10px; + } +.d12-attach p:first-child { + color: #404777; + border-color: #404777; + } + +/* Deletion */ +.d12-delete { + border-color: #A60B05; + background: #FCEDEB url(../images/delete.png) no-repeat 10px 10px; + } +.d12-delete p:first-child { + color: #A60B05; + border-color: #A60B05; + } + +/* Part of a Series */ +.d12-part { + border-color: #333; + background: #eee url(../images/cog.png) no-repeat 10px 10px; + } +.d12-part p:first-child { + color: #333; + border-color: #333; + } + +/* Mentions */ +.d12-mention { + border-color: #0B5DA1; + background: #FFF5DB url(../images/mentions.png) no-repeat 10px 10px; + } +.d12-mention p:first-child { + color: #0B5DA1; + border-color: #0B5DA1; + } + +/* Warning */ +.d12-warning { + border-color: #D56D01; + background: #fafafa url(../images/warning.png) no-repeat 10px 10px; + } +.d12-warning p:first-child { + color: #D56D01; + border-color: #D56D01; + } + +/* Important */ +.d12-important { + border-color: #BF3829; + background: #FFF7F7 url(../images/important.png) no-repeat 10px 10px; + } +.d12-important p:first-child { + color: #BF3829; + border-color: #BF3829; + } + +/* Notice */ +.d12-notice { + border-color: #D56D01; + background: #fafafa url(../images/notice.png) no-repeat 10px 10px; + } +.d12-notice p:first-child { + color: #D56D01; + border-color: #D56D01; + } + +/* Error */ +.d12-error { + border-color: #C13A29; + background: #FFF5F5 url(../images/error.png) no-repeat 10px 10px; + } +.d12-error p:first-child { + color: #C13A29; + border-color: #C13A29; + } + +/* Caution */ +.d12-caution { + border-color: #D56D01; + background: #fafafa url(../images/caution.png) no-repeat 10px 10px; + } +.d12-caution p:first-child { + color: #D56D01; + border-color: #D56D01; + } + +/* Archive */ +.d12-archive { + border-color: #0B5DA1; + background: #eee url(../images/archive.png) no-repeat 10px 10px; + } +.d12-archive p:first-child { + color: #0B5DA1; + border-color: #0B5DA1; + } + +/* Support */ +.d12-support { + border-color: #CD0000; + background: #fff url(../images/support.png) no-repeat 10px 10px; + } +.d12-support p:first-child { + color: #CD0000; + border-color: #CD0000; + } + +/* Contact */ +.d12-contact { + border-color: #630; + background: #fff url(../images/contact.png) no-repeat 10px 10px; + } +.d12-contact p:first-child { + color: #630; + border-color: #630; + } + +/* Global */ +.d12-global { + border-color: #074; + background: #fff url(../images/global.png) no-repeat 10px 10px; + } +.d12-global p:first-child { + color: #074; + border-color: #074; + } + +/* Green */ +.d12-green { + border-color: #427D00; + background: #fff url(../images/green.png) no-repeat 10px 10px; + } +.d12-green p:first-child { + color: #427D00; + border-color: #427D00; + } + +/* Accept */ +.d12-accept { + border-color: #99C700; + background: #fff url(../images/okay.png) no-repeat 10px 10px; + } +.d12-accept p:first-child { + color: #427D00; + border-color: #99C700; + } + +/* Stats */ +.d12-stats { + border-color: #376EA3; + background: #fff url(../images/statistics.png) no-repeat 10px 10px; + } +.d12-stats p:first-child { + color: #376EA3; + border-color: #376EA3; + } + +@media screen and (max-width: 640px) { +.d12-block { + margin: 0.5rem 0; + width: 100%; + } + +} diff --git a/d12-message-blocks.php b/d12-message-blocks.php old mode 100644 new mode 100755 index 2fd5389..af8695b --- a/d12-message-blocks.php +++ b/d12-message-blocks.php @@ -3,7 +3,7 @@ * Plugin Name: d12 Message Blocks * Plugin URI: http://kjodle.net/wordpress/d12-message-blocks/ * Description: Adds shortcodes for message blocks. - * Version: 2.2 + * Version: 2.4 * Author: Kenneth John Odle * Author URI: http://kjodle.net/ * Text Domain: d12-message-blocks @@ -35,37 +35,37 @@ function d12bs_retrieve() { $mbbsoptions = get_option('d12mb_options'); switch($mbbsoptions['bs']) { case "1" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thin.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thin.css', __FILE__), false, '2.3' ); break; case "2" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thick.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thick.css', __FILE__), false, '2.3' ); break; case "3" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-double.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-double.css', __FILE__), false, '2.3' ); break; case "4" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-single-thin.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-single-thin.css', __FILE__), false, '2.3' ); break; case "5" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-single-thick.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-single-thick.css', __FILE__), false, '2.3' ); break; case "6" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-double.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-square-double.css', __FILE__), false, '2.3' ); break; case "7" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thick-thin.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thick-thin.css', __FILE__), false, '2.3' ); break; case "8" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thick-thick.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thick-thick.css', __FILE__), false, '2.3' ); break; case "9" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thin-thick.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thin-thick.css', __FILE__), false, '2.3' ); break; case "10" : - wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thin-thin.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-mw-thin-thin.css', __FILE__), false, '2.3' ); break; default: - wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thick.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12mb', plugins_url('css/bs-round-single-thick.css', __FILE__), false, '2.3' ); return; } } @@ -77,52 +77,59 @@ function d12cs_retrieve() { $mbcsoptions = get_option('d12mb_options'); switch($mbcsoptions['cs']) { case "1" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-default.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-default.css', __FILE__), false, '2.3' ); break; case "2" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-business.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-business.css', __FILE__), false, '2.3' ); break; case "3" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-beach.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-beach.css', __FILE__), false, '2.3' ); break; case "4" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-sol.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-sol.css', __FILE__), false, '2.3' ); break; case "5" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-aqua.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-aqua.css', __FILE__), false, '2.3' ); break; case "6" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-forest.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-forest.css', __FILE__), false, '2.3' ); break; case "7" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-winter.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-winter.css', __FILE__), false, '2.3' ); break; case "8" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-magique.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-magique.css', __FILE__), false, '2.3' ); break; case "9" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-solstice.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-solstice.css', __FILE__), false, '2.3' ); break; case "10" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-bark.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-bark.css', __FILE__), false, '2.3' ); break; case "11" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-leaves.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-leaves.css', __FILE__), false, '2.3' ); break; case "12" : - wp_enqueue_style( 'd12cs', plugins_url('css/cs-bw.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-bw.css', __FILE__), false, '2.3' ); break; default: - wp_enqueue_style( 'd12cs', plugins_url('css/cs-default.css', __FILE__), false, '1.1.0' ); + wp_enqueue_style( 'd12cs', plugins_url('css/cs-default.css', __FILE__), false, '2.3' ); return; } } add_action( 'wp_enqueue_scripts', 'd12cs_retrieve' ); +/* Enqueue a mobile style sheet if necessary */ +function d12_shortcodes_mobile_style() { + wp_enqueue_style( 'd12mb-mobilestyle', plugins_url( '/css/d12mb-mobile.css', __FILE__), array(), '2.3', 'screen and (max-width: 640px)' ); +} +add_action( 'wp_enqueue_scripts', 'd12_shortcodes_mobile_style' ); + + /* Enqueue our back end style sheet */ function d12_shortcodes_admin_styles() { - wp_enqueue_style( 'd12mb-screenstyle', plugins_url( '/css/admin.css', __FILE__, '1.0', 'screen' ) ); + wp_enqueue_style( 'd12mb-screenstyle', plugins_url( '/css/d12mb-admin.css', __FILE__) , array(), '2.3', 'screen' ); } add_action( 'admin_enqueue_scripts', 'd12_shortcodes_admin_styles' ); diff --git a/readme.txt b/readme.txt old mode 100644 new mode 100755 index 6bf6aa9..3c6d468 --- a/readme.txt +++ b/readme.txt @@ -3,8 +3,8 @@ Contributors: kjodle Tags: shortcodes, message blocks, posts, pages Donate link: http://kjodle.info/support Requires at least: 2.5 -Tested up to: 4.4.2 -Stable tag: 2.2 +Tested up to: 4.7.4 +Stable tag: 2.4 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl.html @@ -74,6 +74,11 @@ You can add any html you like in the popup window, and it will be passed to the == Changelog == += 2.4 = +* Made blocks full-width in mobile views + += 2.3 = +* Fixed a bug with stylesheets not loading = 2.2 = * Fixed a bug with the "Part of a Series" message block @@ -93,5 +98,8 @@ You can add any html you like in the popup window, and it will be passed to the == Upgrade Notice == += 2.3 = +This upgrade fixes a bug with stylesheets not loading, which caused the message blocks to not appear properly. + = 2.0 = You can now change color schemes or border styles from the plugin's options page.