Skip to content

Commit

Permalink
Update wins.js file remove liquid
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldpaek committed Jul 23, 2023
1 parent d8da4c9 commit 0cafcdb
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions assets/js/wins.js
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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;
Expand All @@ -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];
Expand Down Expand Up @@ -528,4 +529,3 @@ function changeSeeMoreBtn(x) {

main();
changeSeeMoreBtn(x);

0 comments on commit 0cafcdb

Please sign in to comment.