Fossil

Check-in [4d051c1eda]
Login

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

Overview
Comment:New timeline formatting experiment. Foreground font color changes when mousing over the vinfo hyperline show all immediate parents in red and immediate children in green and hide all entries that are not part of the current line.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4d051c1eda312ef2be17c7f254c54a8d15850688
User & Date: drh 2007-08-29 11:48:58.000
Context
2007-08-29
11:51
Merge aku's makefile changes. ... (check-in: fad606934c user: drh tags: trunk)
11:48
New timeline formatting experiment. Foreground font color changes when mousing over the vinfo hyperline show all immediate parents in red and immediate children in green and hide all entries that are not part of the current line. ... (check-in: 4d051c1eda user: drh tags: trunk)
03:22
Patch up makemake.tcl to incorporate aku's edits, then regenerate the main.mk file. ... (check-in: b616c3d8c3 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/timeline.c.
40
41
42
43
44
45
46
47





48
49
50
51
52
53
54
55
56
57
58
59
60
61
  }
}

/*
** Generate a hyperlink that invokes javascript to highlight
** a version on mouseover.
*/
void hyperlink_to_uuid_with_highlight(const char *zUuid, int id){





  char zShortUuid[UUID_SIZE+1];
  sprintf(zShortUuid, "%.10s", zUuid);
  if( g.okHistory ){
    @ <a onmouseover='hilite("m%d(id)")' onmouseout='unhilite("m%d(id)")'
    @    href="%s(g.zBaseURL)/vinfo/%s(zUuid)">[%s(zShortUuid)]</a>
  }else{
    @ <b onmouseover='hilite("m%d(id)")' onmouseout='unhilite("m%d(id)")'>
    @ [%s(zShortUuid)]</b>
  }
}

/*
** Generate a hyperlink to a diff between two versions.
*/







|
>
>
>
>
>



|


|







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
  }
}

/*
** Generate a hyperlink that invokes javascript to highlight
** a version on mouseover.
*/
void hyperlink_to_uuid_with_mouseover(
  const char *zUuid,   /* The UUID to display */
  const char *zIn,     /* Javascript proc for mouseover */
  const char *zOut,    /* Javascript proc for mouseout */
  int id               /* Argument to javascript procs */
){
  char zShortUuid[UUID_SIZE+1];
  sprintf(zShortUuid, "%.10s", zUuid);
  if( g.okHistory ){
    @ <a onmouseover='%s(zIn)("m%d(id)")' onmouseout='%s(zOut)("m%d(id)")'
    @    href="%s(g.zBaseURL)/vinfo/%s(zUuid)">[%s(zShortUuid)]</a>
  }else{
    @ <b onmouseover='%s(zIn)("m%d(id)")' onmouseout='%s(zOut)("m%d(id)")'>
    @ [%s(zShortUuid)]</b>
  }
}

/*
** Generate a hyperlink to a diff between two versions.
*/
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153

