summaryrefslogtreecommitdiffstats
path: root/theme/javascript/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/app.js')
-rwxr-xr-x[-rw-r--r--]theme/javascript/app.js27
1 files changed, 11 insertions, 16 deletions
diff --git a/theme/javascript/app.js b/theme/javascript/app.js
index f18ae24..3638092 100644..100755
--- a/theme/javascript/app.js
+++ b/theme/javascript/app.js
@@ -7,14 +7,16 @@ require([
"core/state",
"core/keyboard",
"core/exercise",
- "core/quiz",
"core/progress",
"core/sidebar",
"core/search"
-], function($, storage, analytic, sharing, state, keyboard, exercise, quiz, progress, sidebar, search){
+], function($, storage, analytic, sharing, state, keyboard, exercise, progress, sidebar, search){
$(document).ready(function() {
var $book = state.$book;
+ // Initialize storage
+ storage.setBaseKey(state.githubId);
+
// Init sidebar
sidebar.init();
@@ -24,21 +26,14 @@ 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);
- });
- }
+ // 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
+ // Bind exercise
exercise.init();
- quiz.init();
// Bind sharing button
sharing.init();
@@ -49,4 +44,4 @@ require([
// Focus on content
$(".book-body").focus();
});
-});
+}); \ No newline at end of file