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 = {}
config.web.preferences.autoscroll = true
config.web.preferences.header = true
config.web.preferences.sidebar = true
config.web.preferences.glossy_theme = false
config.web.preferences.file_background = true
config.web.preferences.file_fontsize = 13 // valid values are [13..16]
config.web.preferences.debug = 0 // debug level - 0 means disabled
......
......@@ -88,7 +88,7 @@ function Page_Generic(socket)
},
}
this.header = function() {
this.preferences = function() {
if (config.preferences.header) {
$("#pageheader").show()
$(".navbar .home-link").hide()
......@@ -97,6 +97,13 @@ function Page_Generic(socket)
$("#pageheader").hide()
$(".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
......@@ -124,6 +131,7 @@ function Page_Generic(socket)
$(".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() {
if ($(this).attr('type') == 'checkbox')
value = $(this).is(':checked')
set(key,value)
// give to user an immediate feedback on show header
if (key == "header") {
page_generic.header()
}
// give to user an immediate feedback changing preferences
page_generic.preferences()
})
}
......
......@@ -4,7 +4,6 @@
<title><%= web.title %></title>
<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-theme.min.css">
<link rel="stylesheet" href="/stylesheets/style.css">
</head>
......
......@@ -18,6 +18,8 @@
<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>File background</dt><dd>Remove file background if it makes you uncomfortable while reading a log.</dd>
......@@ -47,6 +49,11 @@
<input id="sidebar" type="checkbox"> Enable sidebar
</label>
</div>
<div class="checkbox">
<label>
<input id="glossy_theme" type="checkbox"> Use a glossy theme
</label>
</div>
<div class="checkbox">
<label>
<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