4 # A.k.a `Best web-album Of the world, Or your money back, Humerus'.
6 # The acronyn sucks, however this is a tribute to Dragon Ball by
7 # Akira Toriyama, where the last enemy beaten by heroes of Dragon
8 # Ball is named "Boo". But there was already a free software project
9 # called Boo, so this one will be it "Booh". Or whatever.
12 # Copyright (c) 2004 Guillaume Cottenceau <gc3 at bluewin.ch>
14 # This software may be freely redistributed under the terms of the GNU
15 # public license version 2.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 # holds static data to merge in the html "themes"
24 bindtextdomain("booh")
26 require 'booh/booh-lib'
27 require 'booh/version.rb'
30 $image_head_code = '<meta name="generator" content="Booh-' + $VERSION + <<'EOF'
33 <script language="JavaScript1.1" type="text/JavaScript">
34 var images = new Array(~~images~~);
35 var types = new Array(~~types~~);
36 var videos = new Array(~~videos~~);
37 var videos_widths = new Array(~~videos_widths~~);
38 var videos_heights = new Array(~~videos_heights~~);
40 var thumbnailspages = new Array(~~thumbnailspages~~);
41 var other_sizes = new Array(~~other_sizes~~);
42 var captions = new Array(~~captions~~);
44 dbltilda_current_size = '~~current_size~~';
45 dbltilda_theme = '~~theme~~';
46 dbltilda_stop_slideshow = '~~stop_slideshow~~';
47 dbltilda_run_slideshow = '~~run_slideshow~~';
48 dbltilda_htmlsuffix = '~~htmlsuffix~~';
49 dbltilda_pathtobase = '~~pathtobase~~';
50 dbltilda_flowplayer_active = '~~flowplayer_active~~';
54 $image_head_code.sub!('~~run_slideshow~~', defer_translation(N_('Run slideshow!')))
55 $image_head_code.sub!('~~stop_slideshow~~', defer_translation(N_('Stop slideshow')))
57 $body_additions = <<'EOF'
58 onload="init()" id="body"
62 <form action="fake"><input type="button"
64 value="' + defer_translation(N_('<<- First')) + '"
65 id="b_first"/></form>'
68 <form action="fake"><input type="button"
70 value="' + defer_translation(N_('<- Previous')) + '"
71 id="b_previous"/></form>'
74 <form action="fake"><input type="button"
76 value="' + defer_translation(N_('Next ->')) + '"
80 <form action="fake"><input type="button"
82 value="' + defer_translation(N_('Last ->>')) + '"
87 onclick="toggle_slideshow(true)"
88 value="' + defer_translation(N_('Run slideshow!')) + '"
92 <font size="-2">' + defer_translation(N_('pause:')) + '<input type="text" id="secs" size="1" value="3"/>' + defer_translation(N_('secs')) + '</font>'
96 <span id="main_img">Loading image, please wait...</span>
99 $image_counter_additions = <<'EOF'
103 $caption_additions = <<'EOF'
111 $thumbnails_head_code = '<meta name="generator" content="Booh-' + $VERSION + <<'EOF'
114 <script language="JavaScript1.1" type="text/JavaScript">
115 function set_preferred_size(val) {
116 var expires = new Date(new Date().getTime() + (30 * 86400000)); // 30 days
117 document.cookie = 'booh-preferred-size-~~theme~~='
119 + '; expires=' + expires.toGMTString()
126 $preferred_size_reloader = <<'EOF'
130 <script language="JavaScript1.1" type="text/JavaScript">
132 var sizes = new Array(~~all_sizes~~);
134 function getPreferredSize() {
135 if (document.cookie) {
136 var index = document.cookie.indexOf('booh-preferred-size-~~theme~~');
138 var oleft = document.cookie.indexOf('=', index) + 1;
139 var oright = document.cookie.indexOf(';', index);
141 oright = document.cookie.length;
143 size = document.cookie.substring(oleft, oright);
144 for (i = 0; i < sizes.length; i++) {
145 if (sizes[i] == size) {
146 return 'thumbnails-' + size + '-0~~htmlsuffix~~';
151 w = document.body.offsetWidth;
152 ~~size_auto_chooser~~
153 return 'thumbnails-~~default_size~~-0~~htmlsuffix~~';
156 window.location.href = getPreferredSize();
160 <meta http-equiv="refresh" content="0.1;url=thumbnails-~~default_size~~-nojs-0~~htmlsuffix~~">
165 $index_head_code = '<meta name="generator" content="Booh-' + $VERSION + ' http://booh.org/"/>
166 <script language="JavaScript1.1" type="text/JavaScript">
168 if (!document.cookie || document.cookie.indexOf("booh-not-a-newbie") == -1) {
169 document.getElementById("title").innerHTML += "<br/><br/>' + defer_translation(N_("<i>Hint: you can click on the images to open the albums!</i>")) + '";
171 var expires = new Date(new Date().getTime() + (10 * 86400000)); // 10 days
172 document.cookie = "booh-not-a-newbie=true"
173 + "; expires=" + expires.toGMTString()