From: gc Date: Mon, 18 Apr 2005 21:36:14 +0000 (+0000) Subject: fix cookie X-Git-Tag: 0.9.0~584 X-Git-Url: http://git.zarb.org/?p=booh;a=commitdiff_plain;h=9480effbfe71ae2d91d5f5615c08f4e744f2a34c fix cookie --- diff --git a/README b/README index fdc586a..7a42a70 100644 --- a/README +++ b/README @@ -10,6 +10,7 @@ US-ASCII characters (even if I _don't_ advice you to store files with these) - clever use of the whole space of a typical browser window +- cookie to remember the preferred size of thumbnails accross sub-albums - subalbums support (images in any subdirectory depth) frontend diff --git a/bin/booh b/bin/booh index baed847..5adf087 100755 --- a/bin/booh +++ b/bin/booh @@ -462,8 +462,6 @@ def walk_source_dir type = images.include?(file) ? 'image' : videos.include?(file) ? 'video' : nil if type html_thumbnails += run_iterations(iterations) - html_thumbnails.gsub!(/~~theme~~/, $theme) - html_thumbnails.gsub!(/~~current_size~~/, sizeobj['name']) if type == 'image' index = images.index(file) html_thumbnails.gsub!(/~~image_iteration~~/, @@ -492,6 +490,8 @@ def walk_source_dir html_thumbnails += close_iterations(iterations) for i in html i.sub!(/~~thumbnails~~/, html_thumbnails) + i.gsub!(/~~theme~~/, $theme) + i.gsub!(/~~current_size~~/, sizeobj['name']) end ios = File.open("#{dest_dir}/thumbnails-#{sizeobj['name']}.html", "w") ios.write(html) diff --git a/lib/booh/html-merges.rb b/lib/booh/html-merges.rb index 4ea0da4..23b1d4f 100644 --- a/lib/booh/html-merges.rb +++ b/lib/booh/html-merges.rb @@ -99,6 +99,11 @@ function preload() { function init() { + var expires = new Date(new Date().getTime() + (30 * 86400000)); // 30 days + document.cookie = 'booh-preferred-size-~~theme~~=~~current_size~~' + + '; expires=' + expires.toGMTString() + + '; path=/'; + /* retrieve GET parameters */ all_params = location.href.split("?") if (all_params.length > 1) {