Fossil

Check-in [c6a061f2a0]
Login

Check-in [c6a061f2a0]

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

Overview
Comment:Display "View 1 branch" hyperlink if just one branch is selected. Add documentation to the <tt>www/javascript.md</tt> and to the changelog. Also minor CSS tweaks.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | brlist-timeline
Files: files | file ages | folders
SHA3-256: c6a061f2a0744230b70df6841cdaf94964280ca0dd3179816b8934010a0b31f0
User & Date: george 2021-04-19 16:08:31.379
Context
2021-04-19
16:45
Do not use bold font for the "View X branch(es)" hyperlink. ... (check-in: 08b90535e8 user: george tags: brlist-timeline)
16:08
Display "View 1 branch" hyperlink if just one branch is selected. Add documentation to the <tt>www/javascript.md</tt> and to the changelog. Also minor CSS tweaks. ... (check-in: c6a061f2a0 user: george tags: brlist-timeline)
01:01
Rename 'Timeline' submenu link into 'View X branches' that is shown only if two or more branches are selected. Also some minor code refactoring for better compatability with old versions of WebView. ... (check-in: 00891cba00 user: george tags: brlist-timeline)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/default.css.
1774
1775
1776
1777
1778
1779
1780



1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
input[type="checkbox"].diff-toggle {
  float: right;
}

body.branch .brlist > table > tbody > tr:hover > td:first-child,
body.branch .brlist > table > tbody > tr.selected {
  font-weight: bold;



}
body.branch .brlist > table > tbody > tr > td:nth-child(1) {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
body.branch a.label.timeline-link {
  display: none;
}
body.branch a.label.timeline-link.selected {
  display: inline;
  font-weight: bold;
}

/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
  .desktoponly {
    display: none;
  }







>
>
>






|


|

|







1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
input[type="checkbox"].diff-toggle {
  float: right;
}

body.branch .brlist > table > tbody > tr:hover > td:first-child,
body.branch .brlist > table > tbody > tr.selected {
  font-weight: bold;
}
body.branch .brlist > table > tbody td:first-child > input {
  cursor: pointer;
}
body.branch .brlist > table > tbody > tr > td:nth-child(1) {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
body.branch .submenu > a.label.timeline-link {
  display: none;
}
body.branch .submenu > a.label.timeline-link.selected {
  display: inline;
  font-weight: bold;  /* <-- usefulness is questionable */
}

/* Objects in the "desktoponly" class are invisible on mobile */
@media screen and (max-width: 600px) {
  .desktoponly {
    display: none;
  }
Changes to src/fossil.page.brlist.js.
29
30
31
32
33
34
35
36
37
38
39
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
  }
  else {
    tr.classList.remove('selected');
    for( var i = selected.length; --i >= 0 ;)
      if( selected[i] == tag )
        selected.splice(i,1);
  }
  if( selected.length >= 2 )
    anchor.classList.add('selected');
  else
    anchor.classList.remove('selected');

  anchor.href = prefix + selected.join("|");
  anchor.innerHTML = "View " + selected.length + " branches";

  // console.log("Link:",anchor.href);
}

var stags = []; /* initially selected tags, not used above */
document.querySelectorAll("div.brlist > table td:first-child > input")
  .forEach( function( cbx ){
    cbx.onchange = onChange;
    cbx.disabled = false;
    if( cbx.checked ){
      stags.push(cbx.parentElement.children[0].innerText);
      cbx.parentElement.parentElement.classList.add('selected');
    }
  });

if( stags.length != 0 ){
  anchor.href =  prefix + stags.join("|");
  if( stags.length >= 2 ) {
    anchor.innerHTML = "View " + stags.length + " branches";

    anchor.classList.add('selected');
  }
}

}); // window.addEventListener( 'load' ...







|





|
>
















|
|
>





29
30
31
32
33
34
35
36
37
38
39
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
67
  }
  else {
    tr.classList.remove('selected');
    for( var i = selected.length; --i >= 0 ;)
      if( selected[i] == tag )
        selected.splice(i,1);
  }
  if( selected.length >= 1 )
    anchor.classList.add('selected');
  else
    anchor.classList.remove('selected');

  anchor.href = prefix + selected.join("|");
  anchor.innerHTML = "View " + selected.length +
                     ( selected.length > 1 ? " branches" : " branch" );
  // console.log("Link:",anchor.href);
}

var stags = []; /* initially selected tags, not used above */
document.querySelectorAll("div.brlist > table td:first-child > input")
  .forEach( function( cbx ){
    cbx.onchange = onChange;
    cbx.disabled = false;
    if( cbx.checked ){
      stags.push(cbx.parentElement.children[0].innerText);
      cbx.parentElement.parentElement.classList.add('selected');
    }
  });

if( stags.length != 0 ){
  anchor.href =  prefix + stags.join("|");
  if( stags.length >= 1 ) {
    anchor.innerHTML = "View " + stags.length +
                       ( stags.length > 1 ? " branches" : " branch" );
    anchor.classList.add('selected');
  }
}

}); // window.addEventListener( 'load' ...
Changes to www/changes.wiki.
1
2








3
4
5
6
7
8
9
<title>Change Log</title>









<a name='v2_15'></a>
<h2>Changes for Version 2.15 (2021-03-26) and Patch 2.15.1 on (2021-04-07)</h2>
  *  <b>Patch 2.15.1:</b> Fix a data exfiltration bug in the server.  <b>Upgrading to
     the patch is recommended.</b><p>
  *  The [./defcsp.md|default CSP] has been relaxed slightly to allow
     images to be loaded from any URL.  All other resources are still
     locked down by default.


>
>
>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<title>Change Log</title>

<a name='v2_16'></a>
<h2>Changes for Version 2.16 (pending)</h2>
  *  [/brlist|List of branches] gained
     [/timeline?r=brlist-timeline|the facility] to select several
     branches and [./javascript.md#brlist|point a user] to the
     <tt>/timeline</tt> view that shows just these selected branches
     and the related check-ins.

<a name='v2_15'></a>
<h2>Changes for Version 2.15 (2021-03-26) and Patch 2.15.1 on (2021-04-07)</h2>
  *  <b>Patch 2.15.1:</b> Fix a data exfiltration bug in the server.  <b>Upgrading to
     the patch is recommended.</b><p>
  *  The [./defcsp.md|default CSP] has been relaxed slightly to allow
     images to be loaded from any URL.  All other resources are still
     locked down by default.
Changes to www/javascript.md.
568
569
570
571
572
573
574













575
576
577
578
579
580
581

       SELECT xfrom, xmsg FROM chat WHERE msgid > 1234;

…would pull the messages submitted since the last poll. Making the
gateway bidirectional should be possible as well, as long as it properly
uses SQLite transactions.














----

## <a id="future"></a>Future Plans for JavaScript in Fossil

As of mid-2020, the informal provisional plan is to increase Fossil
UI's use of JavaScript considerably compared to its historically minimal
uses. To that end, a framework of Fossil-centric APIs is being developed







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







568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594

       SELECT xfrom, xmsg FROM chat WHERE msgid > 1234;

…would pull the messages submitted since the last poll. Making the
gateway bidirectional should be possible as well, as long as it properly
uses SQLite transactions.

### <a id="brlist"></a>List of branches

Since Fossil 2.16 [`/brlist`](/brlist) page uses JavaScript to enable
selection of several branches for further study via `/timeline`.
Client-side script interactively responds to checkboxes' events
and constructs a special hyperlink in the submenu.
Clicking this hyperlink loads a `/timeline` page that shows
only these selected branches (and the related check-ins).

_Potential Workaround:_ A user can manually construct an appropriate
regular expession and put it into the "Tag Filter" entry of the
`/timeline` page (in its advanced mode).

----

## <a id="future"></a>Future Plans for JavaScript in Fossil

As of mid-2020, the informal provisional plan is to increase Fossil
UI's use of JavaScript considerably compared to its historically minimal
uses. To that end, a framework of Fossil-centric APIs is being developed