diff options
author | Samy Pessé <samypesse@gmail.com> | 2015-10-24 21:36:17 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2015-10-24 21:36:17 +0200 |
commit | ea4d96610f98da3f692dfd424e2840ab30e61e36 (patch) | |
tree | d413d726d2c728933196beecfd00addb1537b8a6 | |
parent | 4bc56564b4ee7a4fedf34d4c585f2ba0efd3a8ae (diff) | |
download | gitbook-ea4d96610f98da3f692dfd424e2840ab30e61e36.zip gitbook-ea4d96610f98da3f692dfd424e2840ab30e61e36.tar.gz gitbook-ea4d96610f98da3f692dfd424e2840ab30e61e36.tar.bz2 |
Compatibility for require of plugins
-rw-r--r-- | theme/assets/website/app.js | 7 | ||||
-rwxr-xr-x | theme/javascript/index.js | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/theme/assets/website/app.js b/theme/assets/website/app.js index e8d80d9..82bc568 100644 --- a/theme/assets/website/app.js +++ b/theme/assets/website/app.js @@ -24426,7 +24426,7 @@ var gitbook = { // Modules mapping for plugins var MODULES = { 'gitbook': gitbook, - 'jQuery': $, + 'jquery': $, 'lodash': _ }; @@ -24435,6 +24435,7 @@ window.$ = $; window.jQuery = $; window.require = function(mods, fn) { mods = _.map(mods, function(mod) { + mod = mod.toLowerCase(); if (!MODULES[mod]) { throw new Error('GitBook module '+mod+' doesn\'t exist'); } @@ -24735,7 +24736,11 @@ state.update = function(dom) { state.$book = $book; state.level = $book.data('level'); state.basePath = $book.data('basepath'); + + // Date of build state.revision = $book.data('revision'); + + // Original path of the file state.filepath = $book.data('filepath'); // Absolute url to the root of the book diff --git a/theme/javascript/index.js b/theme/javascript/index.js index 303f87d..8eff42a 100755 --- a/theme/javascript/index.js +++ b/theme/javascript/index.js @@ -59,7 +59,7 @@ var gitbook = { // Modules mapping for plugins var MODULES = { 'gitbook': gitbook, - 'jQuery': $, + 'jquery': $, 'lodash': _ }; @@ -68,6 +68,7 @@ window.$ = $; window.jQuery = $; window.require = function(mods, fn) { mods = _.map(mods, function(mod) { + mod = mod.toLowerCase(); if (!MODULES[mod]) { throw new Error('GitBook module '+mod+' doesn\'t exist'); } |