Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch skin5 Excluding Merge-Ins
This is equivalent to a diff from eb1513b7a9 to 6282cdf0c3
2012-09-18
| ||
21:16 | Merge the new theme to trunk. check-in: d5272ee958 user: mistachkin tags: trunk | |
05:14 | Sync up base tag in the header with those contained in the skins file. check-in: f4022040f8 user: mistachkin tags: trunk | |
05:11 | Enhance comments from the previous commit. Closed-Leaf check-in: 6282cdf0c3 user: mistachkin tags: skin5 | |
05:08 | Add a skin with enhanced handling of hyperlinks in the header and footer. check-in: 59fb15865c user: mistachkin tags: skin5 | |
03:21 | Add experimental support for copying the initial settings of a repository from another repository. check-in: e771171c68 user: mistachkin tags: newTemplate | |
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 | |
2012-09-13
| ||
07:12 | re-enable unicode commandline for MSVC build (previous commit accidently removed that) New version of dirent.h, which supports both MBCS and UNICODE check-in: 71d46aba2e user: jan.nijtmans tags: trunk | |
Changes to src/skins.c.
17 17 ** 18 18 ** Implementation of the Setup page for "skins". 19 19 */ 20 20 #include <assert.h> 21 21 #include "config.h" 22 22 #include "skins.h" 23 23 24 -/* @-comment: // */ 24 +/* @-comment: ## */ 25 25 /* 26 26 ** A black-and-white theme with the project title in a bar across the top 27 27 ** and no logo image. 28 28 */ 29 29 static const char zBuiltinSkin1[] = 30 30 @ REPLACE INTO config(name,mtime,value) 31 31 @ VALUES('css',now(),'/* General settings for the entire page */ ................................................................................ 918 918 @ <div class="footer"> 919 919 @ Fossil version $manifest_version $manifest_date 920 920 @ </div> 921 921 @ </body></html> 922 922 @ '); 923 923 ; 924 924 925 + 926 +/* 927 +** This skin is intended to be almost identical to the default one, with the 928 +** following changes to the header and footer: 929 +** 930 +** 1. The logo image in the header has been modified to be a hyperlink to the 931 +** root of the web site containing the repository using the same scheme 932 +** (i.e. HTTP or HTTPS) as the base URL for the repository. The header 933 +** contains a TH1 script block to help accomplish these tasks. 934 +** 935 +** 2. The Fossil version information in the footer has been augmented with 936 +** hyperlinks to the corresponding points on the timeline in the official 937 +** Fossil repository. Additionally, if the Tcl integration feature is 938 +** enabled, the loaded version of Tcl is included, with a hyperlink to the 939 +** official Tcl/Tk web site. The footer also contains a TH1 script block 940 +** to help accomplish these tasks. 941 +*/ 942 +static const char zBuiltinSkin5[] = 943 +@ REPLACE INTO config(name,mtime,value) 944 +@ VALUES('css',now(),'/* General settings for the entire page */ 945 +@ body { 946 +@ margin: 0ex 1ex; 947 +@ padding: 0px; 948 +@ background-color: white; 949 +@ font-family: sans-serif; 950 +@ } 951 +@ 952 +@ /* The project logo in the upper left-hand corner of each page */ 953 +@ div.logo { 954 +@ display: table-cell; 955 +@ text-align: center; 956 +@ vertical-align: bottom; 957 +@ font-weight: bold; 958 +@ color: #558195; 959 +@ min-width: 200px; 960 +@ } 961 +@ 962 +@ /* The page title centered at the top of each page */ 963 +@ div.title { 964 +@ display: table-cell; 965 +@ font-size: 2em; 966 +@ font-weight: bold; 967 +@ text-align: center; 968 +@ padding: 0 0 0 1em; 969 +@ color: #558195; 970 +@ vertical-align: bottom; 971 +@ width: 100% ; 972 +@ } 973 +@ 974 +@ /* The login status message in the top right-hand corner */ 975 +@ div.status { 976 +@ display: table-cell; 977 +@ text-align: right; 978 +@ vertical-align: bottom; 979 +@ color: #558195; 980 +@ font-size: 0.8em; 981 +@ font-weight: bold; 982 +@ min-width: 200px; 983 +@ white-space: nowrap; 984 +@ } 985 +@ 986 +@ /* The header across the top of the page */ 987 +@ div.header { 988 +@ display: table; 989 +@ width: 100% ; 990 +@ } 991 +@ 992 +@ /* The main menu bar that appears at the top of the page beneath 993 +@ ** the header */ 994 +@ div.mainmenu { 995 +@ padding: 5px 10px 5px 10px; 996 +@ font-size: 0.9em; 997 +@ font-weight: bold; 998 +@ text-align: center; 999 +@ letter-spacing: 1px; 1000 +@ background-color: #558195; 1001 +@ border-top-left-radius: 8px; 1002 +@ border-top-right-radius: 8px; 1003 +@ color: white; 1004 +@ } 1005 +@ 1006 +@ /* The submenu bar that *sometimes* appears below the main menu */ 1007 +@ div.submenu, div.sectionmenu { 1008 +@ padding: 3px 10px 3px 0px; 1009 +@ font-size: 0.9em; 1010 +@ text-align: center; 1011 +@ background-color: #456878; 1012 +@ color: white; 1013 +@ } 1014 +@ div.mainmenu a, div.mainmenu a:visited, div.submenu a, div.submenu a:visited, 1015 +@ div.sectionmenu>a.button:link, div.sectionmenu>a.button:visited { 1016 +@ padding: 3px 10px 3px 10px; 1017 +@ color: white; 1018 +@ text-decoration: none; 1019 +@ } 1020 +@ div.mainmenu a:hover, div.submenu a:hover, div.sectionmenu>a.button:hover { 1021 +@ color: #558195; 1022 +@ background-color: white; 1023 +@ } 1024 +@ 1025 +@ /* All page content from the bottom of the menu or submenu down to 1026 +@ ** the footer */ 1027 +@ div.content { 1028 +@ padding: 0ex 1ex 1ex 1ex; 1029 +@ border: solid #aaa; 1030 +@ border-width: 1px; 1031 +@ } 1032 +@ 1033 +@ /* Some pages have section dividers */ 1034 +@ div.section { 1035 +@ margin-bottom: 0px; 1036 +@ margin-top: 1em; 1037 +@ padding: 1px 1px 1px 1px; 1038 +@ font-size: 1.2em; 1039 +@ font-weight: bold; 1040 +@ background-color: #558195; 1041 +@ color: white; 1042 +@ white-space: nowrap; 1043 +@ } 1044 +@ 1045 +@ /* The "Date" that occurs on the left hand side of timelines */ 1046 +@ div.divider { 1047 +@ background: #a1c4d4; 1048 +@ border: 2px #558195 solid; 1049 +@ font-size: 1em; font-weight: normal; 1050 +@ padding: .25em; 1051 +@ margin: .2em 0 .2em 0; 1052 +@ float: left; 1053 +@ clear: left; 1054 +@ white-space: nowrap; 1055 +@ } 1056 +@ 1057 +@ /* The footer at the very bottom of the page */ 1058 +@ div.footer { 1059 +@ clear: both; 1060 +@ font-size: 0.8em; 1061 +@ padding: 5px 10px 5px 10px; 1062 +@ text-align: right; 1063 +@ background-color: #558195; 1064 +@ border-bottom-left-radius: 8px; 1065 +@ border-bottom-right-radius: 8px; 1066 +@ color: white; 1067 +@ } 1068 +@ 1069 +@ /* Hyperlink colors in the footer */ 1070 +@ div.footer a { color: white; } 1071 +@ div.footer a:link { color: white; } 1072 +@ div.footer a:visited { color: white; } 1073 +@ div.footer a:hover { background-color: white; color: #558195; } 1074 +@ 1075 +@ /* verbatim blocks */ 1076 +@ pre.verbatim { 1077 +@ background-color: #f5f5f5; 1078 +@ padding: 0.5em; 1079 +@} 1080 +@ 1081 +@ /* The label/value pairs on (for example) the ci page */ 1082 +@ table.label-value th { 1083 +@ vertical-align: top; 1084 +@ text-align: right; 1085 +@ padding: 0.2ex 2ex; 1086 +@ }'); 1087 +@ REPLACE INTO config(name,mtime,value) VALUES('header',now(),'<html> 1088 +@ <head> 1089 +@ <base href="$baseurl/$current_page" /> 1090 +@ <title>$<project_name>: $<title></title> 1091 +@ <link rel="alternate" type="application/rss+xml" title="RSS Feed" 1092 +@ href="$home/timeline.rss" /> 1093 +@ <link rel="stylesheet" href="$home/style.css?enhanced" type="text/css" 1094 +@ media="screen" /> 1095 +@ </head> 1096 +@ <body> 1097 +@ <div class="header"> 1098 +@ <div class="logo"> 1099 +@ <th1> 1100 +@ ## 1101 +@ ## NOTE: The purpose of this procedure is to take the base URL of the 1102 +@ ## Fossil project and return the root of the entire web site using 1103 +@ ## the same URI scheme as the base URL (e.g. http or https). 1104 +@ ## 1105 +@ proc getLogoUrl { baseurl } { 1106 +@ set idx(first) [string first // $baseurl] 1107 +@ if {$idx(first) != -1} { 1108 +@ ## 1109 +@ ## NOTE: Skip second slash. 1110 +@ ## 1111 +@ set idx(first+1) [expr {$idx(first) + 2}] 1112 +@ ## 1113 +@ ## NOTE: (part 1) The [string first] command does NOT actually 1114 +@ ## the optional startIndex argument as specified in the 1115 +@ ## TH1 support manual; therefore, we fake it by using the 1116 +@ ## [string range] command and then adding the necessary 1117 +@ ## offset to the resulting index manually (below). In Tcl, 1118 +@ ## we could use the following instead: 1119 +@ ## 1120 +@ ## set idx(next) [string first / $baseurl $idx(first+1)] 1121 +@ ## 1122 +@ set idx(nextRange) [string range $baseurl $idx(first+1) end] 1123 +@ set idx(next) [string first / $idx(nextRange)] 1124 +@ if {$idx(next) != -1} { 1125 +@ ## 1126 +@ ## NOTE: (part 2) Add the necessary offset to the result of the 1127 +@ ## search for the next slash (i.e. the one after the initial 1128 +@ ## search for the two slashes). 1129 +@ ## 1130 +@ set idx(next) [expr {$idx(next) + $idx(first+1)}] 1131 +@ ## 1132 +@ ## NOTE: Back up one character from the next slash. 1133 +@ ## 1134 +@ set idx(next-1) [expr {$idx(next) - 1}] 1135 +@ ## 1136 +@ ## NOTE: Extract the URI scheme and host from the base URL. 1137 +@ ## 1138 +@ set scheme [string range $baseurl 0 $idx(first)] 1139 +@ set host [string range $baseurl $idx(first+1) $idx(next-1)] 1140 +@ ## 1141 +@ ## NOTE: Try to stay in SSL mode if we are there now. 1142 +@ ## 1143 +@ if {[string compare $scheme http:/] == 0} { 1144 +@ set scheme http:// 1145 +@ } else { 1146 +@ set scheme https:// 1147 +@ } 1148 +@ set logourl $scheme$host/ 1149 +@ } else { 1150 +@ set logourl $baseurl 1151 +@ } 1152 +@ } else { 1153 +@ set logourl $baseurl 1154 +@ } 1155 +@ return $logourl 1156 +@ } 1157 +@ set logourl [getLogoUrl $baseurl] 1158 +@ </th1> 1159 +@ <a href="$logourl"> 1160 +@ <img src="$baseurl/logo" border="0" alt="$project_name"> 1161 +@ </a> 1162 +@ </div> 1163 +@ <div class="title"><small>$<project_name></small><br />$<title></div> 1164 +@ <div class="status"><nobr><th1> 1165 +@ if {[info exists login]} { 1166 +@ puts "Logged in as $login" 1167 +@ } else { 1168 +@ puts "Not logged in" 1169 +@ } 1170 +@ </th1></nobr></div> 1171 +@ </div> 1172 +@ <div class="mainmenu"> 1173 +@ <th1> 1174 +@ html "<a href=''$home$index_page''>Home</a>\n" 1175 +@ if {[anycap jor]} { 1176 +@ html "<a href=''timeline''>Timeline</a>\n" 1177 +@ } 1178 +@ if {[hascap oh]} { 1179 +@ html "<a href=''dir?ci=tip''>Files</a>\n" 1180 +@ } 1181 +@ if {[hascap o]} { 1182 +@ html "<a href=''brlist''>Branches</a>\n" 1183 +@ html "<a href=''taglist''>Tags</a>\n" 1184 +@ } 1185 +@ if {[hascap r]} { 1186 +@ html "<a href=''reportlist''>Tickets</a>\n" 1187 +@ } 1188 +@ if {[hascap j]} { 1189 +@ html "<a href=''wiki''>Wiki</a>\n" 1190 +@ } 1191 +@ if {[hascap s]} { 1192 +@ html "<a href=''setup''>Admin</a>\n" 1193 +@ } elseif {[hascap a]} { 1194 +@ html "<a href=''setup_ulist''>Users</a>\n" 1195 +@ } 1196 +@ if {[info exists login]} { 1197 +@ html "<a href=''login''>Logout</a>\n" 1198 +@ } else { 1199 +@ html "<a href=''login''>Login</a>\n" 1200 +@ } 1201 +@ </th1></div> 1202 +@ '); 1203 +@ REPLACE INTO config(name,mtime,value) 1204 +@ VALUES('footer',now(),'<div class="footer"> 1205 +@ <th1> 1206 +@ proc getTclVersion {} { 1207 +@ if {[catch {tclEval info patchlevel} tclVersion] == 0} { 1208 +@ return "<a href=\"http://www.tcl.tk/\">Tcl</a> version $tclVersion" 1209 +@ } 1210 +@ return "" 1211 +@ } 1212 +@ proc getVersion { version } { 1213 +@ set length [string length $version] 1214 +@ return [string range $version 1 [expr {$length - 2}]] 1215 +@ } 1216 +@ set version [getVersion $manifest_version] 1217 +@ set tclVersion [getTclVersion] 1218 +@ set fossilUrl http://www.fossil-scm.org 1219 +@ </th1> 1220 +@ <a href="$fossilUrl/">Fossil</a> 1221 +@ version $release_version $tclVersion 1222 +@ <a href="$fossilUrl/index.html/info/$version">$manifest_version</a> 1223 +@ <a href="$fossilUrl/fossil/timeline?c=$manifest_date&y=ci">$manifest_date</a> 1224 +@ </div> 1225 +@ </body></html> 1226 +@ '); 1227 +; 1228 + 925 1229 /* 926 1230 ** An array of available built-in skins. 927 1231 */ 928 1232 static struct BuiltinSkin { 929 1233 const char *zName; 930 1234 const char *zValue; 931 1235 } aBuiltinSkin[] = { 932 1236 { "Default", 0 /* Filled in at runtime */ }, 933 1237 { "Plain Gray, No Logo", zBuiltinSkin1 }, 934 1238 { "Khaki, No Logo", zBuiltinSkin2 }, 935 1239 { "Black & White, Menu on Left", zBuiltinSkin3 }, 936 1240 { "Shadow boxes & Rounded Corners", zBuiltinSkin4 }, 1241 + { "Enhanced Default", zBuiltinSkin5 }, 937 1242 }; 938 1243 939 1244 /* 940 1245 ** For a skin named zSkinName, compute the name of the CONFIG table 941 1246 ** entry where that skin is stored and return it. 942 1247 ** 943 1248 ** Return NULL if zSkinName is NULL or an empty string.