*** empty log message ***
authorgc <gc>
Wed, 12 Apr 2006 20:34:22 +0000 (20:34 +0000)
committergc <gc>
Wed, 12 Apr 2006 20:34:22 +0000 (20:34 +0000)
bin/booh-backend

index f20fbb589493c4ffc39535441f23d51a864a54ec..8365e4ce00253ee353d59fd79f44769f38ad236a 100755 (executable)
@@ -915,8 +915,6 @@ def walk_source_dir
                 html = $html_thumbnails.collect { |l| l.clone }
                 iterations = {}
                 for i in html
-                    i.sub!(/~~run_slideshow~~/,
-                           images.size <= 1 ? '' : '<a href="image-' + size2js(sizeobj['name']) + '.html#run_slideshow=1">' + utf8(_('Run slideshow!'))+'</a>')
                     i.sub!(/~~title~~/,
                            xmldir.attributes['thumbnails-caption'] || utf8(File.basename(dir)))
                     discover_iterations(iterations, i)
@@ -1003,23 +1001,25 @@ def walk_source_dir
                     i.gsub!(/~~current_size_js~~/, size2js(sizeobj['name']))
                     i.gsub!(/~~madewith~~/, $madewith || '')
                     i.gsub!(/~~indexlink~~/, $indexlink || '')
-                    if all_pages.size == 1
-                        i.gsub!(/~~ifmultiplepages\?~~.*~~fi~~/, '')
-                    else
-                        i.gsub!(/~~ifmultiplepages\?~~(.+?)~~fi~~/) { $1 }
-                        i.gsub!(/~~multiplepagesstuff~~/, mstuff)
-                    end
                 end
                 html_nojs = html.collect { |l| l.clone }
                 pagecount = 0
                 for page in all_pages
                     html_thumbnails, html_thumbnails_nojs = page
                     final_html = html.collect { |l| l.clone }
-                    mstuff = utf8(_("Pages: %s") % (pagecount > 0 ? "<a href=\"thumbnails-#{size2js(sizeobj['name'])}-#{pagecount - 1}.html\">" + _("<- Previous") + "</a> " : '') +
-                                                   all_pages.collect_with_index { |p,idx| page == p ? idx + 1 : "<a href=\"thumbnails-#{size2js(sizeobj['name'])}-#{idx}.html\">#{idx + 1}</a>" }.join(', ') +
-                                                   (pagecount < all_pages.size - 1 ? " <a href=\"thumbnails-#{size2js(sizeobj['name'])}-#{pagecount + 1}.html\">" + _("Next ->") + "</a> " : ''))
+                    mstuff = utf8(_("Pages: %s") % (pagecount > 0 ? "<a href=\"thumbnails-#{size2js(sizeobj['name'])}%nojs-#{pagecount - 1}.html\">" + _("<- Previous") + "</a> " : '') +
+                                                   all_pages.collect_with_index { |p,idx| page == p ? idx + 1 : "<a href=\"thumbnails-#{size2js(sizeobj['name'])}%nojs-#{idx}.html\">#{idx + 1}</a>" }.join(', ') +
+                                                   (pagecount < all_pages.size - 1 ? " <a href=\"thumbnails-#{size2js(sizeobj['name'])}%nojs-#{pagecount + 1}.html\">" + _("Next ->") + "</a> " : ''))
                     for i in final_html
+                        i.sub!(/~~run_slideshow~~/,
+                               images.size <= 1 ? '' : '<a href="image-' + size2js(sizeobj['name']) + '.html#run_slideshow=1">' + utf8(_("Run slideshow!"))+'</a>')
                         i.sub!(/~~thumbnails~~/, html_thumbnails)
+                        if all_pages.size == 1
+                            i.gsub!(/~~ifmultiplepages\?~~.*~~fi~~/, '')
+                        else
+                            i.gsub!(/~~ifmultiplepages\?~~(.+?)~~fi~~/) { $1 }
+                            i.gsub!(/~~multiplepagesstuff~~/, mstuff.gsub('%nojs', ''))
+                        end
                         substitute_html_sizes(i, sizeobj, 'thumbnails', "-#{pagecount}")
                     end
                     ios = File.open("#{dest_dir}/thumbnails-#{size2js(sizeobj['name'])}-#{pagecount}.html", "w")
@@ -1027,7 +1027,14 @@ def walk_source_dir
                     ios.close
                     final_html_nojs = html_nojs.collect { |l| l.clone }
                     for i in final_html_nojs
+                        i.sub!(/~~run_slideshow~~/, utf8(_("<i>Click on an image to view it larger</i>")))
                         i.sub!(/~~thumbnails~~/, html_thumbnails_nojs)
+                        if all_pages.size == 1
+                            i.gsub!(/~~ifmultiplepages\?~~.*~~fi~~/, '')
+                        else
+                            i.gsub!(/~~ifmultiplepages\?~~(.+?)~~fi~~/) { $1 }
+                            i.gsub!(/~~multiplepagesstuff~~/, mstuff.gsub('%nojs', '-nojs'))
+                        end
                         substitute_html_sizes(i, sizeobj, 'thumbnails', "-nojs-#{pagecount}")
                     end
                     ios = File.open("#{dest_dir}/thumbnails-#{size2js(sizeobj['name'])}-nojs-#{pagecount}.html", "w")