Fossil

Check-in [7aa10e3c72]
Login

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

Overview
Comment:Add arrows to cue active sorting on /brlist web page
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | brlist-visual-enhancement
Files: files | file ages | folders
SHA1: 7aa10e3c72c738ee84c5b9418ba60a25d79a729e
User & Date: baruch 2015-01-05 15:25:17.580
Context
2015-01-05
15:25
Add arrows to cue active sorting on /brlist web page ... (Closed-Leaf check-in: 7aa10e3c72 user: baruch tags: brlist-visual-enhancement)
01:57
Change the cursor to "pointer" for sortable columns of a table. ... (check-in: 54d53deb16 user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/report.c.
955
956
957
958
959
960
961








962
963
964
965
966

967

968
969
970
971
972
973
974
  @       case "x":  return;
  @     }
  @     this.sortIndex = column;
  @     var newRows = new Array();
  @     for (j = 0; j < this.tbody[0].rows.length; j++) {
  @        newRows[j] = this.tbody[0].rows[j];
  @     }








  @     if( this.sortIndex==this.prevColumn ){
  @       newRows.reverse();
  @     }else{
  @       newRows.sort(sortFn);
  @       this.prevColumn = this.sortIndex;

  @     }

  @     for (i=0;i<newRows.length;i++) {
  @       this.tbody[0].appendChild(newRows[i]);
  @     }
  @   }
  @   this.sortText = function(a,b) {
  @     var i = thisObject.sortIndex;
  @     aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();







>
>
>
>
>
>
>
>





>

>







955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
  @       case "x":  return;
  @     }
  @     this.sortIndex = column;
  @     var newRows = new Array();
  @     for (j = 0; j < this.tbody[0].rows.length; j++) {
  @        newRows[j] = this.tbody[0].rows[j];
  @     }
  @     var arrow = "\u25B4";
  @     var arrowdiv = this.sortRow.getElementsByClassName("sortarrow");
  @     while(arrowdiv[0]) {
  @       if( arrowdiv[0].innerHTML=="\u25B4" ){
  @         arrow = "\u25BE"
  @       }
  @       arrowdiv[0].parentNode.removeChild(arrowdiv[0]);
  @     }
  @     if( this.sortIndex==this.prevColumn ){
  @       newRows.reverse();
  @     }else{
  @       newRows.sort(sortFn);
  @       this.prevColumn = this.sortIndex;
  @       arrow = "\u25B4"
  @     }
  @     cell.innerHTML += "<div class='sortarrow' style='float:right'>" + arrow + "</div>";
  @     for (i=0;i<newRows.length;i++) {
  @       this.tbody[0].appendChild(newRows[i]);
  @     }
  @   }
  @   this.sortText = function(a,b) {
  @     var i = thisObject.sortIndex;
  @     aa = a.cells[i].textContent.replace(/^\W+/,'').toLowerCase();
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
  @   var thisObject = this;
  @   var prevColumn = -1;
  @   var x = tableEl.getElementsByTagName('thead');
  @   if(!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length>0)){
  @     return;
  @   }
  @   if(x && x[0].rows && x[0].rows.length > 0) {
  @     var sortRow = x[0].rows[0];
  @   } else {
  @     return;
  @   }
  @   for (var i=0; i<sortRow.cells.length; i++) {
  @     if( columnTypes[i]=='x' ) continue;
  @     sortRow.cells[i].sTable = this;
  @     sortRow.cells[i].style.cursor = "pointer";
  @     sortRow.cells[i].sortType = columnTypes[i] || 't';
  @     sortRow.cells[i].onclick = function () {
  @       this.sTable.sort(this);
  @       return false;
  @     }
  @   }
  @ }
  @ var t = new SortableTable(gebi("%s(zTableId)"),"%s(zColumnTypes)");
  @ </script>







|



|

|
|
|
|







1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
  @   var thisObject = this;
  @   var prevColumn = -1;
  @   var x = tableEl.getElementsByTagName('thead');
  @   if(!(this.tbody && this.tbody[0].rows && this.tbody[0].rows.length>0)){
  @     return;
  @   }
  @   if(x && x[0].rows && x[0].rows.length > 0) {
  @     this.sortRow = x[0].rows[0];
  @   } else {
  @     return;
  @   }
  @   for (var i=0; i<this.sortRow.cells.length; i++) {
  @     if( columnTypes[i]=='x' ) continue;
  @     this.sortRow.cells[i].sTable = this;
  @     this.sortRow.cells[i].style.cursor = "pointer";
  @     this.sortRow.cells[i].sortType = columnTypes[i] || 't';
  @     this.sortRow.cells[i].onclick = function () {
  @       this.sTable.sort(this);
  @       return false;
  @     }
  @   }
  @ }
  @ var t = new SortableTable(gebi("%s(zTableId)"),"%s(zColumnTypes)");
  @ </script>