Skip to content

Commit 5e425b0

Browse files
committed
Add getlatest downloads
1 parent 085079b commit 5e425b0

File tree

1 file changed

+26
-5
lines changed

1 file changed

+26
-5
lines changed

index.html

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link href='https://fonts.googleapis.com/css?family=Lato:300,400,700,400italic' rel='stylesheet' type='text/css'>
1212
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.min.css" type="text/css">
1313
<link rel="stylesheet" href="css/main.min.css" type="text/css">
14-
14+
<script src="https://code.jquery.com/jquery-3.2.1.min.js" ></script>
1515
</head>
1616

1717
<body>
@@ -72,18 +72,20 @@ <h3>Download</h3>
7272
</div>
7373

7474
<div class="bit-2">
75-
<a onclick="_gaq.push(['_trackEvent', 'Download', 'mini'])" href="https://github.com/cmderdev/cmder/releases/download/v1.3.3/cmder_mini.zip">
75+
<a id="mini" onclick="_gaq.push(['_trackEvent', 'Download', 'mini'])">
7676
<button class="gray">Download mini</button>
7777
</a>
7878
<small>7.8MB</small>
7979
</div>
8080
<div class="bit-2">
81-
<a onclick="_gaq.push(['_trackEvent', 'Download', 'full'])" href="https://github.com/cmderdev/cmder/releases/download/v1.3.3/cmder.zip">
81+
<a id="full" onclick="_gaq.push(['_trackEvent', 'Download', 'full'])">
8282
<button class="blue">Download full</button>
8383
</a>
8484
<small>(With git-for-windows) 100MB</small>
8585
<small>
86-
<em><a onclick="_gaq.push(['_trackEvent', 'Download', 'full', '7z'])" href="https://github.com/cmderdev/cmder/releases/download/v1.3.3/cmder.7z">52MB 7z</a></em>
86+
<em>
87+
<a id="7z" onclick="_gaq.push(['_trackEvent', 'Download', 'full', '7z'])"></a>52MB 7z</a>
88+
</em>
8789
</small>
8890
</div>
8991

@@ -196,7 +198,26 @@ <h4>Other documentations</h4>
196198
s.parentNode.insertBefore(ga, s);
197199
})();
198200
</script>
199-
201+
<script type="text/javascript" defer="defer">
202+
$(document).ready(function () {
203+
getLatestReleases();
204+
})
205+
206+
function getLatestReleases() {
207+
$.getJSON("https://api.github.com/repos/cmderdev/cmder/releases/latest").done(function (release) {
208+
for (const asset of release.assets) {
209+
switch (asset.name) {
210+
case "cmder.zip":
211+
$("#full").attr("href", asset.browser_download_url);
212+
case "cmder_mini.zip":
213+
$("#mini").attr("href", asset.browser_download_url);
214+
case "cmder.7z":
215+
$("#7z").attr("href", asset.browser_download_url);
216+
}
217+
}
218+
})
219+
}
220+
</script>
200221
</body>
201222

202223
</html>

0 commit comments

Comments
 (0)