fixes for themes and header links

This commit is contained in:
Phuntsok Drak-pa 2019-08-25 05:20:06 +02:00
parent bdf3f66324
commit 9590408c7c
3 changed files with 8 additions and 11 deletions

View File

@ -5,8 +5,6 @@
#+HTML_HEAD: <link rel="stylesheet" href="./css/htmlize.min.css"/>
#+HTML_HEAD: <link rel="stylesheet" href="./css/style.css"/>
#+HTML_HEAD: <link id="theme" rel="stylesheet" href="./css/dark.css"/>
# #+HTML_HEAD: <link id="theme" rel="stylesheet" href="./css/light.css"/>
#+HTML_HEAD: <script src="./js/jquery.min.js"></script>
#+HTML_HEAD: <script src="./js/main.js"></script>

View File

@ -3,10 +3,8 @@
# ### STYLE ####################################################################
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/htmlize.css"/>
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/readtheorg.css"/>
#+HTML_HEAD: <link rel="stylesheet" href="../css/htmlize.min.css"/>
#+HTML_HEAD: <link rel="stylesheet" href="../css/style.css"/>
#+HTML_HEAD: <script src="../js/jquery.min.js"></script>
#+HTML_HEAD: <script src="../js/bootstrap.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/jquery.stickytableheaders.min.js"></script>
#+HTML_HEAD: <script type="text/javascript" src="../js/readtheorg.js"></script>
#+HTML_HEAD: <script src="../js/main.js"></script>

View File

@ -50,11 +50,12 @@ function create_theme_switcher() {
}
// set the css and button depending on the cookie found, dark is default
if (Cookies.get('theme') == 'dark') {
$('body').append('<div class="themeBtn"><i class="fas fa-sun"></i></div>');
} else {
if (Cookies.get('theme') == 'light') {
$('body').append('<div class="themeBtn"><i class="fas fa-moon"></i></div>');
$('link[href="./css/dark.css"]').attr('href', './css/light.css');
$('head').append('<link id="theme" rel="stylesheet" href="./css/light.css">');
} else {
$('body').append('<div class="themeBtn"><i class="fas fa-sun"></i></div>');
$('head').append('<link id="theme" rel="stylesheet" href="./css/dark.css">');
}
// switch CSS files and button icon, set new cookie