WordPress.org

Plugin Directory

Changeset 741201


Ignore:
Timestamp:
07/15/13 17:37:48 (9 months ago)
Author:
joedolson
Message:

Update to 1.2.4. Add French translation, diagnostic css, visible logout link. Bug fixes.

Location:
wp-accessibility/trunk
Files:
4 added
4 edited

Legend:

Unmodified
Added
Removed
  • wp-accessibility/trunk/readme.txt

    r706598 r741201  
    4545 
    4646== Changelog == 
     47 
     48= 1.2.4 = 
     49 
     50* Added diagnostic.css (beta) for admin users on front end and in post editor. 
     51* Bug fix in a11y.js; incorrect function call in scrollTo. 
     52* Bug fix in a11y.js; removed hook to # urls 
     53* Added visible logout link to admin to support users of voice activated controls. 
     54* Bug fix to built-in support request form. 
     55* Added filter wpa_move_toolbar to make it possible to attach a11y toolbar to something other than the body element. 
     56* Added French translation. 
     57 
    4758 
    4859= 1.2.3 = 
  • wp-accessibility/trunk/toolbar/js/a11y.js

    r664937 r741201  
    106106    // If there is a '#' in the URL (someone linking directly to a page with an anchor), go directly to that area and focus is 
    107107    // Thanks to WebAIM.org for this idea 
    108     if (document.location.hash) { 
     108    if (document.location.hash && document.location.hash != '#' ) { 
    109109        var anchorUponArrival = document.location.hash; 
    110110        setTimeout(function() { 
    111             $(anchorUponArrival).Scrollto({ duration: 1500 }); 
     111            $(anchorUponArrival).scrollTo({ duration: 1500 }); 
    112112            $(anchorUponArrival).focus(); 
    113113        }, 100); 
     
    118118    $('a[href^="#"]').click(function(event) { 
    119119        var inPageAnchor = "#" + this.href.split('#')[1]; 
    120         $(inPageAnchor).ScrollTo({ duration: 1000 }); 
     120        $(inPageAnchor).scrollTo({ duration: 1000 }); 
    121121        setTimeout(function() { 
    122122            $(inPageAnchor).focus(); 
  • wp-accessibility/trunk/uninstall.php

    r664937 r741201  
    2929    delete_option( 'wpa_continue' ); 
    3030    delete_option( 'wpa_toolbar' ); 
     31    delete_option( 'wpa_diagnostics' ); 
    3132} 
  • wp-accessibility/trunk/wp-accessibility.php

    r706598 r741201  
    44Plugin URI: http://www.joedolson.com/articles/wp-accessibility/ 
    55Description: Provides options to improve accessibility in your WordPress site, including removing title attributes. 
    6 Version: 1.2.3 
     6Version: 1.2.4 
    77Author: Joe Dolson 
    88Author URI: http://www.joedolson.com/ 
     
    3737// ACTIVATION 
    3838function wpa_install() { 
    39     $wpa_version = '1.2.3'; 
     39    $wpa_version = '1.2.4'; 
    4040    if ( get_option('wpa_installed') != 'true' ) { 
    4141        add_option('rta_from_nav_menu', 'on'); 
     
    161161    $grayscale = __('Toggle Grayscale','wp-accessibility'); 
    162162    $fontsize = __('Toggle Font size','wp-accessibility'); 
     163    $location = apply_filters( 'wpa_move_toolbar', 'body' ); 
    163164echo     
    164165    " 
     
    176177        insert_a11y_toolbar += '</div>'; 
    177178        insert_a11y_toolbar += '<!-- // a11y toolbar -->'; 
    178         $(document).find('body').prepend(insert_a11y_toolbar); 
     179        $(document).find('$location').prepend(insert_a11y_toolbar); 
    179180    }(jQuery)); 
    180181//]]> 
     
    264265} 
    265266 
     267// courtesy of Graham Armfield (modified) 
     268// http://www.coolfields.co.uk/2013/02/wordpress-permanently-visible-log-out-link-plugin-version-0-1/ 
     269add_action( 'admin_bar_menu', 'wpa_logout_item', 11 ); 
     270function wpa_logout_item($admin_bar){ 
     271    $args = array( 
     272                'id'    => 'wpa-logout', 
     273                'title' => 'Log Out', 
     274                'href'  => wp_logout_url(), 
     275            ); 
     276    $admin_bar->add_node( $args ); 
     277} 
     278 
    266279function wpa_stylesheet() { 
    267280    // Respects SSL, Style.css is relative to the current file 
     
    270283    wp_register_style( 'ui-a11y.css', plugins_url( 'toolbar/css/a11y.css', __FILE__) ); 
    271284    wp_enqueue_style( 'ui-a11y.css' ); 
     285    if ( current_user_can( 'edit_files' ) && get_option('wpa_diagnostics') == 'on' ) { 
     286        wp_register_style( 'diagnostic', plugins_url('diagnostic.css', __FILE__) ); 
     287        wp_register_style( 'diagnostic-head', plugins_url('diagnostic-head.css', __FILE__) ); 
     288        wp_enqueue_style( 'diagnostic' ); 
     289        wp_enqueue_style( 'diagnostic-head' );       
     290    } 
     291} 
     292add_filter( 'mce_css', 'wp_diagnostic_css' ); 
     293function wp_diagnostic_css( $mce_css ) { 
     294    if (  get_option('wpa_diagnostics') == 'on' ) { 
     295        $mce_css .= ', ' . plugins_url( 'diagnostic.css', __FILE__ ); 
     296        return $mce_css; 
     297    } 
    272298} 
    273299 
     
    325351function wpa_contrast() { 
    326352    if ( !empty($_POST) ) { 
    327     $nonce=$_REQUEST['_wpnonce'];   if (! wp_verify_nonce($nonce,'wpa-nonce') ) die("Security check failed");   
     353    $nonce=$_REQUEST['_wpnonce'];   if (!wp_verify_nonce($nonce,'wpa-nonce') ) die("Security check failed");   
    328354        if (isset($_POST['color']) && $_POST['color'] != "") { 
    329355            $fore_color = $_POST['color']; 
     
    438464            $wpa_toolbar_gs = ( isset( $_POST['wpa_toolbar_gs'] ) )?'on':''; 
    439465            $wpa_admin_css = ( isset( $_POST['wpa_admin_css'] ) )?'on':''; 
     466            $wpa_diagnostics = ( isset( $_POST['wpa_diagnostics'] ) )?'on':''; 
    440467            update_option('wpa_lang', $wpa_lang ); 
    441468            update_option('wpa_target', $wpa_target ); 
     
    450477            update_option('wpa_continue', $wpa_continue ); 
    451478            update_option('wpa_admin_css', $wpa_admin_css ); 
     479            update_option('wpa_diagnostics', $wpa_diagnostics ); 
    452480            $message = __("Miscellaneous Accessibility Settings Updated",'wp-accessibility'); 
    453481            return "<div class='updated'><p>".$message."</p></div>"; 
     
    605633                        <li><input type="checkbox" id="wpa_image_titles" name="wpa_image_titles" <?php if ( get_option('wpa_image_titles') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_image_titles"><?php _e('Remove title attribute from images inserted into post content and featured images.','wp-accessibility'); ?></label></li> 
    606634                        <li><input type="checkbox" id="wpa_toolbar" name="wpa_toolbar" <?php if ( get_option('wpa_toolbar') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar"><?php _e('Add Accessibility toolbar with fontsize adjustment and contrast toggle','wp-accessibility'); ?></label></li>         
    607                         <li><input type="checkbox" id="wpa_toolbar_gs" name="wpa_toolbar_gs" <?php if ( get_option('wpa_toolbar_gs') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar_gs"><?php _e('Include grayscale toggle with Accessibility toolbar','wp-accessibility'); ?></label></li>        
     635                        <li><input type="checkbox" id="wpa_toolbar_gs" name="wpa_toolbar_gs" <?php if ( get_option('wpa_toolbar_gs') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_toolbar_gs"><?php _e('Include grayscale toggle with Accessibility toolbar','wp-accessibility'); ?></label></li> 
     636                        <li><input type="checkbox" id="wpa_diagnostics" name="wpa_diagnostics" <?php if ( get_option('wpa_toolbar_gs') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_diagnostics"><?php _e('Enable diagnostic CSS','wp-accessibility'); ?></label></li>                               
    608637                        <li><input type="checkbox" id="wpa_more" name="wpa_more" <?php if ( get_option('wpa_more') == "on") { echo 'checked="checked" '; } ?>/> <label for="wpa_more"><?php _e('Add post title to "more" links.','wp-accessibility'); ?></label> 
    609638                            <label for="wpa_continue"><?php _e('Continue reading text','wp-accessibility'); ?></label> <input type="text" id="wpa_continue" name="wpa_continue" value="<?php echo esc_attr(get_option('wpa_continue') ); ?>" /></li> 
     
    941970    if ( isset($_POST['wpt_support']) ) { 
    942971        $nonce=$_REQUEST['_wpnonce']; 
    943         if (! wp_verify_nonce($nonce,'wp-accessibility-nonce') ) die("Security check failed");   
     972        if (! wp_verify_nonce($nonce,'wpa-nonce') ) die("Security check failed");    
    944973        $request = ( !empty($_POST['support_request']) )?stripslashes($_POST['support_request']):false; 
    945974        $has_donated = ( $_POST['has_donated'] == 'on')?"Donor":"No donation"; 
     
    966995    echo " 
    967996    <form method='post' action='$admin_url'> 
    968         <div><input type='hidden' name='_wpnonce' value='".wp_create_nonce('wp-accessibility-nonce')."' /></div> 
     997        <div><input type='hidden' name='_wpnonce' value='".wp_create_nonce('wpa-nonce')."' /></div> 
    969998        <div>"; 
    970999        echo " 
Note: See TracChangeset for help on using the changeset viewer.