154
155
156
157
158
159
160
  Blob *pArg
 ){
  char zPrevDate[20];
  zPrevDate[0] = 0;
  @ <table cellspacing=0 border=0 cellpadding=0>
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);

    int nPChild = db_column_int(pQuery, 5);
    int nParent = db_column_int(pQuery, 6);
    int isLeaf = db_column_int(pQuery, 7);
    const char *zDate = db_column_text(pQuery, 2);
    if( xCallback ){
      xCallback(rid, pArg);
    }
    if( memcmp(zDate, zPrevDate, 10) ){
      sprintf(zPrevDate, "%.10s", zDate);
      @ <tr><td colspan=3>
      @ <table cellpadding=2 border=0>
      @ <tr><td bgcolor="#a0b5f4" class="border1">
      @ <table cellpadding=2 cellspacing=0 border=0><tr>
      @ <td bgcolor="#d0d9f4" class="bkgnd1">%s(zPrevDate)</td>
      @ </tr></table>
      @ </td></tr></table>
      @ </td></tr>
    }
    @ <tr id="m%d(rid)" onmouseover='xin("m%d(rid)")'
    @     onmouseout='xout("m%d(rid)")'>
    @ <td valign="top">%s(&zDate[11])</td>
    @ <td width="20"></td>
    @ <td valign="top" align="left">
    hyperlink_to_uuid(db_column_text(pQuery,1));
    @ %h(db_column_text(pQuery,3))
    if( nParent>1 ){
      Stmt q;
      @ <b>Merge</b> from
      db_prepare(&q,
        "SELECT rid, uuid FROM plink, blob"
        " WHERE plink.cid=%d AND blob.rid=plink.pid AND plink.isprim=0",
        rid
      );
      while( db_step(&q)==SQLITE_ROW ){
        int mrid = db_column_int(&q, 0);
        const char *zUuid = db_column_text(&q, 1);
        hyperlink_to_uuid_with_highlight(zUuid, mrid);
      }
      db_finalize(&q);
    }
    if( nPChild>1 ){
      Stmt q;
      @ <b>Fork</b> to
      db_prepare(&q,
        "SELECT rid, uuid FROM plink, blob"
        " WHERE plink.pid=%d AND blob.rid=plink.cid AND plink.isprim>0",
        rid
      );
      while( db_step(&q)==SQLITE_ROW ){
        int frid = db_column_int(&q, 0);
        const char *zUuid = db_column_text(&q, 1);
        hyperlink_to_uuid_with_highlight(zUuid, frid);
      }
      db_finalize(&q);
    }
    if( isLeaf ){
      @ <b>Leaf</b>
    }

    @ (by %h(db_column_text(pQuery,4)))</td></tr>
    if( zLastDate ){
      strcpy(zLastDate, zDate);
    }
  }
  @ </table>
}







>


















|
<



|
<

<
|
<
<
<
<
<
<
<
<
<
|
<
<

<
|
<
<
<
<
<
<
<
<
<
<
<




>







94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120

121
122
123
124

125

126









127


128

129











130
131
132
133
134
135
136
137
138
139
140
141
  Blob *pArg
 ){
  char zPrevDate[20];
  zPrevDate[0] = 0;
  @ <table cellspacing=0 border=0 cellpadding=0>
  while( db_step(pQuery)==SQLITE_ROW ){
    int rid = db_column_int(pQuery, 0);
    const char *zUuid = db_column_text(pQuery, 1);
    int nPChild = db_column_int(pQuery, 5);
    int nParent = db_column_int(pQuery, 6);
    int isLeaf = db_column_int(pQuery, 7);
    const char *zDate = db_column_text(pQuery, 2);
    if( xCallback ){
      xCallback(rid, pArg);
    }
    if( memcmp(zDate, zPrevDate, 10) ){
      sprintf(zPrevDate, "%.10s", zDate);
      @ <tr><td colspan=3>
      @ <table cellpadding=2 border=0>
      @ <tr><td bgcolor="#a0b5f4" class="border1">
      @ <table cellpadding=2 cellspacing=0 border=0><tr>
      @ <td bgcolor="#d0d9f4" class="bkgnd1">%s(zPrevDate)</td>
      @ </tr></table>
      @ </td></tr></table>
      @ </td></tr>
    }
    @ <tr id="m%d(rid)">

    @ <td valign="top">%s(&zDate[11])</td>
    @ <td width="20"></td>
    @ <td valign="top" align="left">
    hyperlink_to_uuid_with_mouseover(zUuid, "xin", "xout", rid);

    if( nParent>1 ){

      @ <b>Merge</b> 









    }


    if( nPChild>1 ){

      @ <b>Fork</b>











    }
    if( isLeaf ){
      @ <b>Leaf</b>
    }
    @ %h(db_column_text(pQuery,3))
    @ (by %h(db_column_text(pQuery,4)))</td></tr>
    if( zLastDate ){
      strcpy(zLastDate, zDate);
    }
  }
  @ </table>
}
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
  cgi_append_content(blob_buffer(&scriptInit), blob_size(&scriptInit));
  blob_reset(&scriptInit);
  @ function setall(value){
  @   for(var x in parentof){
  @     setone(x,value);
  @   }
  @ }
  @ function setone(id, onoff){
  @   if( parentof[id]==null ) return 0;
  @   var w = document.getElementById(id);
  @   var clr = onoff==1 ? "#e0e0ff" : "#ffffff";
  @   if( w.backgroundColor==clr ){
  @     return 0
  @   }else{
  @     w.style.backgroundColor = clr
  @     return 1
  @   }
  @ }
  @ function xin(id) {
  @   setall(0);
  @   setone(id,1);
  @   set_children(id);
  @   set_parents(id);














  @ }
  @ function xout(id) {
  @   setall(0);
  @ }
  @ function set_parents(id){
  @   var plist = parentof[id];
  @   if( plist==null ) return;
  @   for(var x in plist){
  @     var pid = plist[x];
  @     if( setone(pid,1)==1 ){
  @       set_parents(pid);
  @     }
  @   }
  @ }
  @ function set_children(id){
  @   var clist = childof[id];
  @   if( clist==null ) return;
  @   for(var x in clist){
  @     var cid = clist[x];
  @     if( setone(cid,1)==1 ){
  @       set_children(cid);
  @     }
  @   }
  @ }
  @ function hilite(id) {
  @   var x = document.getElementById(id);
  @   x.style.color = "#ff0000";
  @ }
  @ function unhilite(id) {
  @   var x = document.getElementById(id);
  @   x.style.color = "#000000";
  @ }
  @ </script>
  @ <hr>
  @ <form method="GET" action="%s(g.zBaseURL)/timeline">
  @ Start Date:
  @ <input type="text" size="30" value="%h(zStart)" name="d">
  @ Number Of Entries:  
  @ <input type="text" size="4" value="%d(nEntry)" name="n">







|


<
|


|




|
|
|
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>


|

|




|
|



|




|
|



<
<
<
<
<
<
<
<







226
227
228
229
230
231
232
233
234
235

236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
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
  cgi_append_content(blob_buffer(&scriptInit), blob_size(&scriptInit));
  blob_reset(&scriptInit);
  @ function setall(value){
  @   for(var x in parentof){
  @     setone(x,value);
  @   }
  @ }
  @ function setone(id, clr){
  @   if( parentof[id]==null ) return 0;
  @   var w = document.getElementById(id);

  @   if( w.style.color==clr ){
  @     return 0
  @   }else{
  @     w.style.color = clr
  @     return 1
  @   }
  @ }
  @ function xin(id) {
  @   setall("#ffffff");
  @   setone(id,"#000000");
  @   set_children(id, "#002000");
  @   set_parents(id, "#200000");
  @   for(var x in parentof[id]){
  @     var pid = parentof[id][x]
  @     var w = document.getElementById(pid);
  @     if( w!=null ){
  @       w.style.color = "#ff0000";
  @     }
  @   }
  @   for(var x in childof[id]){
  @     var cid = childof[id][x]
  @     var w = document.getElementById(cid);
  @     if( w!=null ){
  @       w.style.color = "#008000";
  @     }
  @   }
  @ }
  @ function xout(id) {
  @   setall("#000000");
  @ }
  @ function set_parents(id, clr){
  @   var plist = parentof[id];
  @   if( plist==null ) return;
  @   for(var x in plist){
  @     var pid = plist[x];
  @     if( setone(pid,clr)==1 ){
  @       set_parents(pid,clr);
  @     }
  @   }
  @ }
  @ function set_children(id,clr){
  @   var clist = childof[id];
  @   if( clist==null ) return;
  @   for(var x in clist){
  @     var cid = clist[x];
  @     if( setone(cid,clr)==1 ){
  @       set_children(cid,clr);
  @     }
  @   }
  @ }








  @ </script>
  @ <hr>
  @ <form method="GET" action="%s(g.zBaseURL)/timeline">
  @ Start Date:
  @ <input type="text" size="30" value="%h(zStart)" name="d">
  @ Number Of Entries:  
  @ <input type="text" size="4" value="%d(nEntry)" name="n">