Commit 70395d9a authored by Leo Iannacone's avatar Leo Iannacone

set files tags client side

parent 9bfbad18
...@@ -267,8 +267,11 @@ function Page_Distrubion(socket) { ...@@ -267,8 +267,11 @@ function Page_Distrubion(socket) {
// update html // update html
socket_data.package.files.forEach(function (f) { socket_data.package.files.forEach(function (f) {
tmp.file = f; tmp.file = f;
var html_file = $('<li id="file-' + f.orig_name + '"><a title="' + f.orig_name + '" href="' + var html_file = $('<li id="file-' + f.orig_name + '">' +
Utils.from_view_to_hash(tmp) + '">' + f.name + '</a></li>'); '<a title="' + f.orig_name + '" href="' +
Utils.from_view_to_hash(tmp) + '">' +
'<span class="status pull-right"></span>' +
f.name + '</a></li>');
html_file.on('click', function () { html_file.on('click', function () {
files.select(this); files.select(this);
}); });
...@@ -335,6 +338,9 @@ function Page_Distrubion(socket) { ...@@ -335,6 +338,9 @@ function Page_Distrubion(socket) {
show: function () { show: function () {
$('#files').show(); $('#files').show();
}, },
set_status: function (file, status) {
$('#logs li[id="file-' + file + '"] .status').html(status);
}
}; };
var package_info = { var package_info = {
...@@ -361,6 +367,14 @@ function Page_Distrubion(socket) { ...@@ -361,6 +367,14 @@ function Page_Distrubion(socket) {
return result; return result;
} }
if (socket_data.hasOwnProperty('tags')) {
var tags = socket_data.tags;
for (var file in tags) {
if (tags.hasOwnProperty(file))
files.set_status(file, tags[file]);
}
}
var info = ""; var info = "";
if (socket_data.uploader) if (socket_data.uploader)
...@@ -661,9 +675,9 @@ function Page_Distrubion(socket) { ...@@ -661,9 +675,9 @@ function Page_Distrubion(socket) {
return; return;
} else if (!Utils.check_view_package(old_view) || !Utils.check_view_package(view) || } else if (!Utils.check_view_package(old_view) || !Utils.check_view_package(view) ||
view.package.orig_name != old_view.package.orig_name) { // new package view view.package.orig_name != old_view.package.orig_name) { // new package view
package_info.get();
files.get(); files.get();
file.get(); file.get();
package_info.get();
} else if (!Utils.check_view_file(old_view) || !Utils.check_view_file(view) || } else if (!Utils.check_view_file(old_view) || !Utils.check_view_file(view) ||
view.file.name != old_view.file.name) { // new file view view.file.name != old_view.file.name) { // new file view
file.get(); file.get();
...@@ -684,9 +698,9 @@ function Page_Distrubion(socket) { ...@@ -684,9 +698,9 @@ function Page_Distrubion(socket) {
var populate = function () { var populate = function () {
clean(); clean();
packages.get(); packages.get();
package_info.get();
files.get(); files.get();
file.get(); file.get();
package_info.get();
update.view(); update.view();
}; };
......
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