Fossil SCM

reduce html-validator errors on leaves page

wolfgang 2010-09-09 21:32 wolfgangFormat2CSS
Commit 4dbfba2bd8a63a0b0e03f753481f4d8da6cc24c1
3 files changed +23 -21 +4 -3 +4 -4
+23 -21
--- src/style.c
+++ src/style.c
@@ -461,10 +461,18 @@
461461
@ /* the format for the timeline version display(no history permission!) */
462462
@ span.timelineHistDsp {
463463
@ font-weight: bold;
464464
@ }
465465
@
466
+;
467
+const char zTdTimelineTime[] =
468
+@ /* the format for the timeline time display */
469
+@ td.timelineTime {
470
+@ vertical-align: top;
471
+@ text-align: right;
472
+@ }
473
+@
466474
;
467475
const char zATagLink[] =
468476
@ /* the format for the tag links */
469477
@ a.tagLink {
470478
@ }
@@ -475,31 +483,22 @@
475483
@ span.tagDsp {
476484
@ font-weight: bold;
477485
@ }
478486
@
479487
;
480
-typedef enum cssDefaultItems {
481
- cssOthers = 0,
482
- tableLabelValue,
483
- divSidebox,
484
- divSideboxTitle,
485
- divSideboxDescribed,
486
- spanDisabled,
487
- spanTimelineSuppressed,
488
- tableTimelineTable,
489
- tdTimelineTableCell,
490
- spanTimelineLeaf,
491
- aTimelineHistLink,
492
- spanTimelineHistDsp,
493
- aTagLink,
494
- spanTagDsp,
495
- cssDefaultCount
496
-};
488
+const char zSpanWikiError[] =
489
+@ /* the format for wiki errors */
490
+@ span.wikiError {
491
+@ font-weight: bold;
492
+@ color: red;
493
+@ }
494
+@
495
+;
497496
const struct strctCssDefaults {
498497
char const * const name;
499498
char const * const value;
500
-} cssDefaultList[cssDefaultCount] = {
499
+} cssDefaultList[] = {
501500
{ "", zDefaultCSS },
502501
{ "table.label-value", zTableLabelValueCSS },
503502
{ "div.sidebox", zDivSidebox },
504503
{ "div.sideboxTitle", zDivSideboxTitle },
505504
{ "div.sideboxDescribed", zDivSideboxDescribed },
@@ -508,18 +507,21 @@
508507
{ "table.timelineTable", zTableTimelineTable },
509508
{ "td.timelineTableCell", zTdTimelineTableCell },
510509
{ "span.timelineLeaf", zSpanTimelineLeaf },
511510
{ "a.timelineHistLink", zATimelineHistLink },
512511
{ "span.timelineHistDsp", zSpanTimelineHistDsp },
512
+ { "td.timelineTime", zTdTimelineTime },
513513
{ "a.tagLink", zATagLink },
514
- { "span.tagDsp", zSpanTagDsp }
514
+ { "span.tagDsp", zSpanTagDsp },
515
+ { "span.wikiError", zSpanWikiError },
516
+ { 0, 0 }
515517
};
516518
517519
void cgi_append_default_css(void) {
518520
enum cssDefaultItems i;
519521
520
- for (i=cssOthers;i<cssDefaultCount;i++)
522
+ for (i=0;cssDefaultList[i].name;i++)
521523
cgi_printf(cssDefaultList[i].value);
522524
}
523525
524526
/*
525527
** WEBPAGE: style.css
@@ -532,11 +534,11 @@
532534
cgi_set_content_type("text/css");
533535
zCSS = db_get("css",(char*)zDefaultCSS);
534536
/* append user defined css */
535537
cgi_append_content(zCSS, -1);
536538
/* add special missing definitions */
537
- for (i=cssOthers+1;i<cssDefaultCount;i++)
539
+ for (i=1;cssDefaultList[i].name;i++)
538540
if (!strstr(zCSS,cssDefaultList[i].name))
539541
cgi_append_content(cssDefaultList[i].value, -1);
540542
g.isConst = 1;
541543
}
542544
543545
--- src/style.c
+++ src/style.c
@@ -461,10 +461,18 @@
461 @ /* the format for the timeline version display(no history permission!) */
462 @ span.timelineHistDsp {
463 @ font-weight: bold;
464 @ }
465 @
 
 
 
 
 
 
 
 
466 ;
467 const char zATagLink[] =
468 @ /* the format for the tag links */
469 @ a.tagLink {
470 @ }
@@ -475,31 +483,22 @@
475 @ span.tagDsp {
476 @ font-weight: bold;
477 @ }
478 @
479 ;
480 typedef enum cssDefaultItems {
481 cssOthers = 0,
482 tableLabelValue,
483 divSidebox,
484 divSideboxTitle,
485 divSideboxDescribed,
486 spanDisabled,
487 spanTimelineSuppressed,
488 tableTimelineTable,
489 tdTimelineTableCell,
490 spanTimelineLeaf,
491 aTimelineHistLink,
492 spanTimelineHistDsp,
493 aTagLink,
494 spanTagDsp,
495 cssDefaultCount
496 };
497 const struct strctCssDefaults {
498 char const * const name;
499 char const * const value;
500 } cssDefaultList[cssDefaultCount] = {
501 { "", zDefaultCSS },
502 { "table.label-value", zTableLabelValueCSS },
503 { "div.sidebox", zDivSidebox },
504 { "div.sideboxTitle", zDivSideboxTitle },
505 { "div.sideboxDescribed", zDivSideboxDescribed },
@@ -508,18 +507,21 @@
508 { "table.timelineTable", zTableTimelineTable },
509 { "td.timelineTableCell", zTdTimelineTableCell },
510 { "span.timelineLeaf", zSpanTimelineLeaf },
511 { "a.timelineHistLink", zATimelineHistLink },
512 { "span.timelineHistDsp", zSpanTimelineHistDsp },
 
513 { "a.tagLink", zATagLink },
514 { "span.tagDsp", zSpanTagDsp }
 
 
515 };
516
517 void cgi_append_default_css(void) {
518 enum cssDefaultItems i;
519
520 for (i=cssOthers;i<cssDefaultCount;i++)
521 cgi_printf(cssDefaultList[i].value);
522 }
523
524 /*
525 ** WEBPAGE: style.css
@@ -532,11 +534,11 @@
532 cgi_set_content_type("text/css");
533 zCSS = db_get("css",(char*)zDefaultCSS);
534 /* append user defined css */
535 cgi_append_content(zCSS, -1);
536 /* add special missing definitions */
537 for (i=cssOthers+1;i<cssDefaultCount;i++)
538 if (!strstr(zCSS,cssDefaultList[i].name))
539 cgi_append_content(cssDefaultList[i].value, -1);
540 g.isConst = 1;
541 }
542
543
--- src/style.c
+++ src/style.c
@@ -461,10 +461,18 @@
461 @ /* the format for the timeline version display(no history permission!) */
462 @ span.timelineHistDsp {
463 @ font-weight: bold;
464 @ }
465 @
466 ;
467 const char zTdTimelineTime[] =
468 @ /* the format for the timeline time display */
469 @ td.timelineTime {
470 @ vertical-align: top;
471 @ text-align: right;
472 @ }
473 @
474 ;
475 const char zATagLink[] =
476 @ /* the format for the tag links */
477 @ a.tagLink {
478 @ }
@@ -475,31 +483,22 @@
483 @ span.tagDsp {
484 @ font-weight: bold;
485 @ }
486 @
487 ;
488 const char zSpanWikiError[] =
489 @ /* the format for wiki errors */
490 @ span.wikiError {
491 @ font-weight: bold;
492 @ color: red;
493 @ }
494 @
495 ;
 
 
 
 
 
 
 
 
 
496 const struct strctCssDefaults {
497 char const * const name;
498 char const * const value;
499 } cssDefaultList[] = {
500 { "", zDefaultCSS },
501 { "table.label-value", zTableLabelValueCSS },
502 { "div.sidebox", zDivSidebox },
503 { "div.sideboxTitle", zDivSideboxTitle },
504 { "div.sideboxDescribed", zDivSideboxDescribed },
@@ -508,18 +507,21 @@
507 { "table.timelineTable", zTableTimelineTable },
508 { "td.timelineTableCell", zTdTimelineTableCell },
509 { "span.timelineLeaf", zSpanTimelineLeaf },
510 { "a.timelineHistLink", zATimelineHistLink },
511 { "span.timelineHistDsp", zSpanTimelineHistDsp },
512 { "td.timelineTime", zTdTimelineTime },
513 { "a.tagLink", zATagLink },
514 { "span.tagDsp", zSpanTagDsp },
515 { "span.wikiError", zSpanWikiError },
516 { 0, 0 }
517 };
518
519 void cgi_append_default_css(void) {
520 enum cssDefaultItems i;
521
522 for (i=0;cssDefaultList[i].name;i++)
523 cgi_printf(cssDefaultList[i].value);
524 }
525
526 /*
527 ** WEBPAGE: style.css
@@ -532,11 +534,11 @@
534 cgi_set_content_type("text/css");
535 zCSS = db_get("css",(char*)zDefaultCSS);
536 /* append user defined css */
537 cgi_append_content(zCSS, -1);
538 /* add special missing definitions */
539 for (i=1;cssDefaultList[i].name;i++)
540 if (!strstr(zCSS,cssDefaultList[i].name))
541 cgi_append_content(cssDefaultList[i].value, -1);
542 g.isConst = 1;
543 }
544
545
+4 -3
--- src/timeline.c
+++ src/timeline.c
@@ -239,12 +239,12 @@
239239
@ </td></tr>
240240
}
241241
memcpy(zTime, &zDate[11], 5);
242242
zTime[5] = 0;
243243
@ <tr>
244
- @ <td valign="top" align="right">%s(zTime)</td>
245
- @ <td width="20" align="left" valign="top">
244
+ @ <td class="timelineTime">%s(zTime)</td>
245
+ @ <td style="width: 20; text-align: left; vertical-align: top;">
246246
if( pGraph && zType[0]=='c' ){
247247
int nParent = 0;
248248
int aParent[32];
249249
const char *zBr;
250250
int gidx;
@@ -270,12 +270,13 @@
270270
}
271271
gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
272272
db_reset(&qbranch);
273273
@ <div id="m%d(gidx)"></div>
274274
}
275
+ @</td>
275276
if( zBgClr && zBgClr[0] ){
276
- @ <td class="timelineTableCell" bgcolor="%h(zBgClr)">
277
+ @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
277278
}else{
278279
@ <td class="timelineTableCell">
279280
}
280281
if( zType[0]=='c' ){
281282
hyperlink_to_uuid(zUuid);
282283
--- src/timeline.c
+++ src/timeline.c
@@ -239,12 +239,12 @@
239 @ </td></tr>
240 }
241 memcpy(zTime, &zDate[11], 5);
242 zTime[5] = 0;
243 @ <tr>
244 @ <td valign="top" align="right">%s(zTime)</td>
245 @ <td width="20" align="left" valign="top">
246 if( pGraph && zType[0]=='c' ){
247 int nParent = 0;
248 int aParent[32];
249 const char *zBr;
250 int gidx;
@@ -270,12 +270,13 @@
270 }
271 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
272 db_reset(&qbranch);
273 @ <div id="m%d(gidx)"></div>
274 }
 
