$(document).ready(function () { if ( $(".nav-account").length !=0) { $(".nav-account").hide(); document.querySelector('[aria-label="Sign in"]').style.visibility = 'hidden'; } $(".divider-vertical").hide(); var query = window.location.search.substring(1) if(query.length) { if(window.history != undefined && window.history.pushState != undefined) { // window.history.pushState({}, document.title, window.location.pathname); } } if($('#voco_registeredforfund').length) { if ($("#voco_registeredforfund").val()) { $('#voco_registeredforfund').remove(); $('#voco_registeredforfund_label').remove(); } else { $('#voco_registeredforfund').val(window.location); $('#voco_registeredforfund').hide(); $('#voco_registeredforfund_label').hide(); } } }); function getParameterByName( name ){ var regexS = "[\\?&]"+name+"=([^&#]*)", regex = new RegExp( regexS ), results = regex.exec( window.location.search ); if( results == null ){ return ""; } else{ return decodeURIComponent(results[1].replace(/\+/g, " ")); } } function isApplicationCreated() { let requestContainer = document.getElementById("requestContainer"); var isApplicationCreated = requestContainer.getElementsByClassName("view-grid")[0].getElementsByTagName("tr").length > 1; if (isApplicationCreated) return true; else return false; } function HideAddApplicationButton() { if (isApplicationCreated()) { $( "#btnAddApplication" ).parent().hide(); } setPortalMessageUnreadStyle(); } function ChangeReviewerEditToViewButton(){ let reviewContainer = document.getElementById("reviewContainer"); $("#reviewContainer tr").each(function() { if ($(this).children("td").length == 5) { if ($(this).children().eq(3).text() == 'Submitted') { if ($(this).children().eq(4).find('a').text() != 'View') $(this).children().eq(4).find('a').text('View'); } } }); setPortalMessageUnreadStyle(); } function setPortalMessageUnreadStyle(){ let portalMessageContainer = document.getElementById("portalMessageContainer"); $("#portalMessageContainer tr").each(function() { if ($(this).children("td").length == 4) { if ( $(this).children().eq(2).text() === 'Unread' && $(this).children().eq(3).text() === 'Sent' ) { if ($(this).children().eq(2).text != 'Sent') $(this).children().eq(2).text('Sent') ; } if ( $(this).children().eq(2).text() === 'Unread' && $(this).children().eq(3).text() === 'Received' ) { $("td:contains('Unread')").parent().addClass( 'UnreadMessage' ); } } }); } // Executes after page finishes loading. window.addEventListener('load', () => { if ( $( "#btnAddApplication" ).length ) { setTimeout(HideAddApplicationButton,500); } if ( $( "#reviewContainer" ).length ) { setTimeout(ChangeReviewerEditToViewButton,500); } });