Plugin Directory

Changeset 660313


Ignore:
Timestamp:
01/28/2013 08:36:12 PM (13 years ago)
Author:
bobbravo2
Message:

added overrides in constants
tested tag bump

Location:
wp-fontsize/trunk
Files:
2 edited

Legend:

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

    r620025 r660313  
    33Tags: font size, ajax, frontend, font size adjust, fontsize
    44Requires at least: 3.0.0
    5 Tested up to: 3.4.2
     5Tested up to: 3.5.1
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2727You must add css to specify the size of the font adjustments, this plugin only adds the
    2828body class = font-size-{$number} to allow your CSS to do the tweaking.
     29
     30See the plugin source code for user configurable constants.
    2931
    3032Install using the Plugin Repository, then *add the following demo CSS:*
  • wp-fontsize/trunk/wp_fontsize.php

    r657542 r660313  
    1010defined ('WP_FONTSIZE_CSS') or define('WP_FONTSIZE_CSS', true);
    1111defined ('WP_FONTSIZE_HTML') or define('WP_FONTSIZE_HTML', true);
     12defined ('WP_FONTSIZE_MIN') or define('WP_FONTSIZE_MIN', 1);
     13defined ('WP_FONTSIZE_DEFAULT') or define('WP_FONTSIZE_DEFAULT', 3);
     14defined ('WP_FONTSIZE_MAX') or define('WP_FONTSIZE_MAX', 5);
    1215class wp_fontsize {
    1316    const SESSION_KEY = 'wp_fontsize';
    14     const MAX_SIZE = 7;
    15     const DEFAULT_SIZE  = 3;
    16     const MIN_SIZE = 1;
     17    const MAX_SIZE = WP_FONTSIZE_MAX;
     18    const DEFAULT_SIZE  = WP_FONTSIZE_DEFAULT;
     19    const MIN_SIZE = WP_FONTSIZE_DEFAULT;
    1720    private $font_size;
    1821    function  __construct () {
     
    5861    private function css () {  ?>
    5962        <style>
    60 .wp_fontsize_wrapper
    61 {
    62     position: absolute;
    63     right: 0px;
    64     top: 0px;
    65     -moz-border-radius: 0 0 0 3px;
    66     -webkit-border-radius: 0 0 0 3px;
    67     -khtml-border-radius: 0 0 0 3px;
    68     border-radius: 0 0 0 3px;
    69     width: auto;
    70     height: auto;
    71     background-color: #FFFFFF;
    72     overflow: hidden;
    73     padding-left: 5px;
    74     padding-right: 2.3em;
    75     line-height: 2;
    76 }
    77 .wp_fontsize_wrapper LABEL
    78 {
    79     font-size: 10pt;
    80 }
    81 .admin-bar .wp_fontsize_wrapper
    82 {
    83     top: 30px;
    84 }
    85 .wp_fontsize_wrapper UL
    86 {
    87     list-style: none;
    88     position: absolute;
    89     right: 0px;
    90     top: 0px;
    91     margin: 0;
    92     padding: 0;
    93 }
    94 .wp_fontsize_wrapper UL LI
    95 {
    96     display: inline-block;
    97     padding: 0 0.3em;
    98     float: left;
    99     position: relative;
    100     left: 0px;
    101     top: 0.2em;
    102     cursor: pointer;
    103     line-height: 1.5;
    104     font-size: 12pt;
    105 }
    106 .wp_fontsize_wrapper UL LI:hover
    107 {
    108     background-color: #CDCDCD;
    109     -moz-border-radius: 5px;
    110     -webkit-border-radius: 5px;
    111     -khtml-border-radius: 5px;
    112     border-radius: 5px;
    113 }
    114    
    115    
     63            .wp_fontsize_wrapper
     64            {
     65                position: absolute;
     66                right: 0px;
     67                top: 0px;
     68                -moz-border-radius: 0 0 0 3px;
     69                -webkit-border-radius: 0 0 0 3px;
     70                -khtml-border-radius: 0 0 0 3px;
     71                border-radius: 0 0 0 3px;
     72                width: auto;
     73                height: auto;
     74                background-color: #FFFFFF;
     75                overflow: hidden;
     76                padding-left: 5px;
     77                padding-right: 2.3em;
     78                line-height: 2;
     79            }
     80            .wp_fontsize_wrapper LABEL
     81            {
     82                font-size: 10pt;
     83            }
     84            .admin-bar .wp_fontsize_wrapper
     85            {
     86                top: 30px;
     87            }
     88            .wp_fontsize_wrapper UL
     89            {
     90                list-style: none;
     91                position: absolute;
     92                right: 0px;
     93                top: 0px;
     94                margin: 0;
     95                padding: 0;
     96            }
     97            .wp_fontsize_wrapper UL LI
     98            {
     99                display: inline-block;
     100                padding: 0 0.3em;
     101                float: left;
     102                position: relative;
     103                left: 0px;
     104                top: 0.2em;
     105                cursor: pointer;
     106                line-height: 1.5;
     107                font-size: 12pt;
     108            }
     109            .wp_fontsize_wrapper UL LI:hover
     110            {
     111                background-color: #CDCDCD;
     112                -moz-border-radius: 5px;
     113                -webkit-border-radius: 5px;
     114                -khtml-border-radius: 5px;
     115                border-radius: 5px;
     116            }
    116117        </style>
    117118    <?php }
    118119    public static function html () {  ?>
    119120        <div class="wp_fontsize_wrapper" id="wp_fontsize_wrapper">
    120         <label title="Adjust the font size of the website">Font Size:</label>
     121        <label title="<?php __('Adjust the font size of the website', 'wp_fontsize')?>"><?php __('Font Size:', 'wp_fontsize');?></label>
    121122            <ul>
    122                 <li id="wpFontMinus" class="minus">-</li>
    123                 <li id="wpFontPlus" class="plus">+</li>
     123                <li id="wpFontMinus" class="minus"><?php __('-', 'wp_fontsize')?></li>
     124                <li id="wpFontPlus" class="plus"><?php __('+', 'wp_fontsize');?></li>
    124125            </ul>
    125126        </div>
     
    130131                'fontsize' => $this->getFontSize(),
    131132                'nonce' => wp_create_nonce('wp_fontsize'),
     133                'min' => self::MIN_SIZE,
     134                'max' => self::MAX_SIZE,
     135                'default' => self::DEFAULT_SIZE,
    132136            );
    133137        $json_data = json_encode($js_vars);
Note: See TracChangeset for help on using the changeset viewer.