Subversion Repositories Koakuma

Rev

Rev 28 | Rev 30 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 28 Rev 29
Line 1... Line 1...
1
#!/usr/bin/env tclsh
1
#!/usr/bin/env tclsh
2
# $Id: koakuma.cgi.in 28 2024-10-02 08:44:00Z nishi $
2
# $Id: koakuma.cgi.in 29 2024-10-02 08:56:47Z nishi $
3
 
3
 
4
set KOAKUMA_VERSION "1.00"
4
set KOAKUMA_VERSION "1.00"
5
set components ""
5
set components ""
6
 
6
 
7
chan configure stdout -buffering none
7
chan configure stdout -buffering none
Line 239... Line 239...
239
	rputs	"	<head>"
239
	rputs	"	<head>"
240
	rputs	"		<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
240
	rputs	"		<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\">"
241
	rputs	"		<title>$title - Koakuma</title>"
241
	rputs	"		<title>$title - Koakuma</title>"
242
	rputs	"		<link rel=\"stylesheet\" href=\"$css\">"
242
	rputs	"		<link rel=\"stylesheet\" href=\"$css\">"
243
	set msie " src=\"$koakuma_png\""
243
	set msie " src=\"$koakuma_png\""
-
 
244
	set msie2 ""
244
	if { [info exists "env(HTTP_USER_AGENT)"] } {
245
	if { [info exists "env(HTTP_USER_AGENT)"] } {
245
		if { [regexp {MSIE 6} "$env(HTTP_USER_AGENT)"] } {
246
		if { [regexp {MSIE 6} "$env(HTTP_USER_AGENT)"] } {
246
			set msie " style=\"filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$koakuma_png', sizingMethod='scale');\" src=\"/static/transparent.gif\""
247
			set msie " style=\"filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='$koakuma_png', sizingMethod='scale');\" src=\"/static/transparent.gif\""
-
 
248
			set msie2 " style=\"margin-top: 20px;\""
247
		}
249
		}
248
	}
250
	}
249
	rputs	"	</head>"
251
	rputs	"	</head>"
250
	rputs	"	<body>"
252
	rputs	"	<body>"
251
	rputs	"		<a href=\"/koakuma\" id=\"gomain\">"
253
	rputs	"		<a href=\"/koakuma\" id=\"gomain\">"
Line 256... Line 258...
256
	rputs	"			Koakuma"
258
	rputs	"			Koakuma"
257
	rputs	"		</div>"
259
	rputs	"		</div>"
258
	rputs	"		<a href=\"$env(SCRIPT_NAME)\">Root</a>"
260
	rputs	"		<a href=\"$env(SCRIPT_NAME)\">Root</a>"
259
	rputs	"		<div id=\"clearfix\"></div>"
261
	rputs	"		<div id=\"clearfix\"></div>"
260
	if { "$has_toc" == "1" } {
262
	if { "$has_toc" == "1" } {
261
		rputs	"		<div id=\"toc\">"
263
		rputs	"		<div id=\"doc\">"
-
 
264
	} else {
-
 
265
		rputs	"		<div id=\"doc-notoc\">"
-
 
266
	}
-
 
267
	if { "$has_toc" == "1" } {
-
 
268
		rputs	"		<div id=\"toc\"$msie2>"
262
		rputs	"			<div id=\"toctitle\">TOC</div>"
269
		rputs	"			<div id=\"toctitle\">TOC</div>"
263
		foreach sect $toc {
270
		foreach sect $toc {
264
			if { "[string range "[regsub -all { } "$sect" "-"]" 0 0]" == "-" } {
271
			if { "[string range "[regsub -all { } "$sect" "-"]" 0 0]" == "-" } {
265
				rputs "<a class=\"shiftlink\" href=\"#TOC-[regsub {^-} "[regsub -all { } "$sect" "-"]" ""]\">[regsub {^-} "$sect" ""]</a><br>"
272
				rputs "<a class=\"shiftlink\" href=\"#TOC-[regsub {^-} "[regsub -all { } "$sect" "-"]" ""]\">[regsub {^-} "$sect" ""]</a><br>"
266
			} else {
273
			} else {
267
				rputs "<a href=\"#TOC-[regsub -all { } "$sect" "-"]\">$sect</a><br>"
274
				rputs "<a href=\"#TOC-[regsub -all { } "$sect" "-"]\">$sect</a><br>"
268
			}
275
			}
269
		}
276
		}
270
		rputs	"		</div>"
277
		rputs	"		</div>"
271
	}
278
	}
272
	if { "$has_toc" == "1" } {
-
 
273
		rputs	"		<div id=\"doc\">"
-
 
274
	} else {
-
 
275
		rputs	"		<div id=\"doc-notoc\">"
279
	rputs	"			<div id=\"docinside\">"
276
	}
-
 
277
	rputs	"			<h1>$title</h1>"
280
	rputs	"				<h1>$title</h1>"
278
}
281
}
279
proc end_html {has_toc} {
282
proc end_html {has_toc} {
280
	global KOAKUMA_VERSION toc
283
	global KOAKUMA_VERSION toc
-
 
284
	rputs	"			</div>"
281
	rputs	"		</div>"
285
	rputs	"		</div>"
282
	rputs	"		<div id=\"clearfix\"></div>"
286
	rputs	"		<div id=\"clearfix\"></div>"
283
	rputs	"		<hr>"
287
	rputs	"		<hr>"
284
	rputs	"		<i>Powered by <a href=\"http://nishi.boats/koakuma\">Koakuma</a> $KOAKUMA_VERSION</i>"
288
	rputs	"		<i>Powered by <a href=\"http://nishi.boats/koakuma\">Koakuma</a> $KOAKUMA_VERSION</i>"
285
	rputs	"	</body>"
289
	rputs	"	</body>"