mirror of
https://git.kittycat.homes/zoe/hugo-battheme.git
synced 2024-08-15 03:25:18 +00:00
random word shortcode
This commit is contained in:
parent
26372fdcca
commit
d267fc4356
10 changed files with 91 additions and 3 deletions
21
\
Normal file
21
\
Normal file
|
@ -0,0 +1,21 @@
|
|||
const buttons = document.getElementsByClassName("randomword-button");
|
||||
|
||||
export function randomizeWords() {
|
||||
registerButtons();
|
||||
}
|
||||
|
||||
function registerButtons() {
|
||||
for (let button of buttons) {
|
||||
button.addEventListener("click", function () {
|
||||
button.innerHTML = processWordlist(button.getAttribute("data-wordlist"));
|
||||
});
|
||||
button.click();
|
||||
}
|
||||
}
|
||||
|
||||
// takes all the words and returns only one
|
||||
function processWordlist(wordlist) {
|
||||
return wordlist;
|
||||
}
|
||||
|
||||
function stripSpaces() {}
|
Loading…
Add table
Add a link
Reference in a new issue