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
ad5866e1
Commit
ad5866e1
authored
Jun 12, 2014
by
Leo Iannacone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show only num_lines when file is in preview - also when receive new data
parent
4c36d7fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
2 deletions
+15
-2
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+15
-2
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
ad5866e1
'
use strict
'
;
'
use strict
'
;
/* global debug: false */
/* global page_generic: false */
// function to get all files in on click
// function to get all files in on click
// event comes from HTML
// event comes from HTML
function
download_all
(
div_id
)
{
function
download_all
(
div_id
)
{
...
@@ -66,6 +69,7 @@ function Page_Distrubion(socket) {
...
@@ -66,6 +69,7 @@ function Page_Distrubion(socket) {
var
view
=
Utils
.
from_hash_to_view
();
var
view
=
Utils
.
from_hash_to_view
();
var
sidebarOffset
=
0
;
var
sidebarOffset
=
0
;
var
new_lines
=
[];
var
new_lines
=
[];
var
current_file_in_preview
=
false
;
function
__check_hash_makes_sense
()
{
function
__check_hash_makes_sense
()
{
if
(
window
.
location
.
hash
.
indexOf
(
'
..
'
)
>=
0
)
{
if
(
window
.
location
.
hash
.
indexOf
(
'
..
'
)
>=
0
)
{
...
@@ -100,6 +104,7 @@ function Page_Distrubion(socket) {
...
@@ -100,6 +104,7 @@ function Page_Distrubion(socket) {
label
+=
'
<a class="btn btn-link btn-lg" title="Download" href="
'
+
view
.
file
.
path
+
'
">
'
+
label
+=
'
<a class="btn btn-link btn-lg" title="Download" href="
'
+
view
.
file
.
path
+
'
">
'
+
'
<span class="glyphicon glyphicon-download-alt"></span></a>
'
;
'
<span class="glyphicon glyphicon-download-alt"></span></a>
'
;
if
(
config
.
file
.
preview
.
indexOf
(
view
.
file
.
name
)
>=
0
)
{
if
(
config
.
file
.
preview
.
indexOf
(
view
.
file
.
name
)
>=
0
)
{
current_file_in_preview
=
true
;
var
view_all
=
$
(
'
<a id="get-whole-file" class="btn btn-link btn-lg" title="View the whole file"></a>
'
);
var
view_all
=
$
(
'
<a id="get-whole-file" class="btn btn-link btn-lg" title="View the whole file"></a>
'
);
view_all
.
html
(
'
<span class="glyphicon glyphicon-eye-open"></span>
'
);
view_all
.
html
(
'
<span class="glyphicon glyphicon-eye-open"></span>
'
);
label
+=
view_all
.
get
(
0
).
outerHTML
;
label
+=
view_all
.
get
(
0
).
outerHTML
;
...
@@ -230,7 +235,7 @@ function Page_Distrubion(socket) {
...
@@ -230,7 +235,7 @@ function Page_Distrubion(socket) {
// update html
// update html
socket_data
.
package
.
sources
.
forEach
(
function
(
f
)
{
socket_data
.
package
.
sources
.
forEach
(
function
(
f
)
{
$
(
'
#sources ul
'
).
append
(
'
<li><a title="
'
+
f
.
orig_name
+
'
" href="
'
+
f
.
path
+
'
">
'
+
f
.
name
+
'
</a></li>
'
);
$
(
'
#sources ul
'
).
append
(
'
<li><a title="
'
+
f
.
orig_name
+
'
" href="
'
+
f
.
path
+
'
">
'
+
f
.
name
+
'
</a></li>
'
);
})
})
;
$
(
'
#sources
'
).
show
();
$
(
'
#sources
'
).
show
();
}
}
files
.
show
();
files
.
show
();
...
@@ -284,7 +289,15 @@ function Page_Distrubion(socket) {
...
@@ -284,7 +289,15 @@ function Page_Distrubion(socket) {
},
},
append
:
function
(
new_content
)
{
append
:
function
(
new_content
)
{
var
content
=
$
(
'
#file pre
'
);
var
content
=
$
(
'
#file pre
'
);
content
.
append
(
new_content
);
if
(
!
current_file_in_preview
)
{
content
.
append
(
new_content
);
}
else
{
// always show only config.file.num_lines lines in preview
content
=
content
.
html
().
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
);
content
=
content
.
concat
(
new_content
.
replace
(
/
\n
$/
,
''
).
split
(
'
\n
'
));
content
=
content
.
slice
(
-
config
.
file
.
num_lines
).
join
(
'
\n
'
);
$
(
'
#file pre
'
).
html
(
content
);
}
if
(
config
.
preferences
.
autoscroll
)
{
if
(
config
.
preferences
.
autoscroll
)
{
// scroll down if file is covering footer
// scroll down if file is covering footer
...
...
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