Fossil

Check-in [dc8a247e]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:timeline css skinned
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wolfgangFormat2CSS
Files: files | file ages | folders
SHA1:dc8a247e749f180b5aeb1b26410f20b7efa063e0
User & Date: wolfgang 2010-09-09 20:12:54
Context
2010-09-09
20:27
tag.c css skinned check-in: 6cf335ab user: wolfgang tags: wolfgangFormat2CSS
20:12
timeline css skinned check-in: dc8a247e user: wolfgang tags: wolfgangFormat2CSS
20:04
merged trunk to branch check-in: ef6979ea user: wolfgang tags: wolfgangFormat2CSS
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/style.c.

422
423
424
425
426
427
428





































429
430
431
432
433
434
435
436
437





438
439
440
441
442
443
444
445
446
447
448
449
450





451
452
453
454
455
456
457
const char zSpanTimelineSuppressed[] =
@ /* The suppressed duplicates lines in timeline, .. */
@ span.timelineDisabled {
@   font-style: italic;
@   font-size: small;
@ }
@





































;
typedef enum cssDefaultItems {
  cssOthers = 0,
  tableLabelValue,
  divSidebox,
  divSideboxTitle,
  divSideboxDescribed,
  spanDisabled,
  spanTimelineSuppressed,





  cssDefaultCount
};
const struct strctCssDefaults {
  char const * const name;
  char const * const value;
} cssDefaultList[cssDefaultCount] = {
  { "",                      zDefaultCSS             },
  { "table.label-value",     zTableLabelValueCSS     },
  { "div.sidebox",           zDivSidebox             },
  { "div.sideboxTitle",      zDivSideboxTitle        },
  { "div.sideboxDescribed",  zDivSideboxDescribed    },
  { "span.disabled",         zSpanDisabled           },
  { "span.timelineDisabled", zSpanTimelineSuppressed }





};

void cgi_append_default_css(void) {
  enum cssDefaultItems i;

  for (i=cssOthers;i<cssDefaultCount;i++)
    cgi_printf(cssDefaultList[i].value);







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









>
>
>
>
>












|
>
>
>
>
>







422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
const char zSpanTimelineSuppressed[] =
@ /* The suppressed duplicates lines in timeline, .. */
@ span.timelineDisabled {
@   font-style: italic;
@   font-size: small;
@ }
@
;
const char zTableTimelineTable[] =
@ /* the format for the timeline data table */
@ table.timelineTable {
@   cellspacing: 0;
@   border: 0;
@   cellpadding: 0
@ }
@
;
const char zTdTimelineTableCell[] =
@ /* the format for the timeline data cells */
@ td.timelineTableCell {
@   valign: top;
@   align: left;
@ }
@
;
const char zSpanTimelineLeaf[] =
@ /* the format for the timeline leaf marks */
@ span.timelineLeaf {
@   font-weight: bold;
@ }
@
;
const char zATimelineHistLink[] =
@ /* the format for the timeline version links */
@ a.timelineHistLink {
@ }
@
;
const char zSpanTimelineHistDsp[] =
@ /* the format for the timeline version display(no history permission!) */
@ span.timelineHistDsp {
@   font-weight: bold;
@ }
@
;
typedef enum cssDefaultItems {
  cssOthers = 0,
  tableLabelValue,
  divSidebox,
  divSideboxTitle,
  divSideboxDescribed,
  spanDisabled,
  spanTimelineSuppressed,
  tableTimelineTable,
  tdTimelineTableCell,
  spanTimelineLeaf,
  aTimelineHistLink,
  spanTimelineHistDsp,
  cssDefaultCount
};
const struct strctCssDefaults {
  char const * const name;
  char const * const value;
} cssDefaultList[cssDefaultCount] = {
  { "",                      zDefaultCSS             },
  { "table.label-value",     zTableLabelValueCSS     },
  { "div.sidebox",           zDivSidebox             },
  { "div.sideboxTitle",      zDivSideboxTitle        },
  { "div.sideboxDescribed",  zDivSideboxDescribed    },
  { "span.disabled",         zSpanDisabled           },
  { "span.timelineDisabled", zSpanTimelineSuppressed },
  { "table.timelineTable",   zTableTimelineTable     },
  { "td.timelineTableCell",  zTdTimelineTableCell    },
  { "span.timelineLeaf",     zSpanTimelineLeaf       },
  { "a.timelineHistLink",    zATimelineHistLink      },
  { "span.timelineHistDsp",  zSpanTimelineHistDsp    }
};

void cgi_append_default_css(void) {
  enum cssDefaultItems i;

  for (i=cssOthers;i<cssDefaultCount;i++)
    cgi_printf(cssDefaultList[i].value);

Changes to src/timeline.c.

46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
187
188
189
190
191
192
193



194
195
196
197
198
199
200
201
202
203
204
...
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
...
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324



325
326
327
328
329
330
331
/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){
  char zShortUuid[UUID_SIZE+1];
  shorten_uuid(zShortUuid, zUuid);
  if( g.okHistory ){
    @ <a href="%s(g.zBaseURL)/info/%s(zShortUuid)">[%s(zShortUuid)]</a>
  }else{
    @ <b>[%s(zShortUuid)]</b>
  }
}

/*
** Generate a hyperlink that invokes javascript to highlight
** a version on mouseover.
*/
................................................................................
  if( db_get_boolean("timeline-block-markup", 0) ){
    wikiFlags = WIKI_INLINE;
  }else{
    wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
  }
  if( tmFlags & TIMELINE_GRAPH ){
    pGraph = graph_init();



    @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
  }

  @ <table cellspacing=0 border=0 cellpadding=0>
  blob_zero(&comment);
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);
    const char *zUuid = db_column_text(pQuery, 1);
    int isLeaf = db_column_int(pQuery, 5);
    const char *zBgClr = db_column_text(pQuery, 6);
    const char *zDate = db_column_text(pQuery, 2);
