-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- setup prettier config file for the repo - ran prettier on the entire repo - updated docs - added GitHub Action that creates a commit on PRs to master if the code isn't prettified. closes #324
- Loading branch information
1 parent
d43a414
commit e59c35a
Showing
821 changed files
with
7,543 additions
and
7,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Prettifier | ||
|
||
on: | ||
pull_request: | ||
branches: [master] | ||
|
||
jobs: | ||
prettier: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Prettify code | ||
uses: creyD/[email protected] | ||
with: | ||
prettier_options: --write **/*.+(js|html|css|json|md|yaml) | ||
only_changed: True | ||
prettier_plugins: prettier-plugin-go-template | ||
commit_message: "Prettified code" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
18.12.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.html" | ||
], | ||
"options": { | ||
"parser": "go-template", | ||
"goTemplateBracketSpacing": true, | ||
"bracketSameLine": true | ||
} | ||
}, | ||
{ | ||
"files": [ | ||
"*.js" | ||
], | ||
"options": { | ||
"trailingComma": "none", | ||
"tabs": true, | ||
"tabWidth": 2, | ||
"printWidth": 120 | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
(() => { | ||
// add 10 second delay in showing the newsletter popup | ||
setTimeout(() => { | ||
const newsletterModalEl = document.getElementById('newsletter-modal'); | ||
const newsletterModal = new bootstrap.Modal(newsletterModalEl); | ||
if (document.cookie.indexOf('newsletter') < 0) { | ||
newsletterModalEl.addEventListener('hide.bs.modal', (event) => { | ||
// activeElement is the element that triggered the modal to hide | ||
const activeElement = document.activeElement; | ||
// if the user clicks on the join button, set a cookie to not show the popup again | ||
if (activeElement.id === 'join-btn') { | ||
document.cookie = `newsletter=1; path=/;`; | ||
} else if (activeElement.id === 'maybe-later-btn') { | ||
// if the user clicks on the maybe later button, set a cookie to show the popup again in 3 months | ||
const expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + 3); | ||
document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; | ||
} else { | ||
// if the user exits the popup in any other way (clicking outside the modal / ESC key), | ||
// set a cookie to show the popup again in 1 month | ||
const expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + 1); | ||
document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; | ||
} | ||
}) | ||
newsletterModal.show(); | ||
// add 10 second delay in showing the newsletter popup | ||
setTimeout(() => { | ||
const newsletterModalEl = document.getElementById("newsletter-modal"); | ||
const newsletterModal = new bootstrap.Modal(newsletterModalEl); | ||
if (document.cookie.indexOf("newsletter") < 0) { | ||
newsletterModalEl.addEventListener("hide.bs.modal", (event) => { | ||
// activeElement is the element that triggered the modal to hide | ||
const activeElement = document.activeElement; | ||
// if the user clicks on the join button, set a cookie to not show the popup again | ||
if (activeElement.id === "join-btn") { | ||
document.cookie = `newsletter=1; path=/;`; | ||
} else if (activeElement.id === "maybe-later-btn") { | ||
// if the user clicks on the maybe later button, set a cookie to show the popup again in 3 months | ||
const expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + 3); | ||
document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; | ||
} else { | ||
// if the user exits the popup in any other way (clicking outside the modal / ESC key), | ||
// set a cookie to show the popup again in 1 month | ||
const expiryDate = new Date(); | ||
expiryDate.setMonth(expiryDate.getMonth() + 1); | ||
document.cookie = `newsletter=1; expires=${expiryDate.toUTCString()}; path=/;`; | ||
} | ||
}, 10_000); | ||
}); | ||
newsletterModal.show(); | ||
} | ||
}, 10_000); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.