Plugin Directory

Changeset 3214271


Ignore:
Timestamp:
12/29/2024 12:50:08 AM (15 months ago)
Author:
LinSoftware
Message:

Update plugin for 2025; removes IE support, removes mailing list prompt, compatible for WP 6.7

Location:
blur-text/trunk
Files:
2 added
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • blur-text/trunk/blur-text.js

    r1247794 r3214271  
    44jQuery( document ).ready(function() {
    55
    6     /**
    7      * detect IE
    8      * returns version of IE or false, if browser is not Internet Explorer
    9      */
    10     function detectIE() {
    11         var ua = window.navigator.userAgent;
    12 
    13         var msie = ua.indexOf('MSIE ');
    14         if (msie > 0) {
    15             // IE 10 or older => return version number
    16             return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
    17         }
    18 
    19         var trident = ua.indexOf('Trident/');
    20         if (trident > 0) {
    21             // IE 11 => return version number
    22             var rv = ua.indexOf('rv:');
    23             return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
    24         }
    25 
    26         var edge = ua.indexOf('Edge/');
    27         if (edge > 0) {
    28             // IE 12 => return version number
    29             return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
    30         }
    31 
    32         // other browser
    33         return false;
    34     }
    35 
    36     var IE = detectIE();
    37 
    38     var supports_shadow = function supports_shadow() {
    39         return document.createElement("detect").style.textShadow === "";
    40     };
    41 
    42     var compatible = !IE && supports_shadow();
     6    var compatible = true;
    437
    448    var $blur = jQuery(".blur"),
     
    5216        var background_color = this.css("background");
    5317        this.attr('oldbackground', background_color);
    54         if(supports_shadow && !IE ) {
    55             this.css('color', 'transparent');
    56             this.css('text-shadow', '0px 0px 10px ' + c);
    57         } else {
    58             this.css('background', c);
    59             this.css('color', c);
    60         }
     18        this.css('color', 'transparent');
     19        this.css('text-shadow', '0px 0px 10px ' + c);
    6120    };
    6221
    6322    jQuery.fn.unblur = function() {
    6423            var oldcolor = this.attr('oldcolor');
    65             var oldbackground = this.attr('oldbackground');
    6624            this.css('color', oldcolor);
    6725            this.css('text-shadow', 'none');
    6826            this.removeAttr('oldcolor');
    69         if(IE) {
    70             this.css('background', oldbackground);
    71         }
    7227    };
    7328
    74     // set up initial blur
    7529    $blur_hover.each(function() {
    7630        toggleblur(jQuery(this));
    7731    });
     32
    7833    $blur.each(function() {
    7934        toggleblur(jQuery(this));
     
    9449    function toggleblur($element) {
    9550
    96         if(!compatible && $element.hasClass('blur_nofallback')) {
    97             // do nothing
    98             return;
    99         } else if (!compatible && $element.hasClass('blur_hide')) {
    100             $element.hide();
    101             return;
    102         }
    10351        var attr = $element.attr('oldcolor');
    10452        // For some browsers, `attr` is undefined; for others,
     
    11058        }
    11159    }
    112 
    113 
    114 
    11560});
  • blur-text/trunk/blur-text.php

    r1247794 r3214271  
    22/*
    33 * Plugin Name: Blur Text
    4  * Plugin URI: http://www.linsoftware.com/blur-text/
     4 * Plugin URI: https://www.linsoftware.com/blur-text/
    55 * Description: Blur Text with a shortcode.  Unblur with a click or hover.
    6  * Version: 1.0.0
    7  * Author: Linnea Wilhelm, Lin Software
    8  * Author URI: http://www.linsoftware.com
     6 * Version: 2.0.0
     7 * Author: Linnea Huxford, LinSoftware
     8 * Author URI: https://www.linsoftware.com
    99 */
    1010
    11 include_once('includes/LinsoftSubscribeNotice.php');
    12 
    13 
    14 // adds the following css classes, depending on the atts
    15 // blur
    16 // blur_hover
    17 // blur_click
    18 // blur_nofallback
    19 
     11/**
     12 * Adds a shortcode for blurring text.
     13 *
     14 * Supported Attributes:
     15 * blur
     16 * blur_hover
     17 * blur_click
     18 *
     19 * @param $atts array Attributes for the shortcode.
     20 * @param $content string The content inside the shortcode.
     21 *
     22 * @return string The content with the shortcode applied.
     23 */
    2024function blur_shortcode( $atts, $content = null ) {
    2125    $a = shortcode_atts( array(
     
    2529    ), $atts );
    2630
    27     $class_names = 'blur';
     31    $color = esc_attr( $a['color'] );
     32    $class_names = [];
    2833    if(strcmp($a['toggle'], 'hover')== 0) {
    29         $class_names .= '_hover';
    30     } elseif (strcmp($a['toggle'], 'click')== 0) {
    31         $class_names .= '_click';
     34        $class_names[] = 'blur_hover';
     35    } else {
     36        $class_names[] = 'blur_click';
    3237    }
    3338
    3439    if(strcmp($a['fallback'], 'none')== 0) {
    35         $class_names .= ' blur_nofallback';
     40        $class_names[] = 'blur_nofallback';
    3641    } elseif(strcmp($a['fallback'], 'hide')== 0) {
    37         $class_names .= ' blur_hide';
     42        $class_names[] = 'blur_hide';
    3843    }
    3944
     45    $class_names = join( ' ', array_map( 'sanitize_html_class', $class_names ) );
    4046
    41     return '<span class="' . $class_names . '" style="color:'. $a['color'] .'">' . $content . '</span>';
     47    return '<span class="' . $class_names . '" style="color:'. $color .'">' . $content . '</span>';
    4248}
    4349
     
    4753function blur_scripts() {
    4854    wp_enqueue_script( 'blur_linsoft', plugins_url( '/blur-text.js', __FILE__ ) ,
    49         array( 'jquery' ), '1.0.0' );
     55        array( 'jquery' ), '2.0.0' );
    5056}
    5157
  • blur-text/trunk/readme.txt

    r1247794 r3214271  
    11=== Blur Text ===
    2 Author URI: http://www.linsoftware.com
    3 Plugin URI: http://www.linsoftware.com/blur-text/
    4 Contributors: LinSoftware
    5 Donate link: http://www.linsoftware.com/support-free-plugin-development/
     2Author URI: https://www.linsoftware.com
     3Plugin URI: https://www.linsoftware.com/blur-text/
     4Contributors: Linnea Huxford
    65Tags: blur text, hide text, blur, hover
    76Requires at least: 3.9
    8 Tested up to: 4.3
    9 Stable tag: 1.0.0
     7Tested up to: 6.7.1
     8Stable tag: 2.0.0
    109License: GPLv2 or later
    1110License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3433[blur color=#00FF00]This text will be green, even when blurred.[/blur]
    3534
    36 This plugin uses the CSS3 feature "text-shadow" to create the blur and a transparent color font.  This plugin only works with the following browsers:
    37 Firefox 3.5+
    38 Chrome 4+
    39 Safari 4+
    40 Opera 9.6+
    41 
    42 This plugin allows you to choose what should be done on unsupported browsers.  There are currently 3 choices:
    43 1) blackout - This makes the background color the same color as the text  (default)
    44 2) none - This doesn't change the text at all.
    45 3) hide - The text will not be shown on unsupported browsers.
    46 
    47 The fallback is specified like this:
    48 
    49 [blur fallback=blackout color=red]This text will have a solid red background on unsupported browsers.[/blur]
    50 
    51 [blur toggle=click fallback=hide]If you are using IE or another unsupported browser, you will not see this text.[/blur]
    52 
    53 
    5435== Installation ==
    5536
     
    6748I may write a premium plugin that has these features.  However, I need suggestions as to exactly what type of features I
    6849 should add.  If you would like me to customize this plugin for you so that it shows the blurred text only in a
    69  specific context, I may be albe to program a custom plugin for you.  Please contact me at http://www.linsoftware.com/contact/
    70 
     50 specific context, I may be able to program a custom plugin for you.  Please contact me at http://www.linsoftware.com/contact/
    7151
    7252== Screenshots ==
     
    7656
    7757== Changelog ==
     58
     59= 2.0.0: December 2024 =
     60* Security Release
     61* Compatibility with WordPress 6.7.1
     62* Remove support for IE.
     63* Remove fallback for unsupported browsers because all browsers now support text-shadow.
     64* Remove mailing list subscription prompt.
    7865
    7966= 1.0.0: September 2015 =
Note: See TracChangeset for help on using the changeset viewer.