Fossil SCM
first step to extract formats in separat css definitions
Commit
bdd92802d0739ffd7668ba017fa2225aa61e6c41
Parent
e2ab51b011cb98e…
2 files changed
+1
+11
-1
+1
| --- src/setup.c | ||
| +++ src/setup.c | ||
| @@ -909,10 +909,11 @@ | ||
| 909 | 909 | @ of CSS files can be seen on the <a href="setup_skin">skins page</a>. |
| 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 | + @ %h(zTableLabelValueCSS) | |
| 914 | 915 | @ </pre></blockquote> |
| 915 | 916 | style_footer(); |
| 916 | 917 | db_end_transaction(0); |
| 917 | 918 | } |
| 918 | 919 | |
| 919 | 920 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -909,10 +909,11 @@ | |
| 909 | @ of CSS files can be seen on the <a href="setup_skin">skins page</a>. |
| 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 | @ </pre></blockquote> |
| 915 | style_footer(); |
| 916 | db_end_transaction(0); |
| 917 | } |
| 918 | |
| 919 |
| --- src/setup.c | |
| +++ src/setup.c | |
| @@ -909,10 +909,11 @@ | |
| 909 | @ of CSS files can be seen on the <a href="setup_skin">skins page</a>. |
| 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 | @ </pre></blockquote> |
| 916 | style_footer(); |
| 917 | db_end_transaction(0); |
| 918 | } |
| 919 | |
| 920 |
+11
-1
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -243,10 +243,14 @@ | ||
| 243 | 243 | @ </body></html> |
| 244 | 244 | ; |
| 245 | 245 | |
| 246 | 246 | /* |
| 247 | 247 | ** The default Cascading Style Sheet. |
| 248 | +** It's assembled by different strings for each class. | |
| 249 | +** The default css conatains all definitions. | |
| 250 | +** The style sheet, send to the client only contains the ones, | |
| 251 | +** not defined in the user defined css. | |
| 248 | 252 | */ |
| 249 | 253 | const char zDefaultCSS[] = |
| 250 | 254 | @ /* General settings for the entire page */ |
| 251 | 255 | @ body { |
| 252 | 256 | @ margin: 0ex 1ex; |
| @@ -372,10 +376,12 @@ | ||
| 372 | 376 | @ pre.verbatim { |
| 373 | 377 | @ background-color: #f5f5f5; |
| 374 | 378 | @ padding: 0.5em; |
| 375 | 379 | @} |
| 376 | 380 | @ |
| 381 | +; | |
| 382 | +const char zTableLabelValueCSS[] = | |
| 377 | 383 | @ /* The label/value pairs on (for example) the ci page */ |
| 378 | 384 | @ table.label-value th { |
| 379 | 385 | @ vertical-align: top; |
| 380 | 386 | @ text-align: right; |
| 381 | 387 | @ padding: 0.2ex 2ex; |
| @@ -384,15 +390,19 @@ | ||
| 384 | 390 | |
| 385 | 391 | /* |
| 386 | 392 | ** WEBPAGE: style.css |
| 387 | 393 | */ |
| 388 | 394 | void page_style_css(void){ |
| 389 | - char *zCSS = 0; | |
| 395 | + const char *zCSS = 0; | |
| 396 | + const char *zCSSdef = 0; | |
| 390 | 397 | |
| 391 | 398 | cgi_set_content_type("text/css"); |
| 392 | 399 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 400 | + /* append user defined css */ | |
| 393 | 401 | cgi_append_content(zCSS, -1); |
| 402 | + /* add special missing definitions */ | |
| 403 | + if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1); | |
| 394 | 404 | g.isConst = 1; |
| 395 | 405 | } |
| 396 | 406 | |
| 397 | 407 | /* |
| 398 | 408 | ** WEBPAGE: test_env |
| 399 | 409 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -243,10 +243,14 @@ | |
| 243 | @ </body></html> |
| 244 | ; |
| 245 | |
| 246 | /* |
| 247 | ** The default Cascading Style Sheet. |
| 248 | */ |
| 249 | const char zDefaultCSS[] = |
| 250 | @ /* General settings for the entire page */ |
| 251 | @ body { |
| 252 | @ margin: 0ex 1ex; |
| @@ -372,10 +376,12 @@ | |
| 372 | @ pre.verbatim { |
| 373 | @ background-color: #f5f5f5; |
| 374 | @ padding: 0.5em; |
| 375 | @} |
| 376 | @ |
| 377 | @ /* The label/value pairs on (for example) the ci page */ |
| 378 | @ table.label-value th { |
| 379 | @ vertical-align: top; |
| 380 | @ text-align: right; |
| 381 | @ padding: 0.2ex 2ex; |
| @@ -384,15 +390,19 @@ | |
| 384 | |
| 385 | /* |
| 386 | ** WEBPAGE: style.css |
| 387 | */ |
| 388 | void page_style_css(void){ |
| 389 | char *zCSS = 0; |
| 390 | |
| 391 | cgi_set_content_type("text/css"); |
| 392 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 393 | cgi_append_content(zCSS, -1); |
| 394 | g.isConst = 1; |
| 395 | } |
| 396 | |
| 397 | /* |
| 398 | ** WEBPAGE: test_env |
| 399 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -243,10 +243,14 @@ | |
| 243 | @ </body></html> |
| 244 | ; |
| 245 | |
| 246 | /* |
| 247 | ** The default Cascading Style Sheet. |
| 248 | ** It's assembled by different strings for each class. |
| 249 | ** The default css conatains all definitions. |
| 250 | ** The style sheet, send to the client only contains the ones, |
| 251 | ** not defined in the user defined css. |
| 252 | */ |
| 253 | const char zDefaultCSS[] = |
| 254 | @ /* General settings for the entire page */ |
| 255 | @ body { |
| 256 | @ margin: 0ex 1ex; |
| @@ -372,10 +376,12 @@ | |
| 376 | @ pre.verbatim { |
| 377 | @ background-color: #f5f5f5; |
| 378 | @ padding: 0.5em; |
| 379 | @} |
| 380 | @ |
| 381 | ; |
| 382 | const char zTableLabelValueCSS[] = |
| 383 | @ /* The label/value pairs on (for example) the ci page */ |
| 384 | @ table.label-value th { |
| 385 | @ vertical-align: top; |
| 386 | @ text-align: right; |
| 387 | @ padding: 0.2ex 2ex; |
| @@ -384,15 +390,19 @@ | |
| 390 | |
| 391 | /* |
| 392 | ** WEBPAGE: style.css |
| 393 | */ |
| 394 | void page_style_css(void){ |
| 395 | const char *zCSS = 0; |
| 396 | const char *zCSSdef = 0; |
| 397 | |
| 398 | cgi_set_content_type("text/css"); |
| 399 | zCSS = db_get("css",(char*)zDefaultCSS); |
| 400 | /* append user defined css */ |
| 401 | cgi_append_content(zCSS, -1); |
| 402 | /* add special missing definitions */ |
| 403 | if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1); |
| 404 | g.isConst = 1; |
| 405 | } |
| 406 | |
| 407 | /* |
| 408 | ** WEBPAGE: test_env |
| 409 |