From e35c73a0885f2daff63ccc7c22c6e645867d24fe Mon Sep 17 00:00:00 2001 From: kremalicious Date: Sat, 17 Dec 2011 21:08:03 +0000 Subject: [PATCH] New options page to control notification styles in adminbar and/or admin menu - split up the css for this, add subtle options page css to the admin menu css - values are both set by default upon activation - new quick 32px icon git-svn-id: http://plugins.svn.wordpress.org/badged/trunk@476933 b8457f37-d9ea-0310-8a92-e5e31aec5664 --- bubbles-bar.css | 69 ++++++++++++++++++++++++++++++++ bubbles.css => bubbles-menu.css | 46 ++++++++++++--------- bubbles-settings.php | 48 ++++++++++++++++++++++ bubbles.php | 48 +++++++++++++++++----- icon-bubbles-32.png | Bin 0 -> 1415 bytes readme.md | 2 +- 6 files changed, 184 insertions(+), 29 deletions(-) create mode 100644 bubbles-bar.css rename bubbles.css => bubbles-menu.css (87%) create mode 100644 bubbles-settings.php create mode 100644 icon-bubbles-32.png diff --git a/bubbles-bar.css b/bubbles-bar.css new file mode 100644 index 0000000..8eb5330 --- /dev/null +++ b/bubbles-bar.css @@ -0,0 +1,69 @@ + +/* ============================================================== */ +/* Bubbles */ +/* ------------------------ */ +/* CSS Styles for the Admin Bar only */ +/* by Matthias Kretschmann | http://mkretschmann.com */ +/* ============================================================== */ + +#wp-admin-bar-updates .ab-label, +#wp-admin-bar-comments .ab-label { + background-color: #d5231f !important; + color: #fff; /* just in case, is white per WP default */ + font: 11px/15px Helvetica, Verdana, Geneva, sans-serif; + text-shadow: 0 1px 1px #771717; + + background-image: -moz-linear-gradient(top, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 100%); + background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.3)), color-stop(100%,rgba(255,255,255,0))); + background-image: -webkit-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); + background-image: -o-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); + background-image: -ms-linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); + background-image: linear-gradient(top, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4dffffff', endColorstr='#00ffffff',GradientType=0 ); + + border: 2px solid #fff; + -webkit-border-radius: 10px; /* just in case, is 10px per WP default */ + -moz-border-radius: 10px; + border-radius: 10px; + + -webkit-background-clip: padding-box; + -moz-background-clip: padding-box; + background-clip: padding-box; + + margin-top: -1px; + + padding: 0 3px; + position: relative; + -webkit-box-shadow: 0px 2px 2px #000 !important; + -moz-box-shadow: 0px 2px 2px #000 !important; + box-shadow: 0px 2px 2px #000 !important; +} + + + /* inject another styling layer, for inset shadow & shine gradient */ + #wp-admin-bar-updates .ab-label:before, + #wp-admin-bar-comments .ab-label:before { + content: ""; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + + -webkit-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + + -webkit-box-shadow: inset 0 0 3px #631212; + -moz-box-shadow: inset 0 0 3px #631212; + box-shadow: inset 0 0 3px #631212; + + background: -moz-radial-gradient(center -5px, circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.3) 59%, rgba(255,255,255,0) 65%, rgba(255,255,255,0) 100%); + background: -webkit-gradient(radial, center -5px, 0px, center -5px, 100%, color-stop(0%,rgba(255,255,255,0.3)), color-stop(59%,rgba(255,255,255,0.3)), color-stop(65%,rgba(255,255,255,0)), color-stop(100%,rgba(255,255,255,0))); + background: -webkit-radial-gradient(center -5px, circle, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.3) 59%,rgba(255,255,255,0) 65%,rgba(255,255,255,0) 100%); + background: -o-radial-gradient(center -5px, circle, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.3) 59%,rgba(255,255,255,0) 65%,rgba(255,255,255,0) 100%); + background: -ms-radial-gradient(center -5px, circle, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.3) 59%,rgba(255,255,255,0) 65%,rgba(255,255,255,0) 100%); + background: radial-gradient(center -5px, circle, rgba(255,255,255,0.3) 0%,rgba(255,255,255,0.3) 59%,rgba(255,255,255,0) 65%,rgba(255,255,255,0) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4dffffff', endColorstr='#00ffffff',GradientType=1 ); + + } \ No newline at end of file diff --git a/bubbles.css b/bubbles-menu.css similarity index 87% rename from bubbles.css rename to bubbles-menu.css index 55a3262..c887951 100644 --- a/bubbles.css +++ b/bubbles-menu.css @@ -2,7 +2,7 @@ /* ============================================================== */ /* Bubbles */ /* ------------------------ */ -/* CSS Styles */ +/* CSS Styles for the Admin Menu only */ /* by Matthias Kretschmann | http://mkretschmann.com */ /* ============================================================== */ @@ -14,10 +14,7 @@ #adminmenu span.update-plugins, #sidemenu li a span.update-plugins, #sidemenu a .update-plugins, -#rightnow .reallynow, - -#wp-admin-bar-updates .ab-label, -#wp-admin-bar-comments .ab-label { +#rightnow .reallynow { /* need to be rude for these */ background-color: #d5231f !important; -webkit-box-shadow: 0px 2px 2px #888 !important; @@ -56,22 +53,11 @@ box-shadow: 0px 2px 2px #444 !important; } - /* Notifications in Adminbar */ - #wp-admin-bar-updates .ab-label, - #wp-admin-bar-comments .ab-label { - padding: 0 3px; - position: relative; - -webkit-box-shadow: 0px 2px 2px #000 !important; - -moz-box-shadow: 0px 2px 2px #000 !important; - box-shadow: 0px 2px 2px #000 !important; - } - /* inject another styling layer, for inset shadow & shine gradient */ #adminmenu .awaiting-mod:before, #adminmenu .update-plugins:before, #sidemenu .update-plugins:before, - .reallynow:before, - #wp-admin-bar-updates .ab-label:before { + .reallynow:before { content: ""; position: absolute; left: 0; @@ -102,4 +88,28 @@ #adminmenu li span.update-plugins span, #sidemenu li a span.update-plugins span { padding: 0 4px; -} \ No newline at end of file +} + + + + +/* ============================================================== */ +/* The Options Page */ +/* ============================================================== */ + +#bubblesoptions form h2 { + border-bottom: 1px solid #eee; + border-top: 1px solid #eee; + margin-top: 1em; + padding: 10px 0; +} + +#bubblesoptions footer { + border-top: 1px solid #eee; + color: #666; +} + +#bubblesoptions .icon32 { + background-image: url(icon-bubbles-32.png); + background-repeat: no-repeat; +} diff --git a/bubbles-settings.php b/bubbles-settings.php new file mode 100644 index 0000000..5545b96 --- /dev/null +++ b/bubbles-settings.php @@ -0,0 +1,48 @@ +
+ +
+
+

