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
c0c918ec
Commit
c0c918ec
authored
Jun 04, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jslint client code
parent
08e14f2f
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
912 additions
and
926 deletions
+912
-926
debomatic-webui/public/javascripts/debug.js
debomatic-webui/public/javascripts/debug.js
+21
-20
debomatic-webui/public/javascripts/main.js
debomatic-webui/public/javascripts/main.js
+20
-19
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+563
-577
debomatic-webui/public/javascripts/page_generic.js
debomatic-webui/public/javascripts/page_generic.js
+168
-171
debomatic-webui/public/javascripts/preferences.js
debomatic-webui/public/javascripts/preferences.js
+52
-50
debomatic-webui/public/javascripts/utils.js
debomatic-webui/public/javascripts/utils.js
+88
-89
No files found.
debomatic-webui/public/javascripts/debug.js
View file @
c0c918ec
"
use strict
"
;
/*
/*
General information about debugging:
General information about debugging:
...
@@ -10,18 +11,18 @@
...
@@ -10,18 +11,18 @@
3 - socket emit data
3 - socket emit data
4 - socket received data
4 - socket received data
*/
*/
var
debug
=
function
()
{
var
debug
=
function
()
{
if
(
arguments
.
length
<
2
)
{
if
(
arguments
.
length
<
2
)
{
return
return
;
}
}
var
level
=
arguments
[
0
]
var
level
=
arguments
[
0
];
arguments
[
0
]
=
"
debug [
"
+
level
+
"
]:
"
arguments
[
0
]
=
"
debug [
"
+
level
+
"
]:
"
;
if
(
level
<=
config
.
preferences
.
debug
)
{
if
(
level
<=
config
.
preferences
.
debug
)
{
if
(
console
.
debug
)
if
(
console
.
debug
)
console
.
debug
.
apply
(
console
,
arguments
)
console
.
debug
.
apply
(
console
,
arguments
);
else
else
console
.
log
.
apply
(
console
,
arguments
)
console
.
log
.
apply
(
console
,
arguments
);
}
}
}
}
/*
/*
...
@@ -30,11 +31,11 @@ var debug = function() {
...
@@ -30,11 +31,11 @@ var debug = function() {
usage: debug_socket("emit"|"received", event_name, data)
usage: debug_socket("emit"|"received", event_name, data)
*/
*/
var
debug_socket
=
function
()
{
var
debug_socket
=
function
()
{
if
(
arguments
.
length
!=
3
)
if
(
arguments
.
length
!=
3
)
return
return
;
var
level
=
3
;
var
level
=
3
;
if
(
arguments
[
0
]
==
"
received
"
)
if
(
arguments
[
0
]
==
"
received
"
)
level
=
4
level
=
4
;
debug
(
level
,
"
socket
"
,
arguments
[
0
],
"
event:
"
,
arguments
[
1
],
"
data:
"
,
arguments
[
2
])
debug
(
level
,
"
socket
"
,
arguments
[
0
],
"
event:
"
,
arguments
[
1
],
"
data:
"
,
arguments
[
2
]);
}
}
\ No newline at end of file
debomatic-webui/public/javascripts/main.js
View file @
c0c918ec
// main client javascript
// main client javascript
'
use strict
'
;
var
preferences
=
new
Preferences
()
var
preferences
=
new
Preferences
()
;
var
page_generic
=
new
Page_Generic
()
var
page_generic
=
new
Page_Generic
()
;
if
(
window
.
location
.
pathname
==
config
.
paths
.
preferences
)
{
if
(
window
.
location
.
pathname
==
config
.
paths
.
preferences
)
{
preferences
.
initPage
()
preferences
.
initPage
();
}
}
if
(
window
.
location
.
pathname
==
'
/
'
)
{
if
(
window
.
location
.
pathname
==
'
/
'
)
{
// convert email addresses in the right format
// convert email addresses in the right format
var
emails
=
$
(
"
.email
"
)
var
emails
=
$
(
'
.email
'
);
$
.
each
(
emails
,
function
()
{
$
.
each
(
emails
,
function
()
{
var
subject
=
''
var
subject
=
''
;
if
(
$
(
this
).
attr
(
'
subject
'
))
{
if
(
$
(
this
).
attr
(
'
subject
'
))
{
subject
=
'
?subject=
'
+
$
(
this
).
attr
(
'
subject
'
)
subject
=
'
?subject=
'
+
$
(
this
).
attr
(
'
subject
'
);
}
}
var
real_email
=
$
(
this
).
attr
(
'
address
'
).
replace
(
'
AT
'
,
'
@
'
).
replace
(
'
DOT
'
,
'
.
'
).
replace
(
/ /g
,
''
)
var
real_email
=
$
(
this
).
attr
(
'
address
'
).
replace
(
'
AT
'
,
'
@
'
).
replace
(
'
DOT
'
,
'
.
'
).
replace
(
/ /g
,
''
);
var
label
=
real_email
var
label
=
real_email
;
if
(
config
.
debomatic
.
admin
.
name
&&
config
.
debomatic
.
admin
.
name
!=
'
Your Name
'
)
if
(
config
.
debomatic
.
admin
.
name
&&
config
.
debomatic
.
admin
.
name
!=
'
Your Name
'
);
label
=
config
.
debomatic
.
admin
.
name
label
=
config
.
debomatic
.
admin
.
name
;
real_email
=
'
<a href="mailto:
'
+
real_email
+
subject
+
'
">
'
+
label
+
'
</a>
'
real_email
=
'
<a href="mailto:
'
+
real_email
+
subject
+
'
">
'
+
label
+
'
</a>
'
;
$
(
this
).
html
(
real_email
)
$
(
this
).
html
(
real_email
);
})
})
}
}
var
socket
=
io
.
connect
(
'
/
'
);
var
socket
=
io
.
connect
(
'
/
'
);
page_generic
.
start
(
socket
)
page_generic
.
start
(
socket
)
;
if
(
window
.
location
.
pathname
==
config
.
paths
.
distribution
)
{
if
(
window
.
location
.
pathname
==
config
.
paths
.
distribution
)
{
new
Page_Distrubion
(
socket
).
start
()
new
Page_Distrubion
(
socket
).
start
();
}
}
debomatic-webui/public/javascripts/page_distribution.js
View file @
c0c918ec
This diff is collapsed.
Click to expand it.
debomatic-webui/public/javascripts/page_generic.js
View file @
c0c918ec
This diff is collapsed.
Click to expand it.
debomatic-webui/public/javascripts/preferences.js
View file @
c0c918ec
'
use strict
'
;
function
Preferences
()
{
function
Preferences
()
{
// update config.preferences according with user choices
// update config.preferences according with user choices
var
load
=
function
()
{
var
load
=
function
()
{
for
(
key
in
config
.
preferences
)
{
for
(
var
key
in
config
.
preferences
)
{
if
((
value
=
localStorage
.
getItem
(
key
)))
{
var
value
=
localStorage
.
getItem
(
key
);
debug
(
2
,
'
loading preference
'
,
key
,
value
)
if
(
value
)
{
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
)
debug
(
2
,
'
loading preference
'
,
key
,
value
);
}
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
);
}
}
}
}
};
// set prefence
var
set
=
function
(
key
,
value
)
{
// set prefence
if
(
config
.
preferences
.
hasOwnProperty
(
key
))
{
var
set
=
function
(
key
,
value
)
{
debug
(
1
,
'
setting preference
'
,
key
,
value
)
if
(
config
.
preferences
.
hasOwnProperty
(
key
))
{
localStorage
.
setItem
(
key
,
value
)
debug
(
1
,
'
setting preference
'
,
key
,
value
);
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
)
localStorage
.
setItem
(
key
,
value
);
}
config
.
preferences
[
key
]
=
JSON
.
parse
(
value
);
}
}
};
// init prefence page
this
.
initPage
=
function
()
{
// init prefence page
this
.
initPage
=
function
()
{
page_generic
.
set_window_title
(
"
Preferences
"
)
page_generic
.
set_window_title
(
'
Preferences
'
);
// set view according with config.preferences
for
(
key
in
config
.
preferences
)
{
// set view according with config.preferences
var
element
=
$
(
"
#preferences #
"
+
key
)
for
(
var
key
in
config
.
preferences
)
{
if
(
element
.
attr
(
'
type
'
)
==
"
checkbox
"
)
{
var
element
=
$
(
'
#preferences #
'
+
key
);
element
.
prop
(
'
checked
'
,
config
.
preferences
[
key
])
if
(
element
.
attr
(
'
type
'
)
==
'
checkbox
'
)
{
}
element
.
prop
(
'
checked
'
,
config
.
preferences
[
key
]);
else
{
}
else
{
element
.
val
(
config
.
preferences
[
key
])
element
.
val
(
config
.
preferences
[
key
]);
}
}
}
}
// on input change, set prefence
// on input change, set prefence
$
(
"
#preferences input, #preferences select
"
).
change
(
function
()
{
$
(
'
#preferences input, #preferences select
'
).
change
(
function
()
{
var
key
=
$
(
this
).
attr
(
'
id
'
)
var
key
=
$
(
this
).
attr
(
'
id
'
);
var
value
=
$
(
this
).
val
()
var
value
=
$
(
this
).
val
();
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 changing preferences
// give to user an immediate feedback changing preferences
page_generic
.
preferences
()
page_generic
.
preferences
();
})
});
}
};
load
()
load
();
}
}
\ No newline at end of file
debomatic-webui/public/javascripts/utils.js
View file @
c0c918ec
'
use strict
'
;
var
Utils
=
{
var
Utils
=
{
from_hash_to_view
:
function
(
hash
)
{
from_hash_to_view
:
function
(
hash
)
{
if
(
!
hash
)
if
(
!
hash
)
hash
=
window
.
location
.
hash
hash
=
window
.
location
.
hash
;
hash
=
hash
.
replace
(
'
#
'
,
''
)
hash
=
hash
.
replace
(
'
#
'
,
''
);
info
=
hash
.
split
(
'
/
'
);
var
info
=
hash
.
split
(
'
/
'
);
var
view
=
{}
var
view
=
{};
view
.
distribution
=
{}
view
.
distribution
=
{};
view
.
packages
=
{}
view
.
packages
=
{};
view
.
package
=
{}
view
.
package
=
{};
view
.
file
=
{}
view
.
file
=
{};
if
(
info
.
length
>=
1
)
{
if
(
info
.
length
>=
1
)
{
view
.
distribution
.
name
=
info
[
0
];
view
.
distribution
.
name
=
info
[
0
];
}
}
if
(
info
.
length
>=
3
){
if
(
info
.
length
>=
3
)
{
view
.
package
.
name
=
info
[
1
];
view
.
package
.
name
=
info
[
1
];
view
.
package
.
version
=
info
[
2
];
view
.
package
.
version
=
info
[
2
];
view
.
package
.
orig_name
=
view
.
package
.
name
+
'
_
'
+
view
.
package
.
version
view
.
package
.
orig_name
=
view
.
package
.
name
+
'
_
'
+
view
.
package
.
version
;
}
}
if
(
info
.
length
>=
4
)
{
if
(
info
.
length
>=
4
)
{
view
.
file
.
name
=
info
[
3
]
view
.
file
.
name
=
info
[
3
];
view
.
file
.
orig_name
=
view
.
package
.
orig_name
+
'
.
'
+
view
.
file
.
name
view
.
file
.
orig_name
=
view
.
package
.
orig_name
+
'
.
'
+
view
.
file
.
name
;
}
}
return
view
return
view
;
},
},
from_view_to_hash
:
function
(
view
)
{
hash
=
"
#
"
if
(
Utils
.
check_view_distribution
(
view
))
{
hash
=
hash
+
view
.
distribution
.
name
if
(
Utils
.
check_view_package
(
view
))
{
hash
=
hash
+
'
/
'
+
view
.
package
.
name
+
"
/
"
+
view
.
package
.
version
if
(
Utils
.
check_view_file
(
view
))
hash
=
hash
+
'
/
'
+
view
.
file
.
name
}
}
return
hash
},
check_view_distribution
:
function
(
view
)
{
return
view
&&
view
.
distribution
&&
view
.
distribution
.
name
},
check_view_package
:
function
(
view
)
{
return
Utils
.
check_view_distribution
(
view
)
&&
view
.
package
&&
view
.
package
.
name
&&
view
.
package
.
version
&&
view
.
package
.
orig_name
},
check_view_file
:
function
(
view
)
{
return
Utils
.
check_view_package
(
view
)
&&
view
.
file
&&
view
.
file
.
name
},
get_status_icon_and_class
:
function
(
status_data
)
{
from_view_to_hash
:
function
(
view
)
{
var
_c
=
config
.
status
.
className
var
hash
=
'
#
'
;
var
_i
=
config
.
status
.
icons
if
(
Utils
.
check_view_distribution
(
view
))
{
var
_s
=
status_data
hash
=
hash
+
view
.
distribution
.
name
;
var
className
=
null
if
(
Utils
.
check_view_package
(
view
))
{
var
icon
=
null
hash
=
hash
+
'
/
'
+
view
.
package
.
name
+
'
/
'
+
view
.
package
.
version
;
if
(
_s
.
hasOwnProperty
(
'
success
'
))
{
if
(
Utils
.
check_view_file
(
view
))
if
(
_s
.
success
==
true
)
{
hash
=
hash
+
'
/
'
+
view
.
file
.
name
;
className
=
_c
.
success
}
icon
=
_i
.
success
}
}
return
hash
;
else
{
},
className
=
_c
.
fail
icon
=
_i
.
fail
}
}
else
{
className
=
_c
[
_s
.
status
]
icon
=
_i
[
_s
.
status
]
}
// do not change color if update or create and successed
check_view_distribution
:
function
(
view
)
{
if
(
_s
.
success
==
true
&&
return
view
&&
view
.
distribution
&&
view
.
distribution
.
name
;
_s
.
status
!=
config
.
status
.
build
)
},
{
className
=
_c
[
_s
.
status
]
}
return
{
check_view_package
:
function
(
view
)
{
className
:
className
,
return
Utils
.
check_view_distribution
(
view
)
&&
view
.
package
&&
view
.
package
.
name
&&
view
.
package
.
version
&&
view
.
package
.
orig_name
;
icon
:
icon
},
}
},
check_view_file
:
function
(
view
)
{
return
Utils
.
check_view_package
(
view
)
&&
view
.
file
&&
view
.
file
.
name
;
},
get_status_icon_and_class
:
function
(
status_data
)
{
var
_c
=
config
.
status
.
className
;
var
_i
=
config
.
status
.
icons
;
var
_s
=
status_data
;
var
className
=
null
;
var
icon
=
null
;
if
(
_s
.
hasOwnProperty
(
'
success
'
))
{
if
(
_s
.
success
===
true
)
{
className
=
_c
.
success
;
icon
=
_i
.
success
;
}
else
{
className
=
_c
.
fail
;
icon
=
_i
.
fail
;
}
}
else
{
className
=
_c
[
_s
.
status
];
icon
=
_i
[
_s
.
status
];
}
get_status_icon_html
:
function
(
status_data
)
{
// do not change color if update or create and successed
info
=
Utils
.
get_status_icon_and_class
(
status_data
)
if
(
_s
.
success
===
true
&&
return
'
<span class="icon glyphicon glyphicon-
'
+
info
.
icon
+
'
"></span>
'
_s
.
status
!=
config
.
status
.
build
)
{
},
className
=
_c
[
_s
.
status
];
}
// clone an object via JSON
return
{
clone
:
function
(
object
)
{
className
:
className
,
return
JSON
.
parse
(
JSON
.
stringify
(
object
));
icon
:
icon
}
};
}
},
get_status_icon_html
:
function
(
status_data
)
{
var
info
=
Utils
.
get_status_icon_and_class
(
status_data
);
return
'
<span class="icon glyphicon glyphicon-
'
+
info
.
icon
+
'
"></span>
'
;
},
// clone an object via JSON
clone
:
function
(
object
)
{
return
JSON
.
parse
(
JSON
.
stringify
(
object
));
}
};
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