Skip to content

Commit ea4d966

Browse files
committed
Compatibility for require of plugins
1 parent 4bc5656 commit ea4d966

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

theme/assets/website/app.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24426,7 +24426,7 @@ var gitbook = {
2442624426
// Modules mapping for plugins
2442724427
var MODULES = {
2442824428
'gitbook': gitbook,
24429-
'jQuery': $,
24429+
'jquery': $,
2443024430
'lodash': _
2443124431
};
2443224432

@@ -24435,6 +24435,7 @@ window.$ = $;
2443524435
window.jQuery = $;
2443624436
window.require = function(mods, fn) {
2443724437
mods = _.map(mods, function(mod) {
24438+
mod = mod.toLowerCase();
2443824439
if (!MODULES[mod]) {
2443924440
throw new Error('GitBook module '+mod+' doesn\'t exist');
2444024441
}
@@ -24735,7 +24736,11 @@ state.update = function(dom) {
2473524736
state.$book = $book;
2473624737
state.level = $book.data('level');
2473724738
state.basePath = $book.data('basepath');
24739+
24740+
// Date of build
2473824741
state.revision = $book.data('revision');
24742+
24743+
// Original path of the file
2473924744
state.filepath = $book.data('filepath');
2474024745

2474124746
// Absolute url to the root of the book

theme/javascript/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ var gitbook = {
5959
// Modules mapping for plugins
6060
var MODULES = {
6161
'gitbook': gitbook,
62-
'jQuery': $,
62+
'jquery': $,
6363
'lodash': _
6464
};
6565

@@ -68,6 +68,7 @@ window.$ = $;
6868
window.jQuery = $;
6969
window.require = function(mods, fn) {
7070
mods = _.map(mods, function(mod) {
71+
mod = mod.toLowerCase();
7172
if (!MODULES[mod]) {
7273
throw new Error('GitBook module '+mod+' doesn\'t exist');
7374
}

0 commit comments

Comments
 (0)