Skip to content
Browse files

show osx downloads

  • Loading branch information...
1 parent 5adacbc commit 463c065c3a264a604980ef89e5ec6b955ff73485 @parkouss parkouss committed
Showing with 8 additions and 7 deletions.
  1. +8 −7 _layouts/home.html
View
15 _layouts/home.html
@@ -28,10 +28,11 @@
<script>
function createElement(tags) {
- var tag = document.createElement('dl');
- var template = '<dl>'
- + '<dd>linux: ' + tags.data.linux + '</dd>'
- + '<dd>windows: ' + tags.data.windows + '</dd>';
+ var tag = document.createElement('ul');
+ var template = ''
+ + '<li>linux: ' + tags.data.linux + '</li>'
+ + '<li>windows: ' + tags.data.windows + '</li>'
+ + '<li>osx: ' + tags.data.osx + '</li>';
tag.innerHTML = template;
document.getElementById('downloads').appendChild(tag);
}
@@ -48,11 +49,11 @@
var platformName = platformData.name;
- if(platformName.match(/\.[0-9a-z]{1,5}$/g) == '.exe') {
+ if(platformName.endsWith('.exe')) {
tags['windows'] += platformData.download_count;
- } else if (platformName.match(/.*\.(tgz$)|(tar\.gz$)/g) == 'tar.gz') {
+ } else if (platformName.endsWith('.tar.gz')) {
tags['linux'] += platformData.download_count;
- } else if (platformName.match(/\.[0-9a-z]{1,5}$/g) == '.dmg') {
+ } else if (platformName.endsWith('.dmg')) {
tags['osx'] += platformData.download_count;
}

0 comments on commit 463c065

Please sign in to comment.
Something went wrong with that request. Please try again.