Fossil SCM

Make the Basic/Advanced menu controls on timelines a setting that persists in the display preferences cookie.

drh 2017-12-05 22:39 trunk
Commit 259074d364c11415f84027baaee5bc6ba92ff98feec54378feb1afe67e9b387a
2 files changed +6 -32 +35 -14
+6 -32
--- src/style.c
+++ src/style.c
@@ -46,29 +46,26 @@
4646
} aSubmenu[30];
4747
static int nSubmenu = 0; /* Number of buttons */
4848
static struct SubmenuCtrl {
4949
const char *zName; /* Form query parameter */
5050
const char *zLabel; /* Label. Might be NULL for FF_MULTI */
51
- unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_BINARY */
52
- unsigned char eVisible; /* STYLE_NORMAL, STYLE_VISIBLE, .... */
51
+ unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_CHECKBOX */
52
+ unsigned char eVisible; /* STYLE_NORMAL or STYLE_DISABLED */
5353
short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
5454
const char *const *azChoice; /* value/display pairs for FF_MULTI */
5555
const char *zFalse; /* FF_BINARY label when false */
5656
const char *zJS; /* Javascript to run on toggle */
5757
} aSubmenuCtrl[20];
5858
static int nSubmenuCtrl = 0;
5959
#define FF_ENTRY 1 /* Text entry box */
6060
#define FF_MULTI 2 /* Combobox. Multiple choices. */
61
-#define FF_BINARY 3 /* Control binary query parameter */
62
-#define FF_CHECKBOX 4 /* Check-box with JS */
63
-#define FF_JSBUTTON 5 /* Run JS when clicked */
61
+#define FF_BINARY 3 /* Control for binary query parameter */
62
+#define FF_CHECKBOX 4 /* Check-box */
6463
6564
#if INTERFACE
6665
#define STYLE_NORMAL 0 /* Normal display of control */
6766
#define STYLE_DISABLED 1 /* Control is disabled */
68
-#define STYLE_CLUTTER 2 /* Only visible in "Advanced" display */
69
-#define STYLE_BASIC 4 /* Only visible in "Basic" display */
7067
#endif /* INTERFACE */
7168
7269
/*
7370
** Remember that the header has been generated. The footer is omitted
7471
** if an error occurs before the header.
@@ -242,22 +239,10 @@
242239
aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
243240
aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
244241
aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
245242
nSubmenuCtrl++;
246243
}
247
-void style_submenu_jsbutton(
248
- const char *zLabel, /* Label to display on the submenu */
249
- int eVisible, /* Visible or disabled */
250
- const char *zJS /* Javascript to run when clicked */
251
-){
252
- assert( nSubmenuCtrl < count(aSubmenuCtrl) );
253
- aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
254
- aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
255
- aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
256
- aSubmenuCtrl[nSubmenuCtrl].eType = FF_JSBUTTON;
257
- nSubmenuCtrl++;
258
-}
259244
void style_submenu_binary(
260245
const char *zName, /* Query parameter name */
261246
const char *zTrue, /* Label to show when parameter is true */
262247
const char *zFalse, /* Label to show when the parameter is false */
263248
int eVisible /* Visible or disabled */
@@ -577,16 +562,10 @@
577562
if( aSubmenuCtrl[i].eVisible & STYLE_DISABLED ){
578563
zDisabled = " disabled";
579564
}else if( zQPN ){
580565
cgi_tag_query_parameter(zQPN);
581566
}
582
- if( aSubmenuCtrl[i].eVisible & STYLE_CLUTTER ){
583
- zXtraClass = " clutter";
584
- }
585
- if( aSubmenuCtrl[i].eVisible & STYLE_BASIC ){
586
- zXtraClass = " anticlutter";
587
- }
588567
switch( aSubmenuCtrl[i].eType ){
589568
case FF_ENTRY:
590569
@ <span class='submenuctrl%s(zXtraClass)'>\
591570
@ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
592571
@ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
@@ -623,11 +602,12 @@
623602
}
624603
break;
625604
}
626605
case FF_BINARY: {
627606
int isTrue = PB(zQPN);
628
- @ <select class='submenuctrl%s(zXtraClass)' size='1' name='%s(zQPN)' \
607
+ @ <select class='submenuctrl%s(zXtraClass)' size='1' \
608
+ @ name='%s(zQPN)' \
629609
@ onchange='gebi("f01").submit();'%s(zDisabled)>
630610
@ <option value='1'\
631611
if( isTrue ){
632612
@ selected\
633613
}
@@ -652,16 +632,10 @@
652632
@ onchange='gebi("f01").submit();'%s(zDisabled)>\
653633
}
654634
@ %h(aSubmenuCtrl[i].zLabel)</label>
655635
break;
656636
}
657
- case FF_JSBUTTON: {
658
- @ <a class="label%s(zXtraClass)" \
659
- @ onclick='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
660
- @ %s(aSubmenuCtrl[i].zLabel)</a>
661
- break;
662
- }
663637
}
664638
}
665639
@ </div>
666640
if( nSubmenuCtrl ){
667641
cgi_query_parameters_to_hidden();
668642
--- src/style.c
+++ src/style.c
@@ -46,29 +46,26 @@
46 } aSubmenu[30];
47 static int nSubmenu = 0; /* Number of buttons */
48 static struct SubmenuCtrl {
49 const char *zName; /* Form query parameter */
50 const char *zLabel; /* Label. Might be NULL for FF_MULTI */
51 unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_BINARY */
52 unsigned char eVisible; /* STYLE_NORMAL, STYLE_VISIBLE, .... */
53 short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
54 const char *const *azChoice; /* value/display pairs for FF_MULTI */
55 const char *zFalse; /* FF_BINARY label when false */
56 const char *zJS; /* Javascript to run on toggle */
57 } aSubmenuCtrl[20];
58 static int nSubmenuCtrl = 0;
59 #define FF_ENTRY 1 /* Text entry box */
60 #define FF_MULTI 2 /* Combobox. Multiple choices. */
61 #define FF_BINARY 3 /* Control binary query parameter */
62 #define FF_CHECKBOX 4 /* Check-box with JS */
63 #define FF_JSBUTTON 5 /* Run JS when clicked */
64
65 #if INTERFACE
66 #define STYLE_NORMAL 0 /* Normal display of control */
67 #define STYLE_DISABLED 1 /* Control is disabled */
68 #define STYLE_CLUTTER 2 /* Only visible in "Advanced" display */
69 #define STYLE_BASIC 4 /* Only visible in "Basic" display */
70 #endif /* INTERFACE */
71
72 /*
73 ** Remember that the header has been generated. The footer is omitted
74 ** if an error occurs before the header.
@@ -242,22 +239,10 @@
242 aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
243 aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
244 aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
245 nSubmenuCtrl++;
246 }
247 void style_submenu_jsbutton(
248 const char *zLabel, /* Label to display on the submenu */
249 int eVisible, /* Visible or disabled */
250 const char *zJS /* Javascript to run when clicked */
251 ){
252 assert( nSubmenuCtrl < count(aSubmenuCtrl) );
253 aSubmenuCtrl[nSubmenuCtrl].zLabel = zLabel;
254 aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
255 aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
256 aSubmenuCtrl[nSubmenuCtrl].eType = FF_JSBUTTON;
257 nSubmenuCtrl++;
258 }
259 void style_submenu_binary(
260 const char *zName, /* Query parameter name */
261 const char *zTrue, /* Label to show when parameter is true */
262 const char *zFalse, /* Label to show when the parameter is false */
263 int eVisible /* Visible or disabled */
@@ -577,16 +562,10 @@
577 if( aSubmenuCtrl[i].eVisible & STYLE_DISABLED ){
578 zDisabled = " disabled";
579 }else if( zQPN ){
580 cgi_tag_query_parameter(zQPN);
581 }
582 if( aSubmenuCtrl[i].eVisible & STYLE_CLUTTER ){
583 zXtraClass = " clutter";
584 }
585 if( aSubmenuCtrl[i].eVisible & STYLE_BASIC ){
586 zXtraClass = " anticlutter";
587 }
588 switch( aSubmenuCtrl[i].eType ){
589 case FF_ENTRY:
590 @ <span class='submenuctrl%s(zXtraClass)'>\
591 @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
592 @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
@@ -623,11 +602,12 @@
623 }
624 break;
625 }
626 case FF_BINARY: {
627 int isTrue = PB(zQPN);
628 @ <select class='submenuctrl%s(zXtraClass)' size='1' name='%s(zQPN)' \
 
629 @ onchange='gebi("f01").submit();'%s(zDisabled)>
630 @ <option value='1'\
631 if( isTrue ){
632 @ selected\
633 }
@@ -652,16 +632,10 @@
652 @ onchange='gebi("f01").submit();'%s(zDisabled)>\
653 }
654 @ %h(aSubmenuCtrl[i].zLabel)</label>
655 break;
656 }
657 case FF_JSBUTTON: {
658 @ <a class="label%s(zXtraClass)" \
659 @ onclick='%s(aSubmenuCtrl[i].zJS)'%s(zDisabled)>\
660 @ %s(aSubmenuCtrl[i].zLabel)</a>
661 break;
662 }
663 }
664 }
665 @ </div>
666 if( nSubmenuCtrl ){
667 cgi_query_parameters_to_hidden();
668
--- src/style.c
+++ src/style.c
@@ -46,29 +46,26 @@
46 } aSubmenu[30];
47 static int nSubmenu = 0; /* Number of buttons */
48 static struct SubmenuCtrl {
49 const char *zName; /* Form query parameter */
50 const char *zLabel; /* Label. Might be NULL for FF_MULTI */
51 unsigned char eType; /* FF_ENTRY, FF_MULTI, FF_CHECKBOX */
52 unsigned char eVisible; /* STYLE_NORMAL or STYLE_DISABLED */
53 short int iSize; /* Width for FF_ENTRY. Count for FF_MULTI */
54 const char *const *azChoice; /* value/display pairs for FF_MULTI */
55 const char *zFalse; /* FF_BINARY label when false */
56 const char *zJS; /* Javascript to run on toggle */
57 } aSubmenuCtrl[20];
58 static int nSubmenuCtrl = 0;
59 #define FF_ENTRY 1 /* Text entry box */
60 #define FF_MULTI 2 /* Combobox. Multiple choices. */
61 #define FF_BINARY 3 /* Control for binary query parameter */
62 #define FF_CHECKBOX 4 /* Check-box */
 
