Skip to content

Commit 76a6718

Browse files
committed
Prepare for v4.1.0
1 parent 6c3a54c commit 76a6718

File tree

11 files changed

+417
-7
lines changed

11 files changed

+417
-7
lines changed

api/update/index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ async function checkUpdate() {
4040
forum: "0",
4141
},
4242
});
43-
checkUpdate()
43+
// checkUpdate()
4444
}
4545
}
46-
checkUpdate();
46+
// checkUpdate();
4747

4848
function makeScreen(update) {
49+
return
4950
console.log(update);
5051
if (document.querySelector(".ste-update-bg")) return;
5152
let background = Object.assign(document.createElement("div"), {

extras/background.js

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ async function checkBetaUpdates() {
4949
).json();
5050
if (
5151
data.version !== chrome.runtime.getManifest().version_name ||
52-
(await (await fetch("/changelog/beta.json")).json()).beta !==
53-
data.beta
52+
(await (await fetch("/changelog/beta.json")).json()).beta !== data.beta
5453
) {
5554
// chrome.tabs.create({
5655
// url: "/extras/beta/index.html",
@@ -64,6 +63,7 @@ if (chrome.runtime.getManifest().version_name.endsWith("-beta")) {
6463
}
6564

6665
chrome.runtime.onInstalled.addListener(async function (object) {
66+
checkApril();
6767
try {
6868
var featureData = await (await fetch("/features/features.json")).json();
6969
} catch (err) {
@@ -671,12 +671,17 @@ chrome.runtime.onMessageExternal.addListener(async function (
671671
}
672672
if (msg.msg === "openPong") {
673673
await chrome.tabs.create({
674-
url: "/api/april/pong/index.html?username=" + msg.username + "&id=" + msg.id,
674+
url:
675+
"/api/april/pong/index.html?username=" + msg.username + "&id=" + msg.id,
675676
});
676677
}
677678
if (msg.msg === "openDashboardPage") {
678679
await chrome.tabs.create({
679-
url: "/extras/dashboard/index.html?code=" + msg.token + "&username=" + msg.username,
680+
url:
681+
"/extras/dashboard/index.html?code=" +
682+
msg.token +
683+
"&username=" +
684+
msg.username,
680685
});
681686
chrome.tabs.remove(sender.tab.id, function () {});
682687
}
@@ -821,7 +826,32 @@ chrome.runtime.onMessage.addListener(async function (
821826
}
822827
});
823828

829+
async function checkApril() {
830+
if (new Date().getMonth() === 3 && new Date().getDate() === 1) {
831+
let features = (await chrome.storage.sync.get("features"))?.features || "";
832+
if (!features.includes("random-block-colors")) {
833+
await chrome.storage.sync.set({ aprilAutomatic2025: true });
834+
features = features + ".random-block-colors";
835+
await chrome.storage.sync.set({ features });
836+
}
837+
} else {
838+
let aprilAutomatic = (await chrome.storage.sync.get("aprilAutomatic2025"))
839+
?.aprilAutomatic2025;
840+
841+
if (aprilAutomatic) {
842+
let features =
843+
(await chrome.storage.sync.get("features"))?.features || "";
844+
if (features.includes("random-block-colors")) {
845+
features = features.replaceAll("random-block-colors", "");
846+
await chrome.storage.sync.set({ features });
847+
await chrome.storage.sync.set({ aprilAutomatic2025: false });
848+
}
849+
}
850+
}
851+
}
852+
824853
chrome.alarms.onAlarm.addListener(async function () {
854+
checkApril();
825855
chrome.alarms.clearAll();
826856
chrome.alarms.create("test", {
827857
delayInMinutes: 0.5,

features/features.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
[
2+
{
3+
"version": 2,
4+
"id": "random-block-colors",
5+
"versionAdded": "v4.1.0"
6+
},
27
{
38
"version": 2,
49
"id": "remove-confirmation",

features/more-block-themes/script.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
export default async function ({ feature, console, scratchClass }) {
2+
let randomBlockColorsEnabled = !!ScratchTools.modules.find((el) => el.feature.id === "random-block-colors")
3+
if (randomBlockColorsEnabled) return;
4+
25
let CIRCLE = await (await fetch(feature.self.getResource("circle"))).text();
36

47
let COLORS = document.createElement("link")
Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 17 additions & 0 deletions
Loading
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
:root {
2+
--motion-fill: transparent;
3+
--motion-stroke: #3373CC;
4+
5+
--looks-fill: transparent;
6+
--looks-stroke: #774DCB;
7+
8+
--sound-fill: transparent;
9+
--sound-stroke: #BD42BD;
10+
11+
--event-fill: transparent;
12+
--event-stroke: #CC9900;
13+
14+
--control-fill: transparent;
15+
--control-stroke: #CF8B17;
16+
17+
--sensing-fill: transparent;
18+
--sensing-stroke: #2E8EB8;
19+
20+
--operators-fill: transparent;
21+
--operators-stroke: #389438;
22+
23+
--data-fill: transparent;
24+
--data-stroke: #DB6E00;
25+
--data-lists-fill: transparent;
26+
--data-lists-stroke: #E64D00;
27+
28+
--custom-fill: transparent;
29+
--custom-stroke: #FF3355;
30+
31+
--other-fill: transparent;
32+
--other-stroke: #0B8E69;
33+
34+
--text-light: #000000;
35+
--text-normal: #000000;
36+
--text-light: var(--editorDarkMode-primary-text);
37+
--text-normal: var(--editorDarkMode-primary-text);
38+
39+
--arg-border: transparent;
40+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"title": "Random Block Colors",
3+
"description": "Swaps around the colors of all the blocks each time you press the green flag!",
4+
"credits": [
5+
{
6+
"username": "Alan",
7+
"url": "https://www.youtube.com/watch?v=z54AmH9Yi78&feature=youtu.be"
8+
}
9+
],
10+
"type": ["Editor", "Egg"],
11+
"styles": [{ "file": "style.css", "runOn": "/projects/*" }],
12+
"scripts": [{ "file": "script.js", "runOn": "/projects/*" }],
13+
"resources": [
14+
{ "name": "check", "path": "/check.svg" },
15+
{ "name": "circle", "path": "/circle.svg" },
16+
{ "name": "colors", "path": "/colors.css" }
17+
],
18+
"components": [
19+
{
20+
"type": "info",
21+
"content": "This is an April Fool's Day feature. It was likely enabled automatically on April 1st, but you may disable it if you'd like."
22+
},
23+
{
24+
"type": "warning",
25+
"content": "This feature is not compatible with the \"More Block Themes\" feature. You will not be able to use other block themes while this feature is enabled."
26+
}
27+
]
28+
}

0 commit comments

Comments
 (0)