Fossil SCM

made default css handled by loop instead of explizit calls, ..

wolfgang 2010-09-08 21:15 wolfgangFormat2CSS
Commit a5576e2d51fc5c843b36e2cf3223de0591ee9d81
3 files changed +1 -7 +46 -5 +2 -2
+1 -7
--- src/setup.c
+++ src/setup.c
@@ -908,17 +908,11 @@
908908
@ The default CSS is shown below for reference. Other examples
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>
913
- @ %h(zDefaultCSS)
914
- @ %h(zTableLabelValueCSS)
915
- @ %h(zDivSidebox)
916
- @ %h(zDivSideboxTitle)
917
- @ %h(zDivSideboxDescribed)
918
- @ %h(zSpanDisabled)
919
- @ </pre></blockquote>
913
+ cgi_append_default_css();
920914
style_footer();
921915
db_end_transaction(0);
922916
}
923917
924918
/*
925919
--- src/setup.c
+++ src/setup.c
@@ -908,17 +908,11 @@
908 @ The default CSS is shown below for reference. Other examples
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 @ %h(zDivSidebox)
916 @ %h(zDivSideboxTitle)
917 @ %h(zDivSideboxDescribed)
918 @ %h(zSpanDisabled)
919 @ </pre></blockquote>
920 style_footer();
921 db_end_transaction(0);
922 }
923
924 /*
925
--- src/setup.c
+++ src/setup.c
@@ -908,17 +908,11 @@
908 @ The default CSS is shown below for reference. Other examples
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 cgi_append_default_css();
 
 
 
 
 
 
914 style_footer();
915 db_end_transaction(0);
916 }
917
918 /*
919
+46 -5
--- src/style.c
+++ src/style.c
@@ -382,58 +382,99 @@
382382
@ table.label-value th {
383383
@ vertical-align: top;
384384
@ text-align: right;
385385
@ padding: 0.2ex 2ex;
386386
@ }
387
+@
387388
;
388389
const char zDivSidebox[] =
389390
@ /* The nomenclature sidebox for branches,.. */
390391
@ div.sidebox {
391392
@ float: right;
392393
@ border-width: medium;
393394
@ border-style: double;
394395
@ margin: 10;
395396
@ }
397
+@
396398
;
397399
const char zDivSideboxTitle[] =
398400
@ /* The nomenclature title in sideboxes for branches,.. */
399401
@ div.sideboxTitle {
400402
@ display: inline;
401403
@ font-weight: bold;
402404
@ }
405
+@
403406
;
404407
const char zDivSideboxDescribed[] =
405408
@ /* The defined element in sideboxes for branches,.. */
406409
@ div.sideboxDescribed {
407410
@ display: inline;
408411
@ font-weight: bold;
409412
@ }
413
+@
410414
;
411415
const char zSpanDisabled[] =
412416
@ /* The defined element in sideboxes for branches,.. */
413417
@ span.disabled {
414418
@ color: red;
415419
@ }
420
+@
421
+;
422
+const char zSpanTimelineSuppressed[] =
423
+@ /* The suppressed duplicates lines in timeline, .. */
424
+@ span.timelineDisabled {
425
+@ font-style: italic;
426
+@ font-size: small;
427
+@ }
428
+@
416429
;
430
+typedef enum cssDefaultItems {
431
+ cssOthers = 0,
432
+ tableLabelValue,
433
+ divSidebox,
434
+ divSideboxTitle,
435
+ divSideboxDescribed,
436
+ spanDisabled,
437
+ spanTimelineSuppressed,
438
+ cssDefaultCount
439
+};
440
+const struct strctCssDefaults {
441
+ char const * const name;
442
+ char const * const value;
443
+} cssDefaultList[cssDefaultCount] = {
444
+ { "", zDefaultCSS },
445
+ { "table.label-value", zTableLabelValueCSS },
446
+ { "div.sidebox", zDivSidebox },
447
+ { "div.sideboxTitle", zDivSideboxTitle },
448
+ { "div.sideboxDescribed", zDivSideboxDescribed },
449
+ { "span.disabled", zSpanDisabled },
450
+ { "span.timelineDisabled", zSpanTimelineSuppressed }
451
+};
452
+
453
+void cgi_append_default_css(void) {
454
+ enum cssDefaultItems i;
455
+
456
+ for (i=cssOthers;i<cssDefaultCount;i++)
457
+ cgi_printf(cssDefaultList[i].value);
458
+}
417459
418460
/*
419461
** WEBPAGE: style.css
420462
*/
421463
void page_style_css(void){
422464
const char *zCSS = 0;
423465
const char *zCSSdef = 0;
466
+ enum cssDefaultItems i;
424467
425468
cgi_set_content_type("text/css");
426469
zCSS = db_get("css",(char*)zDefaultCSS);
427470
/* append user defined css */
428471
cgi_append_content(zCSS, -1);
429472
/* add special missing definitions */
430
- if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1);
431
- if (!strstr("div.sidebox",zCSS)) cgi_append_content(zDivSidebox, -1);
432
- if (!strstr("div.sideboxTitle",zCSS)) cgi_append_content(zDivSideboxTitle, -1);
433
- if (!strstr("div.sideboxDescribed",zCSS)) cgi_append_content(zDivSideboxDescribed, -1);
434
- if (!strstr("span.disabled",zCSS)) cgi_append_content(zSpanDisabled, -1);
473
+ for (i=cssOthers+1;i<cssDefaultCount;i++)
474
+ if (!strstr(zCSS,cssDefaultList[i].name))
475
+ cgi_append_content(cssDefaultList[i].value, -1);
435476
g.isConst = 1;
436477
}
437478
438479
/*
439480
** WEBPAGE: test_env
440481
--- src/style.c
+++ src/style.c
@@ -382,58 +382,99 @@
382 @ table.label-value th {
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 const char zDivSideboxDescribed[] =
405 @ /* The defined element in sideboxes for branches,.. */
406 @ div.sideboxDescribed {
407 @ display: inline;
408 @ font-weight: bold;
409 @ }
 
