Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Make the default header and footer a bit more dynamic. |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | dynamicStyle |
| Files: | files | file ages | folders |
| SHA1: |
6cea1e492076c5650b561c5580e77a8d |
| User & Date: | mistachkin 2012-09-18 00:06:01.599 |
Context
|
2012-09-18
| ||
| 00:15 | Strip out TH1 comments from the header. ... (Closed-Leaf check-in: 354bfe206e user: mistachkin tags: dynamicStyle) | |
| 00:06 | Make the default header and footer a bit more dynamic. ... (check-in: 6cea1e4920 user: mistachkin tags: dynamicStyle) | |
| 00:03 | Fix the <base> tag in the default header. ... (check-in: eb1513b7a9 user: drh tags: trunk) | |
Changes
Changes to src/style.c.
| ︙ | ︙ | |||
308 309 310 311 312 313 314 |
/* End the side-box
*/
void style_sidebox_end(void){
@ </div>
}
| < | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 |
/* End the side-box
*/
void style_sidebox_end(void){
@ </div>
}
/*
** The default page header.
*/
const char zDefaultHeader[] =
@ <html>
@ <head>
@ <base href="$baseurl/$current_page" />
@ <title>$<project_name>: $<title></title>
@ <link rel="alternate" type="application/rss+xml" title="RSS Feed"
@ href="$home/timeline.rss" />
@ <link rel="stylesheet" href="$home/style.css?default" type="text/css"
@ media="screen" />
@ </head>
@ <body>
@ <div class="header">
@ <div class="logo">
@ <th1>
@ #
@ # NOTE: The purpose of this procedure is to take the base URL of the
@ # Fossil project and return the root of the entire web site using
@ # the same URI scheme as the base URL (e.g. http or https).
@ #
@ proc getLogoUrl { baseurl } {
@ set idx(first) [string first // $baseurl]
@ if {$idx(first) != -1} {
@ set idx(first+1) [expr {$idx(first) + 2}]; # NOTE: Skip second slash.
@ #
@ # NOTE: (part 1) The [string first] command does NOT actually support
@ # the optional startIndex argument as specified in the TH1
@ # manual; therefore, we fake it by using [string range] and then
@ # adding the necessary offset to the resulting index manually
@ # (below).
@ #
@ # set idx(next) [string first / $baseurl $idx(first+1)]
@ set idx(next) [string first / [string range $baseurl $idx(first+1) end]]
@ if {$idx(next) != -1} {
@ #
@ # NOTE: (part 2) Add the necessary offset to the result of the
@ # search for the next slash (i.e. the one after the initial
@ # search for the two slashes).
@ #
@ set idx(next) [expr {$idx(next) + $idx(first+1)}]
@ #
@ # NOTE: Back up one character from the next slash.
@ #
@ set idx(next-1) [expr {$idx(next) - 1}]
@ #
@ # NOTE: Extract the URI scheme and host from the base URL.
@ #
@ set scheme [string range $baseurl 0 $idx(first)]
@ set host [string range $baseurl $idx(first+1) $idx(next-1)]
@ #
@ # NOTE: Try to stay in SSL mode if we are there now.
@ #
@ if {[string compare $scheme http:/] == 0} {
@ set scheme "http://"
@ } else {
@ set scheme "https://"
@ }
@ set logourl "$scheme$host/"
@ } else {
@ set logourl $baseurl
@ }
@ } else {
@ set logourl $baseurl
@ }
@ return $logourl
@ }
@ set logourl [getLogoUrl $baseurl]
@ </th1>
@ <a href="$logourl">
@ <img src="$baseurl/logo" border="0" alt="$project_name">
@ </a>
@ </div>
@ <div class="title"><small>$<project_name></small><br />$<title></div>
@ <div class="status"><th1>
@ if {[info exists login]} {
@ puts "Logged in as $login"
@ } else {
@ puts "Not logged in"
|
| ︙ | ︙ | |||
373 374 375 376 377 378 379 | ; /* ** The default page footer */ const char zDefaultFooter[] = @ <div class="footer"> | > > > > > > > > > > > > > > > > | > > | 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 |
;
/*
** The default page footer
*/
const char zDefaultFooter[] =
@ <div class="footer">
@ <th1>
@ proc getTclVersion {} {
@ if {[catch {tclEval info patchlevel} tclVersion] == 0} {
@ return "<a href=\"http://www.tcl.tk/\">Tcl</a> version $tclVersion"
@ }
@ return ""
@ }
@ proc getVersion { version } {
@ set length [string length $version]
@ return [string range $version 1 [expr {$length - 2}]]
@ }
@ set version [getVersion $manifest_version]
@ set tclVersion [getTclVersion]
@ set fossilUrl http://www.fossil-scm.org
@ </th1>
@ <a href="$fossilUrl/">Fossil</a>
@ version $release_version $tclVersion
@ <a href="$fossilUrl/index.html/info/$version">$manifest_version</a>
@ <a href="$fossilUrl/fossil/timeline?c=$manifest_date&y=ci">$manifest_date</a>
@ </div>
@ </body></html>
;
/*
** The default Cascading Style Sheet.
** It's assembled by different strings for each class.
|
| ︙ | ︙ |