mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-28 17:31:00 +01:00
Applies the theme to all board pages and catalog.
This commit is contained in:
parent
4238249af6
commit
94f2fae196
@ -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';
|
||||
|
||||
|
@ -83,9 +83,17 @@
|
||||
<br><a href="http://tinyboard.org/">Tinyboard</a> Copyright © 2010-2014 Tinyboard Development Group
|
||||
<br><a href="https://int.vichan.net/devel/">vichan</a> Copyright © 2012-2014 vichan-devel</p>
|
||||
</footer>
|
||||
<script type="text/javascript">
|
||||
ready();
|
||||
</script>
|
||||
<script type="text/javascript">{% raw %}
|
||||
var styles = {
|
||||
{% endraw %}
|
||||
{% for name, uri in config.stylesheets %}{% raw %}'{% endraw %}{{ name|addslashes }}{% raw %}' : '{% endraw %}/stylesheets/{{ uri|addslashes }}{% raw %}',
|
||||
{% endraw %}{% endfor %}{% raw %}
|
||||
}; onready(init);
|
||||
{% endraw %}</script>
|
||||
|
||||
<script type="text/javascript">{% raw %}
|
||||
ready();
|
||||
{% endraw %}</script>
|
||||
</body>
|
||||
</html>
|
||||
{% endfilter %}
|
||||
|
Loading…
Reference in New Issue
Block a user