- Replacing calls to nf.Common.submit with window.open where appropriate.
This commit is contained in:
Matt Gilman 2014-12-23 10:28:41 -05:00
parent 1f4ae73065
commit 7a29166d9c
2 changed files with 53 additions and 56 deletions

View File

@ -84,17 +84,18 @@ nf.ProvenanceTable = (function () {
var downloadContent = function (direction) { var downloadContent = function (direction) {
var eventId = $('#provenance-event-id').text(); var eventId = $('#provenance-event-id').text();
// build the parameters // build the url
var parameters = {}; var url = config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// conditionally include the cluster node id // conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text(); var clusterNodeId = $('#provenance-event-cluster-node-id').text();
if (!nf.Common.isBlank(clusterNodeId)) { if (!nf.Common.isBlank(clusterNodeId)) {
parameters['clusterNodeId'] = clusterNodeId; window.open(url + '?' + $.param({
'clusterNodeId': clusterNodeId
}));
} else {
window.open(url);
} }
// get the content
nf.Common.submit('GET', config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction), parameters);
}; };
/** /**
@ -191,6 +192,29 @@ nf.ProvenanceTable = (function () {
} }
}); });
// input download
$('#input-content-download').on('click', function () {
downloadContent('input');
});
// output download
$('#output-content-download').on('click', function () {
downloadContent('output');
});
// if a content viewer url is specified, use it
if (isContentViewConfigured()) {
// input view
$('#input-content-view').on('click', function () {
viewContent('input');
});
// output view
$('#output-content-view').on('click', function () {
viewContent('output');
});
}
// handle the replay and downloading // handle the replay and downloading
if (nf.Common.isDFM()) { if (nf.Common.isDFM()) {
// replay // replay
@ -220,29 +244,6 @@ nf.ProvenanceTable = (function () {
$('#event-details-dialog').modal('hide'); $('#event-details-dialog').modal('hide');
}); });
// input download
$('#input-content-download').on('click', function () {
downloadContent('input');
});
// output download
$('#output-content-download').on('click', function () {
downloadContent('output');
});
// if a content viewer url is specified, use it
if (isContentViewConfigured()) {
// input view
$('#input-content-view').on('click', function () {
viewContent('input');
});
// output view
$('#output-content-view').on('click', function () {
viewContent('output');
});
}
// show the replay panel // show the replay panel
$('#replay-details').show(); $('#replay-details').show();
} }
@ -1281,19 +1282,17 @@ nf.ProvenanceTable = (function () {
$('#output-content-download').hide(); $('#output-content-download').hide();
if (nf.Common.isDFM()) { if (event.inputContentAvailable === true) {
if (event.inputContentAvailable === true) { $('#input-content-download').show();
$('#input-content-download').show();
if (isContentViewConfigured()) { if (isContentViewConfigured()) {
$('#input-content-view').show(); $('#input-content-view').show();
} else {
$('#input-content-view').hide();
}
} else { } else {
$('#input-content-download').hide();
$('#input-content-view').hide(); $('#input-content-view').hide();
} }
} else {
$('#input-content-download').hide();
$('#input-content-view').hide();
} }
} else { } else {
$('#output-content-details').show(); $('#output-content-details').show();
@ -1327,32 +1326,30 @@ nf.ProvenanceTable = (function () {
outputContentSize.attr('title', nf.Common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes'); outputContentSize.attr('title', nf.Common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
} }
if (nf.Common.isDFM()) { if (event.inputContentAvailable === true) {
if (event.inputContentAvailable === true) { $('#input-content-download').show();
$('#input-content-download').show();
if (isContentViewConfigured()) { if (isContentViewConfigured()) {
$('#input-content-view').show(); $('#input-content-view').show();
} else {
$('#input-content-view').hide();
}
} else { } else {
$('#input-content-download').hide();
$('#input-content-view').hide(); $('#input-content-view').hide();
} }
} else {
$('#input-content-download').hide();
$('#input-content-view').hide();
}
if (event.outputContentAvailable === true) { if (event.outputContentAvailable === true) {
$('#output-content-download').show(); $('#output-content-download').show();
if (isContentViewConfigured()) { if (isContentViewConfigured()) {
$('#output-content-view').show(); $('#output-content-view').show();
} else {
$('#output-content-view').hide();
}
} else { } else {
$('#output-content-download').hide();
$('#output-content-view').hide(); $('#output-content-view').hide();
} }
} else {
$('#output-content-download').hide();
$('#output-content-view').hide();
} }
} }

View File

@ -270,7 +270,7 @@ nf.TemplatesTable = (function () {
if (nf.Common.isDefinedAndNotNull(grid)) { if (nf.Common.isDefinedAndNotNull(grid)) {
var data = grid.getData(); var data = grid.getData();
var item = data.getItem(row); var item = data.getItem(row);
nf.Common.submit('GET', config.urls.templates + '/' + encodeURIComponent(item.id)); window.open(config.urls.templates + '/' + encodeURIComponent(item.id));
} }
}, },