summaryrefslogtreecommitdiffstats
path: root/js/github-api.js
diff options
context:
space:
mode:
authorlou <louiscuny@gmail.com>2013-04-19 15:14:46 +0200
committerlou <louiscuny@gmail.com>2013-04-19 15:14:46 +0200
commitcae9c468f77870324b4b1f115226342e4ac5654c (patch)
tree6fd95aba6987cef6d5ec895e450843d77bff6069 /js/github-api.js
parentcb71f543a2d1a75643943bc6c66101f837decce0 (diff)
downloadmulti-select-cae9c468f77870324b4b1f115226342e4ac5654c.zip
multi-select-cae9c468f77870324b4b1f115226342e4ac5654c.tar.gz
multi-select-cae9c468f77870324b4b1f115226342e4ac5654c.tar.bz2
Website handmade with HTML in order to be set up on github pages
Diffstat (limited to 'js/github-api.js')
-rw-r--r--js/github-api.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/github-api.js b/js/github-api.js
new file mode 100644
index 0000000..719fb08
--- /dev/null
+++ b/js/github-api.js
@@ -0,0 +1,22 @@
+(function($){
+
+ appendContributors = function(contributors){
+ var source = $('#contributors-tpl').html();
+ var template = Handlebars.compile(source);
+
+ $('#contributors').append(template({ contributors: contributors }));
+ }
+
+ $.ajax('https://api.github.com/repos/lou/multi-select/git/refs/tags')
+ .done(function(data){
+ var ref = data[data.length-1].ref;
+ var tagNumber = ref.match(/\d(.\d)*$/)[0];
+
+ $('#brand').append(' <span>'+tagNumber+'</span>')
+ })
+
+ $.ajax('https://api.github.com/repos/lou/multi-select/contributors')
+ .done(function(data){
+ appendContributors(data);
+ });
+})(jQuery)