diff options
| author | czaks <marcin@6irc.net> | 2016-05-05 14:38:24 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2016-05-05 15:37:50 +0200 |
| commit | 02c3c28a16127511a785e428547f8a4dc60abaf7 (patch) | |
| tree | 8c65784b0e7a999cb1b8c9459d489f00d15a46d8 /templates/main.js | |
| parent | 6991ca270eb7ecd879a06971cc9df0334aab7687 (diff) | |
main.js: a bit more sane code
Diffstat (limited to 'templates/main.js')
| -rw-r--r-- | templates/main.js | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/templates/main.js b/templates/main.js index 7e3b2dc1..c2a6f6c0 100644 --- a/templates/main.js +++ b/templates/main.js @@ -115,7 +115,10 @@ var styles = { {% for stylesheet in stylesheets %}{% raw %}'{% endraw %}{{ stylesheet.name|addslashes }}{% raw %}' : '{% endraw %}{{ stylesheet.uri|addslashes }}{% raw %}', {% endraw %}{% endfor %}{% raw %} }; -var board_name = false; + +if (typeof board_name === 'undefined') { + var board_name = false; +} function changeStyle(styleName, link) { {% endraw %} @@ -159,13 +162,7 @@ function changeStyle(styleName, link) { {% endraw %} {% if config.stylesheets_board %} - {# This is such an unacceptable mess. There needs to be an easier way. #} - {# Needs fix for slugify #} - var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }})/); {% raw %} - if (matches) { - board_name = matches[1]; - } if (!localStorage.board_stylesheets) { localStorage.board_stylesheets = '{}'; |