275 if( zBgClr && zBgClr[0] ){
276 @ <td class="timelineTableCell" bgcolor="%h(zBgClr)">
277 }else{
278 @ <td class="timelineTableCell">
279 }
280 if( zType[0]=='c' ){
281 hyperlink_to_uuid(zUuid);
282
--- src/timeline.c
+++ src/timeline.c
@@ -239,12 +239,12 @@
239 @ </td></tr>
240 }
241 memcpy(zTime, &zDate[11], 5);
242 zTime[5] = 0;
243 @ <tr>
244 @ <td class="timelineTime">%s(zTime)</td>
245 @ <td style="width: 20; text-align: left; vertical-align: top;">
246 if( pGraph && zType[0]=='c' ){
247 int nParent = 0;
248 int aParent[32];
249 const char *zBr;
250 int gidx;
@@ -270,12 +270,13 @@
270 }
271 gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
272 db_reset(&qbranch);
273 @ <div id="m%d(gidx)"></div>
274 }
275 @</td>
276 if( zBgClr && zBgClr[0] ){
277 @ <td class="timelineTableCell" style="background-color: %h(zBgClr);">
278 }else{
279 @ <td class="timelineTableCell">
280 }
281 if( zType[0]=='c' ){
282 hyperlink_to_uuid(zUuid);
283
+4 -4
--- src/wiki.c
+++ src/wiki.c
@@ -63,12 +63,12 @@
6363
** and return true. If it is well-formed, return false.
6464
*/
6565
static int check_name(const char *z){
6666
if( !wiki_name_is_wellformed((const unsigned char *)z) ){
6767
style_header("Wiki Page Name Error");
68
- @ The wiki name "<b>%h(z)</b>" is not well-formed. Rules for
69
- @ wiki page names:
68
+ @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
69
+ @ Rules for wiki page names:
7070
well_formed_wiki_name_rules();
7171
style_footer();
7272
return 1;
7373
}
7474
return 0;
@@ -405,12 +405,12 @@
405405
@ <p>Name of new wiki page:
406406
@ <input type="text" width="35" name="name" value="%h(zName)">
407407
@ <input type="submit" value="Create">
408408
@ </p></form>
409409
if( zName[0] ){
410
- @ <p><b><font color="red">
411
- @ "%h(zName)" is not a valid wiki page name!</font></b></p>
410
+ @ <p><span class="wikiError">
411
+ @ "%h(zName)" is not a valid wiki page name!</span></p>
412412
}
413413
style_footer();
414414
}
415415
416416
417417
--- src/wiki.c
+++ src/wiki.c
@@ -63,12 +63,12 @@
63 ** and return true. If it is well-formed, return false.
64 */
65 static int check_name(const char *z){
66 if( !wiki_name_is_wellformed((const unsigned char *)z) ){
67 style_header("Wiki Page Name Error");
68 @ The wiki name "<b>%h(z)</b>" is not well-formed. Rules for
69 @ wiki page names:
70 well_formed_wiki_name_rules();
71 style_footer();
72 return 1;
73 }
74 return 0;
@@ -405,12 +405,12 @@
405 @ <p>Name of new wiki page:
406 @ <input type="text" width="35" name="name" value="%h(zName)">
407 @ <input type="submit" value="Create">
408 @ </p></form>
409 if( zName[0] ){
410 @ <p><b><font color="red">
411 @ "%h(zName)" is not a valid wiki page name!</font></b></p>
412 }
413 style_footer();
414 }
415
416
417
--- src/wiki.c
+++ src/wiki.c
@@ -63,12 +63,12 @@
63 ** and return true. If it is well-formed, return false.
64 */
65 static int check_name(const char *z){
66 if( !wiki_name_is_wellformed((const unsigned char *)z) ){
67 style_header("Wiki Page Name Error");
68 @ The wiki name "<span class="wikiError">%h(z)</span>" is not well-formed.
69 @ Rules for wiki page names:
70 well_formed_wiki_name_rules();
71 style_footer();
72 return 1;
73 }
74 return 0;
@@ -405,12 +405,12 @@
405 @ <p>Name of new wiki page:
406 @ <input type="text" width="35" name="name" value="%h(zName)">
407 @ <input type="submit" value="Create">
408 @ </p></form>
409 if( zName[0] ){
410 @ <p><span class="wikiError">
411 @ "%h(zName)" is not a valid wiki page name!</span></p>
412 }
413 style_footer();
414 }
415
416
417

Keyboard Shortcuts

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