Commit 30bd8870 authored by Leo Iannacone's avatar Leo Iannacone

do not use bootstrap-theme.css - made usable via preferences

parent a1260436
...@@ -30,6 +30,7 @@ config.web.preferences = {} ...@@ -30,6 +30,7 @@ config.web.preferences = {}
config.web.preferences.autoscroll = true config.web.preferences.autoscroll = true
config.web.preferences.header = true config.web.preferences.header = true
config.web.preferences.sidebar = true config.web.preferences.sidebar = true
config.web.preferences.glossy_theme = false
config.web.preferences.file_background = true config.web.preferences.file_background = true
config.web.preferences.file_fontsize = 13 // valid values are [13..16] config.web.preferences.file_fontsize = 13 // valid values are [13..16]
config.web.preferences.debug = 0 // debug level - 0 means disabled config.web.preferences.debug = 0 // debug level - 0 means disabled
......
...@@ -88,7 +88,7 @@ function Page_Generic(socket) ...@@ -88,7 +88,7 @@ function Page_Generic(socket)
}, },
} }
this.header = function() { this.preferences = function() {
if (config.preferences.header) { if (config.preferences.header) {
$("#pageheader").show() $("#pageheader").show()
$(".navbar .home-link").hide() $(".navbar .home-link").hide()
...@@ -97,6 +97,13 @@ function Page_Generic(socket) ...@@ -97,6 +97,13 @@ function Page_Generic(socket)
$("#pageheader").hide() $("#pageheader").hide()
$(".navbar .home-link").show() $(".navbar .home-link").show()
} }
if (config.preferences.glossy_theme) {
$("head").append('<link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css">')
}
else {
$("head").find("link[href='/external_libs/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css']").remove()
}
} }
// update distributions // update distributions
...@@ -124,6 +131,7 @@ function Page_Generic(socket) ...@@ -124,6 +131,7 @@ function Page_Generic(socket)
$(".navbar li a[href='" + window.location.pathname + "']").parent().addClass("active") $(".navbar li a[href='" + window.location.pathname + "']").parent().addClass("active")
} }
this.header() // update html according with preferences
this.preferences()
} }
...@@ -40,10 +40,8 @@ function Preferences() { ...@@ -40,10 +40,8 @@ function Preferences() {
if ($(this).attr('type') == 'checkbox') if ($(this).attr('type') == 'checkbox')
value = $(this).is(':checked') value = $(this).is(':checked')
set(key,value) set(key,value)
// give to user an immediate feedback on show header // give to user an immediate feedback changing preferences
if (key == "header") { page_generic.preferences()
page_generic.header()
}
}) })
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<title><%= web.title %></title> <title><%= web.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap.min.css"> <link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="/external_libs/bootstrap-3.1.1-dist/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/stylesheets/style.css"> <link rel="stylesheet" href="/stylesheets/style.css">
</head> </head>
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
<dt>Enable sidebar</dt><dd>Enable sidebar in <a href="<%= web.paths.distribution %>">distribution</a> page.</dd> <dt>Enable sidebar</dt><dd>Enable sidebar in <a href="<%= web.paths.distribution %>">distribution</a> page.</dd>
<dt>Glossy theme</dt><dd>Use a little glossy theme for the interface.</dd>
<dt>Enable autoscroll</dt><dd>Enable scroll down page automatically when viewing a file and a new line is received.</dd> <dt>Enable autoscroll</dt><dd>Enable scroll down page automatically when viewing a file and a new line is received.</dd>
<dt>File background</dt><dd>Remove file background if it makes you uncomfortable while reading a log.</dd> <dt>File background</dt><dd>Remove file background if it makes you uncomfortable while reading a log.</dd>
...@@ -47,6 +49,11 @@ ...@@ -47,6 +49,11 @@
<input id="sidebar" type="checkbox"> Enable sidebar <input id="sidebar" type="checkbox"> Enable sidebar
</label> </label>
</div> </div>
<div class="checkbox">
<label>
<input id="glossy_theme" type="checkbox"> Use a glossy theme
</label>
</div>
<div class="checkbox"> <div class="checkbox">
<label> <label>
<input id="autoscroll" type="checkbox"> Enable autoscroll <input id="autoscroll" type="checkbox"> Enable autoscroll
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment