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.
Commit
9e2e48a4c395d6e98065220134fb7ed3a49191e4
Parent
cf8fa8dd285248f…
2 files changed
+5
+3
+5
| --- src/timeline.c | ||
| +++ src/timeline.c | ||
| @@ -1122,10 +1122,11 @@ | ||
| 1122 | 1122 | int me_rid = name_to_typed_rid(P("me"),"ci"); /* me= for common ancestory */ |
| 1123 | 1123 | int you_rid = name_to_typed_rid(P("you"),"ci");/* you= for common ancst */ |
| 1124 | 1124 | int pd_rid; |
| 1125 | 1125 | double rBefore, rAfter, rCirca; /* Boundary times */ |
| 1126 | 1126 | const char *z; |
| 1127 | + char *zOlderButton = 0; /* URL for Older button at the bottom */ | |
| 1127 | 1128 | |
| 1128 | 1129 | /* Set number of rows to display */ |
| 1129 | 1130 | z = P("n"); |
| 1130 | 1131 | if( z ){ |
| 1131 | 1132 | nEntry = atoi(z); |
| @@ -1545,10 +1546,11 @@ | ||
| 1545 | 1546 | } |
| 1546 | 1547 | if( g.perm.Hyperlink ){ |
| 1547 | 1548 | if( zAfter || n==nEntry ){ |
| 1548 | 1549 | zDate = db_text(0, "SELECT min(timestamp) FROM timeline /*scan*/"); |
| 1549 | 1550 | timeline_submenu(&url, "Older", "b", zDate, "a"); |
| 1551 | + zOlderButton = fossil_strdup(url_render(&url, "b", zDate, "a", 0)); | |
| 1550 | 1552 | free(zDate); |
| 1551 | 1553 | } |
| 1552 | 1554 | if( zBefore || (zAfter && n==nEntry) ){ |
| 1553 | 1555 | zDate = db_text(0, "SELECT max(timestamp) FROM timeline /*scan*/"); |
| 1554 | 1556 | timeline_submenu(&url, "Newer", "a", zDate, "b"); |
| @@ -1575,10 +1577,13 @@ | ||
| 1575 | 1577 | db_prepare(&q, "SELECT * FROM timeline ORDER BY sortby DESC /*scan*/"); |
| 1576 | 1578 | @ <h2>%b(&desc)</h2> |
| 1577 | 1579 | blob_reset(&desc); |
| 1578 | 1580 | www_print_timeline(&q, tmFlags, zThisUser, zThisTag, 0); |
| 1579 | 1581 | db_finalize(&q); |
| 1582 | + if( zOlderButton ){ | |
| 1583 | + @ %z(xhref("class='button'","%z",zOlderButton))Older</a> | |
| 1584 | + } | |
| 1580 | 1585 | style_footer(); |
| 1581 | 1586 | } |
| 1582 | 1587 | |
| 1583 | 1588 | /* |
| 1584 | 1589 | ** The input query q selects various records. Print a human-readable |
| 1585 | 1590 |
| --- 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 @@ | ||
| 469 | 469 | p->nParam++; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | /* |
| 473 | 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. | |
| 474 | 477 | */ |
| 475 | 478 | char *url_render( |
| 476 | 479 | HQuery *p, /* Base URL */ |
| 477 | 480 | const char *zName1, /* First override */ |
| 478 | 481 | const char *zValue1, /* First override value */ |
| 479 | 482 |
| --- 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 |