| | @@ -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. |
| | @@ -243,10 +241,14 @@ |
| 243 | 241 | @ </body></html> |
| 244 | 242 | ; |
| 245 | 243 | |
| 246 | 244 | /* |
| 247 | 245 | ** The default Cascading Style Sheet. |
| 246 | +** It's assembled by different strings for each class. |
| 247 | +** The default css conatains all definitions. |
| 248 | +** The style sheet, send to the client only contains the ones, |
| 249 | +** not defined in the user defined css. |
| 248 | 250 | */ |
| 249 | 251 | const char zDefaultCSS[] = |
| 250 | 252 | @ /* General settings for the entire page */ |
| 251 | 253 | @ body { |
| 252 | 254 | @ margin: 0ex 1ex; |
| | @@ -372,27 +374,66 @@ |
| 372 | 374 | @ pre.verbatim { |
| 373 | 375 | @ background-color: #f5f5f5; |
| 374 | 376 | @ padding: 0.5em; |
| 375 | 377 | @} |
| 376 | 378 | @ |
| 379 | +; |
| 380 | +const char zTableLabelValueCSS[] = |
| 377 | 381 | @ /* The label/value pairs on (for example) the ci page */ |
| 378 | 382 | @ table.label-value th { |
| 379 | 383 | @ vertical-align: top; |
| 380 | 384 | @ text-align: right; |
| 381 | 385 | @ padding: 0.2ex 2ex; |
| 382 | 386 | @ } |
| 383 | 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 | +/* The following table holds the names of CSS elements and the CSS |
| 407 | +** text that implements those elements. |
| 408 | +*/ |
| 409 | +static const struct { |
| 410 | + const char *zElement; /* Name of the CSS element */ |
| 411 | + const char *zText; /* Text of the element */ |
| 412 | +} cssElements[] = { |
| 413 | + { "table.label-value", zTableLabelValueCSS }, |
| 414 | + { "div.sidebox", zDivSidebox }, |
| 415 | + { "div.sideboxTitle", zDivSideboxTitle }, |
| 416 | +}; |
| 384 | 417 | |
| 385 | 418 | /* |
| 386 | 419 | ** WEBPAGE: style.css |
| 387 | 420 | */ |
| 388 | 421 | void page_style_css(void){ |
| 389 | | - char *zCSS = 0; |
| 422 | + const char *zCSS; |
| 423 | + int i; |
| 390 | 424 | |
| 391 | 425 | cgi_set_content_type("text/css"); |
| 392 | 426 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 427 | + /* append user defined css */ |
| 393 | 428 | cgi_append_content(zCSS, -1); |
| 429 | + /* add special missing definitions */ |
| 430 | + for(i=0; i<count(cssElements); i++){ |
| 431 | + if( strstr(cssElements[i].zElement, zCSS)==0 ){ |
| 432 | + cgi_append_content(cssElements[i].zText, -1); |
| 433 | + } |
| 434 | + } |
| 394 | 435 | g.isConst = 1; |
| 395 | 436 | } |
| 396 | 437 | |
| 397 | 438 | /* |
| 398 | 439 | ** WEBPAGE: test_env |
| 399 | 440 | |