................................................................................
        zBr = "trunk";
      }
      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)">
    }else{
      @ <td valign="top" align="left">
    }
    if( zType[0]=='c' ){
      hyperlink_to_uuid(zUuid);
      if( isLeaf ){
        if( db_exists("SELECT 1 FROM tagxref"
                      " WHERE rid=%d AND tagid=%d AND tagtype>0",
                      rid, TAG_CLOSED) ){
          @ <b>Closed-Leaf:</b>
        }else{
          @ <b>Leaf:</b>
        }
      }
    }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
      hyperlink_to_uuid(zUuid);
    }
    db_column_blob(pQuery, commentColumn, &comment);
    if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
................................................................................
    if( xExtra ){
      xExtra(rid);
    }
    @ </td></tr>
  }
  if( suppressCnt ){
    @ <tr><td><td><td>
    @ <small><i>... %d(suppressCnt) similar
    @ event%s(suppressCnt>1?"s":"") omitted.</i></small></tr>
    suppressCnt = 0;
  }
  if( pGraph ){
    graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
    if( pGraph->nErr ){
      graph_free(pGraph);
      pGraph = 0;
    }else{



      @ <tr><td><td>
      @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
    }
  }
  @ </table>
  timeline_output_graph_javascript(pGraph);
}







|

|







 







>
>
>



|







 







|

|







|

|







 







|
|








>
>
>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
...
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
...
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
/*
** Generate a hyperlink to a version.
*/
void hyperlink_to_uuid(const char *zUuid){
  char zShortUuid[UUID_SIZE+1];
  shorten_uuid(zShortUuid, zUuid);
  if( g.okHistory ){
    @ <a class="timelineHistLink" href="%s(g.zBaseURL)/info/%s(zShortUuid)">[%s(zShortUuid)]</a>
  }else{
    @ <span class="timelineHistDsp">[%s(zShortUuid)]</span>
  }
}

/*
** Generate a hyperlink that invokes javascript to highlight
** a version on mouseover.
*/
................................................................................
  if( db_get_boolean("timeline-block-markup", 0) ){
    wikiFlags = WIKI_INLINE;
  }else{
    wikiFlags = WIKI_INLINE | WIKI_NOBLOCK;
  }
  if( tmFlags & TIMELINE_GRAPH ){
    pGraph = graph_init();
    /* style is not moved to css, because this is
    ** a technical div for the timeline graph
    */
    @ <div id="canvas" style="position:relative;width:1px;height:1px;"></div>
  }

  @ <table class="timelineTable">
  blob_zero(&comment);
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);
    const char *zUuid = db_column_text(pQuery, 1);
    int isLeaf = db_column_int(pQuery, 5);
    const char *zBgClr = db_column_text(pQuery, 6);
    const char *zDate = db_column_text(pQuery, 2);
................................................................................
        zBr = "trunk";
      }
      gidx = graph_add_row(pGraph, rid, nParent, aParent, zBr, zBgClr);
      db_reset(&qbranch);
      @ <div id="m%d(gidx)"></div>
    }
    if( zBgClr && zBgClr[0] ){
      @ <td class="timelineTableCell" bgcolor="%h(zBgClr)">
    }else{
      @ <td class="timelineTableCell">
    }
    if( zType[0]=='c' ){
      hyperlink_to_uuid(zUuid);
      if( isLeaf ){
        if( db_exists("SELECT 1 FROM tagxref"
                      " WHERE rid=%d AND tagid=%d AND tagtype>0",
                      rid, TAG_CLOSED) ){
          @ <span class="timelineLeaf">Closed-Leaf:</span>
        }else{
          @ <span class="timelineLeaf">Leaf:</span>
        }
      }
    }else if( (tmFlags & TIMELINE_ARTID)!=0 ){
      hyperlink_to_uuid(zUuid);
    }
    db_column_blob(pQuery, commentColumn, &comment);
    if( mxWikiLen>0 && blob_size(&comment)>mxWikiLen ){
................................................................................
    if( xExtra ){
      xExtra(rid);
    }
    @ </td></tr>
  }
  if( suppressCnt ){
    @ <tr><td><td><td>
    @ <span class="timelineDisabled">... %d(suppressCnt) similar
    @ event%s(suppressCnt>1?"s":"") omitted.</span></tr>
    suppressCnt = 0;
  }
  if( pGraph ){
    graph_finish(pGraph, (tmFlags & TIMELINE_DISJOINT)!=0);
    if( pGraph->nErr ){
      graph_free(pGraph);
      pGraph = 0;
    }else{
      /* style is not moved to css, because this is
      ** a technical div for the timeline graph
      */
      @ <tr><td><td>
      @ <div id="grbtm" style="width:%d(pGraph->mxRail*20+30)px;"></div>
    }
  }
  @ </table>
  timeline_output_graph_javascript(pGraph);
}

Changes to src/update.c.