Skip to content

Commit 8bda1e4

Browse files
committed
News
1 parent 82bfa5b commit 8bda1e4

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

extras/index.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,6 @@
2323
<hr style="border: none; height: 1.5rem" />
2424
<div class="sectionwrap">
2525
<div class="news">
26-
<div class="note blue">
27-
<h3>ScratchTools is Going Multilingual!</h3>
28-
<span
29-
>ScratchTools is becoming available in even more languages! Our
30-
beta version supports Polish and Russian, and more languages such
31-
as Spanish, Turkish, German and Japanese are coming soon! If you
32-
know a language other than English, you can help translate and get
33-
credit for it
34-
<a href="https://explore.transifex.com/scratchtools/scratchtools/"
35-
>here</a
36-
>!</span
37-
>
38-
</div>
3926
</div>
4027
<br />
4128
<div class="note purple blocked" style="display: none">

extras/popup/popup.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,4 +1044,21 @@ async function parseFile(file) {
10441044
function importSettingsInput() {
10451045
var input = document.querySelector(".settings-load-input")
10461046
input.click()
1047+
}
1048+
1049+
if (document.querySelector(".news")) {
1050+
getNews()
1051+
}
1052+
1053+
async function getNews() {
1054+
var data = await (await fetch("https://data.scratchtools.app/news/")).json()
1055+
var note = document.createElement("div")
1056+
note.className = "note blue"
1057+
var h3 = document.createElement("h3")
1058+
h3.textContent = data.title
1059+
var span = document.createElement("span")
1060+
span.innerHTML = data.description
1061+
note.appendChild(h3)
1062+
note.appendChild(span)
1063+
document.querySelector(".news").appendChild(note)
10471064
}

0 commit comments

Comments
 (0)