- 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 eventId = $('#provenance-event-id').text();
// build the parameters
var parameters = {};
// build the url
var url = config.urls.provenance + '/events/' + encodeURIComponent(eventId) + '/content/' + encodeURIComponent(direction);
// conditionally include the cluster node id
var clusterNodeId = $('#provenance-event-cluster-node-id').text();
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
if (nf.Common.isDFM()) {
// replay
@ -220,29 +244,6 @@ nf.ProvenanceTable = (function () {
$('#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
$('#replay-details').show();
}
@ -1281,7 +1282,6 @@ nf.ProvenanceTable = (function () {
$('#output-content-download').hide();
if (nf.Common.isDFM()) {
if (event.inputContentAvailable === true) {
$('#input-content-download').show();
@ -1294,7 +1294,6 @@ nf.ProvenanceTable = (function () {
$('#input-content-download').hide();
$('#input-content-view').hide();
}
}
} else {
$('#output-content-details').show();
@ -1327,7 +1326,6 @@ nf.ProvenanceTable = (function () {
outputContentSize.attr('title', nf.Common.formatInteger(event.outputContentClaimFileSizeBytes) + ' bytes');
}
if (nf.Common.isDFM()) {
if (event.inputContentAvailable === true) {
$('#input-content-download').show();
@ -1354,7 +1352,6 @@ nf.ProvenanceTable = (function () {
$('#output-content-view').hide();
}
}
}
if (nf.Common.isDFM()) {
if (event.replayAvailable === true) {

View File

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