+
+ +
+ + + + + + + + + + + + + + + + + + +
+

+ +
+ + + /> +
+ + + /> +
+ + + +
+ + + +
\ No newline at end of file diff --git a/bubbles.php b/bubbles.php index 2cbbb4c..1e94fd9 100644 --- a/bubbles.php +++ b/bubbles.php @@ -9,22 +9,50 @@ * License: GPL */ - -/** - * Throw in the styles - * - * Enqueue the css file - * - * @since 0.1.0 - */ + +if (function_exists('load_plugin_textdomain')) { + load_plugin_textdomain('bbls', false, dirname(plugin_basename(__FILE__)).'/languages' ); +} function bubbles_init() { - wp_register_style('bubbles-css', plugins_url('/bubbles/bubbles.css'), false, '9001'); - wp_enqueue_style('bubbles-css'); + + bubbles_register_settings(); + if ( get_option('menu') == 'yes') { + wp_register_style('bubbles-menu-css', plugins_url('/bubbles/bubbles-menu.css'), false, '9001'); + wp_enqueue_style('bubbles-menu-css'); + } + + if ( get_option('bar') == 'yes') { + wp_register_style('bubbles-bar-css', plugins_url('/bubbles/bubbles-bar.css'), false, '9001'); + wp_enqueue_style('bubbles-bar-css'); + } + +} + +function bubbles_settings() { + add_options_page('Bubbles Options', 'Bubbles', 'manage_options', 'bubbles_settings', 'bubbles_settings_page'); +} + +function bubbles_register_settings() { + register_setting('bubbles', 'menu'); + register_setting('bubbles', 'bar'); +} + +function bubbles_settings_page() { + require_once('bubbles-settings.php'); +} + +function bubbles_activation() { + bubbles_register_settings(); + update_option('menu', 'yes'); + update_option('bar', 'yes'); } if ( is_admin() ) { add_action('admin_init', 'bubbles_init'); + add_action('admin_menu', 'bubbles_settings'); } +register_activation_hook(__FILE__, 'bubbles_activation'); + ?> \ No newline at end of file diff --git a/icon-bubbles-32.png b/icon-b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