diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-02-26 09:41:26 +0100 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-02-26 09:41:26 +0100 |
commit | d3d64f636c859f7f01a64f7774cf70bd8ccdc562 (patch) | |
tree | 4f7731f37c3a793d187b0ab1cd77680e69534c6c /theme/javascript/state.js | |
parent | 4cb9cbb5ae3aa8f9211ffa3ac5e3d34232c0ca4f (diff) | |
parent | eef072693b17526347c37b66078a5059c71caa31 (diff) | |
download | gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.zip gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.gz gitbook-d3d64f636c859f7f01a64f7774cf70bd8ccdc562.tar.bz2 |
Merge pull request #1109 from GitbookIO/3.0.0
Version 3.0.0
Diffstat (limited to 'theme/javascript/state.js')
-rw-r--r-- | theme/javascript/state.js | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/theme/javascript/state.js b/theme/javascript/state.js deleted file mode 100644 index ef1eb04..0000000 --- a/theme/javascript/state.js +++ /dev/null @@ -1,38 +0,0 @@ -var $ = require('jquery'); -var url = require('url'); -var path = require('path'); - -var state = {}; - -state.update = function(dom) { - var $book = $(dom.find('.book')); - - state.$book = $book; - state.level = $book.data('level'); - state.basePath = $book.data('basepath'); - - // If book is multilingual, language of this book - state.innerLanguage = $book.data('innerlanguage'); - - // Date of build - state.revision = $book.data('revision'); - - // Original path of the file - state.filepath = $book.data('filepath'); - - // Title of the chapter - state.chapterTitle = $book.data('chapter-title'); - - // Absolute url to the root of the book (inner book) - state.root = url.resolve( - location.protocol+'//'+location.host, - path.dirname(path.resolve(location.pathname.replace(/\/$/, '/index.html'), state.basePath)) - ).replace(/\/?$/, '/'); - - // Absolute root to the language (for multilingual book) - state.bookRoot = state.innerLanguage? url.resolve(state.root, '..') : state.root; -}; - -state.update($); - -module.exports = state; |