Ignore:
Timestamp:
Feb 19, 2014, 6:14:59 AM (10 years ago)
Author:
rvelices
Message:

modus js optims

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/modus/themeconf.inc.php

    r27332 r27412  
    6969
    7070        if ( ($pos=strpos($source, '<ul class="categoryActions">'))!==false || ($pos=strpos($source, '<ul class=categoryActions>'))!==false){
    71                 if ( ($pos2=strpos($source, '</ul>', $pos))!==false 
     71                if ( ($pos2=strpos($source, '</ul>', $pos))!==false
    7272                        && (substr_count($source, '<li>', $pos, $pos2-$pos) > 2) )
    7373                        $source = substr_replace($source, '<a id=albumActionsSwitcher class=pwg-button><span class="pwg-icon pwg-icon-ellipsis"></span></a>{combine_script version=1 id=\'modus.async\' path="themes/`$themeconf.id`/js/modus.async.js" load=\'async\'}', $pos, 0);
     
    146146function modus_css_resolution($params)
    147147{
    148   $base = @$params['base'];
    149   $min = @$params['min'];
    150   $max = @$params['max'];
    151  
    152   $rules = array();
    153   if (!empty($base))
    154     $rules[] = $base;
    155   foreach(array('min','max') as $type)
    156   {
    157     if (!empty($$type))
    158       $rules[] = '(-webkit-'.$type.'-device-pixel-ratio:'.$$type.')';
    159   }
    160   $res = implode(' and ', $rules);
    161 
    162   $rules = array();
    163   if (!empty($base))
    164     $rules[] = $base;
    165   foreach(array('min','max') as $type)
    166   {
    167     if (!empty($$type))
    168       $rules[] = '('.$type.'-resolution:'.round(96*$$type,1).'dpi)';
    169   }
    170   $res .= ','.implode(' and ', $rules);
    171 
    172   return $res;
     148        $base = @$params['base'];
     149        $min = @$params['min'];
     150        $max = @$params['max'];
     151
     152        $rules = array();
     153        if (!empty($base))
     154                $rules[] = $base;
     155        foreach(array('min','max') as $type)
     156        {
     157                if (!empty($$type))
     158                        $rules[] = '(-webkit-'.$type.'-device-pixel-ratio:'.$$type.')';
     159        }
     160        $res = implode(' and ', $rules);
     161
     162        $rules = array();
     163        if (!empty($base))
     164                $rules[] = $base;
     165        foreach(array('min','max') as $type)
     166        {
     167                if (!empty($$type))
     168                        $rules[] = '('.$type.'-resolution:'.round(96*$$type,1).'dpi)';
     169        }
     170        $res .= ','.implode(' and ', $rules);
     171
     172        return $res;
    173173}
    174174
     
    184184        $device = get_device();
    185185        $container_margin = 5;
    186        
     186
    187187        if ('mobile'==$device)
    188188        {
     
    224224                }
    225225                while($csize[1]<$row_height-2 && $idx<count($candidates));
    226                
     226
    227227                if ($do_pop && $idx<count($candidates))
    228228                {
     
    254254
    255255        $my_base_name = basename(dirname(__FILE__));
    256   // not async to avoid visible flickering reflow
    257   $template->scriptLoader->add('modus.arange', 1, array('jquery'), 'themes/'.$my_base_name."/js/thumb.arrange.min.js", 0);
     256        // not async to avoid visible flickering reflow
     257        $template->scriptLoader->add('modus.arange', 1, array('jquery'), 'themes/'.$my_base_name."/js/thumb.arrange.min.js", 0);
    258258        if ($do_pop)
    259259                $template->scriptLoader->add('modus.pop', 2, array('jquery'), 'themes/'.$my_base_name."/js/thumb.pop.js", 0);
Note: See TracChangeset for help on using the changeset viewer.