diff --git a/templates/main.js b/templates/main.js
index b0c27f47..9437c5ca 100644
--- a/templates/main.js
+++ b/templates/main.js
@@ -53,8 +53,13 @@ function changeStyle(styleName, link) {
var x = document.getElementsByTagName('head')[0];
x.appendChild(s);
}
+
+ {% endraw %}
+ var root = "{{ config.root }}";
+ {% raw %}
+ root = root.replace(/\/$/, "");
- document.getElementById('stylesheet').href = styles[styleName];
+ document.getElementById('stylesheet').href = root + styles[styleName];
selectedstyle = styleName;
if (document.getElementsByClassName('styles').length != 0) {
@@ -76,7 +81,7 @@ function changeStyle(styleName, link) {
{% endraw %}
function init_stylechooser() {
- var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page50|replace({'+': '\\+', '%d': '\\d+', '.': '\\.'}) }})/);
+ var matches = document.URL.match(/\/(\w+)\/($|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.file_index|replace({'.': '\\.'}) }}|{{ config.dir.res|replace({'/': '\\/'}) }}{{ config.file_page50|replace({'+': '\\+', '%d': '\\d+', '.': '\\.'}) }}|{{ config.file_page|replace({'%d': '\\d+', '.': '\\.'}) }}|{{ config.catalog_link|replace({'.': '\\.'}) }})/);
var newElement = document.createElement('div');
newElement.className = 'styles';
diff --git a/templates/themes/catalog/catalog.html b/templates/themes/catalog/catalog.html
index db94e2a4..be02a80e 100644
--- a/templates/themes/catalog/catalog.html
+++ b/templates/themes/catalog/catalog.html
@@ -83,9 +83,17 @@
Tinyboard Copyright © 2010-2014 Tinyboard Development Group
vichan Copyright © 2012-2014 vichan-devel