summaryrefslogtreecommitdiffstats
path: root/theme/javascript/app.js
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-14 16:36:12 +0200
committerSamy Pessé <samypesse@gmail.com>2014-04-14 16:36:12 +0200
commit5848f5db51fb9258ff55dc93010b2c862abeec0a (patch)
treed12c06a056e30bf42e144f5e52643cee86243ece /theme/javascript/app.js
parent1bbef540157b513d3e336325a3d636885e15357e (diff)
parent9f1ba8483b3484391ca1cf5b3ed6005d97e0693b (diff)
downloadgitbook-5848f5db51fb9258ff55dc93010b2c862abeec0a.zip
gitbook-5848f5db51fb9258ff55dc93010b2c862abeec0a.tar.gz
gitbook-5848f5db51fb9258ff55dc93010b2c862abeec0a.tar.bz2
Merge pull request #88 from GitbookIO/feature/clarity
Feature/clarity
Diffstat (limited to 'theme/javascript/app.js')
-rwxr-xr-x[-rw-r--r--]theme/javascript/app.js35
1 files changed, 10 insertions, 25 deletions
diff --git a/theme/javascript/app.js b/theme/javascript/app.js
index f18ae24..38a9572 100644..100755
--- a/theme/javascript/app.js
+++ b/theme/javascript/app.js
@@ -6,15 +6,19 @@ require([
"core/state",
"core/keyboard",
- "core/exercise",
- "core/quiz",
+ "core/navigation",
"core/progress",
"core/sidebar",
"core/search"
-], function($, storage, analytic, sharing, state, keyboard, exercise, quiz, progress, sidebar, search){
+], function($, storage, analytic, sharing, state, keyboard, navigation, progress, sidebar, search){
$(document).ready(function() {
var $book = state.$book;
+ if (state.githubId) {
+ // Initialize storage
+ storage.setBaseKey(state.githubId);
+ }
+
// Init sidebar
sidebar.init();
@@ -24,29 +28,10 @@ require([
// Init keyboard
keyboard.init();
- 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 exercises
- exercise.init();
- quiz.init();
-
// Bind sharing button
sharing.init();
- // Show progress
- progress.show();
-
- // Focus on content
- $(".book-body").focus();
+ // Init navigation
+ navigation.init();
});
-});
+}); \ No newline at end of file