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
c1643db6
Commit
c1643db6
authored
Mar 10, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
better select functions and update split in update.page and update.view
parent
05352521
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
64 deletions
+63
-64
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+63
-64
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
c1643db6
...
@@ -45,7 +45,7 @@ function Page_Distrubion()
...
@@ -45,7 +45,7 @@ function Page_Distrubion()
tmp
.
package
=
p
tmp
.
package
=
p
$
(
'
#packages ul
'
).
append
(
'
<li id="package-
'
+
p
.
orig_name
+
'
"><a href="
'
+
Utils
.
from_data_to_hash
(
tmp
)
+
'
">
'
+
p
.
name
+
'
<span>
'
+
p
.
version
+
'
</span></a></li>
'
)
$
(
'
#packages ul
'
).
append
(
'
<li id="package-
'
+
p
.
orig_name
+
'
"><a href="
'
+
Utils
.
from_data_to_hash
(
tmp
)
+
'
">
'
+
p
.
name
+
'
<span>
'
+
p
.
version
+
'
</span></a></li>
'
)
})
})
select
(
data
)
select
()
},
},
clean
:
function
()
{
clean
:
function
()
{
...
@@ -60,10 +60,8 @@ function Page_Distrubion()
...
@@ -60,10 +60,8 @@ function Page_Distrubion()
socket
.
emit
(
"
get_distribution_packages
"
,
new_data
)
socket
.
emit
(
"
get_distribution_packages
"
,
new_data
)
}
}
},
},
select
:
function
(
data
)
{
select
:
function
()
{
packages
.
unselect
()
packages
.
unselect
()
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_package
(
data
))
{
if
(
Utils
.
check_data_package
(
data
))
{
$
(
"
#packages li[id='package-
"
+
data
.
package
.
orig_name
+
"
']
"
).
addClass
(
'
active
'
)
$
(
"
#packages li[id='package-
"
+
data
.
package
.
orig_name
+
"
']
"
).
addClass
(
'
active
'
)
}
}
...
@@ -125,10 +123,8 @@ function Page_Distrubion()
...
@@ -125,10 +123,8 @@ function Page_Distrubion()
socket
.
emit
(
"
get_package_files_list
"
,
new_data
)
socket
.
emit
(
"
get_package_files_list
"
,
new_data
)
}
}
},
},
select
:
function
(
data
)
{
select
:
function
()
{
files
.
unselect
()
files
.
unselect
()
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_file
(
data
))
{
if
(
Utils
.
check_data_file
(
data
))
{
$
(
"
#logs li[id='file-
"
+
data
.
file
.
orig_name
+
"
']
"
).
addClass
(
'
active
'
)
$
(
"
#logs li[id='file-
"
+
data
.
file
.
orig_name
+
"
']
"
).
addClass
(
'
active
'
)
}
}
...
@@ -203,15 +199,13 @@ function Page_Distrubion()
...
@@ -203,15 +199,13 @@ function Page_Distrubion()
// })
// })
}
}
var
select
=
function
(
data
)
{
var
select
=
function
()
{
unselect
()
unselect
()
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
if
(
Utils
.
check_data_distribution
(
data
))
{
if
(
Utils
.
check_data_distribution
(
data
))
{
$
(
"
#distributions li[id='distribution-
"
+
data
.
distribution
.
name
+
"
']
"
).
addClass
(
'
active
'
)
$
(
"
#distributions li[id='distribution-
"
+
data
.
distribution
.
name
+
"
']
"
).
addClass
(
'
active
'
)
}
}
packages
.
select
(
data
)
packages
.
select
()
files
.
select
(
data
)
files
.
select
()
}
}
var
unselect
=
function
()
{
var
unselect
=
function
()
{
...
@@ -229,7 +223,8 @@ function Page_Distrubion()
...
@@ -229,7 +223,8 @@ function Page_Distrubion()
breadcrumb
.
update
()
breadcrumb
.
update
()
}
}
var
update
=
function
(
data
,
old_data
)
{
var
update
=
{
page
:
function
(
data
,
old_data
)
{
if
(
!
old_data
)
{
if
(
!
old_data
)
{
if
(
!
data
)
if
(
!
data
)
populate
()
populate
()
...
@@ -244,6 +239,7 @@ function Page_Distrubion()
...
@@ -244,6 +239,7 @@ function Page_Distrubion()
{
{
clean
()
clean
()
populate
(
data
)
populate
(
data
)
return
}
}
else
if
(
else
if
(
!
Utils
.
check_data_package
(
old_data
)
||
!
Utils
.
check_data_package
(
old_data
)
||
...
@@ -266,9 +262,15 @@ function Page_Distrubion()
...
@@ -266,9 +262,15 @@ function Page_Distrubion()
{
{
file
.
get
()
file
.
get
()
}
}
update
.
view
(
data
)
}
},
view
:
function
(
data
)
{
if
(
!
data
)
data
=
Utils
.
from_hash_to_data
()
title
.
set
(
data
)
title
.
set
(
data
)
breadcrumb
.
update
()
breadcrumb
.
update
()
select
(
data
)
select
()
sticky
()
sticky
()
}
}
}
}
...
@@ -280,37 +282,34 @@ function Page_Distrubion()
...
@@ -280,37 +282,34 @@ function Page_Distrubion()
packages
.
get
(
data
)
packages
.
get
(
data
)
files
.
get
(
data
)
files
.
get
(
data
)
file
.
get
(
data
)
file
.
get
(
data
)
select
(
data
)
update
.
view
(
data
)
breadcrumb
.
update
()
title
.
set
(
data
)
sticky
()
}
}
this
.
init
=
function
(
mysocket
)
{
this
.
init
=
function
(
mysocket
)
{
socket
=
mysocket
socket
=
mysocket
socket
.
on
(
'
distribution_packages
'
,
function
(
data
){
socket
.
on
(
'
distribution_packages
'
,
function
(
socket_
data
){
packages
.
set
(
data
)
packages
.
set
(
socket_
data
)
})
})
socket
.
on
(
'
package_files_list
'
,
function
(
data
){
socket
.
on
(
'
package_files_list
'
,
function
(
socket_
data
){
files
.
set
(
data
)
files
.
set
(
socket_
data
)
})
})
socket
.
on
(
'
file
'
,
function
(
data
)
{
socket
.
on
(
'
file
'
,
function
(
socket_
data
)
{
file
.
set
(
data
)
file
.
set
(
socket_
data
)
})
})
socket
.
on
(
'
file_newcontent
'
,
function
(
data
)
{
socket
.
on
(
'
file_newcontent
'
,
function
(
socket_
data
)
{
file
.
append
(
data
)
file
.
append
(
socket_
data
)
})
})
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
$
(
window
).
on
(
'
hashchange
'
,
function
()
{
__check_hash_makes_sense
()
__check_hash_makes_sense
()
new_data
=
Utils
.
from_hash_to_data
()
var
old_data
=
data
update
(
new_data
,
data
)
data
=
Utils
.
from_hash_to_data
(
)
data
=
new_data
update
.
page
(
data
,
old_data
)
});
});
$
(
window
).
on
(
'
load
'
,
function
(){
$
(
window
).
on
(
'
load
'
,
function
(){
...
...
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