Fossil

download.js
Login
/***** Edit the following with each new release *******/
var releases = [
  {"re":        /-2\.28\.(tar\.gz|zip)$/,
   "title":     "Version 2.28 (2026-03-11)",
   "titleurl":  "../doc/trunk/www/changes.wiki#v2_28",
   "history":   "../timeline?p=version-2.28&d=version-2.27",
   "future":    "../timeline?df=version-2.28",
   "tarball":   "52445a27f116603d784ad753c6acd494e0b02aeaf8502ee0fee0aa30030f4c4e/fossil-src-2.28.tar.gz",
   "tarballsz": 7329012},
  {"re":        /-202601281612\.(tar\.gz|zip)$/,
   "title":     "Snapshot as of 2026-01-28 16:12Z",
   "titleurl":  "../doc/trunk/www/changes.wiki",
   "history":   "../timeline?p=2026-01-28T16:12z&d=version-2.27",
   "future":    "../timeline?df=2026-01-28T16:12z",
   "tarball":   "74d5ce39ea9f6850e7cfe4fb48f8c68b33bef3bd40208f83112561dd25f1f278/fossil-src-202601281614.tar.gz",
   "tarballsz": 7320259},
  {"re":        /-2\.27\.(tar\.gz|zip)$/,
   "title":     "Version 2.27 (2025-09-30)",
   "titleurl":  "../doc/trunk/www/changes.wiki#v2_27",
   "history":   "../timeline?p=version-2.27&d=version-2.26",
   "future":    "../timeline?df=version-2.27",
   "tarball":   "99675884a93c09125dbfbef0ca47959626c81545c132e247e67a08bd12ac7256/fossil-src-2.27.tar.gz",
   "tarballsz": 7181357}]
/******* Should not need to change anything else ******/
function escHTML(x){
  return x.replace(/&/g,"&amp").replace(/</g,"&lt").replace(/>/g,"&gt");
}
var r1 = new XMLHttpRequest();
r1.onreadystatechange = function(){
  if(r1.readyState!=4) return
  var jx = JSON.parse(r1.responseText);
  /* The jx returned will look like this:
  ** [{"name":NAME, "mtime":MTIME, "hash":HASH, "size":SIZE, "user":USER}]
  **
  ** The sequence[] array describes the columns in the download matrix
  */
  var sequence = [
    {"name":  "linux",
     "re":    /-linux-/,
     "icon":  "build-icons/linux.gif",
     "title": "Linux x64"  },
    {"name":  "macarm",
     "re":    /-mac-arm6?4?-/,
     "icon":  "build-icons/mac.gif",
     "title": "Mac ARM"  },
    {"name":  "macx64",
     "re":    /-mac(-x64|osx)-/,
     "icon":  "build-icons/mac.gif",
     "title": "Mac x64"  },
    {"name":  "pi",
     "re":    /-pi-/,
     "icon":  "build-icons/pi.gif",
     "title": "Rasp<wbr>berry<wbr>Pi" },
    {"name":  "src",
     "icon":  "build-icons/src.gif",
     "title": "Source Tar<wbr>ball"  },
    {"name":  "win32",
     "re":    /-w32-/,
     "icon":  "build-icons/win32.gif",
     "title": "Win<wbr>dows<wbr>32"  },
    {"name":  "win64",
     "re":    /-w64-/,
     "icon":  "build-icons/win32.gif",
     "title": "Win<wbr>dows<wbr>64"  },
    {"name":  "winarm",
     "re":    /-win-arm-/,
     "icon":  "build-icons/win32.gif",
     "title": "Win<wbr>dows<wbr>ARM"}]

  /* Accumulate HTML for the download matrix in h */
  var h = "<table cellpadding='10'>\n"

  /* Find the hash of each icon, if possible */
  var hash = new Array;
  for(var i=0; i<sequence.length; i++){
    hash[sequence[i].icon] = "";
  }
  for(var i=0; i<jx.length; i++){
    if( hash[jx[i].name]=="" ){
      hash[jx[i].name] = jx[i].hash;
    }
  }

  var top = 1;
  for(var i=0; i<releases.length; i++){
    var cnt = 0;
    var products = {"dummy":0};
    for(var j=0; j<jx.length; j++){
      var nm = jx[j].name;
      if( !releases[i].re.test(nm) ) continue;
      for(k=0; k<sequence.length; k++){
        if( sequence[k].name!="src" && sequence[k].re.test(nm) ){
          products[sequence[k].name] = jx[j];
          cnt++
          break
        }
      }
    }
    if( cnt==0 ) continue
    h += "<tr></tr>"   /* To defeat even/odd row coloring */
    h += "<tr><td colspan=8 align='left'>\n"
    if( top ){
      top = 0;
    }else{
      h += "<hr>\n";
    }
    h += "<center><b>"
    if( releases[i].titleurl ){
      h += "<a href='" + releases[i].titleurl + "'>" + releases[i].title +
           "</a>\n"
    }else{
      h += releases[i].title
    }
    if( releases[i].history ){
      h += "(<a href='" + releases[i].history + "'>history graph</a>)\n"
    }
    if( releases[i].future ){
      h += "(<a href='" + releases[i].future + "'>subsequent changes</a>)\n"
    }
    h += "</b></center></td></tr>\n<tr></tr><tr>"
    for(k=0; k<sequence.length; k++){
      var nm = sequence[k].name
      h += "<td align='center' valign='bottom'>\n"
      var sz = 0;
      if( nm=="src" ){
        h += "<a href='../tarball/"+releases[i].tarball+"'>\n"
        sz = releases[i].tarballsz
      }else if( products[nm] ){
        h += "<a href='" + encodeURI(products[nm].name) + "'>\n"
        sz = products[nm].size
      }
      if( sz>0 ){
        var icon = sequence[k].icon
        if( hash[icon]!="" ){
          icon = "./"+hash[icon];
        }
        h += "<img src='" + icon + "'><br>\n"
        h += sequence[k].title + "</a><br>\n"
        sz /= 1000000.0;
        h += sz.toFixed(2) + " MB\n"
      }
      h += "</td>\n"
    }
    h += "</tr>\n"
  }
  h += "</table>"
  document.getElementById("download_filelist").innerHTML = h;
}
r1.open("GET","../juvlist",true);
r1.send()