summaryrefslogtreecommitdiffstats
path: root/theme/javascript/state.js
diff options
context:
space:
mode:
Diffstat (limited to 'theme/javascript/state.js')
-rw-r--r--theme/javascript/state.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/theme/javascript/state.js b/theme/javascript/state.js
new file mode 100644
index 0000000..52b9ab3
--- /dev/null
+++ b/theme/javascript/state.js
@@ -0,0 +1,16 @@
+var $ = require('jquery');
+
+var state = {};
+
+state.update = function(dom) {
+ var $book = $(dom.find(".book"));
+
+ state.$book = $book;
+ state.level = $book.data("level");
+ state.basePath = $book.data("basepath");
+ state.revision = $book.data("revision");
+};
+
+state.update($);
+
+module.exports = state;