Changeset 112216 in spip-zone


Ignore:
Timestamp:
Oct 30, 2018, 1:38:06 PM (12 months ago)
Author:
arnaud.berard@…
Message:

ajout de blur-up a la liste des addons et produire_fond plutot que generer_url …

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/lazysizes/trunk/lazysizes_fonctions.php

    r110617 r112216  
    1717                'attrchange' => 'ls.attrchange',
    1818                'bgset' => 'ls.bgset',
     19                'blur-up' => 'ls.blur-up',
    1920                'custommedia' => 'ls.custommedia',
    2021                'fix-io-sizes' => 'fix-ios-sizes',
     
    4041function lazysizes_insertion_js($flux = ''){
    4142        include_spip('inc/config');
    42         $lazy_options = lire_config('lazysizes/options');
    43         $js_init_options = generer_url_public('lazysizes_config.js') ;
     43        $lazy_cfg = lire_config('lazysizes');
     44        $js_init_options = produire_fond_statique('lazysizes_config.js',$lazy_cfg) ;
    4445        $flux .= "<script type='text/javascript' src='$js_init_options' ></script>\n";;
    4546
    4647        // Addons
    47         $active_addons = lire_config('lazysizes/addons');
    4848        $ls_addons = lazysizes_addons();
    4949
    50         if (is_array($active_addons)) {
    51                 foreach($active_addons as $addon => $state){
     50        if (is_array($lazy_cfg['addons'])) {
     51                foreach($lazy_cfg['addons'] as $addon => $state){
    5252                        if(array_key_exists($addon, $ls_addons)){
    5353                                $file = timestamp(find_in_path('javascript/addons/'.$addon.'/'.$ls_addons[$addon].'.js'));
Note: See TracChangeset for help on using the changeset viewer.