-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,40 @@ | ||
// TODO: Add remote site link updating here | ||
/* Project detail view specific JQuery */ | ||
|
||
/* Update target/peer remote project links once accessed */ | ||
var updateRemoteProjectLinks = function() { | ||
var linkUuids = []; | ||
$('.sodar-pr-link-remote').each(function() { | ||
if (!$(this).hasClass('sodar-pr-link-remote-source') | ||
&& $(this).attr('disabled') === 'disabled') { | ||
linkUuids.push($(this).attr('data-uuid')); | ||
} | ||
}); | ||
if (linkUuids.length > 0) { | ||
var queryParams = [] | ||
for (var i = 0; i < linkUuids.length; i++) { | ||
queryParams.push(['rp', linkUuids[i]]) | ||
} | ||
$.ajax({ | ||
url: window.remoteLinkUrl + '?' + new URLSearchParams(queryParams), | ||
method: 'GET', | ||
dataType: 'JSON', | ||
}).done(function (data) { | ||
for (var k in data) { | ||
var elem = $('a[data-uuid="' +k + '"]'); | ||
if (elem.attr('disabled') === 'disabled' && data[k] === true) { | ||
elem.removeAttr('disabled'); | ||
} | ||
} | ||
}); | ||
}}; | ||
|
||
$(document).ready(function() { | ||
// Set up remote project link updating, omit categories | ||
if ($('div#sodar-pr-page-container-detail').attr( | ||
'data-project-type') === 'PROJECT') { | ||
updateRemoteProjectLinks(); | ||
setInterval(function () { | ||
updateRemoteProjectLinks(); | ||
}, 5000); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters