Fossil SCM

first step to extract formats in separat css definitions

wolfgang 2010-09-08 00:00 wolfgangFormat2CSS
Commit bdd92802d0739ffd7668ba017fa2225aa61e6c41
2 files changed +1 +11 -1
--- src/setup.c
+++ src/setup.c
@@ -909,10 +909,11 @@
909909
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
910910
@ See also the <a href="setup_header">header</a> and
911911
@ <a href="setup_footer">footer</a> editing screens.
912912
@ <blockquote><pre>
913913
@ %h(zDefaultCSS)
914
+ @ %h(zTableLabelValueCSS)
914915
@ </pre></blockquote>
915916
style_footer();
916917
db_end_transaction(0);
917918
}
918919
919920
--- 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 @@
243243
@ </body></html>
244244
;
245245
246246
/*
247247
** 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.
248252
*/
249253
const char zDefaultCSS[] =
250254
@ /* General settings for the entire page */
251255
@ body {
252256
@ margin: 0ex 1ex;
@@ -372,10 +376,12 @@
372376
@ pre.verbatim {
373377
@ background-color: #f5f5f5;
374378
@ padding: 0.5em;
375379
@}
376380
@
381
+;
382
+const char zTableLabelValueCSS[] =
377383
@ /* The label/value pairs on (for example) the ci page */
378384
@ table.label-value th {
379385
@ vertical-align: top;
380386
@ text-align: right;
381387
@ padding: 0.2ex 2ex;
@@ -384,15 +390,19 @@
384390
385391
/*
386392
** WEBPAGE: style.css
387393
*/
388394
void page_style_css(void){
389
- char *zCSS = 0;
395
+ const char *zCSS = 0;
396
+ const char *zCSSdef = 0;
390397
391398
cgi_set_content_type("text/css");
392399
zCSS = db_get("css",(char*)zDefaultCSS);
400
+ /* append user defined css */
393401
cgi_append_content(zCSS, -1);
402
+ /* add special missing definitions */
403
+ if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1);
394404
g.isConst = 1;
395405
}
396406
397407
/*
398408
** WEBPAGE: test_env
399409
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button