fix bug "return to thumbmail image" broken in x-large
authorgc <gc>
Sun, 14 Aug 2005 21:04:57 +0000 (21:04 +0000)
committergc <gc>
Sun, 14 Aug 2005 21:04:57 +0000 (21:04 +0000)
bin/booh-backend
lib/booh/html-merges.rb

index 253d163..a2605f7 100755 (executable)
@@ -429,7 +429,7 @@ def substitute_html_sizes(html, sizeobj, type)
         for sizeobj2 in $images_size
             if sizeobj != sizeobj2
                 if type == 'thumbnails'
-                    sizestrings << '<a href="thumbnails-' + sizeobj2['name'] + '.html">' + sizename(sizeobj2['name']) + '</a>'
+                    sizestrings << '<a href="thumbnails-' + size2js(sizeobj2['name']) + '.html">' + sizename(sizeobj2['name']) + '</a>'
                 else
                     sizestrings << '<a id="link' + size2js(sizeobj2['name']) + '">' + sizename(sizeobj2['name']) + '</a>'
                 end
@@ -794,8 +794,9 @@ def walk_source_dir
                     i.sub!(/~~thumbnails~~/, html_thumbnails)
                     i.gsub!(/~~theme~~/, $theme)
                     i.gsub!(/~~current_size~~/, sizeobj['name'])
+                    i.gsub!(/~~current_size_js~~/, size2js(sizeobj['name']))
                 end
-                ios = File.open("#{dest_dir}/thumbnails-#{sizeobj['name']}.html", "w")
+                ios = File.open("#{dest_dir}/thumbnails-#{size2js(sizeobj['name'])}.html", "w")
                 ios.write(html)
                 ios.close
             end
@@ -828,7 +829,7 @@ def walk_source_dir
                         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!(/~~thumbnails~~/, '<a href="thumbnails-' + size2js(sizeobj['name']) + '.html" id="thumbnails">' + utf8(_('return to thumbnails')) + '</a>')
                         i.gsub!(/~~theme~~/, $theme)
                         i.gsub!(/~~current_size~~/, size2js(sizeobj['name']))
                         substitute_html_sizes(i, sizeobj, 'image')
@@ -979,7 +980,7 @@ def walk_source_dir
         #- substitute "return to albums" and previous/next correctly
         if xmldir.child_byname_notattr('image', 'deleted') || xmldir.child_byname_notattr('video', 'deleted')
             for sizeobj in $images_size
-                substInFile("#{dest_dir}/thumbnails-#{sizeobj['name']}.html") { |line|
+                substInFile("#{dest_dir}/thumbnails-#{size2js(sizeobj['name'])}.html") { |line|
                     sub_previous_next_album(previous_album, next_album, line)
                     if xmldir.elements['dir']
                         line.sub!(/~~return_to_albums~~/, '<a href="index.html">' + utf8(_('return to albums')) + '</a>')
index 4eacf24..82f2413 100644 (file)
@@ -478,7 +478,7 @@ $thumbnails_head_code = <<'EOF'
 
 <script language="JavaScript1.1" type="text/JavaScript">
     var expires = new Date(new Date().getTime() + (30 * 86400000));  // 30 days
-    document.cookie = 'booh-preferred-size-~~theme~~=~~current_size~~'
+    document.cookie = 'booh-preferred-size-~~theme~~=~~current_size_js~~'
                       + '; expires=' + expires.toGMTString()
                       + '; path=/';
 </script>