Commit a1ee36bd authored by Leo Iannacone's avatar Leo Iannacone

Due to out of memory error on some big logs, I have to revert this

change.

Revert "do not download file twice while having it in HTML - just get the content text"

This reverts commit 00f97b25.
parent 00f97b25
......@@ -123,12 +123,12 @@ function Page_Distrubion(socket) {
label = '';
var window_title = null;
if (Utils.check_view_file(view)) {
var complete_name = view.file.orig_name;
var complete_name = view.package.orig_name + '.' + view.file.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 id="download-file" class="btn btn-link btn-lg" data-toggle="tooltip" title="Download"> ' +
label += ' <a class="btn btn-link btn-lg" data-toggle="tooltip" title="Download" href="' + view.file.path + '"> ' +
'<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,21 +151,6 @@ 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('');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment