Content deleted Content added
Polygnotus (talk | contribs) No edit summary |
Polygnotus (talk | contribs) No edit summary |
||
Line 24:
color: red;
}
#next-button, #view-article-button {
font-size: 0.9rem;
padding: 0.3rem 0.7rem;
cursor: pointer;
}
#debug-info {
Line 37 ⟶ 38:
margin-top: 0.5rem;
font-style: italic;
▲ margin-top: 0.5rem;
}
`;
Line 61 ⟶ 51:
<div id="article-name"></div>
<button id="next-button">Next Word</button>
<
<div id="debug-info"></div>
`;
Line 75 ⟶ 64:
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.articleLinkElement = document.getElementById('article-link');
this.nextButton.addEventListener('click', () => this.displayNextWord());
this.viewArticleButton.addEventListener('click', () => this.viewWikipediaArticle());
this.fetchWords();
Line 119 ⟶ 108:
this.articleNameElement.textContent = `Article: ${currentWord.articleName}`;
this.currentIndex++;
if (this.currentIndex >= this.words.length) {
Line 131 ⟶ 118:
this.typoDisplayElement.textContent = '';
this.articleNameElement.textContent = '';
}
Line 139 ⟶ 123:
}
const currentWord = this.words[this.currentIndex - 1];
const apiUrl = `https://en.wikipedia.org/w/api.php?action=query&format=json&prop=extracts&exintro=1&explaintext=1&titles=${encodedArticleName}&origin=*`;▼
const
▲ const
}
}
|