Plugin Directory

Changeset 556178


Ignore:
Timestamp:
06/11/2012 03:28:59 PM (14 years ago)
Author:
miltonbjones
Message:

releasing version 1.1: added options to customize headline and message colors

Location:
notify-bar/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • notify-bar/trunk/js/notify-bar-farbtastic.js

    r548066 r556178  
    1010
    1111jQuery(document).ready(function() {
     12    jQuery('#ilctabscolorpicker-headline').hide();
     13    jQuery('#ilctabscolorpicker-headline').farbtastic('#headline_color');
     14    jQuery("#headline_color").click(function(){jQuery('#ilctabscolorpicker-headline').slideToggle()});
     15});
     16
     17
     18jQuery(document).ready(function() {
     19    jQuery('#ilctabscolorpicker-message').hide();
     20    jQuery('#ilctabscolorpicker-message').farbtastic('#message_color');
     21    jQuery("#message_color").click(function(){jQuery('#ilctabscolorpicker-message').slideToggle()});
     22});
     23
     24
     25jQuery(document).ready(function() {
    1226    jQuery('#ilctabscolorpicker-link').hide();
    1327    jQuery('#ilctabscolorpicker-link').farbtastic('#link_color');
  • notify-bar/trunk/notify-bar.php

    r549120 r556178  
    128128        'mbj_notify_bar_main'
    129129        ); 
     130       
     131    add_settings_field(
     132        'mbj_notify_bar_headline_color',
     133        'Headline color:',
     134        'mbj_notify_bar_setting_headline_color',
     135        'mbj_notify_bar',
     136        'mbj_notify_bar_main'
     137        ); 
     138       
     139    add_settings_field(
     140        'mbj_notify_bar_message_color',
     141        'Message color:',
     142        'mbj_notify_bar_setting_message_color',
     143        'mbj_notify_bar',
     144        'mbj_notify_bar_main'
     145        );             
    130146           
    131147    add_settings_field(
     
    150166            'hide_this' => 'yes',
    151167            'background_color' => '#ffff33',
     168            'headline_color' => '#000000',
     169            'message_color' => '#000000',
    152170            'link_color' => '#0000ff',
    153171            'headline' => 'Type Headline Here',
     
    211229    // echo the field
    212230    echo "<input type='text' id='background_color' name='mbj_notify_bar_options[background_color]' value='$text_string' /><div id='ilctabscolorpicker-background'>                                                                                                                                                                                </div>";
     231}
     232
     233
     234/* set up and display the form element for setting the headline color */
     235function mbj_notify_bar_setting_headline_color() {
     236    $options = get_option( 'mbj_notify_bar_options' );
     237    $text_string = $options['headline_color'];
     238    // echo the field
     239    echo "<input type='text' id='headline_color' name='mbj_notify_bar_options[headline_color]' value='$text_string' /><div id='ilctabscolorpicker-headline'>                                                                                                                                                                                  </div>";
     240}
     241
     242
     243/* set up and display the form element for setting the message color */
     244function mbj_notify_bar_setting_message_color() {
     245    $options = get_option( 'mbj_notify_bar_options' );
     246    $text_string = $options['message_color'];
     247    // echo the field
     248    echo "<input type='text' id='message_color' name='mbj_notify_bar_options[message_color]' value='$text_string' /><div id='ilctabscolorpicker-message'>                                                                                                                                                                                 </div>";
    213249}
    214250
     
    288324        $valid['background_color'] = '#ffff33';
    289325    }
     326   
     327    // use regex to check that first character is # sign and then only accept 7 characters for the headline color
     328    // otherwise use #000000, which is the same as default headline color
     329    if (preg_match('/^#/', $input['headline_color'])) {
     330        $valid['headline_color'] = substr($input['headline_color'], 0, 7);
     331    }
     332    else {
     333        $valid['headline_color'] = '#000000';
     334    }
     335   
     336    // use regex to check that first character is # sign and then only accept 7 characters for the message color
     337    // otherwise use #000000, which is the same as default message color
     338    if (preg_match('/^#/', $input['message_color'])) {
     339        $valid['message_color'] = substr($input['message_color'], 0, 7);
     340    }
     341    else {
     342        $valid['message_color'] = '#000000';
     343    }
    290344           
    291345    // use regex to check that first character is # sign and then only accept 7 characters for the link color
     
    333387    $mbj_notify_bar_display_options_message = $mbj_notify_bar_display_options['message'];
    334388    $mbj_notify_bar_display_options_background_color = $mbj_notify_bar_display_options['background_color'];
     389    $mbj_notify_bar_display_options_headline_color = $mbj_notify_bar_display_options['headline_color'];
     390    $mbj_notify_bar_display_options_message_color = $mbj_notify_bar_display_options['message_color'];
    335391    $mbj_notify_bar_display_options_link_color = $mbj_notify_bar_display_options['link_color'];
    336392
  • notify-bar/trunk/readme.txt

    r548165 r556178  
    55Requires at least: 3.3
    66Tested up to: 3.3
    7 Stable tag: trunk
     7Stable tag: 1.1
    88License: GPLv2
    99
     
    1212== Description ==
    1313
    14 This plugin adds a bar (Notify Bar) across the top of some or all pages on your website.  The bar displays a headline and a paragraph, which can be used to publish important announcements such as upcoming site maintenance, downtime, approaching deadlines, or whatever seems important.  The background color of the bar and the link color for the text can be can be customized with a color picker.  There is also an optional jQuery slideUp feature that allows the user to click a 'Hide This' link and remove the bar after reading the message.  [More Information](http://www.webworkgarage.com/notify-bar-wordpress-plugin/)
     14This plugin adds a bar (Notify Bar) across the top of some or all pages on your website.  The bar displays a headline and a paragraph, which can be used to publish important announcements such as upcoming site maintenance, downtime, approaching deadlines, or whatever seems important.  The background color, headline color, message color and the link color can be customized with a color picker.  There is also an optional jQuery slideUp feature that allows the user to click a 'Hide This' link and remove the bar after reading the message.  [More Information](http://www.webworkgarage.com/notify-bar-wordpress-plugin/)
    1515
    1616
     
    2929= Why does the Notify Bar not look the same on all sites? =
    3030
    31 The Notify Bar plugin is meant to be flexible enough to look good on a variety of websites by going pretty light on CSS and using inheriting fonts and various other properties from the site you are installing it on.  For example, on most websites, the background color of the Notify Bar will stretch the full width of the page, but on some sites that might not be the case.  One way this could happen would be if you have set the HTML body element of your site to have a width of less than 100%.  There are other conditions that might make the Notify Bar look different across different websites, but the hope is that by inheriting the fonts from what you're using on your site and by allowing you to change the background and link colors, you can make the Notify Bar look nice on most any website.
     31The Notify Bar plugin is meant to be flexible enough to look good on a variety of websites by going pretty light on CSS and using inheriting fonts and various other properties from the site you are installing it on.  For example, on most websites, the background color of the Notify Bar will stretch the full width of the page, but on some sites that might not be the case.  One way this could happen would be if you have set the HTML body element of your site to have a width of less than 100%.  There are other conditions that might make the Notify Bar look different across different websites, but the hope is that by inheriting the fonts from what you're using on your site and by allowing you to set your own colors, you can make the Notify Bar look nice on most any website.
    3232
    3333
     
    6262== Changelog ==
    6363
     64= 1.1 =
     65* Added options to customize headline color and message color
     66
    6467= 1.0 =
    6568* Plugin Launched
Note: See TracChangeset for help on using the changeset viewer.