diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2014-04-21 14:26:09 -0700 |
---|---|---|
committer | Aaron O'Mullan <aaron.omullan@gmail.com> | 2014-04-21 14:26:09 -0700 |
commit | 4c90fdb7b27fdf6527b59097d489a9df0a929264 (patch) | |
tree | b00f3196f58ed712dea40dd69a261fc43129a651 /theme/javascript/gitbook.js | |
parent | d1c1d7b75b6e4a304d031c4313cf54ae8aa3a11d (diff) | |
parent | 98c133df3c9077c1b06748c3206bea3ff011ed3a (diff) | |
download | gitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.zip gitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.tar.gz gitbook-4c90fdb7b27fdf6527b59097d489a9df0a929264.tar.bz2 |
Merge pull request #123 from GitbookIO/feature/plugins
Fix #65: Plugins Architecture
Diffstat (limited to 'theme/javascript/gitbook.js')
-rwxr-xr-x | theme/javascript/gitbook.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/theme/javascript/gitbook.js b/theme/javascript/gitbook.js new file mode 100755 index 0000000..713a734 --- /dev/null +++ b/theme/javascript/gitbook.js @@ -0,0 +1,47 @@ +define([ + "jQuery", + "utils/storage", + "utils/sharing", + + "core/events", + "core/state", + "core/keyboard", + "core/navigation", + "core/progress", + "core/sidebar", + "core/search" +], function($, storage, sharing, events, state, keyboard, navigation, progress, sidebar, search){ + var start = function(config) { + var $book; + $book = state.$book; + + if (state.githubId) { + // Initialize storage + storage.setBaseKey(state.githubId); + } + + // Init sidebar + sidebar.init(); + + // Load search + search.init(); + + // Init keyboard + keyboard.init(); + + // Bind sharing button + sharing.init(); + + // Init navigation + navigation.init(); + + $(document).trigger("bookReady"); + + events.trigger("start", config); + } + + return { + start: start, + events: events + }; +}); |