From be8f74be73f31def32f40c486e3c82f72383bb31 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 12:58:07 -0700 Subject: [PATCH] Update wins.js file remove liquid --- assets/js/wins.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/assets/js/wins.js b/assets/js/wins.js index 994ae5e5a2..c0d2a57cbb 100644 --- a/assets/js/wins.js +++ b/assets/js/wins.js @@ -1,6 +1,6 @@ ---- +// --- ---- +// --- //assigning the google form questions to variables for readability //these variables correspond with a question on the google form //these variables can be used as a key to access the data @@ -39,9 +39,10 @@ } function main() { - {% assign localData = site.data.external._wins-data %} + // {% assign localData = site.data.external._wins-data %} // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment - const cardData = JSON.parse(decodeURIComponent("{{ localData | jsonify | uri_escape }}")); + // const cardData = JSON.parse(decodeURIComponent("{{ localData | jsonify | uri_escape }}")); + const cardData = window.localData; window.localStorage.setItem('data', JSON.stringify(cardData)); makeCards(cardData); ifPageEmpty(); @@ -280,10 +281,10 @@ } function makeCards(data) { - {% assign githubData = site.data.external.github-data %} + // {% assign githubData = site.data.external.github-data %} // Escapes JSON for injections. See: #2134. If this is no longer the case, perform necessary edits, and remove this comment. - let githubData = JSON.parse(decodeURIComponent("{{ githubData | jsonify | uri_escape }}")); - + // let githubData = JSON.parse(decodeURIComponent("{{ githubData | jsonify | uri_escape }}")); + const githubData = window.githubData; const cards = data.reverse(); const cardTemplate = document.getElementById("wins-card-template"); const QUOTE_ICON_PATH = '/assets/images/wins-page/quote-icon.svg' @@ -311,7 +312,7 @@ AVATAR_DEFAULT_PATH; cloneCardTemplate.querySelector('.wins-card-profile-img').src = profileImgSrc; - cloneCardTemplate.querySelector('.wins-card-profile-img').id = `ghImg-${index}`; + cloneCardTemplate.querySelector('.wins-card-profile-img').id = `ghImg-${index}`; cloneCardTemplate.querySelector('.wins-card-profile-img').alt = `photograph of ${card[name]}`; cloneCardTemplate.querySelector('.wins-card-big-quote').src = QUOTE_ICON_PATH; @@ -321,10 +322,10 @@ if (card[linkedin_url].length > 0) { cloneCardTemplate.querySelector('.wins-card-linkedin-icon').href = card[linkedin_url]; cloneCardTemplate.querySelector('.linkedin-icon').src = LINKEDIN_ICON ; - cloneCardTemplate.querySelector('.linkedin-icon').alt = `LinkedIn profile for ${card[name]}`; + cloneCardTemplate.querySelector('.linkedin-icon').alt = `LinkedIn profile for ${card[name]}`; } else { cloneCardTemplate.querySelector('.wins-card-linkedin-icon').setAttribute('hidden', 'true') - }; + } if (card[github_url].length > 0){ cloneCardTemplate.querySelector('.wins-card-github-icon').href = card[github_url]; @@ -528,4 +529,3 @@ function changeSeeMoreBtn(x) { main(); changeSeeMoreBtn(x); -