Skip to content

Instantly share code, notes, and snippets.

@hogmoru
Last active July 24, 2016 14:04
Show Gist options
  • Save hogmoru/1193186acccc3b3831221334fcc58a9b to your computer and use it in GitHub Desktop.
Save hogmoru/1193186acccc3b3831221334fcc58a9b to your computer and use it in GitHub Desktop.
Experiment B for Syncthing donwload page
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<style>
body {
margin: 40px;
}
img {
max-width: 100%;
}
a.dl-suggestion {
font-weight: bold; color: #29b74e;
}
a.st-thumbnail {
cursor: pointer;
}
</style>
<title>Downloads</title>
</head>
<body>
<div class="container">
<img src="https://syncthing.net/images/logo-horizontal.svg" height="128" />
<h1>Downloads <span class="text-danger">PRE-ALPHA-UNSTABLE-OMGBBQ</span></h1>
<div class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Syncthing<a class="pull-right" href="https://github.com/syncthing/syncthing" target="_new"><small class="bg-primary">syncthing/syncthing</small></a></h3>
</div>
<div class="panel-body" id="st-syncthing-download">
<p>Main application: command-line tool with built-in web user interface</p>
<div class="btn-group st-version-chooser">
<button type="button" class="btn btn-default">
<span class="text-muted">version: </span><span class="st-version-holder">&hellip;</span>
</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-version-list" aria-labelledby="syncthing versions chooser">
</ul>
</div>
<div class="btn-group st-platform-chooser">
<a role="button" class="btn btn-success st-download-button" disabled="disabled">
<span class="st-dl-text">Choose platform</span>
<span class="glyphicon glyphicon-arrow-right st-dl-icon" aria-hidden="true"></span>
</a>
<button type="button" class="btn btn-success dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-platform-list" aria-labelledby="syncthing platform chooser">
</ul>
</div>
<div class="alert alert-warning st-non-latest-version" role="alert" style="display: none; margin-top: 10px; margin-bottom: 10px;">
<strong>Warning:</strong> this is not the latest version. Only download a version other than latest if you know what you are doing.
</div>
<div class="alert alert-info st-linux-packages" role="alert" style="display: none; margin-top: 10px; margin-bottom: 10px;">
<p>
<strong>Heads up!</strong> There are also <a href="http://apt.syncthing.net/">Debian / Ubuntu packages</a> available.
</p>
<p>
Make sure to check out the <a href="http://docs.syncthing.net/intro/getting-started.html">Getting Started Guide</a>
if you need help. Releases are signed as described on the <a href="https://www.syncthing.net/security.html">security</a> page.
</p>
</div>
<div class="alert alert-info st-windows-gui" role="alert" style="display: none; margin-top: 10px; margin-bottom: 10px;">
<strong>Heads up!</strong> Windows users might also want to try SyncTrayzor, check it out in third-party contributions below.
</div>
</div>
</div>
<h2>Third-party contributions</h2>
<ul>
<li>
<p><a href="https://github.com/canton7/SyncTrayzor">SyncTrayzor</a>: a Windows GUI wrapper. Sits in your system tray and offers easy access to the built-in web UI.</p>
<p>
<a id="st-synctrayzor-screenshot" class="st-thumbnail">
<img width=100 src="https://raw.githubusercontent.com/canton7/SyncTrayzor/master/readme/screenshot.png" alt="SyncTrayzor screenshot">
</a>
</p>
</li>
<li>
<p><a href="https://github.com/syncthing/syncthing-gtk">Syncthing-GTK</a>: a cross-platform GUI wrapper.</p>
<p>
<a id="st-gtkui-screenshot" class="st-thumbnail">
<img width=100 src="http://i.imgur.com/eX250tQ.png" alt="Syncthing GTK screenshot">
</a>
</p>
</li>
<li><a href="https://github.com/syncthing/syncthing-inotify/releases/latest">filesystem watcher</a>: instantly trigger sync upon file changes.</li>
<li>
<a href="https://github.com/syncthing/syncthing-android">Android app</a>
<p>
<a href="https://play.google.com/store/apps/details?id=com.nutomic.syncthingandroid">
<img style="height:80px;" alt="Get it on Google Play" src="https://www.syncthing.net/images/google-play-badge.png">
</a>
<a href="https://f-droid.org/repository/browse/?fdid=com.nutomic.syncthingandroid">
<img style="height:80px;" alt="Get it on F-Droid" src="https://www.syncthing.net/images/fdroid-badge.png">
</a>
</p>
</li>
<li><a href="http://docs.syncthing.net/users/contrib.html">other</a> community contributions.</li>
</ul>
<h2>Auxiliary downloads</h2>
<h4>For advanced users &amp; contributors</h4>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Discovery Server<a class="pull-right" href="https://github.com/syncthing/discosrv" target="_new"><small class="bg-info">syncthing/discosrv</small></a></h3>
</div>
<div class="panel-body" id="st-discosrv-download">
<p>The Syncthing global discovery server</p>
<div class="btn-group st-version-chooser">
<button type="button" class="btn btn-default">
<span class="text-muted">version: </span><span class="st-version-holder">&hellip;</span>
</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-version-list" aria-labelledby="syncthing versions chooser">
</ul>
</div>
<div class="btn-group st-platform-chooser">
<a role="button" class="btn btn-info st-download-button" disabled="disabled">
<span class="st-dl-text">Choose platform</span>
<span class="glyphicon glyphicon-arrow-right st-dl-icon" aria-hidden="true"></span>
</a>
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-platform-list" aria-labelledby="syncthing platform chooser">
</ul>
</div>
<div class="alert alert-warning st-non-latest-version" role="alert" style="display: none; margin-top: 10px; margin-bottom: 10px;">
<strong>Warning:</strong> this is not the latest version. Only download a version other than latest if you know what you are doing.
</div>
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Relay Server<a class="pull-right" href="https://github.com/syncthing/relaysrv" target="_new"><small class="bg-info">syncthing/relaysrv</small></a></h3>
</div>
<div class="panel-body" id="st-relaysrv-download">
<p>The Syncthing relay server</p>
<div class="btn-group st-version-chooser">
<button type="button" class="btn btn-default">
<span class="text-muted">version: </span><span class="st-version-holder">&hellip;</span>
</button>
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-version-list" aria-labelledby="syncthing versions chooser">
</ul>
</div>
<div class="btn-group st-platform-chooser">
<a role="button" class="btn btn-info st-download-button" disabled="disabled">
<span class="st-dl-text">Choose platform</span>
<span class="glyphicon glyphicon-arrow-right st-dl-icon" aria-hidden="true"></span>
</a>
<button type="button" class="btn btn-info dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Toggle Dropdown</span>
</button>
<ul class="dropdown-menu st-platform-list" aria-labelledby="syncthing platform chooser">
</ul>
</div>
<div class="alert alert-warning st-non-latest-version" role="alert" style="display: none; margin-top: 10px; margin-bottom: 10px;">
<strong>Warning:</strong> this is not the latest version. Only download a version other than latest if you know what you are doing.
</div>
</div>
</div>
</div>
<div id="st-screenshot-modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 id="st-screenshot-modal-title" class="modal-title">Screenshot</h4>
</div>
<div class="modal-body">
<img id="st-screenshot-modal-img" src="x.png">
</div>
</div>
</div>
</div>
<script>
var versionsData = {
"syncthing": {
"0.14.0": [
"syncthing-dragonfly-amd64-v0.14.0.tar.gz",
"syncthing-freebsd-386-v0.14.0.tar.gz",
"syncthing-freebsd-amd64-v0.14.0.tar.gz",
"syncthing-linux-386-v0.14.0.tar.gz",
"syncthing-linux-amd64-v0.14.0.tar.gz",
"syncthing-linux-arm-v0.14.0.tar.gz",
"syncthing-linux-arm64-v0.14.0.tar.gz",
"syncthing-linux-ppc64-v0.14.0.tar.gz",
"syncthing-linux-ppc64le-v0.14.0.tar.gz",
"syncthing-macosx-386-v0.14.0.tar.gz",
"syncthing-macosx-amd64-v0.14.0.tar.gz",
"syncthing-netbsd-386-v0.14.0.tar.gz",
"syncthing-netbsd-amd64-v0.14.0.tar.gz",
"syncthing-openbsd-386-v0.14.0.tar.gz",
"syncthing-openbsd-amd64-v0.14.0.tar.gz",
"syncthing-solaris-amd64-v0.14.0.tar.gz",
"syncthing-windows-386-v0.14.0.zip",
"syncthing-windows-amd64-v0.14.0.zip"
],
"0.14.0-rc.1": [
"syncthing-dragonfly-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-freebsd-386-v0.14.0-rc.1.tar.gz",
"syncthing-freebsd-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-linux-386-v0.14.0-rc.1.tar.gz",
"syncthing-linux-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-linux-arm-v0.14.0-rc.1.tar.gz",
"syncthing-linux-arm64-v0.14.0-rc.1.tar.gz",
"syncthing-linux-ppc64-v0.14.0-rc.1.tar.gz",
"syncthing-linux-ppc64le-v0.14.0-rc.1.tar.gz",
"syncthing-macosx-386-v0.14.0-rc.1.tar.gz",
"syncthing-macosx-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-netbsd-386-v0.14.0-rc.1.tar.gz",
"syncthing-netbsd-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-openbsd-386-v0.14.0-rc.1.tar.gz",
"syncthing-openbsd-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-solaris-amd64-v0.14.0-rc.1.tar.gz",
"syncthing-windows-386-v0.14.0-rc.1.zip",
"syncthing-windows-amd64-v0.14.0-rc.1.zip",
"syncthing-source-v0.14.0-rc.1.tar.gz",
"syncthing-source-v0.14.0-rc.1.tar.gz.asc"
],
"0.14.0-beta.1": [
"syncthing-dragonfly-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-freebsd-386-v0.14.0-beta.1.tar.gz",
"syncthing-freebsd-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-linux-386-v0.14.0-beta.1.tar.gz",
"syncthing-linux-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-linux-arm-v0.14.0-beta.1.tar.gz",
"syncthing-linux-arm64-v0.14.0-beta.1.tar.gz",
"syncthing-linux-ppc64-v0.14.0-beta.1.tar.gz",
"syncthing-linux-ppc64le-v0.14.0-beta.1.tar.gz",
"syncthing-macosx-386-v0.14.0-beta.1.tar.gz",
"syncthing-macosx-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-netbsd-386-v0.14.0-beta.1.tar.gz",
"syncthing-netbsd-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-openbsd-386-v0.14.0-beta.1.tar.gz",
"syncthing-openbsd-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-solaris-amd64-v0.14.0-beta.1.tar.gz",
"syncthing-windows-386-v0.14.0-beta.1.zip",
"syncthing-windows-amd64-v0.14.0-beta.1.zip",
"syncthing-source-v0.14.0-beta.1.tar.gz",
"syncthing-source-v0.14.0-beta.1.tar.gz.asc"
],
"0.13.10": [
"syncthing-dragonfly-amd64-v0.13.10.tar.gz",
"syncthing-freebsd-386-v0.13.10.tar.gz",
"syncthing-freebsd-amd64-v0.13.10.tar.gz",
"syncthing-linux-386-v0.13.10.tar.gz",
"syncthing-linux-amd64-v0.13.10.tar.gz",
"syncthing-linux-arm-v0.13.10.tar.gz",
"syncthing-linux-arm64-v0.13.10.tar.gz",
"syncthing-linux-ppc64-v0.13.10.tar.gz",
"syncthing-linux-ppc64le-v0.13.10.tar.gz",
"syncthing-macosx-386-v0.13.10.tar.gz",
"syncthing-macosx-amd64-v0.13.10.tar.gz",
"syncthing-netbsd-386-v0.13.10.tar.gz",
"syncthing-netbsd-amd64-v0.13.10.tar.gz",
"syncthing-openbsd-386-v0.13.10.tar.gz",
"syncthing-openbsd-amd64-v0.13.10.tar.gz",
"syncthing-solaris-amd64-v0.13.10.tar.gz",
"syncthing-windows-386-v0.13.10.zip",
"syncthing-windows-amd64-v0.13.10.zip"
],
"0.13.9": [
"syncthing-dragonfly-amd64-v0.13.9.tar.gz",
"syncthing-freebsd-386-v0.13.9.tar.gz",
"syncthing-freebsd-amd64-v0.13.9.tar.gz",
"syncthing-linux-386-v0.13.9.tar.gz",
"syncthing-linux-amd64-v0.13.9.tar.gz",
"syncthing-linux-arm-v0.13.9.tar.gz",
"syncthing-linux-arm64-v0.13.9.tar.gz",
"syncthing-linux-ppc64-v0.13.9.tar.gz",
"syncthing-linux-ppc64le-v0.13.9.tar.gz",
"syncthing-macosx-386-v0.13.9.tar.gz",
"syncthing-macosx-amd64-v0.13.9.tar.gz",
"syncthing-netbsd-386-v0.13.9.tar.gz",
"syncthing-netbsd-amd64-v0.13.9.tar.gz",
"syncthing-openbsd-386-v0.13.9.tar.gz",
"syncthing-openbsd-amd64-v0.13.9.tar.gz",
"syncthing-solaris-amd64-v0.13.9.tar.gz",
"syncthing-windows-386-v0.13.9.zip",
"syncthing-windows-amd64-v0.13.9.zip"
]
},
"discosrv": {
"0.13.10": [
"discosrv-freebsd-386-v0.13.10.tar.gz",
"discosrv-freebsd-amd64-v0.13.10.tar.gz",
"discosrv-linux-386-v0.13.10.tar.gz",
"discosrv-linux-amd64-v0.13.10.tar.gz",
"discosrv-linux-arm-v0.13.10.tar.gz",
"discosrv-macosx-amd64-v0.13.10.tar.gz",
"discosrv-solaris-amd64-v0.13.10.tar.gz",
"discosrv-windows-386-v0.13.10.zip",
"discosrv-windows-amd64-v0.13.10.zip"
],
"0.13.5": [
"discosrv-freebsd-386-v0.13.5.tar.gz",
"discosrv-freebsd-amd64-v0.13.5.tar.gz",
"discosrv-linux-386-v0.13.5.tar.gz",
"discosrv-linux-amd64-v0.13.5.tar.gz",
"discosrv-linux-arm-v0.13.6.tar.gz",
"discosrv-macosx-amd64-v0.13.5.tar.gz",
"discosrv-solaris-amd64-v0.13.5.tar.gz",
"discosrv-windows-386-v0.13.5.zip",
"discosrv-windows-amd64-v0.13.5.zip"
],
"0.13.0": [
"discosrv-freebsd-386.tar.gz",
"discosrv-freebsd-amd64.tar.gz",
"discosrv-linux-386.tar.gz",
"discosrv-linux-amd64.tar.gz",
"discosrv-linux-arm.tar.gz",
"discosrv-darwin-amd64.tar.gz",
"discosrv-netbsd-386.tar.gz",
"discosrv-netbsd-amd64.tar.gz",
"discosrv-openbsd-386.tar.gz",
"discosrv-openbsd-amd64.tar.gz",
"discosrv-solaris-amd64.tar.gz",
"discosrv-windows-386.zip",
"discosrv-windows-amd64.zip"
],
"0.12.2": [
"discosrv-freebsd-386.tar.gz",
"discosrv-freebsd-amd64.tar.gz",
"discosrv-linux-386.tar.gz",
"discosrv-linux-amd64.tar.gz",
"discosrv-linux-arm.tar.gz",
"discosrv-darwin-amd64.tar.gz",
"discosrv-netbsd-386.tar.gz",
"discosrv-netbsd-amd64.tar.gz",
"discosrv-openbsd-386.tar.gz",
"discosrv-openbsd-amd64.tar.gz",
"discosrv-solaris-amd64.tar.gz",
"discosrv-windows-386.zip",
"discosrv-windows-amd64.zip"
],
"0.12.1": [
"discosrv-freebsd-386.tar.gz",
"discosrv-freebsd-amd64.tar.gz",
"discosrv-linux-386.tar.gz",
"discosrv-linux-amd64.tar.gz",
"discosrv-linux-arm.tar.gz",
"discosrv-darwin-amd64.tar.gz",
"discosrv-netbsd-386.tar.gz",
"discosrv-netbsd-amd64.tar.gz",
"discosrv-openbsd-386.tar.gz",
"discosrv-openbsd-amd64.tar.gz",
"discosrv-solaris-amd64.tar.gz",
"discosrv-windows-386.zip",
"discosrv-windows-amd64.zip"
]
},
"relaysrv": {
"0.13.5": [
"relaysrv-freebsd-386-v0.13.5.tar.gz",
"relaysrv-freebsd-amd64-v0.13.5.tar.gz",
"relaysrv-linux-386-v0.13.5.tar.gz",
"relaysrv-linux-amd64-v0.13.5.tar.gz",
"relaysrv-linux-arm-v0.13.6.tar.gz",
"relaysrv-macosx-amd64-v0.13.5.tar.gz",
"relaysrv-solaris-amd64-v0.13.5.tar.gz",
"relaysrv-windows-386-v0.13.5.zip",
"relaysrv-windows-amd64-v0.13.5.zip"
],
"0.12.18": [
"relaysrv-freebsd-386.tar.gz",
"relaysrv-freebsd-amd64.tar.gz",
"relaysrv-linux-386.tar.gz",
"relaysrv-linux-amd64.tar.gz",
"relaysrv-linux-arm.tar.gz",
"relaysrv-darwin-amd64.tar.gz",
"relaysrv-netbsd-386.tar.gz",
"relaysrv-netbsd-amd64.tar.gz",
"relaysrv-openbsd-386.tar.gz",
"relaysrv-openbsd-amd64.tar.gz",
"relaysrv-solaris-amd64.tar.gz",
"relaysrv-windows-386.zip",
"relaysrv-windows-amd64.zip"
],
"0.12.1": [
"relaysrv-freebsd-386.tar.gz",
"relaysrv-freebsd-amd64.tar.gz",
"relaysrv-linux-386.tar.gz",
"relaysrv-linux-amd64.tar.gz",
"relaysrv-linux-arm.tar.gz",
"relaysrv-darwin-amd64.tar.gz",
"relaysrv-netbsd-386.tar.gz",
"relaysrv-netbsd-amd64.tar.gz",
"relaysrv-openbsd-386.tar.gz",
"relaysrv-openbsd-amd64.tar.gz",
"relaysrv-solaris-amd64.tar.gz",
"relaysrv-windows-386.zip",
"relaysrv-windows-amd64.zip"
],
"0.12.0": [
"relaysrv-freebsd-386.tar.gz",
"relaysrv-freebsd-amd64.tar.gz",
"relaysrv-linux-386.tar.gz",
"relaysrv-linux-amd64.tar.gz",
"relaysrv-linux-arm.tar.gz",
"relaysrv-darwin-amd64.tar.gz",
"relaysrv-netbsd-386.tar.gz",
"relaysrv-netbsd-amd64.tar.gz",
"relaysrv-openbsd-386.tar.gz",
"relaysrv-openbsd-amd64.tar.gz",
"relaysrv-solaris-amd64.tar.gz",
"relaysrv-windows-386.zip",
"relaysrv-windows-amd64.zip"
]
}
};
var platforms = [
"dragonfly-amd64",
"freebsd-amd64", "freebsd-386",
"linux-amd64", "linux-386", "linux-arm", "linux-arm64", "linux-ppc64", "linux-ppc64le",
"macosx-amd64", "macosx-386",
"netbsd-amd64", "netbsd-386",
"openbsd-amd64", "openbsd-386",
"solaris-amd64",
"windows-amd64", "windows-386"
];
var UNKNOWN = '?';
function getUserOS() {
if (document.location.hash && document.location.hash.indexOf('os=')==1) {
return document.location.hash.substring(4);
}
if (window.navigator.platform === 'MacIntel') return 'macosx';
if (window.navigator.platform === 'Win32') return 'windows';
if (window.navigator.platform.indexOf('Linux')>=0) return 'linux';
return UNKNOWN;
}
var userOS = getUserOS();
var compare = function(a, b) {
if (a > b) return +1;
if (a < b) return -1;
return 0;
}
function platformValue(platform) {
if (platform === userOS + '-amd64') return 0; // generally prefer amd64 cpu arch
if (platform.indexOf(userOS+'-') === 0) return 1;
else return 2;
}
if (userOS !== UNKNOWN) {
platforms.sort(function(a, b) {
return compare(platformValue(a), platformValue(b)) || compare(a, b);
});
}
function getFileForProductVersionAndPlatform(product, version, platform) {
var files = versionsData[product][version];
var regex = new RegExp("-" + platform + "[-.]");
var matchingFiles = files.filter(function(f) { return regex.exec(f); });
if (matchingFiles.length==1) {
return matchingFiles[0];
}
}
function populateDownloadUI(product) {
var versions = Object.keys(versionsData[product]);
function setVersion(product, v) {
var isLatestVersion = (v === versions[0]);
var $versionAlert = $('#st-' + product + '-download > .alert.st-non-latest-version');
$versionAlert.css('display', isLatestVersion ? 'none' : 'block');
var $versionHolder = $('#st-' + product + '-download > .st-version-chooser > button > .st-version-holder');
$versionHolder.text(v);
var fileExistsForPlatform = function(platform) {
return getFileForProductVersionAndPlatform(product, v, platform);
}
var availablePlatforms = platforms.filter(fileExistsForPlatform);
var $platformList = $('#st-' + product + '-download > .st-platform-chooser > .st-platform-list');
$platformList.empty();
availablePlatforms.forEach(function(p) {
var $li = $('<li>');
var $a = $('<a>' + p + '</a>');
$a.appendTo($li);
$li.appendTo($platformList);
$a.on('click', function(e) { setFile(product, v, p); });
});
if (availablePlatforms.length > 0 && userOS !== UNKNOWN) {
setFile(product, v, availablePlatforms[0]);
}
}
function getFileURL(product, version, file) {
return 'https://github.com/syncthing/' + product + '/releases/download/v' + version + '/' + file ;
}
function setFile(product, version, platform) {
var file = getFileForProductVersionAndPlatform(product, version, platform);
if (product === 'syncthing') {
$('#st-' + product + '-download > .alert.st-linux-packages').css('display', platform.indexOf('linux')===0 ? 'block' : 'none');
$('#st-' + product + '-download > .alert.st-windows-gui').css('display', platform.indexOf('windows')===0 ? 'block' : 'none');
}
var $downloadButton = $('#st-' + product + '-download > .st-platform-chooser > .st-download-button');
var $downloadIcon = $downloadButton.find('.st-dl-icon');
var $downloadText = $downloadButton.find('.st-dl-text');
$downloadButton.attr('disabled', false);
$downloadButton.attr('href', getFileURL(product, version, file));
$downloadIcon.removeClass('glyphicon-arrow-right');
$downloadIcon.addClass('glyphicon-download-alt');
$downloadText.text('Download ' + product + ' v' + version + ' for ' + platform);
}
var $versionList = $('#st-' + product + '-download > .st-version-chooser > .st-version-list');
versions.forEach(function(v) {
var $li = $('<li>');
var $a = $('<a>' + v + '</a>');
$a.appendTo($li);
$li.appendTo($versionList);
$a.on('click', function(e) { setVersion(product, v); });
});
if (versions.length > 0) {
$versionList.find('li > a').first().css('font-weight', 'bold');
setVersion(product, versions[0]);
}
}
['syncthing', 'discosrv', 'relaysrv'].forEach(populateDownloadUI);
$('#st-synctrayzor-screenshot').on('click', function() {
$('#st-screenshot-modal-img').attr('src', 'https://raw.githubusercontent.com/canton7/SyncTrayzor/master/readme/screenshot.png');
$('#st-screenshot-modal-title').text('SyncTrayzor screenshot');
$('#st-screenshot-modal').modal('show');
});
$('#st-gtkui-screenshot').on('click', function() {
$('#st-screenshot-modal-img').attr('src', 'http://i.imgur.com/eX250tQ.png');
$('#st-screenshot-modal-title').text('Syncthing GTK screenshot');
$('#st-screenshot-modal').modal('show');
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment