diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..0a6b2283 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,39 @@ +# Pull Request + +## Description + +Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. + +Fixes # (issue number) + +## Type of change + +Please delete options that are not relevant. + +- [ ] New Ressource +- [ ] New Module +- [ ] Content fix +- [ ] Documentation update +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) + + +## How Has This Been Tested? + +Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. + +- [ ] Code Review +- [ ] Local execution +- [ ] other (please specify) + +## Checklist: + +- [ ] My content is Open Source (see License) +- [ ] My code follows the Open Source guidelines of this project +- [ ] I have performed a self-review of my own code +- [ ] I have commented my code, particularly in hard-to-understand areas +- [ ] I have made corresponding changes to the documentation where needed +- [ ] My changes generate no new warnings (double check during this pull request) +- [ ] I have added tests that prove my fix is effective or that my feature works (described above) +- [ ] Any dependent changes have been merged and published in downstream branches (development first) diff --git a/assets/js/modules.js b/assets/js/modules.js index 689dad2f..569a7f8a 100644 --- a/assets/js/modules.js +++ b/assets/js/modules.js @@ -27,6 +27,7 @@ this.addSorting(); this.addSearchFilter(); + this.addRandomizer(); } /** @@ -382,6 +383,18 @@ url.searchParams.delete('search'); sessionStorage.setItem(TRAINING_URL, url.href); } + + _randomize(evt){ + this.shuffle.sort({ randomize: true }); + } + + addRandomizer() { + const randomizeButton = document.getElementById('randomize'); + if (!randomizeButton) { + return; + } + randomizeButton.addEventListener('click', this._randomize.bind(this)); + } } document.addEventListener('DOMContentLoaded', function () { diff --git a/index.html b/index.html index 1a5e9579..c4fcbe04 100644 --- a/index.html +++ b/index.html @@ -139,6 +139,7 @@