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
05352521
Commit
05352521
authored
Mar 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use var on declaration to prevent uncontrolled beahaviour
parent
697053ac
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+15
-15
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
05352521
...
@@ -6,7 +6,7 @@ function Page_Distrubion()
...
@@ -6,7 +6,7 @@ function Page_Distrubion()
function
__check_hash_makes_sense
()
{
function
__check_hash_makes_sense
()
{
if
(
!
window
.
location
.
hash
)
if
(
!
window
.
location
.
hash
)
window
.
location
.
pathname
=
'
/
'
window
.
location
.
pathname
=
'
/
'
info
=
window
.
location
.
hash
.
split
(
'
/
'
)
var
info
=
window
.
location
.
hash
.
split
(
'
/
'
)
if
(
info
.
length
==
2
)
if
(
info
.
length
==
2
)
window
.
location
.
hash
=
info
[
0
]
window
.
location
.
hash
=
info
[
0
]
}
}
...
@@ -15,9 +15,9 @@ function Page_Distrubion()
...
@@ -15,9 +15,9 @@ function Page_Distrubion()
set
:
function
(
data
)
{
set
:
function
(
data
)
{
if
(
!
data
)
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
data
=
Utils
.
from_hash_to_data
()
label
=
''
var
label
=
''
if
(
Utils
.
check_data_file
(
data
))
{
if
(
Utils
.
check_data_file
(
data
))
{
complete_name
=
data
.
package
.
orig_name
+
'
.
'
+
data
.
file
.
name
var
complete_name
=
data
.
package
.
orig_name
+
'
.
'
+
data
.
file
.
name
if
(
!
data
.
file
.
path
)
if
(
!
data
.
file
.
path
)
data
.
file
.
path
=
PATHS
.
debomatic
+
'
/
'
+
data
.
distribution
.
name
+
'
/pool/
'
+
data
.
package
.
orig_name
+
'
/
'
+
complete_name
data
.
file
.
path
=
PATHS
.
debomatic
+
'
/
'
+
data
.
distribution
.
name
+
'
/pool/
'
+
data
.
package
.
orig_name
+
'
/
'
+
complete_name
label
=
complete_name
+
'
\
label
=
complete_name
+
'
\
...
@@ -39,7 +39,7 @@ function Page_Distrubion()
...
@@ -39,7 +39,7 @@ function Page_Distrubion()
var
packages
=
{
var
packages
=
{
set
:
function
(
data
)
{
set
:
function
(
data
)
{
$
(
'
#packages ul
'
).
html
(
''
)
$
(
'
#packages ul
'
).
html
(
''
)
tmp
=
data
var
tmp
=
data
tmp
.
file
=
null
tmp
.
file
=
null
data
.
distribution
.
packages
.
forEach
(
function
(
p
){
data
.
distribution
.
packages
.
forEach
(
function
(
p
){
tmp
.
package
=
p
tmp
.
package
=
p
...
@@ -55,7 +55,7 @@ function Page_Distrubion()
...
@@ -55,7 +55,7 @@ function Page_Distrubion()
if
(
!
data
)
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_distribution
(
data
))
{
if
(
Utils
.
check_data_distribution
(
data
))
{
new_data
=
{}
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
distribution
=
data
.
distribution
socket
.
emit
(
"
get_distribution_packages
"
,
new_data
)
socket
.
emit
(
"
get_distribution_packages
"
,
new_data
)
}
}
...
@@ -76,16 +76,16 @@ function Page_Distrubion()
...
@@ -76,16 +76,16 @@ function Page_Distrubion()
var
files
=
{
var
files
=
{
set
:
function
(
data
)
{
set
:
function
(
data
)
{
files
.
clean
()
files
.
clean
()
tmp
=
data
var
tmp
=
data
if
(
data
.
package
.
files
&&
data
.
package
.
files
.
length
>
0
)
{
if
(
data
.
package
.
files
&&
data
.
package
.
files
.
length
>
0
)
{
selected_file
=
Utils
.
check_data_file
(
data
)
selected_file
=
Utils
.
check_data_file
(
data
)
data
.
package
.
files
.
forEach
(
function
(
f
){
data
.
package
.
files
.
forEach
(
function
(
f
){
tmp
.
file
=
f
tmp
.
file
=
f
current
_file
=
$
(
'
<li id="file-
'
+
f
.
orig_name
+
'
"><a title="
'
+
f
.
orig_name
+
'
" href="
'
+
Utils
.
from_data_to_hash
(
tmp
)
+
'
">
'
+
f
.
name
+
'
</a></li>
'
)
var
html
_file
=
$
(
'
<li id="file-
'
+
f
.
orig_name
+
'
"><a title="
'
+
f
.
orig_name
+
'
" href="
'
+
Utils
.
from_data_to_hash
(
tmp
)
+
'
">
'
+
f
.
name
+
'
</a></li>
'
)
current
_file
.
on
(
"
click
"
,
function
(){
html
_file
.
on
(
"
click
"
,
function
(){
files
.
select
(
this
)
files
.
select
(
this
)
})
})
$
(
'
#logs ul
'
).
append
(
file
)
$
(
'
#logs ul
'
).
append
(
html_
file
)
})
})
$
(
'
#logs
'
).
show
()
$
(
'
#logs
'
).
show
()
select
()
select
()
...
@@ -119,7 +119,7 @@ function Page_Distrubion()
...
@@ -119,7 +119,7 @@ function Page_Distrubion()
if
(
!
data
)
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_package
(
data
))
{
if
(
Utils
.
check_data_package
(
data
))
{
new_data
=
{}
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
distribution
=
data
.
distribution
new_data
.
package
=
data
.
package
new_data
.
package
=
data
.
package
socket
.
emit
(
"
get_package_files_list
"
,
new_data
)
socket
.
emit
(
"
get_package_files_list
"
,
new_data
)
...
@@ -149,7 +149,7 @@ function Page_Distrubion()
...
@@ -149,7 +149,7 @@ function Page_Distrubion()
$
(
'
#file
'
).
hide
()
$
(
'
#file
'
).
hide
()
},
},
append
:
function
(
data
)
{
append
:
function
(
data
)
{
new_html
=
$
(
"
#file pre
"
).
html
()
+
data
.
file
.
new_content
var
new_html
=
$
(
"
#file pre
"
).
html
()
+
data
.
file
.
new_content
$
(
"
#file pre
"
).
html
(
new_html
)
$
(
"
#file pre
"
).
html
(
new_html
)
if
(
AUTOSCROLL
)
// scroll down
if
(
AUTOSCROLL
)
// scroll down
...
@@ -159,7 +159,7 @@ function Page_Distrubion()
...
@@ -159,7 +159,7 @@ function Page_Distrubion()
if
(
!
data
)
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_file
(
data
))
{
if
(
Utils
.
check_data_file
(
data
))
{
new_data
=
{}
var
new_data
=
{}
new_data
.
distribution
=
data
.
distribution
new_data
.
distribution
=
data
.
distribution
new_data
.
package
=
data
.
package
new_data
.
package
=
data
.
package
new_data
.
file
=
data
.
file
new_data
.
file
=
data
.
file
...
@@ -174,9 +174,9 @@ function Page_Distrubion()
...
@@ -174,9 +174,9 @@ function Page_Distrubion()
if
(
!
hash
)
if
(
!
hash
)
hash
=
window
.
location
.
hash
hash
=
window
.
location
.
hash
hash
=
hash
.
replace
(
'
#
'
,
''
)
hash
=
hash
.
replace
(
'
#
'
,
''
)
new_html
=
'
<li><a href="/">home</a></li>
'
var
new_html
=
'
<li><a href="/">home</a></li>
'
new_hash
=
'
#
'
var
new_hash
=
'
#
'
info
=
hash
.
split
(
'
/
'
)
var
info
=
hash
.
split
(
'
/
'
)
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
info
.
length
;
i
++
)
{
new_hash
+=
info
[
i
]
new_hash
+=
info
[
i
]
if
(
i
==
(
info
.
length
-
1
))
if
(
i
==
(
info
.
length
-
1
))
...
...
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