WordPress.org

Plugin Directory

Changeset 590695


Ignore:
Timestamp:
08/27/12 00:24:07 (20 months ago)
Author:
bradparbs
Message:

Updated plugin!

Location:
wptextresizecontrols/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wptextresizecontrols/trunk/init.php

    r553171 r590695  
    22/* 
    33Plugin Name: easyTextResizer 
    4 Description: just add wpTextResizeControls(0) to your template for the controls automatically styled wpTextResizeControls(1) to manually style  
    5 Version: 1.0 
     4Description: Use the [wpResize] shortcode wherever you want the resizing controls to show up. 
     5Version: 1.2 
    66Author: Brad Parbs 
    77Author URI: http://github.com/bradp 
     
    1515 
    1616add_action('wp_head','wpTextResize',6); 
     17 
     18function wpTextResizeControlsWidget(){ 
     19    ?> 
     20    <div title='Resize Body Text' class="wpTextResizeControls" style='background-color:lightgray;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;float:right;clear:right;padding:3px;'> 
     21        <a class='increaseFont' title='Increase Font Size' style='font-size:18px;'>A</a><a class='resetFont' title='Reset Font Size' style='font-size:13px;padding-left:10px;'>A</a><a class='decreaseFont' title='Decrease Font Size' style='font-size:10px;padding-left:10px;'>A</a> 
     22    <?php 
     23} 
    1724 
    1825function wpTextResizeControls($custom){ 
     
    3239    } 
    3340} 
     41 
     42add_shortcode('wpResize','wpTextResizeControlsWidget') 
  • wptextresizecontrols/trunk/readme.txt

    r553177 r590695  
    22Contributors: bradparbs 
    33Donate link: http://bradparbs.com/ 
    4 Tags: text, resize 
     4Tags: text, resize, resizer, text resizing, increase font size 
    55Requires at least: 3.2 
    66Tested up to: 3.3.2 
     
    1313wpTextResizeControls is an easy to use template tag to generate Increase, Decrease, reset font size controls for body text on a WordPress site. 
    1414 
    15 Just add wpTextResizeControls(0) to your template for the controls to be automatically styled, or wpTextResizeControls(1) to manually style. When manually styling, wpTextResizeControls is the container, and increaseFont, resetFont, and decreaseFont are all anchors you can target. 
     15Just use the [wpResize] shortcode wherever you want the controls to show up. 
     16 
     17You can also add wpTextResizeControls(0) to your template for the controls to be automatically styled, or wpTextResizeControls(1) to manually style. When manually styling, wpTextResizeControls is the container, and increaseFont, resetFont, and decreaseFont are all anchors you can target. 
    1618 
    1719Go wild! 
     
    26282. Activate the plugin through the 'Plugins' menu in WordPress 
    27293. Add wpTextResizeControls(0) to your template for the controls to be automatically styled, or wpTextResizeControls(1) to manually style. When manually styling, wpTextResizeControls is the container, and increaseFont, resetFont, and decreaseFont are all anchors you can target. 
     30 
     31== Changelog == 
     32 
     33= 1.2 = 
     34 
     35* Added resizing ability to all WordPress themes, no matter what html layout exists 
     36* added shortcode to display controls 
  • wptextresizecontrols/trunk/text.js

    r553171 r590695  
    33  var originalFontSize = $('html').css('font-size'); 
    44    $(".resetFont").click(function(){ 
    5       $('#main_content').css('font-size', originalFontSize); 
     5      $('#page').css('font-size', originalFontSize); 
    66  }); 
    77  // Increase Font Size 
    88  $(".increaseFont").click(function(){ 
    9     var currentFontSize = $('#main_content').css('font-size'); 
     9    var currentFontSize = $('#page').css('font-size'); 
    1010    var currentFontSizeNum = parseFloat(currentFontSize, 10); 
    1111    var newFontSize = currentFontSizeNum*1.2; 
    12     $('#main_content').css('font-size', newFontSize); 
     12    $('#page').css('font-size', newFontSize); 
    1313    $('.decreaseFont').css('font-size', '10px'); 
    1414    $('.increaseFont').css('font-size', '18px'); 
     
    1818  // Decrease Font Size 
    1919  $(".decreaseFont").click(function(){ 
    20     var currentFontSize = $('#main_content').css('font-size'); 
     20    var currentFontSize = $('#page').css('font-size'); 
    2121    var currentFontSizeNum = parseFloat(currentFontSize, 10); 
    2222    var newFontSize = currentFontSizeNum*0.8; 
    23     $('#main_content').css('font-size', newFontSize); 
     23    $('#page').css('font-size', newFontSize); 
    2424    $('.decreaseFont').css('font-size', '10px'); 
    2525    $('.increaseFont').css('font-size', '18px'); 
Note: See TracChangeset for help on using the changeset viewer.