Skip to content

Commit fa825de

Browse files
authored
Merge pull request #18 from cmderdev/getlatest
Add getlatest downloads
2 parents efb9f40 + fe1871f commit fa825de

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

index.html

Lines changed: 24 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,18 @@ <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/latest">
75+
<a id="mini" onclick="_gaq.push(['_trackEvent', 'Download', 'mini'])" href="https://github.com/cmderdev/cmder/releases/latest">
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/latest">
81+
<a id="full" onclick="_gaq.push(['_trackEvent', 'Download', 'full'])" href="https://github.com/cmderdev/cmder/releases/latest">
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/latest">~52MB 7z</a></em>
86+
<em><a id="7z" onclick="_gaq.push(['_trackEvent', 'Download', 'full', '7z'])" href="https://github.com/cmderdev/cmder/releases/latest">~52MB 7z</a></em>
8787
</small>
8888
</div>
8989

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

202221
</html>

0 commit comments

Comments
 (0)