63
64 #if INTERFACE
65 #define STYLE_NORMAL 0 /* Normal display of control */
66 #define STYLE_DISABLED 1 /* Control is disabled */
 
 
67 #endif /* INTERFACE */
68
69 /*
70 ** Remember that the header has been generated. The footer is omitted
71 ** if an error occurs before the header.
@@ -242,22 +239,10 @@
239 aSubmenuCtrl[nSubmenuCtrl].eVisible = eVisible;
240 aSubmenuCtrl[nSubmenuCtrl].zJS = zJS;
241 aSubmenuCtrl[nSubmenuCtrl].eType = FF_CHECKBOX;
242 nSubmenuCtrl++;
243 }
 
 
 
 
 
 
 
 
 
 
 
 
244 void style_submenu_binary(
245 const char *zName, /* Query parameter name */
246 const char *zTrue, /* Label to show when parameter is true */
247 const char *zFalse, /* Label to show when the parameter is false */
248 int eVisible /* Visible or disabled */
@@ -577,16 +562,10 @@
562 if( aSubmenuCtrl[i].eVisible & STYLE_DISABLED ){
563 zDisabled = " disabled";
564 }else if( zQPN ){
565 cgi_tag_query_parameter(zQPN);
566 }
 
 
 
 
 
 
567 switch( aSubmenuCtrl[i].eType ){
568 case FF_ENTRY:
569 @ <span class='submenuctrl%s(zXtraClass)'>\
570 @ &nbsp;%h(aSubmenuCtrl[i].zLabel)\
571 @ <input type='text' name='%s(zQPN)' value='%h(PD(zQPN, ""))' \
@@ -623,11 +602,12 @@
602 }
603 break;
604 }
605 case FF_BINARY: {
606 int isTrue = PB(zQPN);
607 @ <select class='submenuctrl%s(zXtraClass)' size='1' \
608 @ name='%s(zQPN)' \
609 @ onchange='gebi("f01").submit();'%s(zDisabled)>
610 @ <option value='1'\
611 if( isTrue ){
612 @ selected\
613 }
@@ -652,16 +632,10 @@
632 @ onchange='gebi("f01").submit();'%s(zDisabled)>\
633 }
634 @ %h(aSubmenuCtrl[i].zLabel)</label>
635 break;
636 }
 
 
 
 
 
 
637 }
638 }
639 @ </div>
640 if( nSubmenuCtrl ){
641 cgi_query_parameters_to_hidden();
642
+35 -14
--- src/timeline.c
+++ src/timeline.c
@@ -1318,10 +1318,11 @@
13181318
** mionly Limit rel to show ancestors but not descendants
13191319
** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
13201320
** u=USER Only show items associated with USER
13211321
** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
13221322
** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar"
1323
+** advm Use the "Advanced" or "Busy" menu design.
13231324
** ng No Graph.
13241325
** nd Do not highlight the focus check-in
13251326
** v Show details of files changed
13261327
** f=CHECKIN Show family (immediate parents and children) of CHECKIN
13271328
** from=CHECKIN Path from...
@@ -1396,10 +1397,11 @@
13961397
const char *z;
13971398
char *zOlderButton = 0; /* URL for Older button at the bottom */
13981399
char *zNewerButton = 0; /* URL for Newer button at the top */
13991400
int selectedRid = -9999999; /* Show a highlight on this RID */
14001401
int disableY = 0; /* Disable type selector on submenu */
1402
+ int advancedMenu = 0; /* Use the advanced menu design */
14011403
14021404
/* Set number of rows to display */
14031405
cookie_read_parameter("n","n");
14041406
z = P("n");
14051407
if( z==0 ) z = db_get("timeline-default-length",0);
@@ -1418,10 +1420,12 @@
14181420
nEntry = 50;
14191421
}
14201422
cgi_replace_query_parameter("n",z);
14211423
cookie_write_parameter("n","n",0);
14221424
tmFlags |= timeline_ss_submenu();
1425
+ cookie_link_parameter("advm","advm","0");
1426
+ advancedMenu = atoi(PD("advm","0"));
14231427
14241428
/* To view the timeline, must have permission to read project data.
14251429
*/
14261430
pd_rid = name_to_typed_rid(P("dp"),"ci");
14271431
if( pd_rid ){
@@ -1474,11 +1478,13 @@
14741478
/* For exact maching, inhibit links to the selected tag. */
14751479
zThisTag = zTagName;
14761480
}
14771481
14781482
/* Display a checkbox to enable/disable display of related check-ins. */
1479
- style_submenu_checkbox("rel", "Related", STYLE_CLUTTER, 0);
1483
+ if( advancedMenu ){
1484
+ style_submenu_checkbox("rel", "Related", 0, 0);
1485
+ }
14801486
14811487
/* Construct the tag match expression. */
14821488
zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc, &zError);
14831489
}
14841490
@@ -1562,11 +1568,13 @@
15621568
}else{
15631569
bisectOnly = 0;
15641570
}
15651571
15661572
style_header("Timeline");
1567
- style_submenu_element("Help", "%R/help?cmd=/timeline");
1573
+ if( advancedMenu ){
1574
+ style_submenu_element("Help", "%R/help?cmd=/timeline");
1575
+ }
15681576
login_anonymous_available();
15691577
timeline_temp_table();
15701578
blob_zero(&sql);
15711579
blob_zero(&desc);
15721580
blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
@@ -1607,11 +1615,13 @@
16071615
blob_append(&sql, ")", -1);
16081616
path_reset();
16091617
addFileGlobExclusion(zChng, &sql);
16101618
tmFlags |= TIMELINE_DISJOINT;
16111619
db_multi_exec("%s", blob_sql_text(&sql));
1612
- style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);
1620
+ if( advancedMenu ){
1621
+ style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1622
+ }
16131623
blob_appendf(&desc, "%d check-ins going from ",
16141624
db_int(0, "SELECT count(*) FROM timeline"));
16151625
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
16161626
blob_append(&desc, " to ", -1);
16171627
blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
@@ -1657,12 +1667,14 @@
16571667
if( p_rid ){
16581668
/* If both p= and d= are set, we don't have the uuid of d yet. */
16591669
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
16601670
}
16611671
}
1662
- style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);
1663
- style_submenu_entry("n","Max:",4,STYLE_CLUTTER);
1672
+ if( advancedMenu ){
1673
+ style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1674
+ }
1675
+ style_submenu_entry("n","Max:",4,0);
16641676
timeline_y_submenu(1);
16651677
}else if( f_rid && g.perm.Read ){
16661678
/* If f= is present, ignore all other parameters other than n= */
16671679
char *zUuid;
16681680
db_multi_exec(
@@ -1677,12 +1689,14 @@
16771689
if( useDividers ) selectedRid = f_rid;
16781690
blob_appendf(&desc, "Parents and children of check-in ");
16791691
zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
16801692
blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
16811693
tmFlags |= TIMELINE_DISJOINT;
1682
- style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
1683
- style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);
1694
+ if( advancedMenu ){
1695
+ style_submenu_checkbox("unhide", "Unhide", 0, 0);
1696
+ style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1697
+ }
16841698
}else{
16851699
/* Otherwise, a timeline based on a span of time */
16861700
int n;
16871701
const char *zEType = "timeline item";
16881702
char *zDate;
@@ -1960,29 +1974,36 @@
19601974
){
19611975
zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0));
19621976
}
19631977
free(zDate);
19641978
}
1965
- if( zType[0]=='a' || zType[0]=='c' ){
1966
- style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
1979
+ if( advancedMenu ){
1980
+ if( zType[0]=='a' || zType[0]=='c' ){
1981
+ style_submenu_checkbox("unhide", "Unhide", 0, 0);
1982
+ }
1983
+ style_submenu_checkbox("v", "Files",(zType[0]!='a' && zType[0]!='c'),0);
19671984
}
1968
- style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);
19691985
style_submenu_entry("n","Max:",4,0);
19701986
timeline_y_submenu(disableY);
1971
- style_submenu_entry("t", "Tag Filter:", -8, STYLE_CLUTTER);
1972
- style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, STYLE_CLUTTER);
1987
+ if( advancedMenu ){
1988
+ style_submenu_entry("t", "Tag Filter:", -8, 0);
1989
+ style_submenu_multichoice("ms", count(azMatchStyles)/2,azMatchStyles,0);
1990
+ }
19731991
}
19741992
blob_zero(&cond);
19751993
}
19761994
if( PB("showsql") ){
19771995
@ <pre>%h(blob_sql_text(&sql))</pre>
19781996
}
19791997
if( search_restrict(SRCH_CKIN)!=0 ){
19801998
style_submenu_element("Search", "%R/search?y=c");
19811999
}
1982
- style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
1983
- style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
2000
+ if( advancedMenu ){
2001
+ style_submenu_element("Basic", url_render(&url, "advm", "0", 0, 0));
2002
+ }else{
2003
+ style_submenu_element("Advanced", url_render(&url, "advm", "1", 0, 0));
2004
+ }
19842005
if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
19852006
if( useDividers && zMark && zMark[0] ){
19862007
double r = symbolic_name_to_mtime(zMark);
19872008
if( r>0.0 ) selectedRid = timeline_add_divider(r);
19882009
}
19892010
--- src/timeline.c
+++ src/timeline.c
@@ -1318,10 +1318,11 @@
1318 ** mionly Limit rel to show ancestors but not descendants
1319 ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1320 ** u=USER Only show items associated with USER
1321 ** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
1322 ** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar"
 
