Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
debomatic-webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
debomatic-webui-admins
debomatic-webui
Commits
3f9a6b68
Commit
3f9a6b68
authored
Mar 14, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added web.ui preferences page - auto load user preferences on window.load
parent
3f4e6252
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
90 additions
and
8 deletions
+90
-8
debomatic-webui/public/javascripts/main.js
debomatic-webui/public/javascripts/main.js
+5
-1
debomatic-webui/public/javascripts/preferences.js
debomatic-webui/public/javascripts/preferences.js
+45
-5
debomatic-webui/public/stylesheets/style.css
debomatic-webui/public/stylesheets/style.css
+14
-0
debomatic-webui/views/preferences.ejs
debomatic-webui/views/preferences.ejs
+26
-2
No files found.
debomatic-webui/public/javascripts/main.js
View file @
3f9a6b68
var
socket
=
io
.
connect
(
'
//
'
+
config
.
hostname
);
new
Preferences
()
var
preferences
=
new
Preferences
()
new
Page_Generic
().
init
(
socket
)
if
(
window
.
location
.
pathname
==
config
.
paths
.
distribution
)
{
new
Page_Distrubion
(
socket
).
start
()
}
else
if
(
window
.
location
.
pathname
==
config
.
paths
.
preferences
)
{
preferences
.
initPage
()
}
\ No newline at end of file
debomatic-webui/public/javascripts/preferences.js
View file @
3f9a6b68
function
Preferences
()
{
// update config.preferences according with user choices
this
.
load
=
function
()
{
for
(
setting
in
config
.
preferences
)
{
if
((
value
=
localStorage
.
getItem
(
setting
)))
{
config
.
preferences
[
setting
]
=
JSON
.
parse
(
value
)
var
load
=
function
()
{
for
(
key
in
config
.
preferences
)
{
if
((
value
=
localStorage
.
getItem
(
key
)))
{
debug
(
2
,
'
loading preference
'
,
key
,
value
)
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
)
}
}
}
this
.
load
()
// set prefence
var
set
=
function
(
key
,
value
)
{
if
(
config
.
preferences
.
hasOwnProperty
(
key
))
{
debug
(
1
,
'
setting preference
'
,
key
,
value
)
localStorage
.
setItem
(
key
,
value
)
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
)
}
}
// init prefence page
this
.
initPage
=
function
()
{
$
(
window
).
on
(
'
load
'
,
function
()
{
// set view according with config.preferences
for
(
key
in
config
.
preferences
)
{
var
element
=
$
(
"
#preferences #
"
+
key
)
if
(
element
.
attr
(
'
type
'
)
==
"
checkbox
"
)
{
element
.
prop
(
'
checked
'
,
config
.
preferences
[
key
])
}
else
{
element
.
val
(
config
.
preferences
[
key
])
}
}
// on input change, set prefence
$
(
"
#preferences input, #preferences select
"
).
change
(
function
()
{
var
key
=
$
(
this
).
attr
(
'
id
'
)
var
value
=
$
(
this
).
val
()
if
(
$
(
this
).
attr
(
'
type
'
)
==
'
checkbox
'
)
value
=
$
(
this
).
is
(
'
:checked
'
)
set
(
key
,
value
)
})
})
}
load
()
}
\ No newline at end of file
debomatic-webui/public/stylesheets/style.css
View file @
3f9a6b68
...
...
@@ -89,3 +89,17 @@ footer {
right
:
5px
;
}
#preferences
{
font-size
:
15px
;
}
#preferences
.debug
#debug
{
width
:
58px
;
float
:
left
;
margin-right
:
10px
;
}
#preferences
.debug
label
{
font-weight
:
normal
;
padding-top
:
6px
;
}
\ No newline at end of file
debomatic-webui/views/preferences.ejs
View file @
3f9a6b68
<div class="panel panel-primary">
<div
id="preferences"
class="panel panel-primary">
<div class="panel-heading">
<h3 class="panel-title">Preferences</h3>
</div>
<div class="panel-body">
Panel content
<div class="checkbox">
<label>
<input id="header" type="checkbox"> Show header
</label>
</div>
<div class="checkbox">
<label>
<input id="sidebar" type="checkbox"> Show sidebar
</label>
</div>
<div class="checkbox">
<label>
<input id="autoscroll" type="checkbox"> Enable autoscroll
</label>
</div>
<div class="debug">
<select id="debug" class="form-control">
<option>0</option>
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
<label for="debug">Set debug level</label>
</div>
</div>
</div>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment