Fossil SCM
layout sideboxes using css, css is only added to the user defined css, if the corresponding class is missing
Commit
b34a583f32dd24c601396c73d453c029e0f3f48a
Parent
e621ef436757ec3…
2 files changed
+2
-1
+14
-9
+2
-1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -910,11 +910,12 @@ | ||
| 910 | 910 | @ See also the <a href="setup_header">header</a> and |
| 911 | 911 | @ <a href="setup_footer">footer</a> editing screens. |
| 912 | 912 | @ <blockquote><pre> |
| 913 | 913 | @ %h(zDefaultCSS) |
| 914 | 914 | @ %h(zTableLabelValueCSS) |
| 915 | - @ %h(zDivNomenclatureSidebox) | |
| 915 | + @ %h(zDivSidebox) | |
| 916 | + @ %h(zDivSideboxTitle) | |
| 916 | 917 | @ </pre></blockquote> |
| 917 | 918 | style_footer(); |
| 918 | 919 | db_end_transaction(0); |
| 919 | 920 | } |
| 920 | 921 | |
| 921 | 922 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -910,11 +910,12 @@ | |
| 910 | @ See also the <a href="setup_header">header</a> and |
| 911 | @ <a href="setup_footer">footer</a> editing screens. |
| 912 | @ <blockquote><pre> |
| 913 | @ %h(zDefaultCSS) |
| 914 | @ %h(zTableLabelValueCSS) |
| 915 | @ %h(zDivNomenclatureSidebox) |
| 916 | @ </pre></blockquote> |
| 917 | style_footer(); |
| 918 | db_end_transaction(0); |
| 919 | } |
| 920 | |
| 921 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -910,11 +910,12 @@ | |
| 910 | @ See also the <a href="setup_header">header</a> and |
| 911 | @ <a href="setup_footer">footer</a> editing screens. |
| 912 | @ <blockquote><pre> |
| 913 | @ %h(zDefaultCSS) |
| 914 | @ %h(zTableLabelValueCSS) |
| 915 | @ %h(zDivSidebox) |
| 916 | @ %h(zDivSideboxTitle) |
| 917 | @ </pre></blockquote> |
| 918 | style_footer(); |
| 919 | db_end_transaction(0); |
| 920 | } |
| 921 | |
| 922 |
+14
-9
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -160,20 +160,18 @@ | ||
| 160 | 160 | ** Begin a side-box on the right-hand side of a page. The title and |
| 161 | 161 | ** the width of the box are given as arguments. The width is usually |
| 162 | 162 | ** a percentage of total screen width. |
| 163 | 163 | */ |
| 164 | 164 | void style_sidebox_begin(const char *zTitle, const char *zWidth){ |
| 165 | - @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5 | |
| 166 | - @ vspace=5 hspace=5> | |
| 167 | - @ <tr><td> | |
| 168 | - @ <b>%h(zTitle)</b> | |
| 165 | + @ <div class="sidebox" style="width:%s(zWidth)"> | |
| 166 | + @ <div class="sideboxTitle">%h(zTitle)</div> | |
| 169 | 167 | } |
| 170 | 168 | |
| 171 | 169 | /* End the side-box |
| 172 | 170 | */ |
| 173 | 171 | void style_sidebox_end(void){ |
| 174 | - @ </td></tr></table> | |
| 172 | + @ </div> | |
| 175 | 173 | } |
| 176 | 174 | |
| 177 | 175 | /* @-comment: // */ |
| 178 | 176 | /* |
| 179 | 177 | ** The default page header. |
| @@ -385,19 +383,25 @@ | ||
| 385 | 383 | @ vertical-align: top; |
| 386 | 384 | @ text-align: right; |
| 387 | 385 | @ padding: 0.2ex 2ex; |
| 388 | 386 | @ } |
| 389 | 387 | ; |
| 390 | -const char zDivNomenclatureSidebox[] = | |
| 388 | +const char zDivSidebox[] = | |
| 391 | 389 | @ /* The nomenclature sidebox for branches,.. */ |
| 392 | -@ div.nomenclatureSidebox { | |
| 390 | +@ div.sidebox { | |
| 393 | 391 | @ float: right; |
| 394 | -@ width: 33%; | |
| 395 | 392 | @ border-width: medium; |
| 396 | 393 | @ border-style: double; |
| 397 | 394 | @ margin: 10; |
| 398 | 395 | @ } |
| 396 | +; | |
| 397 | +const char zDivSideboxTitle[] = | |
| 398 | +@ /* The nomenclature title in sideboxes for branches,.. */ | |
| 399 | +@ div.sideboxTitle { | |
| 400 | +@ display: inline; | |
| 401 | +@ font-weight: bold; | |
| 402 | +@ } | |
| 399 | 403 | ; |
| 400 | 404 | |
| 401 | 405 | /* |
| 402 | 406 | ** WEBPAGE: style.css |
| 403 | 407 | */ |
| @@ -409,11 +413,12 @@ | ||
| 409 | 413 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 410 | 414 | /* append user defined css */ |
| 411 | 415 | cgi_append_content(zCSS, -1); |
| 412 | 416 | /* add special missing definitions */ |
| 413 | 417 | if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1); |
| 414 | - if (!strstr("div.nomenclatureSidebox",zCSS)) cgi_append_content(zDivNomenclatureSidebox, -1); | |
| 418 | + if (!strstr("div.sidebox",zCSS)) cgi_append_content(zDivSidebox, -1); | |
| 419 | + if (!strstr("div.sideboxTitle",zCSS)) cgi_append_content(zDivSideboxTitle, -1); | |
| 415 | 420 | g.isConst = 1; |
| 416 | 421 | } |
| 417 | 422 | |
| 418 | 423 | /* |
| 419 | 424 | ** WEBPAGE: test_env |
| 420 | 425 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -160,20 +160,18 @@ | |
| 160 | ** Begin a side-box on the right-hand side of a page. The title and |
| 161 | ** the width of the box are given as arguments. The width is usually |
| 162 | ** a percentage of total screen width. |
| 163 | */ |
| 164 | void style_sidebox_begin(const char *zTitle, const char *zWidth){ |
| 165 | @ <table width="%s(zWidth)" align="right" border="1" cellpadding=5 |
| 166 | @ vspace=5 hspace=5> |
| 167 | @ <tr><td> |
| 168 | @ <b>%h(zTitle)</b> |
| 169 | } |
| 170 | |
| 171 | /* End the side-box |
| 172 | */ |
| 173 | void style_sidebox_end(void){ |
| 174 | @ </td></tr></table> |
| 175 | } |
| 176 | |
| 177 | /* @-comment: // */ |
| 178 | /* |
| 179 | ** The default page header. |
| @@ -385,19 +383,25 @@ | |
| 385 | @ vertical-align: top; |
| 386 | @ text-align: right; |
| 387 | @ padding: 0.2ex 2ex; |
| 388 | @ } |
| 389 | ; |
| 390 | const char zDivNomenclatureSidebox[] = |
| 391 | @ /* The nomenclature sidebox for branches,.. */ |
| 392 | @ div.nomenclatureSidebox { |
| 393 | @ float: right; |
| 394 | @ width: 33%; |
| 395 | @ border-width: medium; |
| 396 | @ border-style: double; |
| 397 | @ margin: 10; |
| 398 | @ } |
| 399 | ; |
| 400 | |
| 401 | /* |
| 402 | ** WEBPAGE: style.css |
| 403 | */ |
| @@ -409,11 +413,12 @@ | |
| 409 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 410 | /* append user defined css */ |
| 411 | cgi_append_content(zCSS, -1); |
| 412 | /* add special missing definitions */ |
| 413 | if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1); |
| 414 | if (!strstr("div.nomenclatureSidebox",zCSS)) cgi_append_content(zDivNomenclatureSidebox, -1); |
| 415 | g.isConst = 1; |
| 416 | } |
| 417 | |
| 418 | /* |
| 419 | ** WEBPAGE: test_env |
| 420 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -160,20 +160,18 @@ | |
| 160 | ** Begin a side-box on the right-hand side of a page. The title and |
| 161 | ** the width of the box are given as arguments. The width is usually |
| 162 | ** a percentage of total screen width. |
| 163 | */ |
| 164 | void style_sidebox_begin(const char *zTitle, const char *zWidth){ |
| 165 | @ <div class="sidebox" style="width:%s(zWidth)"> |
| 166 | @ <div class="sideboxTitle">%h(zTitle)</div> |
| 167 | } |
| 168 | |
| 169 | /* End the side-box |
| 170 | */ |
| 171 | void style_sidebox_end(void){ |
| 172 | @ </div> |
| 173 | } |
| 174 | |
| 175 | /* @-comment: // */ |
| 176 | /* |
| 177 | ** The default page header. |
| @@ -385,19 +383,25 @@ | |
| 383 | @ vertical-align: top; |
| 384 | @ text-align: right; |
| 385 | @ padding: 0.2ex 2ex; |
| 386 | @ } |
| 387 | ; |
| 388 | const char zDivSidebox[] = |
| 389 | @ /* The nomenclature sidebox for branches,.. */ |
| 390 | @ div.sidebox { |
| 391 | @ float: right; |
| 392 | @ border-width: medium; |
| 393 | @ border-style: double; |
| 394 | @ margin: 10; |
| 395 | @ } |
| 396 | ; |
| 397 | const char zDivSideboxTitle[] = |
| 398 | @ /* The nomenclature title in sideboxes for branches,.. */ |
| 399 | @ div.sideboxTitle { |
| 400 | @ display: inline; |
| 401 | @ font-weight: bold; |
| 402 | @ } |
| 403 | ; |
| 404 | |
| 405 | /* |
| 406 | ** WEBPAGE: style.css |
| 407 | */ |
| @@ -409,11 +413,12 @@ | |
| 413 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 414 | /* append user defined css */ |
| 415 | cgi_append_content(zCSS, -1); |
| 416 | /* add special missing definitions */ |
| 417 | if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1); |
| 418 | if (!strstr("div.sidebox",zCSS)) cgi_append_content(zDivSidebox, -1); |
| 419 | if (!strstr("div.sideboxTitle",zCSS)) cgi_append_content(zDivSideboxTitle, -1); |
| 420 | g.isConst = 1; |
| 421 | } |
| 422 | |
| 423 | /* |
| 424 | ** WEBPAGE: test_env |
| 425 |