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
00f97b25
Commit
00f97b25
authored
Sep 16, 2014
by
Leo Iannacone
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
do not download file twice while having it in HTML - just get the content text
parent
056a2751
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
2 deletions
+17
-2
debomatic-webui/public/javascripts/page_distribution.js
debomatic-webui/public/javascripts/page_distribution.js
+17
-2
No files found.
debomatic-webui/public/javascripts/page_distribution.js
View file @
00f97b25
...
...
@@ -123,12 +123,12 @@ function Page_Distrubion(socket) {
label
=
''
;
var
window_title
=
null
;
if
(
Utils
.
check_view_file
(
view
))
{
var
complete_name
=
view
.
package
.
orig_name
+
'
.
'
+
view
.
file
.
name
;
var
complete_name
=
view
.
file
.
orig_
name
;
window_title
=
complete_name
;
label
=
complete_name
;
if
(
!
view
.
file
.
path
)
view
.
file
.
path
=
config
.
paths
.
debomatic
+
'
/
'
+
view
.
distribution
.
name
+
'
/pool/
'
+
view
.
package
.
orig_name
+
'
/
'
+
complete_name
;
label
+=
'
<a
class="btn btn-link btn-lg" data-toggle="tooltip" title="Download" href="
'
+
view
.
file
.
path
+
'
">
'
+
label
+=
'
<a
id="download-file" class="btn btn-link btn-lg" data-toggle="tooltip" title="Download
">
'
+
'
<span class="glyphicon glyphicon-download-alt"></span></a>
'
;
if
(
current_file_in_preview
)
{
var
view_all
=
$
(
'
<a id="get-whole-file" data-toggle="tooltip" class="btn btn-link btn-lg" title="View the whole file"></a>
'
);
...
...
@@ -151,6 +151,21 @@ function Page_Distrubion(socket) {
file
.
get
(
true
);
$
(
this
).
fadeOut
(
'
fast
'
);
});
// set onclick downlaod file
$
(
'
#download-file
'
).
on
(
'
click
'
,
function
(
event
)
{
var
url
=
view
.
file
.
path
;
if
(
!
current_file_in_preview
)
{
url
=
'
data:text/plain;charset=utf-8,
'
+
encodeURIComponent
(
$
(
'
#file .content
'
).
text
());
}
$
(
this
)
.
attr
({
'
download
'
:
view
.
file
.
orig_name
,
'
href
'
:
url
,
'
target
'
:
'
_blank
'
});
});
},
clean
:
function
()
{
$
(
'
#title
'
).
html
(
''
);
...
...
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