Plugin Directory

Changeset 1492697


Ignore:
Timestamp:
09/08/2016 04:43:13 PM (10 years ago)
Author:
bypr.nils
Message:

removing unused enhanced accuracy option

Location:
smart-image-loader/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • smart-image-loader/trunk/options.php

    r1462043 r1492697  
    3535        <tr valign="top">
    3636            <th style="padding-left: 1em;" scope="row">CSS Selector</th>
    37             <td style="padding-left: 1em;"><input type="text" name="sil-selector" id="sil-selector" value="<?php echo get_option('sil-selector', 'img'); ?>" /><br/>(jQuery) CSS Selector for images to affect. Use a class if you want to affect only certain images.</td>
     37            <td style="padding-left: 1em;"><input type="text" name="sil-selector" id="sil-selector" value="<?php echo get_option('sil-selector', 'img'); ?>" /><br/>CSS Selector for images to affect. Use a class if you want to affect only certain images.</td>
    3838        </tr>
    3939
     
    4545        <tr valign="top">
    4646            <th style="padding-left: 1em;" scope="row">Source placeholder</th>
    47             <td style="padding-left: 1em;"><input type="text" name="sil-placeholder" value="<?php echo get_option('sil-placeholder', ''); ?>" /><br/>Value of empty image source.</td>
    48         </tr>
    49 
    50         <tr valign="top" style="padding-left: 1em;">
    51             <th style="padding-left: 1em;" scope="row">Enhanced accuracy</th>
    52             <td style="padding-left: 1em;"><input type="checkbox" name="sil-accuracy" id="sil-accuracy" value="true" <?php checked( "true" == get_option('sil-accuracy') ) ?> /><label for="sil-accuracy">Check the images' actual visibility in addition to their position relative to the viewport.</label></td>
     47            <td style="padding-left: 1em;"><input type="text" name="sil-placeholder" value="<?php echo get_option('sil-placeholder', ''); ?>" /><br/>Value of empty image source attribute (default is a base64 encoded transparent pixel).</td>
    5348        </tr>
    5449
  • smart-image-loader/trunk/plugin.php

    r1462043 r1492697  
    44Plugin URI: https://wordpress.org/plugins/smart-image-loader
    55Description: Load images visible at page load ('above the fold') first for a fast page loading impression. Optional lazy loading for images 'below the fold'.
    6 Version: 0.4.5
     6Version: 0.4.6
    77Text Domain: smart-image-loader
    88Author: Bayer und Preuss
     
    114114            refresh_resize:        <?= get_option('sil-refresh-resize', 'false') ? 'true' : 'false' ?>,
    115115            refresh_scroll:        <?= get_option('sil-refresh-scroll', 'false') ? 'true' : 'false' ?>,
    116             enhanced_accuracy:     <?= get_option('sil-accuracy', 'false') ? 'true' : 'false' ?>,
    117116            lazy_load_at:          <?= get_option('sil-lazy-load-at', '1024') ?>,
    118117            fade:                  <?= get_option('sil-fade', 'false') ? 'true' : 'false' ?>,
     
    171170    add_option( 'sil-refresh-resize', 'true');
    172171    add_option( 'sil-refresh-scroll', 'false');
    173     add_option( 'sil-accuracy', 'false');
    174172    add_option( 'sil-lazy-load-at', '1024');
    175173    add_option( 'sil-fade', 'false');
     
    186184    register_setting( 'sil-settings-group', 'sil-refresh-resize' );
    187185    register_setting( 'sil-settings-group', 'sil-refresh-scroll' );
    188     register_setting( 'sil-settings-group', 'sil-accuracy' );
    189186    register_setting( 'sil-settings-group', 'sil-lazy-load-at' );
    190187    register_setting( 'sil-settings-group', 'sil-fade' );
  • smart-image-loader/trunk/readme.txt

    r1462034 r1492697  
    55Requires at least: 3.8.3
    66Tested up to: 4.5.3
    7 Stable tag: 0.4.5
     7Stable tag: 0.4.6
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    3232
    3333== Changelog ==
     34
     35= 0.4.6 =
     36* made enhanced accuracy option mandatory
     37* very minor performance tweaks
    3438
    3539= 0.4.5 =
  • smart-image-loader/trunk/smart_image_loader.js

    r1462044 r1492697  
    11(function($) {
    22
    3     // Version: 0.4.5
     3    // Version: 0.4.6
    44
    55    "use strict";
     
    2222        // update the images position data on resize event. You can also refresh manually in your script with sil_refresh().
    2323        refresh_scroll: false,
    24 
    25         // Check the images' actual visibility in addition to their position relative to the viewport.
    26         enhanced_accuracy: false,
    2724
    2825        // Maximum screen width where to switch from priority to lazy loading. Set to 0 for no lazy loading
     
    120117        var element,
    121118            $element,
     119            data,
    122120            element_offset_top,
    123121            element_offset_left,
     
    129127            is_not_right_of_screen,
    130128            is_not_left_of_screen,
    131             is_not_hidden;
     129            is_not_hidden,
     130            options;
    132131
    133132        if ( v.nodeType && v.nodeType == 1 )
     
    137136            element = this;
    138137
    139         $element = $(element);
    140 
    141         element_offset_top     = $element.data('offsetTop');
    142         element_offset_left    = $element.data('offsetLeft');
    143         element_width          = $element.data('width');
    144         element_height         = $element.data('height');
    145         element_visibile       = $element.data('visibility');
    146 
    147         is_not_above_screen    = element_offset_top + element_height > scroll_top - sil_options.meat;
    148         is_not_left_of_screen  = element_offset_left + element_width > scroll_left - sil_options.meat;
    149         is_not_below_screen    = element_offset_top < scroll_top + window_height + sil_options.meat;
    150         is_not_right_of_screen = element_offset_left < scroll_left + window_width + sil_options.meat;
     138        $element         = $(element);
     139        data             = $element.data();
     140        options          = sil_options;
     141        element_visibile = data['visibility'];
     142
     143        is_not_above_screen    = data['offsetTop'] + data['height'] > scroll_top - options.meat;
     144        is_not_left_of_screen  = data['offsetLeft'] + data['width'] > scroll_left - options.meat;
     145        is_not_below_screen    = data['offsetTop'] < scroll_top + window_height + options.meat;
     146        is_not_right_of_screen = data['offsetLeft'] < scroll_left + window_width + options.meat;
    151147
    152148
  • smart-image-loader/trunk/smart_image_loader.min.js

    r1462043 r1492697  
    22var V=document,L=window,v=D(V),R,s,A,r,o,e,u,H,c,C,j,g,f,t,n,Q,x,X,T,q=!!(L.matchMedia&&L.matchMedia("(max-device-width: "+W.lazy_load_at+"px)").matches),M=function(){var w=L,d="inner";
    33if(!("innerWidth" in L)){d="client";w=V.documentElement||V.body;}return{width:w[d+"Width"],height:w[d+"Height"]};},N=function(d,w){if(window.getComputedStyle){return document.defaultView.getComputedStyle(d,null)[w];
    4 }if(d.currentStyle){return d.currentStyle[w];}},y=function(){return x!==Q;},S=function(){return T!==X;},I=function(ag){var Y,ah,ab,Z,ac,w,d,ad,aa,ai,af,ae;
    5 if(ag.nodeType&&ag.nodeType==1){Y=ag;}else{if(this.nodeType&&this.nodeType==1){Y=this;}}ah=D(Y);ab=ah.data("offsetTop");Z=ah.data("offsetLeft");ac=ah.data("width");
    6 w=ah.data("height");d=ah.data("visibility");ad=ab+w>C-W.meat;af=Z+ac>j-W.meat;aa=ab<C+H+W.meat;ai=Z<j+u+W.meat;return ad&&af&&aa&&ai&&d;},O=function(d){var w,Y;
    7 if(d.nodeType&&d.nodeType==1){w=d;}else{if(this.nodeType&&this.nodeType==1){w=this;}}Y=D(w).attr("src");return Y==W.placeholder||Y==e;},F=function(d){return typeof d.width=="string"&&d.width.match(/^\d+$/)&&typeof d.height=="string"&&d.height.match(/^\d+$/);
     4}if(d.currentStyle){return d.currentStyle[w];}},y=function(){return x!==Q;},S=function(){return T!==X;},I=function(ah){var Z,ai,Y,ac,aa,ad,w,d,ae,ab,ak,ag,af,aj;
     5if(ah.nodeType&&ah.nodeType==1){Z=ah;}else{if(this.nodeType&&this.nodeType==1){Z=this;}}ai=D(Z);Y=ai.data();aj=W;d=Y.visibility;ae=Y.offsetTop+Y.height>C-aj.meat;
     6ag=Y.offsetLeft+Y.width>j-aj.meat;ab=Y.offsetTop<C+H+aj.meat;ak=Y.offsetLeft<j+u+aj.meat;return ae&&ag&&ab&&ak&&d;},O=function(d){var w,Y;if(d.nodeType&&d.nodeType==1){w=d;
     7}else{if(this.nodeType&&this.nodeType==1){w=this;}}Y=D(w).attr("src");return Y==W.placeholder||Y==e;},F=function(d){return typeof d.width=="string"&&d.width.match(/^\d+$/)&&typeof d.height=="string"&&d.height.match(/^\d+$/);
    88},a=function(d){d=d||s||D("body").find("noscript").prev(W.selector);d.each(function(){var w=D(this);w.data({offsetTop:w.offset().top,offsetLeft:w.offset().left,width:w.width(),height:w.height(),visibility:N(this,"display")!="none"&&N(this,"visibility")!="hidden"&&N(this,"opacity")!="0"&&w.is(":visible")});
    99});c=D(V).height();},J=function(Z,Y,d){R=D(Z);var w=R.attr("data-sil"),aa=o.filter('[data-sil="'+w+'"]');if(typeof Y=="function"){R.on("load",Y);}if(W.fade&&!d){R.data({opacity:R.css("opacity")}).css({opacity:"0"});
Note: See TracChangeset for help on using the changeset viewer.