diff options
author | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:51:41 +0100 |
---|---|---|
committer | James Phillpotts <jphillpotts@scottlogic.co.uk> | 2014-04-07 10:51:41 +0100 |
commit | 58a90886daa0f12f4f25cfe1c1378f455e9eb6a9 (patch) | |
tree | 9207b2f93952b95ddd0f551af855390a9020e2c1 /theme | |
parent | 80794997a4ebfc5bf397132ff89ee8c76e99efbe (diff) | |
download | gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.zip gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.tar.gz gitbook-58a90886daa0f12f4f25cfe1c1378f455e9eb6a9.tar.bz2 |
Whoops, missed a couple of extra uses of githubId
Diffstat (limited to 'theme')
-rw-r--r-- | theme/javascript/app.js | 22 | ||||
-rw-r--r-- | theme/templates/includes/book/exercise.html | 2 |
2 files changed, 14 insertions, 10 deletions
diff --git a/theme/javascript/app.js b/theme/javascript/app.js index 34247ca..392d45b 100644 --- a/theme/javascript/app.js +++ b/theme/javascript/app.js @@ -14,9 +14,6 @@ require([ $(document).ready(function() { var $book = state.$book; - // Initialize storage - storage.setBaseKey(state.githubId); - // Init sidebar sidebar.init(); @@ -26,12 +23,17 @@ require([ // Init keyboard keyboard.init(); - // Star and watch count - $.getJSON("https://api.github.com/repos/"+state.githubId) - .done(function(repo) { - $book.find(".count-star span").text(repo.stargazers_count); - $book.find(".count-watch span").text(repo.subscribers_count); - }); + if (state.githubId) { + // Initialize storage + storage.setBaseKey(state.githubId); + + // Star and watch count + $.getJSON("https://api.github.com/repos/"+state.githubId) + .done(function(repo) { + $book.find(".count-star span").text(repo.stargazers_count); + $book.find(".count-watch span").text(repo.subscribers_count); + }); + } // Bind exercise exercise.init(); @@ -45,4 +47,4 @@ require([ // Focus on content $(".book-body").focus(); }); -});
\ No newline at end of file +}); diff --git a/theme/templates/includes/book/exercise.html b/theme/templates/includes/book/exercise.html index 1acbe79..fbf8505 100644 --- a/theme/templates/includes/book/exercise.html +++ b/theme/templates/includes/book/exercise.html @@ -20,5 +20,7 @@ <div class="btn-group btn-group-justified"> <a href="#" class="btn btn-default action-submit">Submit</a> <a href="#" class="btn btn-default action-solution">Solution</a> + {% if githubId %} <a href="{{ githubHost }}{{ githubId }}/issues/new" target="_blank" class="btn btn-default">Have a Question?</a> + {% endif %} </div> |