WordPress.org

Plugin Directory

Changeset 1538703


Ignore:
Timestamp:
11/22/16 22:05:47 (13 months ago)
Author:
Kau-Boy
Message:

release v1.0.4

Location:
crazy-lazy/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • crazy-lazy/trunk/README.md

    r1483961 r1538703  
    55* Requires at least: 3.6 
    66* Tested up to:      4.6 
    7 * Stable tag:        1.0.3 
     7* Stable tag:        1.0.4 
    88* License:           GPLv2 or later 
    99* License URI:       http://www.gnu.org/licenses/gpl-2.0.html 
     
    6262 
    6363## Changelog ## 
     64### 1.0.4 ### 
     65* fixed duplicate replacements of a single image 
     66 
    6467### 1.0.3 ### 
    6568* fixed some cases with HTML attributes not being closed correctly 
  • crazy-lazy/trunk/crazy-lazy.php

    r1483961 r1538703  
    1313 * Author URI:  http://pluginkollektiv.org 
    1414 * Plugin URI:  https://wordpress.org/plugins/crazy-lazy/ 
     15 * Text Domain: crazy-lazy 
    1516 * License:     GPLv2 or later 
    1617 * License URI: http://www.gnu.org/licenses/gpl-2.0.html 
    17  * Version:     1.0.3 
     18 * Version:     1.0.4 
    1819 */ 
    1920 
  • crazy-lazy/trunk/inc/crazy-lazy.class.php

    r1483961 r1538703  
    9494                    class=["\'](?P<class2>.*?(?:wp-image-|wp-post-image)[^>"\']*)["\'] 
    9595                ) 
    96                 (?P<after>[^>\/]*)                                                  (?# match any additional optional attributes ) 
     96                (?P<after>[^>]*)                                                    (?# match any additional optional attributes ) 
    9797                (?P<closing>\/?)>                                                   (?# match the closing of the img tag with or without a self closing slash ) 
    9898            )/x', 
     
    114114        /* Empty gif */ 
    115115        $null = 'data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='; 
    116         // Return unmodified image if the "data skip" attribute was found. 
    117         if ( false !== strpos( $matches['all'], 'data-crazy-lazy="exclude"' ) ) { 
     116        // Return unmodified image if the "data skip" attribute was found or the image has already been processed. 
     117        if ( false !== strpos( $matches['all'], 'data-crazy-lazy="exclude"' ) || false !== strpos( $matches['class1'] . $matches['class2'], 'crazy_lazy' ) ) { 
    118118            return $matches['all']; 
    119119        } else { 
    120             return '<img ' . $matches['before'] 
    121                    . ' class="crazy_lazy ' . $matches['class1'] . $matches['class2'] . '" src="' . $null . '" ' 
    122                    . $matches['between1'] . $matches['between2'] 
    123                    . ' data-src="' . $matches['src1'] . $matches['src2'] . '" ' 
    124                    . $matches['after'] 
    125                    . ' style="display:none" ' 
    126                    . $matches['closing'] . '><noscript>' . $matches['all'] . '</noscript>'; 
     120            return '<img ' . $matches['before'] 
     121                   . ' style="display:none" ' 
     122                   . ' class="crazy_lazy ' . $matches['class1'] . $matches['class2'] . '" src="' . $null . '" ' 
     123                   . $matches['between1'] . $matches['between2'] 
     124                   . ' data-src="' . $matches['src1'] . $matches['src2'] . '" ' 
     125                   . $matches['after'] 
     126                   . $matches['closing'] . '><noscript>' . $matches['all'] . '</noscript>'; 
    127127        } 
    128128    } 
Note: See TracChangeset for help on using the changeset viewer.