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
This commit is contained in:
Matthias Kretschmann 2011-12-14 18:59:03 +01:00
parent 13b42f71d3
commit b9840b10be
6 changed files with 184 additions and 29 deletions

69
bubbles-bar.css Normal file
View File

@ -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 );
}

View File

@ -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;
}
}
/* ============================================================== */
/* 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;
}

48
bubbles-settings.php Normal file
View File

@ -0,0 +1,48 @@
<div class="wrap" id="bubblesoptions">
<header>
<div class="icon32"></div>
<h2><?php _e( 'Bubbles Options', 'bbls' ); ?></h2>
</header>
<form method="post" action="options.php">
<?php settings_fields( 'bubbles' ); ?>
<table class="form-table">
<tr valign="top">
<td colspan="2">
<h2><?php _e( 'View Options', 'bbls' ); ?></h2>
</td>
</tr>
<tr valign="top">
<th scope="row" class="indent">
<label for="menu"><?php _e( 'Style Notifications in Admin Menu', 'bbls' ); ?></label>
</th>
<td>
<input type="checkbox" name="menu" value="yes"<?php echo get_option('menu') == 'yes' ? ' checked' : '';?> />
</td>
</tr>
<tr valign="top">
<th scope="row" class="indent">
<label for="bar"><?php _e( 'Style Notifications in Adminbar', 'bbls' ); ?></label>
</th>
<td>
<input type="checkbox" name="bar" value="yes"<?php echo get_option('bar') == 'yes' ? ' checked' : '';?> />
</td>
</tr>
</table>
<?php submit_button(); ?>
</form>
<footer>
<p>Thanks for using Bubbles. Created by <a href="http://mkretschmann.com">Matthias Kretschmann</a> (<a href="https://twitter.com/kremalicious">@kremalicious</a>)</p>
</footer>
</div>

View File

@ -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');
?>

BIN
icon-bubbles-32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -4,7 +4,7 @@ Transforms the standard WordPress update & comment notification bubbles into iOS
## Usage
No additional settings needed, just install, activate and enjoy the red bubbles.
Just install, activate and enjoy the red bubbles.
## Changelog