WordPress.org

Plugin Directory

Changeset 590932


Ignore:
Timestamp:
08/27/12 13:27:48 (20 months ago)
Author:
bradparbs
Message:

JS bug fixes and better handling for all themes

Location:
wptextresizecontrols/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wptextresizecontrols/trunk/init.php

    r590758 r590932  
    1313 
    1414wp_enqueue_script( 
    15   "text.js", $plugin_path ."/text.js"); 
     15  'text.js', $plugin_path .'/text.js','jquery'); 
    1616} 
    1717 
    1818add_action('wp_head','wpTextResize',6); 
     19 
     20add_filter('body_class','wpTextResizeBodyClass'); 
     21function wpTextResizeBodyClass($classes) { 
     22    $classes[] = 'wptextresize'; 
     23    return $classes; 
     24} 
    1925 
    2026function wpTextResizeControlsWidget(){ 
     
    2834if($custom == 1 ){ 
    2935    ?> 
    30     <div title='Resize Body Text' class="wpTextResizeControls"> 
     36    <div title='Resize Body Text' class='wpTextResizeControls'> 
    3137    <a class='increaseFont' title='Increase Font Size'>A</a><a class='resetFont' title='Reset Font Size'>A</a><a class='decreaseFont' title='Decrease Font Size'>A</a></div> 
    3238    <?php 
     
    3541else{ 
    3642    ?> 
    37     <div title='Resize Body Text' class="wpTextResizeControls" style='background-color:lightgray;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;padding:3px;width:55px;'> 
     43    <div title='Resize Body Text' class='wpTextResizeControls' style='background-color:lightgray;border-radius:7px;-moz-border-radius:7px;-webkit-border-radius:7px;padding:3px;width:55px;'> 
    3844        <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> 
    3945    </div>   
     
    4349 
    4450add_shortcode('wpResize','wpTextResizeControlsWidget'); 
     51 
  • wptextresizecontrols/trunk/readme.txt

    r590758 r590932  
    33Donate link: http://bradparbs.com/ 
    44Tags: text, resize, resizer, text resizing, increase font size 
     5Stable Tag: trunk 
    56Requires at least: 3.2 
    67Tested up to: 3.3.2 
     
    2829== Changelog == 
    2930 
     31= 1.5 = 
     32 
     33* Bug fixes 
     34 
    3035= 1.4 =  
    3136 
  • wptextresizecontrols/trunk/text.js

    r590695 r590932  
    33  var originalFontSize = $('html').css('font-size'); 
    44    $(".resetFont").click(function(){ 
    5       $('#page').css('font-size', originalFontSize); 
     5      $('.wptextresize').css('font-size', originalFontSize); 
    66  }); 
    77  // Increase Font Size 
    88  $(".increaseFont").click(function(){ 
    9     var currentFontSize = $('#page').css('font-size'); 
     9    var currentFontSize = $('.wptextresize').css('font-size'); 
    1010    var currentFontSizeNum = parseFloat(currentFontSize, 10); 
    1111    var newFontSize = currentFontSizeNum*1.2; 
    12     $('#page').css('font-size', newFontSize); 
     12    $('.wptextresize').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 = $('#page').css('font-size'); 
     20    var currentFontSize = $('.wptextresize').css('font-size'); 
    2121    var currentFontSizeNum = parseFloat(currentFontSize, 10); 
    2222    var newFontSize = currentFontSizeNum*0.8; 
    23     $('#page').css('font-size', newFontSize); 
     23    $('.wptextresize').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.