Added JS for dealing with setting the custom theme
This commit is contained in:
parent
b8c15e5cf3
commit
1657cec1d1
2 changed files with 12 additions and 0 deletions
11
app/static/js/customThemes.js
Normal file
11
app/static/js/customThemes.js
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
function changeTheme() {
|
||||||
|
// Get the selected theme for the dropdown
|
||||||
|
var themes_select = document.getElementById("themes_select");
|
||||||
|
var selected_theme = themes_select.options[themes_select.selectedIndex].text;
|
||||||
|
|
||||||
|
// Update the theme cookie
|
||||||
|
document.cookie = "theme=" + escape(selected_theme) + "; Path=/;"
|
||||||
|
|
||||||
|
// Finally reload the page to let the new theme take effect
|
||||||
|
location.reload();
|
||||||
|
}
|
|
@ -32,6 +32,7 @@ Haldis - {{ active_page|capitalize }}
|
||||||
{{ super() }}
|
{{ super() }}
|
||||||
<script type="text/javascript" src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
<script type="text/javascript" src="{{ url_for('static', filename='js/theme.js') }}"></script>
|
||||||
<script type="text/javascript" src="{{ url_for('static', filename='js/timer.js') }}"></script>
|
<script type="text/javascript" src="{{ url_for('static', filename='js/timer.js') }}"></script>
|
||||||
|
<script type="text/javascript" src="{{ url_for('static', filename='js/customThemes.js') }}"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block navbar %}
|
{% block navbar %}
|
||||||
|
|
Loading…
Reference in a new issue