From bd8be66500769fbaf1c02ed4e1a2a4d6e0e354b5 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sat, 15 Jul 2023 06:37:15 -0700 Subject: [PATCH 01/15] Add eslint github action --- .github/workflows/linter-js.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/linter-js.yml diff --git a/.github/workflows/linter-js.yml b/.github/workflows/linter-js.yml new file mode 100644 index 0000000000..9728183c54 --- /dev/null +++ b/.github/workflows/linter-js.yml @@ -0,0 +1,32 @@ +name: Lint JS + +on: + pull_request: + branches: [gh-pages] + push: + branches: [gh-pages] + +jobs: + build: + name: Lint JS + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + # Full git history is needed to get a proper list of changed files within `super-linter` + fetch-depth: 0 + + # Run Linter against code base # + - name: Lint JS + uses: super-linter/super-linter@v5 + env: + VALIDATE_ALL_CODEBASE: false + DEFAULT_BRANCH: master + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + + LINTER_RULES_PATH: / + CSS_FILE_NAME: .eslint.json + VALIDATE_JAVASCRIPT_ES: true From 68c5ec3957417105d26d68cae0b86db16e1267d3 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sat, 15 Jul 2023 06:38:04 -0700 Subject: [PATCH 02/15] Add eslint config file --- .eslint.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .eslint.json diff --git a/.eslint.json b/.eslint.json new file mode 100644 index 0000000000..cf20cdc7a7 --- /dev/null +++ b/.eslint.json @@ -0,0 +1,3 @@ +{ + "extends": "eslint:recommended" +} From f236f604d6e6298787ae93274efe88888fae6f79 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sat, 15 Jul 2023 06:56:08 -0700 Subject: [PATCH 03/15] Update eslint github action --- .github/workflows/linter-js.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/linter-js.yml b/.github/workflows/linter-js.yml index 9728183c54..bbe47e2a84 100644 --- a/.github/workflows/linter-js.yml +++ b/.github/workflows/linter-js.yml @@ -1,10 +1,12 @@ name: Lint JS -on: - pull_request: - branches: [gh-pages] - push: - branches: [gh-pages] +on: [push, pull_request] + +# on: +# pull_request: +# branches: [gh-pages] +# push: +# branches: [gh-pages] jobs: build: From c6667260dfcfd73510e64516aeb6cf93ae9a5af8 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sat, 15 Jul 2023 07:09:38 -0700 Subject: [PATCH 04/15] Update eslint github file --- .github/workflows/linter-js.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linter-js.yml b/.github/workflows/linter-js.yml index bbe47e2a84..056fb5dc65 100644 --- a/.github/workflows/linter-js.yml +++ b/.github/workflows/linter-js.yml @@ -1,12 +1,11 @@ name: Lint JS -on: [push, pull_request] -# on: -# pull_request: -# branches: [gh-pages] -# push: -# branches: [gh-pages] +on: + pull_request: + branches: [github-actions-implement-eslint-1442] + push: + branches: [github-actions-implement-eslint-1442] jobs: build: From 1b76594cfc5b1559cacda26031b8b0cc988620a9 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sat, 15 Jul 2023 07:22:45 -0700 Subject: [PATCH 05/15] Fix eslint github action --- .github/workflows/linter-js.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/linter-js.yml b/.github/workflows/linter-js.yml index 056fb5dc65..57c98b4e3a 100644 --- a/.github/workflows/linter-js.yml +++ b/.github/workflows/linter-js.yml @@ -24,7 +24,7 @@ jobs: uses: super-linter/super-linter@v5 env: VALIDATE_ALL_CODEBASE: false - DEFAULT_BRANCH: master + DEFAULT_BRANCH: gh-pages GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c931435a42bb07d385f8d42b71c08420e4c553f4 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Tue, 18 Jul 2023 22:37:00 -0700 Subject: [PATCH 06/15] Update eslintrc.json file --- .eslint.json | 3 --- .eslintrc.json | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) delete mode 100644 .eslint.json create mode 100644 .eslintrc.json diff --git a/.eslint.json b/.eslint.json deleted file mode 100644 index cf20cdc7a7..0000000000 --- a/.eslint.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "eslint:recommended" -} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000000..1a2d7cceb9 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,15 @@ +{ + "env": { + "browser": true, + "es2021": true, + "node": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "module" + }, + "rules": { + + } +} From f106b98496a3f5d1b1f003a6a57ff565791d625e Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Tue, 18 Jul 2023 22:37:17 -0700 Subject: [PATCH 07/15] Update linter-js.yml file --- .github/workflows/linter-js.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/linter-js.yml b/.github/workflows/linter-js.yml index 57c98b4e3a..0b8d92a482 100644 --- a/.github/workflows/linter-js.yml +++ b/.github/workflows/linter-js.yml @@ -3,9 +3,9 @@ name: Lint JS on: pull_request: - branches: [github-actions-implement-eslint-1442] + branches: [gh-pages] push: - branches: [github-actions-implement-eslint-1442] + branches: [gh-pages] jobs: build: @@ -21,7 +21,7 @@ jobs: # Run Linter against code base # - name: Lint JS - uses: super-linter/super-linter@v5 + uses: github/super-linter@v5.0.0 env: VALIDATE_ALL_CODEBASE: false DEFAULT_BRANCH: gh-pages @@ -29,5 +29,5 @@ jobs: LINTER_RULES_PATH: / - CSS_FILE_NAME: .eslint.json + JAVASCRIPT_ES_CONFIG_FILE: .eslintrc.json VALIDATE_JAVASCRIPT_ES: true From 2a69d0e939d166aa850da1875d761d7a165b2001 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Tue, 18 Jul 2023 22:54:58 -0700 Subject: [PATCH 08/15] Rename linter-js.yml to lint-js.yml --- .github/workflows/{linter-js.yml => lint-js.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{linter-js.yml => lint-js.yml} (100%) diff --git a/.github/workflows/linter-js.yml b/.github/workflows/lint-js.yml similarity index 100% rename from .github/workflows/linter-js.yml rename to .github/workflows/lint-js.yml From 336093bc9248629c30fff6ad36c6a349d9fefa0a Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Thu, 20 Jul 2023 07:39:01 -0700 Subject: [PATCH 09/15] Add test file --- newEslintTest.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 newEslintTest.js diff --git a/newEslintTest.js b/newEslintTest.js new file mode 100644 index 0000000000..0a5d099dfe --- /dev/null +++ b/newEslintTest.js @@ -0,0 +1,6 @@ +const unusedVar = () => { + const foo = 1; + const bar = 2; + const baz = 3; + return bar; +} From 43645951d5f43f5891966a35743d23c3f8059853 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Thu, 20 Jul 2023 07:46:25 -0700 Subject: [PATCH 10/15] Remove bad file --- newEslintTest.js | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 newEslintTest.js diff --git a/newEslintTest.js b/newEslintTest.js deleted file mode 100644 index 0a5d099dfe..0000000000 --- a/newEslintTest.js +++ /dev/null @@ -1,6 +0,0 @@ -const unusedVar = () => { - const foo = 1; - const bar = 2; - const baz = 3; - return bar; -} From e1c12233e1d7f8225576f12d8c2c14052b3fceaa Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 12:57:28 -0700 Subject: [PATCH 11/15] Update rules on eslintrc.json file --- .eslintrc.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1a2d7cceb9..15f48196d6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,6 +10,9 @@ "sourceType": "module" }, "rules": { - + "no-mixed-spaces-and-tabs": "off", + "no-unused-vars": "off", + "no-extra-semi": "off", + "no-prototype-builtins": "off" } } From d8da4c9551c25c944fab3e5daf7d16dbacc35363 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 12:57:47 -0700 Subject: [PATCH 12/15] Create wins.liquid file --- assets/js/wins.liquid | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 assets/js/wins.liquid diff --git a/assets/js/wins.liquid b/assets/js/wins.liquid new file mode 100644 index 0000000000..97bb48e338 --- /dev/null +++ b/assets/js/wins.liquid @@ -0,0 +1,11 @@ +--- +--- + + + + + From 0cafcdb1d5d697962caa016ae0a37350265a6b9b Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 12:58:07 -0700 Subject: [PATCH 13/15] 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); - From 62900f59020c8577f26a5b51fb53a287de83cce8 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 12:59:48 -0700 Subject: [PATCH 14/15] Update lint-js.yml file to test change --- .github/workflows/lint-js.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint-js.yml b/.github/workflows/lint-js.yml index 0b8d92a482..7bfdf9f54a 100644 --- a/.github/workflows/lint-js.yml +++ b/.github/workflows/lint-js.yml @@ -3,9 +3,9 @@ name: Lint JS on: pull_request: - branches: [gh-pages] + # branches: [gh-pages] push: - branches: [gh-pages] + # branches: [gh-pages] jobs: build: From 738c46c0d439504ef14450a8e97f303026c43a99 Mon Sep 17 00:00:00 2001 From: Ronald Paek Date: Sun, 23 Jul 2023 14:42:29 -0700 Subject: [PATCH 15/15] Separate liquid and js for hamburger-nav --- assets/js/hamburger-nav.js | 18 +++++++++++------- assets/js/hamburger-nav.liquid | 14 ++++++++++++++ 2 files changed, 25 insertions(+), 7 deletions(-) create mode 100644 assets/js/hamburger-nav.liquid diff --git a/assets/js/hamburger-nav.js b/assets/js/hamburger-nav.js index 57689b428a..b0680527c6 100644 --- a/assets/js/hamburger-nav.js +++ b/assets/js/hamburger-nav.js @@ -1,10 +1,14 @@ ---- -title: hamburger nav file ---- +// --- +// title: hamburger nav file +// --- //Retrieve svg string from _includes - const burgerImage = `{% include svg/icon-hamburger-nav.svg %}` ; - const burgerImageX = `{% include svg/icon-hamburger-nav-x.svg %}` ; +// const burgerImage = `{% include svg/icon-hamburger-nav.svg %}` ; +// const burgerImageX = `{% include svg/icon-hamburger-nav-x.svg %}` ; + +var parser = new DOMParser(); +var burgerImage = parser.parseFromString(window.burgerImage, "image/svg+xml").documentElement; +var burgerImageX = parser.parseFromString(window.burgerImageX, "image/svg+xml").documentElement; document.querySelector('#burgerImage').addEventListener('click',toggleNavDisplay); @@ -14,7 +18,7 @@ function toggleNavDisplay(){ swapIcons(this.firstElementChild.id); document.querySelector('#headerNav').style.display == 'flex' ? document.querySelector('#headerNav').style.display = 'none': document.querySelector('#headerNav').style.display = 'flex'; - + } @@ -30,7 +34,7 @@ function swapIcons(icon_id){ //insert opposite icon document.querySelector(`#burgerImage`).insertAdjacentHTML('afterbegin',hamburger[icon_id].opposite); - + } diff --git a/assets/js/hamburger-nav.liquid b/assets/js/hamburger-nav.liquid new file mode 100644 index 0000000000..f932335a66 --- /dev/null +++ b/assets/js/hamburger-nav.liquid @@ -0,0 +1,14 @@ +--- +title: hamburger nav file +--- + +{% assign burgerImage = include svg/icon-hamburger-nav.svg %} +{% assign burgerImageX = include svg/icon-hamburger-nav-x.svg %} + + + +