Plugin Directory

Changeset 722962


Ignore:
Timestamp:
06/05/2013 06:53:16 AM (13 years ago)
Author:
bobbravo2
Message:

updated docs

Location:
wp-fontsize/trunk
Files:
2 edited

Legend:

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

    r660313 r722962  
    33Tags: font size, ajax, frontend, font size adjust, fontsize
    44Requires at least: 3.0.0
    5 Tested up to: 3.5.1
     5Tested up to: 3.6.0
    66License: GPLv2 or later
    77License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1717
    1818**How it works**
    19 1.Click on the fontsize buttons
    20 1.AJAX Request to validate & save the new size
    21 1.jQuery Changes the body class for instant results
    22 1.Subsequent page navigation maintains the size without any Flash of Wrong Sized Text (FOWST)
     191. Click on the fontsize buttons
     201. AJAX Request to validate & save the new size
     211. jQuery Changes the body class for instant results
     221. Subsequent page navigation maintains the size without any Flash of Wrong Sized Text (FOWST)
    2323
    2424== Installation ==
     
    2828body class = font-size-{$number} to allow your CSS to do the tweaking.
    2929
    30 See the plugin source code for user configurable constants.
     30See the FAQ for configurable constants.
    3131
    32 Install using the Plugin Repository, then *add the following demo CSS:*
    3332**Demo CSS:**
    34 `.font-size-1
     33This will change the font size of all paragraph elements.
     34`.font-size-1 p
    3535{
    3636    font-size: 0.8em;
    3737}
    38 .font-size-2
     38.font-size-2 p
    3939{
    4040    font-size: 0.9em;
    4141}
    42 .font-size-3
    43 {
    44     font-size: 1em;
    45 }
    46 .font-size-4
    47 {
    48     font-size: 1.2em;
    49 }
    50 .font-size-5
    51 {
    52     font-size: 1.3em;
    53 }
    54 .font-size-6
    55 {
    56     font-size: 1.5em;
    57 }
    58 .font-size-7
     42...
     43other rules here
     44...
     45.font-size-7 p
    5946{
    6047    font-size: 1.7em;
    6148}`
    62 
     49To target other elements:
     50`
     51.font-size-7 p, .font-size-7 h1, .font-size-7 h2 .(etc...) {
     52    font-size: 1.7em;
     53}
     54`
    6355== Frequently Asked Questions ==
     56= Where is the admin screen? =
     57There is none. The only configuration can be done by adding the below constants to your wp-config.php file.
     58You'll need to author your CSS to take advantage of the stateful classes added to the <body> element.
    6459
    6560= How do I customize the number of levels? =
    6661
    67 See the plugin file: wp_fontsize.php and adjust the constants at the top of the class. See:
    68 `const MAX_SIZE = 7;
    69 const DEFAULT_SIZE  = 3;
    70 const MIN_SIZE = 1;`
     62Add the following constants to your wp-config.php file, adjusting the levels to your liking.
     63`
     64define('WP_FONTSIZE_MAX', 7);
     65define('WP_FONTSIZE_DEFAULT', 3);
     66define('WP_FONTSIZE_MIN', 1);
     67`
    7168
    7269= How do I disable the including of the CSS? =
    73 Look for the public method: `<?php wp_fontsize->footer();?>`
    74 Inside of that method, you can comment out the parts of the plugin you'd like to disable, for example:
     70This disables the CSS that lays out the font size indicator in the top right of the screen.
     71Use this to override the CSS with your own styles.
    7572`
    76 <?php function  footer () {
    77         ob_start(array(&$this, 'min'));
    78         $this->html();
    79         //This will disable the default CSS, you must apply your own for the widget to work properly
    80         //$this->css();
    81         $this->js();
    82         ob_end_flush();
    83     }
    84 ?>
     73define('WP_FONTSIZE_CSS', false);
    8574`
    86 
     75= How do I use the font size adjustor in my template?  =
     76This lets you use the plugin inside a template, by using the wp_fontsize::html() method. This will display the interface using the tag:
     77`
     78<?php wp_fontsize::html(); ?>
     79`
     80To disable the default html adjustor, make sure you add this to your wp-config.php:
     81`
     82define('WP_FONTSIZE_HTML', false);
     83`
    8784== Screenshots ==
    8885
  • wp-fontsize/trunk/wp_fontsize.php

    r688885 r722962  
    2121    function  __construct () {
    2222        $this->font_size = self::DEFAULT_SIZE;
    23         if ( ! isset($_SESSION )) session_start();
     23        if ( ! isset($_SESSION ))
     24            session_start();
    2425        if ( ! isset( $_SESSION[ self::SESSION_KEY ] ) )
    2526            $this->setFontSize(self::DEFAULT_SIZE);
Note: See TracChangeset for help on using the changeset viewer.