File: common.tcl

package info (click to toggle)
tk-html3 3.0~fossil20110109-8
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,656 kB
  • sloc: ansic: 48,994; tcl: 25,966; sh: 1,190; yacc: 161; makefile: 24
file content (100 lines) | stat: -rw-r--r-- 3,487 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100

# This file contains Tcl code used by the scripts that generate web-pages 
# (mkwebpage.tcl, mksupportpage.tcl) to generate the boxes on the left-hand
# side of the pages.
#

# This global variable contains the complete html text of the 
# "Site Contents" box.
set ::SiteMap {
    <!--
  	The following <div> block implements the "Site Contents" box. The
  	original text (from which each page copies this block) is contained in
  	the file webpage/common.tcl of the source distribution. If you need to
  	edit it, change it in webpage/common.tcl and regenerate the site.
    -->
    <div id="sitemap">
      <h3>Site Contents</h3>
      <ul>
        <li> <a href="index.html">Home</a>
             <span class="caption">Front page of this site</span>
        <li> <a href="support.html">Standards</a>
             <span class="caption">
                 Summary of support for CSS and HTML standards</span>
        <li> <a href="tkhtml.html">Man page</a>
             <span class="caption">
                 Unix style manual page for the widget.
             </span>
        <li> <a href="hv3.html">Hv3</a>
             <span class="caption">
                 Page for the demo/test application hv3. Screenshots and
                 starpacks for windows and linux are available here.
             </span>
        <li> <a href="http://tkhtml.tcl.tk/cvstrac/timeline">Cvstrac</a>
             <span class="caption">
		  Cvstrac is used for project change-log, wiki and bug
                  tracking.
             </span>
      </ul>
    </div>
}

proc getTabs {idx} {
  set ret "<center>"
  append ret {<div id="sitemap">}
  append ret <table><tr>
  set ii 0
  foreach {label href caption} [list                                         \
    Home       index.html   "Front page of this site"                        \
    Standards  support.html "Summary of support for CSS and HTML standards"  \
    "Tkhtml3"  tkhtml.html  "Unix style manual page for the Tkhtml3 widget." \
    "Hv3"      hv3.html     {
		 Page for the web browser application hv3. Screenshots and
                 starpacks for windows and linux are available here. }       \
    "Hv3&nbsp;Widget" hv3_widget.html     {
		 Page for the Hv3 mega-widget, a Snit based pure Tcl widget
                 that adds some commonly requested functionality to Tkhtml3. } \
    FFAQ       ffaq.html     "tkhtml.tcl.tk FFAQ"                            \
    Cvstrac      http://tkhtml.tcl.tk/cvstrac/timeline {
		  Cvstrac is used for project change-log, wiki and bug
                  tracking. }
  ] {
    if {$ii==$idx} {
      append ret [subst {
        <td><a id="active" href="$href">$label</div></a>}]
    } else {
      append ret "<td><a href=\"$href\">$label</a>"
    }
    append ret "<span class=\"caption\">$caption</span>"

    append ret {<td width=10 class="spacer"></td>}
    incr ii
  }
  append ret </table>
  append ret </div>
  return $ret
}

set ::PageSectionList [list]
proc addPageSection {title name} {
  lappend ::PageSectionList [list $title $name]
}

proc getToc {} {
  append ret {
    <!--
    	The following <div> block implements the "Page Contents" box.
  	This is auto-generated by code in the file webpage/common.tcl.
    -->
    <div id="toc">
      <h3>Page Contents</h3>
      <ul>
  }
  foreach entry $::PageSectionList {
    foreach {caption href} $entry {}
    append ret "        <li><a href=\"#$href\">$caption</a></li>\n"
  }
  append ret "      </ul>\n    </div>"

  return $ret
}