From 94f2fae19671fd56ff6fea5d62eeeb53596dd9e7 Mon Sep 17 00:00:00 2001 From: fourfivesix Date: Wed, 24 Sep 2014 13:56:38 -0300 Subject: [PATCH] Applies the theme to all board pages and catalog. --- templates/main.js | 9 +++++++-- templates/themes/catalog/catalog.html | 14 +++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) 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

- + + + {% endfilter %}