Changeset 3214271
- Timestamp:
- 12/29/2024 12:50:08 AM (15 months ago)
- Location:
- blur-text/trunk
- Files:
-
- 2 added
- 2 deleted
- 3 edited
-
assets/banner-772x250.jpg (added)
-
assets/icon-128x128.jpg (added)
-
assets/screenshot-2.jpg (deleted)
-
blur-text.js (modified) (4 diffs)
-
blur-text.php (modified) (3 diffs)
-
includes (deleted)
-
readme.txt (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blur-text/trunk/blur-text.js
r1247794 r3214271 4 4 jQuery( document ).ready(function() { 5 5 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; 43 7 44 8 var $blur = jQuery(".blur"), … … 52 16 var background_color = this.css("background"); 53 17 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); 61 20 }; 62 21 63 22 jQuery.fn.unblur = function() { 64 23 var oldcolor = this.attr('oldcolor'); 65 var oldbackground = this.attr('oldbackground');66 24 this.css('color', oldcolor); 67 25 this.css('text-shadow', 'none'); 68 26 this.removeAttr('oldcolor'); 69 if(IE) {70 this.css('background', oldbackground);71 }72 27 }; 73 28 74 // set up initial blur75 29 $blur_hover.each(function() { 76 30 toggleblur(jQuery(this)); 77 31 }); 32 78 33 $blur.each(function() { 79 34 toggleblur(jQuery(this)); … … 94 49 function toggleblur($element) { 95 50 96 if(!compatible && $element.hasClass('blur_nofallback')) {97 // do nothing98 return;99 } else if (!compatible && $element.hasClass('blur_hide')) {100 $element.hide();101 return;102 }103 51 var attr = $element.attr('oldcolor'); 104 52 // For some browsers, `attr` is undefined; for others, … … 110 58 } 111 59 } 112 113 114 115 60 }); -
blur-text/trunk/blur-text.php
r1247794 r3214271 2 2 /* 3 3 * Plugin Name: Blur Text 4 * Plugin URI: http ://www.linsoftware.com/blur-text/4 * Plugin URI: https://www.linsoftware.com/blur-text/ 5 5 * Description: Blur Text with a shortcode. Unblur with a click or hover. 6 * Version: 1.0.07 * Author: Linnea Wilhelm, LinSoftware8 * Author URI: http ://www.linsoftware.com6 * Version: 2.0.0 7 * Author: Linnea Huxford, LinSoftware 8 * Author URI: https://www.linsoftware.com 9 9 */ 10 10 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 */ 20 24 function blur_shortcode( $atts, $content = null ) { 21 25 $a = shortcode_atts( array( … … 25 29 ), $atts ); 26 30 27 $class_names = 'blur'; 31 $color = esc_attr( $a['color'] ); 32 $class_names = []; 28 33 if(strcmp($a['toggle'], 'hover')== 0) { 29 $class_names .= '_hover';30 } else if (strcmp($a['toggle'], 'click')== 0){31 $class_names .= '_click';34 $class_names[] = 'blur_hover'; 35 } else { 36 $class_names[] = 'blur_click'; 32 37 } 33 38 34 39 if(strcmp($a['fallback'], 'none')== 0) { 35 $class_names .= 'blur_nofallback';40 $class_names[] = 'blur_nofallback'; 36 41 } elseif(strcmp($a['fallback'], 'hide')== 0) { 37 $class_names .= 'blur_hide';42 $class_names[] = 'blur_hide'; 38 43 } 39 44 45 $class_names = join( ' ', array_map( 'sanitize_html_class', $class_names ) ); 40 46 41 return '<span class="' . $class_names . '" style="color:'. $ a['color'].'">' . $content . '</span>';47 return '<span class="' . $class_names . '" style="color:'. $color .'">' . $content . '</span>'; 42 48 } 43 49 … … 47 53 function blur_scripts() { 48 54 wp_enqueue_script( 'blur_linsoft', plugins_url( '/blur-text.js', __FILE__ ) , 49 array( 'jquery' ), ' 1.0.0' );55 array( 'jquery' ), '2.0.0' ); 50 56 } 51 57 -
blur-text/trunk/readme.txt
r1247794 r3214271 1 1 === 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/ 2 Author URI: https://www.linsoftware.com 3 Plugin URI: https://www.linsoftware.com/blur-text/ 4 Contributors: Linnea Huxford 6 5 Tags: blur text, hide text, blur, hover 7 6 Requires at least: 3.9 8 Tested up to: 4.39 Stable tag: 1.0.07 Tested up to: 6.7.1 8 Stable tag: 2.0.0 10 9 License: GPLv2 or later 11 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 34 33 [blur color=#00FF00]This text will be green, even when blurred.[/blur] 35 34 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 54 35 == Installation == 55 36 … … 67 48 I may write a premium plugin that has these features. However, I need suggestions as to exactly what type of features I 68 49 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/ 71 51 72 52 == Screenshots == … … 76 56 77 57 == 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. 78 65 79 66 = 1.0.0: September 2015 =
Note: See TracChangeset
for help on using the changeset viewer.