Hi
I've just played around with the sources and started some coding, to remove the
formating from the html code and adding it to the style sheet.
As a first step, i moved the formating from the timeline page to the css style
sheet.
To be compatible with older repositories, the used classes are appended to the
user defined style sheet - if needed.
What do you think about it? Is there a chance, to get this to the main trunk, or
is this not the correct approach to extend skinning.
best regards
Wolfgang
----------------------------------------------------------------------------
CHANGED src/setup.c
Index: src/setup.c
===================================================================
--- src/setup.c
+++ src/setup.c
@@ -909,10 +909,13 @@
@ of CSS files can be seen on the <a href="setup_skin">skins page</a>.
@ See also the <a href="setup_header">header</a> and
@ <a href="setup_footer">footer</a> editing screens.
@ <blockquote><pre>
@ %h(zDefaultCSS)
+ @ %h(zTdTimelineTimeStampCell)
+ @ %h(zTdTimelineOmitted)
+ @ %h(zTdTimelineComment)
@ </pre></blockquote>
style_footer();
db_end_transaction(0);
}
CHANGED src/style.c
Index: src/style.c
===================================================================
--- src/style.c
+++ src/style.c
@@ -379,20 +379,49 @@
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }
;
-
+const char zTdTimelineTimeStampCell[] =
+@ /* The time column in timeline tables */
+@ td.timelineTimeStampCell {
+@ valign: top;
+@ text-align: right;
+...@}
+;
+const char zTdTimelineOmitted[] =
+@ /* The omitted line in timeline tables */
+@ td.timelineOmitted {
+@ font-size: small;
+@ font-style: italic;
+@ }
+;
+const char zTdTimelineComment[] =
+@ /* The comment cell in timeline tables */
+@ td.timelineComment {
+@ valign: top;
+@ text-align: left;
+@ }
+;
+
/*
** WEBPAGE: style.css
*/
void page_style_css(void){
char *zCSS = 0;
cgi_set_content_type("text/css");
zCSS = db_get("css",(char*)zDefaultCSS);
cgi_append_content(zCSS, -1);
+ cgi_append_content("\n", -1);
+ /* append internal classes, if not already in style sheet */
+ if (!strstr(zCSS,"timelineTimeStampCell"))
+ cgi_append_content(zTdTimelineTimeStampCell,-1);
+ if (!strstr(zCSS,"timelineOmitted"))
+ cgi_append_content(zTdTimelineOmitted,-1);
+ if (!strstr(zCSS,"timelineComment"))
+ cgi_append_content(zTdTimelineComment,-1);
g.isConst = 1;
}
/*
** WEBPAGE: test_env
CHANGED src/timeline.c
Index: src/timeline.c
===================================================================
--- src/timeline.c
+++ src/timeline.c
@@ -218,13 +218,13 @@
}
}
}
prevTagid = tagid;
if( suppressCnt ){
- @ <tr><td><td><td>
- @ <small><i>... %d(suppressCnt) similar
- @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
+ @ <tr><td><td><td class="timelineOmitted">
+ @ ... %d(suppressCnt) similar event%s(suppressCnt>1?"s":"") omitted.
+ @ </tr>
suppressCnt = 0;
}
if( strcmp(zType,"div")==0 ){
@ <tr><td colspan=3><hr></td></tr>
continue;
@@ -236,11 +236,11 @@
@ </td></tr>
}
memcpy(zTime, &zDate[11], 5);
zTime[5] = 0;
@ <tr>
- @ <td valign="top" align="right">%s(zTime)</td>
+ @ <td class="timelineTimeStampCell">%s(zTime)</td>
@ <td width="20" align="left" valign="top">
if( pGraph && zType[0]=='c' ){
int nParent = 0;
int aParent[32];
const char *zBr;
@@ -268,13 +268,13 @@
gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
db_reset(&qbranch);
@ <div id="m%d(gidx)"></div>
}
if( zBgClr && zBgClr[0] ){
- @ <td valign="top" align="left" bgcolor="%h(zBgClr)">
+ @ <td class="timelineComment" bgcolor="%h(zBgClr)">
}else{
- @ <td valign="top" align="left">
+ @ <td class="timelineComment">
}
if( zType[0]=='c' ){
hyperlink_to_uuid(zUuid);
if( isLeaf ){
if( db_exists("SELECT 1 FROM tagxref"
@@ -310,12 +310,13 @@
}
@ </td></tr>
}
if( suppressCnt ){
@ <tr><td><td><td>
- @ <small><i>... %d(suppressCnt) similar
- @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
+ @ <tr><td><td><td class="timelineOmitted">
+ @ ... %d(suppressCnt) similar event%s(suppressCnt>1?"s":"") omitted.
+ @ </tr>
suppressCnt = 0;
}
if( pGraph ){
graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
if( pGraph->nErr ){
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users