mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-06 14:44:24 +01:00
Fix JS
This commit is contained in:
parent
10ddf1ab02
commit
0350f3b66a
@ -76,6 +76,7 @@ function changeStyle(styleName, link) {
|
|||||||
{% endraw %}
|
{% endraw %}
|
||||||
|
|
||||||
function init_stylechooser() {
|
function init_stylechooser() {
|
||||||
|
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+', '.': '\\.'}) }})/);
|
||||||
var newElement = document.createElement('div');
|
var newElement = document.createElement('div');
|
||||||
newElement.className = 'styles';
|
newElement.className = 'styles';
|
||||||
|
|
||||||
@ -104,6 +105,8 @@ function init_stylechooser() {
|
|||||||
localStorage.board_stylesheets = '{}';
|
localStorage.board_stylesheets = '{}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.stylesheet_choices = JSON.parse(localStorage.board_stylesheets);
|
||||||
|
|
||||||
if (board_name && stylesheet_choices[board_name]) {
|
if (board_name && stylesheet_choices[board_name]) {
|
||||||
for (var styleName in styles) {
|
for (var styleName in styles) {
|
||||||
if (styleName == stylesheet_choices[board_name]) {
|
if (styleName == stylesheet_choices[board_name]) {
|
||||||
@ -128,11 +131,6 @@ function init_stylechooser() {
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
}
|
}
|
||||||
|
|
||||||
var stylesheet_choices = JSON.parse(localStorage.board_stylesheets); {% endraw %}
|
|
||||||
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 %}
|
|
||||||
|
|
||||||
function get_cookie(cookie_name) {
|
function get_cookie(cookie_name) {
|
||||||
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
|
var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)');
|
||||||
if (results)
|
if (results)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user