if type == 'image'
index = images.index(file)
html_thumbnails.gsub!(/~~image_iteration~~/,
- '<a href="image-' + sizeobj['name'] + '.html?current=' + fullscreen_images[sizeobj['name']][index] + '">' +
+ '<a href="image-' + sizeobj['name'] + '.html?current=' + fullscreen_images[sizeobj['name']][index] +
+ '" name="' + fullscreen_images[sizeobj['name']][index] + '">' +
img_element("#{dest_dir}/#{thumbnail_images[sizeobj['name']][index]}") + '</a>')
html_thumbnails.gsub!(/~~caption_iteration~~/,
find_caption_value(xmldir, images[index]) || utf8(images[index]))
#- generate image.html (page with fullscreen images)
if images.size > 0
- #- don't ask me why I need so many backslashes... the aim is to print \\\" for each " in the javascript source
- captions4js = find_captions(xmldir, images).collect { |e| e ? '"' + e.gsub('"', '\\\\\\\\\\\\\\\\\"' ) + '"' : '""' }.join(', ')
+ captions4js = find_captions(xmldir, images).collect { |e| e ? '"' + e.gsub('"', '\"' ) + '"' : '""' }.join(', ')
for sizeobj in $images_size
html = $html_images.collect { |l| l.clone }
images4js = fullscreen_images[sizeobj['name']].collect { |e| "\"#{e}\"" }.join(', ')
end
end
for i in html
- i.sub!(/~~images~~/, images4js)
- i.sub!(/~~other_images~~/, otherimages4js)
- i.sub!(/~~other_sizes~~/, othersizes.join(', '))
- i.sub!(/~~captions~~/, captions4js)
- i.sub!(/~~title~~/, xmldir.attributes['thumbnails-caption'] || utf8(File.basename(dir)))
- i.sub!(/~~thumbnails~~/, '<a href="thumbnails-' + sizeobj['name'] + '.html">' + utf8(_('Return to thumbnails')) + '</a>')
- i.sub!(/~~theme~~/, $theme)
- i.sub!(/~~current_size~~/, sizeobj['name'])
+ i.gsub!(/~~images~~/, images4js)
+ i.gsub!(/~~other_images~~/, otherimages4js)
+ i.gsub!(/~~other_sizes~~/, othersizes.join(', '))
+ i.gsub!(/~~captions~~/, captions4js)
+ i.gsub!(/~~title~~/, xmldir.attributes['thumbnails-caption'] || utf8(File.basename(dir)))
+ i.gsub!(/~~thumbnails~~/, '<a href="thumbnails-' + sizeobj['name'] + '.html" id="thumbnails">' + utf8(_('Return to thumbnails')) + '</a>')
+ i.gsub!(/~~theme~~/, $theme)
+ i.gsub!(/~~current_size~~/, sizeobj['name'])
for sizeobj2 in $images_size
if sizeobj != sizeobj2
i.sub!(/~~size_#{sizeobj2['name']}~~/,
/* don't show text if image not yet loaded because navigator
* won't refresh it during load */
if (images_loaded[current] == 2) {
- eval("document.getElementById('image_counter')" +
- ".firstChild.data = '" + ( current + 1 ) + "/" + images.length + "'");
- eval("document.getElementById('main_text')" +
- ".firstChild.data = \"" + ( captions[current] || images[current] ) + "\"");
+ document.getElementById('image_counter').firstChild.data = ( current + 1 ) + "/" + images.length;
+ document.getElementById('main_text').firstChild.data = captions[current] || images[current];
for (i = 0; i < other_sizes.length; i++) {
- eval("linkelems = document.getElementById('link" + other_sizes[i] + "').href.split('?');" +
- "document.getElementById('link" + other_sizes[i] + "').href = linkelems[0] + '?current=" + eval("images_" + other_sizes[i] + "[current]") + "'");
+ linkelems = document.getElementById('link' + other_sizes[i]).href.split('?');
+ document.getElementById('link' + other_sizes[i]).href = linkelems[0] + '?current=' + eval("images_" + other_sizes[i] + "[current]");
}
+ document.getElementById('thumbnails').href = 'thumbnails-~~current_size~~.html#' + images[current];
set_cursor("default");
} else {
setTimeout("show_current_text()", 100);