Fossil SCM

Put an "Older" button at the bottom of /timeline pages that can be extended downward. That button is already at the top of the page, but it is convenient not to have to scroll back to the top to press it.

drh 2015-02-05 19:19 UTC form-submenu
Commit 9e2e48a4c395d6e98065220134fb7ed3a49191e4
2 files changed +5 +3
--- src/timeline.c
+++ src/timeline.c
@@ -1122,10 +1122,11 @@
11221122
int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
11231123
int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
11241124
int pd_rid;
11251125
double rBefore, rAfter, rCirca; /* Boundary times */
11261126
const char *z;
1127
+ char *zOlderButton = 0; /* URL for Older button at the bottom */
11271128
11281129
/* Set number of rows to display */
11291130
z = P("n");
11301131
if( z ){
11311132
nEntry = atoi(z);
@@ -1545,10 +1546,11 @@
15451546
}
15461547
if( g.perm.Hyperlink ){
15471548
if( zAfter || n==nEntry ){
15481549
zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
15491550
timeline_submenu(&url, "Older", "b", zDate, "a");
1551
+ zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0));
15501552
free(zDate);
15511553
}
15521554
if( zBefore || (zAfter && n==nEntry) ){
15531555
zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
15541556
timeline_submenu(&url, "Newer", "a", zDate, "b");
@@ -1575,10 +1577,13 @@
15751577
db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
15761578
@ <h2>%b(&desc)</h2>
15771579
blob_reset(&desc);
15781580
www_print_timeline(&q, tmFlags, zThisUser, zThisTag, 0);
15791581
db_finalize(&q);
1582
+ if( zOlderButton ){
1583
+ @ %z(xhref("class='button'","%z",zOlderButton))Older</a>
1584
+ }
15801585
style_footer();
15811586
}
15821587
15831588
/*
15841589
** The input query q selects various records. Print a human-readable
15851590
--- src/timeline.c
+++ src/timeline.c
@@ -1122,10 +1122,11 @@
1122 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1123 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1124 int pd_rid;
1125 double rBefore, rAfter, rCirca; /* Boundary times */
1126 const char *z;
 
1127
1128 /* Set number of rows to display */
1129 z = P("n");
1130 if( z ){
1131 nEntry = atoi(z);
@@ -1545,10 +1546,11 @@
1545 }
1546 if( g.perm.Hyperlink ){
1547 if( zAfter || n==nEntry ){
1548 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1549 timeline_submenu(&url, "Older", "b", zDate, "a");
 
1550 free(zDate);
1551 }
1552 if( zBefore || (zAfter && n==nEntry) ){
1553 zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
1554 timeline_submenu(&url, "Newer", "a", zDate, "b");
@@ -1575,10 +1577,13 @@
1575 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
1576 @ <h2>%b(&desc)</h2>
1577 blob_reset(&desc);
1578 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, 0);
1579 db_finalize(&q);
 
 
 
1580 style_footer();
1581 }
1582
1583 /*
1584 ** The input query q selects various records. Print a human-readable
1585
--- src/timeline.c
+++ src/timeline.c
@@ -1122,10 +1122,11 @@
1122 int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */
1123 int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */
1124 int pd_rid;
1125 double rBefore, rAfter, rCirca; /* Boundary times */
1126 const char *z;
1127 char *zOlderButton = 0; /* URL for Older button at the bottom */
1128
1129 /* Set number of rows to display */
1130 z = P("n");
1131 if( z ){
1132 nEntry = atoi(z);
@@ -1545,10 +1546,11 @@
1546 }
1547 if( g.perm.Hyperlink ){
1548 if( zAfter || n==nEntry ){
1549 zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/");
1550 timeline_submenu(&url, "Older", "b", zDate, "a");
1551 zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0));
1552 free(zDate);
1553 }
1554 if( zBefore || (zAfter && n==nEntry) ){
1555 zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/");
1556 timeline_submenu(&url, "Newer", "a", zDate, "b");
@@ -1575,10 +1577,13 @@
1577 db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/");
1578 @ <h2>%b(&desc)</h2>
1579 blob_reset(&desc);
1580 www_print_timeline(&q, tmFlags, zThisUser, zThisTag, 0);
1581 db_finalize(&q);
1582 if( zOlderButton ){
1583 @ %z(xhref("class='button'","%z",zOlderButton))Older</a>
1584 }
1585 style_footer();
1586 }
1587
1588 /*
1589 ** The input query q selects various records. Print a human-readable
1590
+3
--- src/url.c
+++ src/url.c
@@ -469,10 +469,13 @@
469469
p->nParam++;
470470
}
471471
472472
/*
473473
** Render the URL with a parameter override.
474
+**
475
+** Returned memory is transient and is overwritten on the next call to this
476
+** routine for the same HQuery, or until the HQuery object is destroyed.
474477
*/
475478
char *url_render(
476479
HQuery *p, /* Base URL */
477480
const char *zName1, /* First override */
478481
const char *zValue1, /* First override value */
479482
--- src/url.c
+++ src/url.c
@@ -469,10 +469,13 @@
469 p->nParam++;
470 }
471
472 /*
473 ** Render the URL with a parameter override.
 
 
 
474 */
475 char *url_render(
476 HQuery *p, /* Base URL */
477 const char *zName1, /* First override */
478 const char *zValue1, /* First override value */
479
--- src/url.c
+++ src/url.c
@@ -469,10 +469,13 @@
469 p->nParam++;
470 }
471
472 /*
473 ** Render the URL with a parameter override.
474 **
475 ** Returned memory is transient and is overwritten on the next call to this
476 ** routine for the same HQuery, or until the HQuery object is destroyed.
477 */
478 char *url_render(
479 HQuery *p, /* Base URL */
480 const char *zName1, /* First override */
481 const char *zValue1, /* First override value */
482

Keyboard Shortcuts

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