Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Add JS file for releases to template
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Robinson committed Sep 9, 2009
1 parent fee852a commit 61edb27
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions _layouts/default-template.html
Expand Up @@ -9,6 +9,7 @@
<link rel="stylesheet" type="text/css" media="all" href="/css/grids.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/content.css" />
<link rel="stylesheet" type="text/css" media="all" href="/css/disqus.css" />
<script type="text/javascript" charset="utf-8" src="/js/misc.js"></script>
</head>
<body>
{% if page.github_url != '' %}
Expand Down
15 changes: 15 additions & 0 deletions js/misc.js
@@ -0,0 +1,15 @@
function showreleases(response) {
var releases = [];
for (var tag in response.tags) {
var tar = "http://github.com/tlrobinson/narwhal/tarball/"+tag,
zip = "http://github.com/tlrobinson/narwhal/zipball/"+tag;
commit = "http://github.com/tlrobinson/narwhal/commit/"+response.tags[tag],
tree = "http://github.com/tlrobinson/narwhal/tree/"+response.tags[tag];
releases.push('<li>'+tag+': [<a href="'+zip+'">zip</a>][<a href="'+tar+'">tar</a>][<a href="'+tree+'">tree</a>][<a href="'+commit+'">commit</a>]</li>');
}
releases = releases.sort();
var reversed = [];
while (releases.length) reversed.push(releases.pop());

document.getElementById("releases").innerHTML = "<ul>" + reversed.join("\n") + "</ul>";
}

0 comments on commit 61edb27

Please sign in to comment.