Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) m Polygnotus moved page User:Polygnotus/test3.js to User:Polygnotus/Scripts/GetAPIBatch.js |
||
(One intermediate revision by the same user not shown) | |||
Line 24:
color: red;
}
#next
font-size: 0.9rem;
padding: 0.3rem 0.7rem;
cursor: pointer;
margin-right: 0.5rem;▼
}
#debug-info {
Line 51 ⟶ 50:
<div id="article-name"></div>
<button id="next-button">Next Word</button>
<div id="debug-info"></div>
`;
Line 64 ⟶ 62:
this.typoDisplayElement = document.getElementById('typo-display');
this.nextButton = document.getElementById('next-button');
this.debugElement = document.getElementById('debug-info');
this.articleNameElement = document.getElementById('article-name');
this.nextButton.addEventListener('click', () => this.
this.fetchWords();
Line 97 ⟶ 93:
}
async
if (this.currentIndex >= this.words.length) {
await this.fetchWords();
Line 107 ⟶ 103:
this.typoDisplayElement.textContent = `Typo: ${currentWord.typo}`;
this.articleNameElement.textContent = `Article: ${currentWord.articleName}`;
this.navigateToWikipedia(currentWord.articleName);
this.currentIndex++;
Line 123 ⟶ 122:
}
▲ window.open(articleUrl, '_blank');
▲ }
}
|