html_reload_to_thumbnails.gsub!(/~~theme~~/, $theme)
html_reload_to_thumbnails.gsub!(/~~default_size~~/, $default_size['name'])
html_reload_to_thumbnails.gsub!(/~~all_sizes~~/, all_images_sizes.collect { |s| "\"#{size2js(s['name'])}\"" }.join(', '))
+ size_auto_chooser = '';
+ all_images_sizes.sort { |a,b| b['optimizedforwidth'].to_i <=> a['optimizedforwidth'].to_i }.
+ each { |s| size_auto_chooser += "if (w + 50 - #{s['optimizedforwidth']} > 0) { return 'thumbnails-#{size2js(s['name'])}.html'; }\n" }
+ html_reload_to_thumbnails.gsub!(/~~size_auto_chooser~~/, size_auto_chooser)
return html_reload_to_thumbnails
end
'description' => _("Sizes that should fit browsers in fullscreen for 800x600 screens"),
'fullscreen' => '750x414',
'thumbnails' => '192x144',
+ 'optimizedforwidth' => '800',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1024x768 screens"),
'fullscreen' => '960x528',
'thumbnails' => '240x180',
+ 'optimizedforwidth' => '1024',
'default' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1280x1024 screens"),
'fullscreen' => '1200x660',
'thumbnails' => '300x225',
+ 'optimizedforwidth' => '1280',
},
{
'name' => 'x-large',
'description' => _("Sizes that should fit browsers in fullscreen for 1400x1050 screens"),
'fullscreen' => '1312x721',
'thumbnails' => '328x245',
+ 'optimizedforwidth' => '1400',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1600x1200 screens"),
'fullscreen' => '1500x825',
'thumbnails' => '375x281',
+ 'optimizedforwidth' => '1600',
'optional' => true,
}
]
'description' => _("Sizes that should fit browsers in fullscreen for 800x600 screens"),
'fullscreen' => '552x414',
'thumbnails' => '184x138',
+ 'optimizedforwidth' => '800',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1024x768 screens"),
'fullscreen' => '704x528',
'thumbnails' => '232x174',
+ 'optimizedforwidth' => '1024',
'default' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1280x1024 screens"),
'fullscreen' => '880x660',
'thumbnails' => '292x219',
+ 'optimizedforwidth' => '1280',
},
{
'name' => 'x-large',
'description' => _("Sizes that should fit browsers in fullscreen for 1400x1050 screens"),
'fullscreen' => '962x721',
'thumbnails' => '320x240',
+ 'optimizedforwidth' => '1400',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1600x1200 screens"),
'fullscreen' => '1100x825',
'thumbnails' => '368x276',
+ 'optimizedforwidth' => '1600',
'optional' => true,
}
]
'description' => _("Sizes that should fit browsers in fullscreen for 800x600 screens"),
'fullscreen' => '750x414',
'thumbnails' => '192x144',
+ 'optimizedforwidth' => '800',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1024x768 screens"),
'fullscreen' => '960x528',
'thumbnails' => '240x180',
+ 'optimizedforwidth' => '1024',
'default' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1280x1024 screens"),
'fullscreen' => '1200x660',
'thumbnails' => '300x225',
+ 'optimizedforwidth' => '1280',
},
{
'name' => 'x-large',
'description' => _("Sizes that should fit browsers in fullscreen for 1400x1050 screens"),
'fullscreen' => '1312x721',
'thumbnails' => '328x245',
+ 'optimizedforwidth' => '1400',
'optional' => true,
},
{
'description' => _("Sizes that should fit browsers in fullscreen for 1600x1200 screens"),
'fullscreen' => '1500x825',
'thumbnails' => '375x281',
+ 'optimizedforwidth' => '1600',
'optional' => true,
}
]
$preferred_size_reloader = <<'EOF'
<html>
- <head>
+ <body>
+ </body>
<script language="JavaScript1.1" type="text/JavaScript">
var sizes = new Array(~~all_sizes~~);
}
}
}
+ } else {
+ w = document.body.offsetWidth;
+ ~~size_auto_chooser~~
}
return 'thumbnails-~~default_size~~.html';
}
window.location.href = getPreferredSize();
</script>
- </head>
</html>
EOF