1323 ** ng No Graph.
1324 ** nd Do not highlight the focus check-in
1325 ** v Show details of files changed
1326 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1327 ** from=CHECKIN Path from...
@@ -1396,10 +1397,11 @@
1396 const char *z;
1397 char *zOlderButton = 0; /* URL for Older button at the bottom */
1398 char *zNewerButton = 0; /* URL for Newer button at the top */
1399 int selectedRid = -9999999; /* Show a highlight on this RID */
1400 int disableY = 0; /* Disable type selector on submenu */
 
1401
1402 /* Set number of rows to display */
1403 cookie_read_parameter("n","n");
1404 z = P("n");
1405 if( z==0 ) z = db_get("timeline-default-length",0);
@@ -1418,10 +1420,12 @@
1418 nEntry = 50;
1419 }
1420 cgi_replace_query_parameter("n",z);
1421 cookie_write_parameter("n","n",0);
1422 tmFlags |= timeline_ss_submenu();
 
 
1423
1424 /* To view the timeline, must have permission to read project data.
1425 */
1426 pd_rid = name_to_typed_rid(P("dp"),"ci");
1427 if( pd_rid ){
@@ -1474,11 +1478,13 @@
1474 /* For exact maching, inhibit links to the selected tag. */
1475 zThisTag = zTagName;
1476 }
1477
1478 /* Display a checkbox to enable/disable display of related check-ins. */
1479 style_submenu_checkbox("rel", "Related", STYLE_CLUTTER, 0);
 
 
1480
1481 /* Construct the tag match expression. */
1482 zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc, &zError);
1483 }
1484
@@ -1562,11 +1568,13 @@
1562 }else{
1563 bisectOnly = 0;
1564 }
1565
1566 style_header("Timeline");
1567 style_submenu_element("Help", "%R/help?cmd=/timeline");
 
 
1568 login_anonymous_available();
1569 timeline_temp_table();
1570 blob_zero(&sql);
1571 blob_zero(&desc);
1572 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
@@ -1607,11 +1615,13 @@
1607 blob_append(&sql, ")", -1);
1608 path_reset();
1609 addFileGlobExclusion(zChng, &sql);
1610 tmFlags |= TIMELINE_DISJOINT;
1611 db_multi_exec("%s", blob_sql_text(&sql));
1612 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);
 
 
1613 blob_appendf(&desc, "%d check-ins going from ",
1614 db_int(0, "SELECT count(*) FROM timeline"));
1615 blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
1616 blob_append(&desc, " to ", -1);
1617 blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
@@ -1657,12 +1667,14 @@
1657 if( p_rid ){
1658 /* If both p= and d= are set, we don't have the uuid of d yet. */
1659 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
1660 }
1661 }
1662 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);
1663 style_submenu_entry("n","Max:",4,STYLE_CLUTTER);
 
 
1664 timeline_y_submenu(1);
1665 }else if( f_rid && g.perm.Read ){
1666 /* If f= is present, ignore all other parameters other than n= */
1667 char *zUuid;
1668 db_multi_exec(
@@ -1677,12 +1689,14 @@
1677 if( useDividers ) selectedRid = f_rid;
1678 blob_appendf(&desc, "Parents and children of check-in ");
1679 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
1680 blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
1681 tmFlags |= TIMELINE_DISJOINT;
1682 style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
1683 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER, 0);
 
 
1684 }else{
1685 /* Otherwise, a timeline based on a span of time */
1686 int n;
1687 const char *zEType = "timeline item";
1688 char *zDate;
@@ -1960,29 +1974,36 @@
1960 ){
1961 zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0));
1962 }
1963 free(zDate);
1964 }
1965 if( zType[0]=='a' || zType[0]=='c' ){
1966 style_submenu_checkbox("unhide", "Unhide", STYLE_CLUTTER, 0);
 
 
 
1967 }
1968 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c')|STYLE_CLUTTER,0);
1969 style_submenu_entry("n","Max:",4,0);
1970 timeline_y_submenu(disableY);
1971 style_submenu_entry("t", "Tag Filter:", -8, STYLE_CLUTTER);
1972 style_submenu_multichoice("ms", count(azMatchStyles)/2, azMatchStyles, STYLE_CLUTTER);
 
 
1973 }
1974 blob_zero(&cond);
1975 }
1976 if( PB("showsql") ){
1977 @ <pre>%h(blob_sql_text(&sql))</pre>
1978 }
1979 if( search_restrict(SRCH_CKIN)!=0 ){
1980 style_submenu_element("Search", "%R/search?y=c");
1981 }
1982 style_submenu_jsbutton("Advanced", STYLE_BASIC, "reclutter()");
1983 style_submenu_jsbutton("Basic", STYLE_CLUTTER, "declutter()");
 
 
 