410 ;
411 const char zSpanDisabled[] =
412 @ /* The defined element in sideboxes for branches,.. */
413 @ span.disabled {
414 @ color: red;
415 @ }
 
 
 
 
 
 
 
 
 
416 ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
418 /*
419 ** WEBPAGE: style.css
420 */
421 void page_style_css(void){
422 const char *zCSS = 0;
423 const char *zCSSdef = 0;
 
424
425 cgi_set_content_type("text/css");
426 zCSS = db_get("css",(char*)zDefaultCSS);
427 /* append user defined css */
428 cgi_append_content(zCSS, -1);
429 /* add special missing definitions */
430 if (!strstr("table.label-value",zCSS)) cgi_append_content(zTableLabelValueCSS, -1);
431 if (!strstr("div.sidebox",zCSS)) cgi_append_content(zDivSidebox, -1);
432 if (!strstr("div.sideboxTitle",zCSS)) cgi_append_content(zDivSideboxTitle, -1);
433 if (!strstr("div.sideboxDescribed",zCSS)) cgi_append_content(zDivSideboxDescribed, -1);
434 if (!strstr("span.disabled",zCSS)) cgi_append_content(zSpanDisabled, -1);
435 g.isConst = 1;
436 }
437
438 /*
439 ** WEBPAGE: test_env
440
--- src/style.c
+++ src/style.c
@@ -382,58 +382,99 @@
382 @ table.label-value th {
383 @ vertical-align: top;
384 @ text-align: right;
385 @ padding: 0.2ex 2ex;
386 @ }
387 @
388 ;
389 const char zDivSidebox[] =
390 @ /* The nomenclature sidebox for branches,.. */
391 @ div.sidebox {
392 @ float: right;
393 @ border-width: medium;
394 @ border-style: double;
395 @ margin: 10;
396 @ }
397 @
398 ;
399 const char zDivSideboxTitle[] =
400 @ /* The nomenclature title in sideboxes for branches,.. */
401 @ div.sideboxTitle {
402 @ display: inline;
403 @ font-weight: bold;
404 @ }
405 @
406 ;
407 const char zDivSideboxDescribed[] =
408 @ /* The defined element in sideboxes for branches,.. */
409 @ div.sideboxDescribed {
410 @ display: inline;
411 @ font-weight: bold;
412 @ }
413 @
414 ;
415 const char zSpanDisabled[] =
416 @ /* The defined element in sideboxes for branches,.. */
417 @ span.disabled {
418 @ color: red;
419 @ }
420 @
421 ;
422 const char zSpanTimelineSuppressed[] =
423 @ /* The suppressed duplicates lines in timeline, .. */
424 @ span.timelineDisabled {
425 @ font-style: italic;
426 @ font-size: small;
427 @ }
428 @
429 ;
430 typedef enum cssDefaultItems {
431 cssOthers = 0,
432 tableLabelValue,
433 divSidebox,
434 divSideboxTitle,
435 divSideboxDescribed,
436 spanDisabled,
437 spanTimelineSuppressed,
438 cssDefaultCount
439 };
440 const struct strctCssDefaults {
441 char const * const name;
442 char const * const value;
443 } cssDefaultList[cssDefaultCount] = {
444 { "", zDefaultCSS },
445 { "table.label-value", zTableLabelValueCSS },
446 { "div.sidebox", zDivSidebox },
447 { "div.sideboxTitle", zDivSideboxTitle },
448 { "div.sideboxDescribed", zDivSideboxDescribed },
449 { "span.disabled", zSpanDisabled },
450 { "span.timelineDisabled", zSpanTimelineSuppressed }
451 };
452
453 void cgi_append_default_css(void) {
454 enum cssDefaultItems i;
455
456 for (i=cssOthers;i<cssDefaultCount;i++)
457 cgi_printf(cssDefaultList[i].value);
458 }
459
460 /*
461 ** WEBPAGE: style.css
462 */
463 void page_style_css(void){
464 const char *zCSS = 0;
465 const char *zCSSdef = 0;
466 enum cssDefaultItems i;
467
468 cgi_set_content_type("text/css");
469 zCSS = db_get("css",(char*)zDefaultCSS);
470 /* append user defined css */
471 cgi_append_content(zCSS, -1);
472 /* add special missing definitions */
473 for (i=cssOthers+1;i<cssDefaultCount;i++)
474 if (!strstr(zCSS,cssDefaultList[i].name))
475 cgi_append_content(cssDefaultList[i].value, -1);
 
 
476 g.isConst = 1;
477 }
478
479 /*
480 ** WEBPAGE: test_env
481
+2 -2
--- src/timeline.c
+++ src/timeline.c
@@ -219,12 +219,12 @@
219219
}
220220
}
221221
prevTagid = tagid;
222222
if( suppressCnt ){
223223
@ <tr><td><td><td>
224
- @ <small><i>... %d(suppressCnt) similar
225
- @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
224
+ @ <span class="timelineDisabled">... %d(suppressCnt) similar
225
+ @ event%s(suppressCnt>1?"s":"") omitted.</span></tr>
226226
suppressCnt = 0;
227227
}
228228
if( strcmp(zType,"div")==0 ){
229229
@ <tr><td colspan=3><hr></td></tr>
230230
continue;
231231
--- src/timeline.c
+++ src/timeline.c
@@ -219,12 +219,12 @@
219 }
220 }
221 prevTagid = tagid;
222 if( suppressCnt ){
223 @ <tr><td><td><td>
224 @ <small><i>... %d(suppressCnt) similar
225 @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
226 suppressCnt = 0;
227 }
228 if( strcmp(zType,"div")==0 ){
229 @ <tr><td colspan=3><hr></td></tr>
230 continue;
231
--- src/timeline.c
+++ src/timeline.c
@@ -219,12 +219,12 @@
219 }
220 }
221 prevTagid = tagid;
222 if( suppressCnt ){
223 @ <tr><td><td><td>
224 @ <span class="timelineDisabled">... %d(suppressCnt) similar
225 @ event%s(suppressCnt>1?"s":"") omitted.</span></tr>
226 suppressCnt = 0;
227 }
228 if( strcmp(zType,"div")==0 ){
229 @ <tr><td colspan=3><hr></td></tr>
230 continue;
231

Keyboard Shortcuts

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