Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
kewitham committed May 29, 2024
1 parent d106827 commit 0457f58
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions assets/js/outreach-campaign.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
function getCookieValue(name) {
const match = document.cookie.match('(^|;) *' + name + '=([^;]*)');
if (match) {
return match[2]
}
return false;
const match = document.cookie.match('(^|;) *' + name + '=([^;]*)');
if (match) {
return match[2];
}
return false;
}

export default function communityOutreach() {
if (document.referrer.includes('/redirects/communityoutreach/')) {
document.cookie = 'communityoutreach=true';
if (document.referrer.includes('/redirects/communityoutreach/')) {
document.cookie = 'communityoutreach=true';
}
window.addEventListener('DOMContentLoaded', function () {
const outreachCampaignUser = getCookieValue('communityoutreach');
if (window.location.pathname == '/file-a-complaint/' && outreachCampaignUser) {
const faCLink = document.querySelector('.civil-rights-complaint');
faCLink.setAttribute(
'href',
'https://civilrights.justice.gov/report?utm_campaign=61607827-e620-4e59-8850-b946d32c69ab'
);
}
window.addEventListener('DOMContentLoaded', function() {
const outreachCampaignUser = getCookieValue('communityoutreach');
if (window.location.pathname == '/file-a-complaint/' && outreachCampaignUser) {
const faCLink = document.querySelector('.civil-rights-complaint');
faCLink.setAttribute('href', 'https://civilrights.justice.gov/report?utm_campaign=61607827-e620-4e59-8850-b946d32c69ab');
}
});
}
});
}

0 comments on commit 0457f58

Please sign in to comment.