Changeset 722962
- Timestamp:
- 06/05/2013 06:53:16 AM (13 years ago)
- Location:
- wp-fontsize/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
wp_fontsize.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-fontsize/trunk/readme.txt
r660313 r722962 3 3 Tags: font size, ajax, frontend, font size adjust, fontsize 4 4 Requires at least: 3.0.0 5 Tested up to: 3. 5.15 Tested up to: 3.6.0 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 17 17 18 18 **How it works** 19 1. Click on the fontsize buttons20 1. AJAX Request to validate & save the new size21 1. jQuery Changes the body class for instant results22 1. Subsequent page navigation maintains the size without any Flash of Wrong Sized Text (FOWST)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) 23 23 24 24 == Installation == … … 28 28 body class = font-size-{$number} to allow your CSS to do the tweaking. 29 29 30 See the plugin source code for user configurable constants.30 See the FAQ for configurable constants. 31 31 32 Install using the Plugin Repository, then *add the following demo CSS:*33 32 **Demo CSS:** 34 `.font-size-1 33 This will change the font size of all paragraph elements. 34 `.font-size-1 p 35 35 { 36 36 font-size: 0.8em; 37 37 } 38 .font-size-2 38 .font-size-2 p 39 39 { 40 40 font-size: 0.9em; 41 41 } 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 ... 43 other rules here 44 ... 45 .font-size-7 p 59 46 { 60 47 font-size: 1.7em; 61 48 }` 62 49 To 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 ` 63 55 == Frequently Asked Questions == 56 = Where is the admin screen? = 57 There is none. The only configuration can be done by adding the below constants to your wp-config.php file. 58 You'll need to author your CSS to take advantage of the stateful classes added to the <body> element. 64 59 65 60 = How do I customize the number of levels? = 66 61 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;` 62 Add the following constants to your wp-config.php file, adjusting the levels to your liking. 63 ` 64 define('WP_FONTSIZE_MAX', 7); 65 define('WP_FONTSIZE_DEFAULT', 3); 66 define('WP_FONTSIZE_MIN', 1); 67 ` 71 68 72 69 = 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: 70 This disables the CSS that lays out the font size indicator in the top right of the screen. 71 Use this to override the CSS with your own styles. 75 72 ` 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 ?> 73 define('WP_FONTSIZE_CSS', false); 85 74 ` 86 75 = How do I use the font size adjustor in my template? = 76 This 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 ` 80 To disable the default html adjustor, make sure you add this to your wp-config.php: 81 ` 82 define('WP_FONTSIZE_HTML', false); 83 ` 87 84 == Screenshots == 88 85 -
wp-fontsize/trunk/wp_fontsize.php
r688885 r722962 21 21 function __construct () { 22 22 $this->font_size = self::DEFAULT_SIZE; 23 if ( ! isset($_SESSION )) session_start(); 23 if ( ! isset($_SESSION )) 24 session_start(); 24 25 if ( ! isset( $_SESSION[ self::SESSION_KEY ] ) ) 25 26 $this->setFontSize(self::DEFAULT_SIZE);
Note: See TracChangeset
for help on using the changeset viewer.