Changeset 660313
- Timestamp:
- 01/28/2013 08:36:12 PM (13 years ago)
- Location:
- wp-fontsize/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp_fontsize.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-fontsize/trunk/readme.txt
r620025 r660313 3 3 Tags: font size, ajax, frontend, font size adjust, fontsize 4 4 Requires at least: 3.0.0 5 Tested up to: 3. 4.25 Tested up to: 3.5.1 6 6 License: GPLv2 or later 7 7 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 27 27 You must add css to specify the size of the font adjustments, this plugin only adds the 28 28 body class = font-size-{$number} to allow your CSS to do the tweaking. 29 30 See the plugin source code for user configurable constants. 29 31 30 32 Install using the Plugin Repository, then *add the following demo CSS:* -
wp-fontsize/trunk/wp_fontsize.php
r657542 r660313 10 10 defined ('WP_FONTSIZE_CSS') or define('WP_FONTSIZE_CSS', true); 11 11 defined ('WP_FONTSIZE_HTML') or define('WP_FONTSIZE_HTML', true); 12 defined ('WP_FONTSIZE_MIN') or define('WP_FONTSIZE_MIN', 1); 13 defined ('WP_FONTSIZE_DEFAULT') or define('WP_FONTSIZE_DEFAULT', 3); 14 defined ('WP_FONTSIZE_MAX') or define('WP_FONTSIZE_MAX', 5); 12 15 class wp_fontsize { 13 16 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; 17 20 private $font_size; 18 21 function __construct () { … … 58 61 private function css () { ?> 59 62 <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 } 116 117 </style> 117 118 <?php } 118 119 public static function html () { ?> 119 120 <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> 121 122 <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> 124 125 </ul> 125 126 </div> … … 130 131 'fontsize' => $this->getFontSize(), 131 132 'nonce' => wp_create_nonce('wp_fontsize'), 133 'min' => self::MIN_SIZE, 134 'max' => self::MAX_SIZE, 135 'default' => self::DEFAULT_SIZE, 132 136 ); 133 137 $json_data = json_encode($js_vars);
Note: See TracChangeset
for help on using the changeset viewer.