summaryrefslogtreecommitdiffstats
path: root/theme/assets/app.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-09 08:17:37 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-09 08:17:37 +0200
commit1b432288f041baef2ebe54c96a7a86f547b14c67 (patch)
tree8856ef41c7f38e135d84c8f5f3e4363c91459569 /theme/assets/app.js
parent2182baa2e9bf520943871c52340066cfdd28ba0b (diff)
parentfa2f82d52f34b725483f0fd55be3cc9b04f7dc9b (diff)
downloadgitbook-1b432288f041baef2ebe54c96a7a86f547b14c67.zip
gitbook-1b432288f041baef2ebe54c96a7a86f547b14c67.tar.gz
gitbook-1b432288f041baef2ebe54c96a7a86f547b14c67.tar.bz2
Merge branch 'optional-github' of https://github.com/mrpotes/gitbook into mrpotes-optional-github
Diffstat (limited to 'theme/assets/app.js')
-rw-r--r--theme/assets/app.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/theme/assets/app.js b/theme/assets/app.js
index 3a10746..36eb935 100644
--- a/theme/assets/app.js
+++ b/theme/assets/app.js
@@ -21370,9 +21370,6 @@ require([
$(document).ready(function() {
var $book = state.$book;
- // Initialize storage
- storage.setBaseKey(state.githubId);
-
// Init sidebar
sidebar.init();
@@ -21382,12 +21379,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();
@@ -21402,5 +21404,6 @@ require([
$(".book-body").focus();
});
});
+
define("app", function(){});