1984 if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
1985 if( useDividers && zMark && zMark[0] ){
1986 double r = symbolic_name_to_mtime(zMark);
1987 if( r>0.0 ) selectedRid = timeline_add_divider(r);
1988 }
1989
--- src/timeline.c
+++ src/timeline.c
@@ -1318,10 +1318,11 @@
1318 ** mionly Limit rel to show ancestors but not descendants
1319 ** ms=MATCHSTYLE Set tag match style to EXACT, GLOB, LIKE, REGEXP
1320 ** u=USER Only show items associated with USER
1321 ** y=TYPE 'ci', 'w', 't', 'e', or 'all'.
1322 ** ss=VIEWSTYLE c: "Compact" v: "Verbose" m: "Modern" j: "Columnar"
1323 ** advm Use the "Advanced" or "Busy" menu design.
1324 ** ng No Graph.
1325 ** nd Do not highlight the focus check-in
1326 ** v Show details of files changed
1327 ** f=CHECKIN Show family (immediate parents and children) of CHECKIN
1328 ** from=CHECKIN Path from...
@@ -1396,10 +1397,11 @@
1397 const char *z;
1398 char *zOlderButton = 0; /* URL for Older button at the bottom */
1399 char *zNewerButton = 0; /* URL for Newer button at the top */
1400 int selectedRid = -9999999; /* Show a highlight on this RID */
1401 int disableY = 0; /* Disable type selector on submenu */
1402 int advancedMenu = 0; /* Use the advanced menu design */
1403
1404 /* Set number of rows to display */
1405 cookie_read_parameter("n","n");
1406 z = P("n");
1407 if( z==0 ) z = db_get("timeline-default-length",0);
@@ -1418,10 +1420,12 @@
1420 nEntry = 50;
1421 }
1422 cgi_replace_query_parameter("n",z);
1423 cookie_write_parameter("n","n",0);
1424 tmFlags |= timeline_ss_submenu();
1425 cookie_link_parameter("advm","advm","0");
1426 advancedMenu = atoi(PD("advm","0"));
1427
1428 /* To view the timeline, must have permission to read project data.
1429 */
1430 pd_rid = name_to_typed_rid(P("dp"),"ci");
1431 if( pd_rid ){
@@ -1474,11 +1478,13 @@
1478 /* For exact maching, inhibit links to the selected tag. */
1479 zThisTag = zTagName;
1480 }
1481
1482 /* Display a checkbox to enable/disable display of related check-ins. */
1483 if( advancedMenu ){
1484 style_submenu_checkbox("rel", "Related", 0, 0);
1485 }
1486
1487 /* Construct the tag match expression. */
1488 zTagSql = tagMatchExpression(matchStyle, zTagName, &zMatchDesc, &zError);
1489 }
1490
@@ -1562,11 +1568,13 @@
1568 }else{
1569 bisectOnly = 0;
1570 }
1571
1572 style_header("Timeline");
1573 if( advancedMenu ){
1574 style_submenu_element("Help", "%R/help?cmd=/timeline");
1575 }
1576 login_anonymous_available();
1577 timeline_temp_table();
1578 blob_zero(&sql);
1579 blob_zero(&desc);
1580 blob_append(&sql, "INSERT OR IGNORE INTO timeline ", -1);
@@ -1607,11 +1615,13 @@
1615 blob_append(&sql, ")", -1);
1616 path_reset();
1617 addFileGlobExclusion(zChng, &sql);
1618 tmFlags |= TIMELINE_DISJOINT;
1619 db_multi_exec("%s", blob_sql_text(&sql));
1620 if( advancedMenu ){
1621 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1622 }
1623 blob_appendf(&desc, "%d check-ins going from ",
1624 db_int(0, "SELECT count(*) FROM timeline"));
1625 blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h", zFrom), zFrom);
1626 blob_append(&desc, " to ", -1);
1627 blob_appendf(&desc, "%z[%h]</a>", href("%R/info/%h",zTo), zTo);
@@ -1657,12 +1667,14 @@
1667 if( p_rid ){
1668 /* If both p= and d= are set, we don't have the uuid of d yet. */
1669 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", d_rid);
1670 }
1671 }
1672 if( advancedMenu ){
1673 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1674 }
1675 style_submenu_entry("n","Max:",4,0);
1676 timeline_y_submenu(1);
1677 }else if( f_rid && g.perm.Read ){
1678 /* If f= is present, ignore all other parameters other than n= */
1679 char *zUuid;
1680 db_multi_exec(
@@ -1677,12 +1689,14 @@
1689 if( useDividers ) selectedRid = f_rid;
1690 blob_appendf(&desc, "Parents and children of check-in ");
1691 zUuid = db_text("", "SELECT uuid FROM blob WHERE rid=%d", f_rid);
1692 blob_appendf(&desc, "%z[%S]</a>", href("%R/info/%!S", zUuid), zUuid);
1693 tmFlags |= TIMELINE_DISJOINT;
1694 if( advancedMenu ){
1695 style_submenu_checkbox("unhide", "Unhide", 0, 0);
1696 style_submenu_checkbox("v", "Files", (zType[0]!='a' && zType[0]!='c'),0);
1697 }
1698 }else{
1699 /* Otherwise, a timeline based on a span of time */
1700 int n;
1701 const char *zEType = "timeline item";
1702 char *zDate;
@@ -1960,29 +1974,36 @@
1974 ){
1975 zNewerButton = fossil_strdup(url_render(&url, "a", zDate, "b", 0));
1976 }
1977 free(zDate);
1978 }
1979 if( advancedMenu ){
1980 if( zType[0]=='a' || zType[0]=='c' ){
1981 style_submenu_checkbox("unhide", "Unhide", 0, 0);
1982 }
1983 style_submenu_checkbox("v", "Files",(zType[0]!='a' && zType[0]!='c'),0);
1984 }
 
1985 style_submenu_entry("n","Max:",4,0);
1986 timeline_y_submenu(disableY);
1987 if( advancedMenu ){
1988 style_submenu_entry("t", "Tag Filter:", -8, 0);
1989 style_submenu_multichoice("ms", count(azMatchStyles)/2,azMatchStyles,0);
1990 }
1991 }
1992 blob_zero(&cond);
1993 }
1994 if( PB("showsql") ){
1995 @ <pre>%h(blob_sql_text(&sql))</pre>
1996 }
1997 if( search_restrict(SRCH_CKIN)!=0 ){
1998 style_submenu_element("Search", "%R/search?y=c");
1999 }
2000 if( advancedMenu ){
2001 style_submenu_element("Basic", url_render(&url, "advm", "0", 0, 0));
2002 }else{
2003 style_submenu_element("Advanced", url_render(&url, "advm", "1", 0, 0));
2004 }
2005 if( PB("showid") ) tmFlags |= TIMELINE_SHOWRID;
2006 if( useDividers && zMark && zMark[0] ){
2007 double r = symbolic_name_to_mtime(zMark);
2008 if( r>0.0 ) selectedRid = timeline_add_divider(r);
2009 }
2010

Keyboard Shortcuts

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