Skip to content

Commit 60fccec

Browse files
committed
Global Procedures Experiment is real again
1 parent 97e56e2 commit 60fccec

494 files changed

Lines changed: 534050 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/playground/experiments.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@
44
"name": "Assets Tab",
55
"description": "A new tab in the editor that allows you to upload arbitrary files and such into your project!",
66
"status": "Final Testing"
7+
},
8+
{
9+
"id": "global-procedures",
10+
"name": "Global Procedures",
11+
"description": "Use global custom blocks in your projects! (Round 2 babyyyy)",
12+
"status": "Almost Ready"
713
}
814
]
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>Addon Settings - NitroBolt</title>
7+
<style>
8+
body[data-splash-theme="dark"] {
9+
background: #111;
10+
}
11+
12+
noscript {
13+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
14+
}
15+
</style>
16+
</head>
17+
<body>
18+
<noscript>
19+
<h1>This page requires JavaScript</h1>
20+
</noscript>
21+
22+
<script>
23+
(function() {
24+
var theme = '';
25+
26+
try {
27+
var themeSetting = localStorage.getItem('tw:theme');
28+
} catch (e) {
29+
// ignore
30+
}
31+
if (themeSetting === 'light') {
32+
theme = 'light';
33+
} else if (themeSetting === 'dark') {
34+
theme = 'dark';
35+
} else if (themeSetting) {
36+
try {
37+
var parsed = JSON.parse(themeSetting);
38+
if (parsed.gui === 'dark' || parsed.gui === 'light') {
39+
theme = parsed.gui;
40+
}
41+
} catch (e) {
42+
// ignore
43+
}
44+
}
45+
46+
if (!theme) {
47+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
48+
}
49+
50+
document.body.setAttribute('data-splash-theme', theme);
51+
})();
52+
</script>
53+
54+
<div id="app"></div>
55+
<script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings.js"></script></body>
56+
</html>
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<title>NitroBolt Credits</title>
7+
<style>
8+
body[data-splash-theme="dark"] {
9+
background: #111;
10+
}
11+
12+
noscript {
13+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
14+
}
15+
</style>
16+
</head>
17+
<body>
18+
<noscript>
19+
<h1>This page requires JavaScript</h1>
20+
</noscript>
21+
22+
<script>
23+
(function() {
24+
var theme = '';
25+
26+
try {
27+
var themeSetting = localStorage.getItem('tw:theme');
28+
} catch (e) {
29+
// ignore
30+
}
31+
if (themeSetting === 'light') {
32+
theme = 'light';
33+
} else if (themeSetting === 'dark') {
34+
theme = 'dark';
35+
} else if (themeSetting) {
36+
try {
37+
var parsed = JSON.parse(themeSetting);
38+
if (parsed.gui === 'dark' || parsed.gui === 'light') {
39+
theme = parsed.gui;
40+
}
41+
} catch (e) {
42+
// ignore
43+
}
44+
}
45+
46+
if (!theme) {
47+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
48+
}
49+
50+
document.body.setAttribute('data-splash-theme', theme);
51+
})();
52+
</script>
53+
54+
<div id="app"></div>
55+
<script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/credits.js"></script></body>
56+
</html>
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="google" value="notranslate">
7+
<meta name="description" content="NitroBolt is a TurboWarp mod with many changes that builds upon and enhances TurboWarp with many useful features." />
8+
<title>NitroBolt - Editor</title>
9+
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
10+
11+
<link rel="manifest" href="manifest.webmanifest">
12+
13+
<style>
14+
.splash-screen {
15+
position: absolute;
16+
width: 100%;
17+
height: 100%;
18+
top: 0;
19+
left: 0;
20+
display: flex;
21+
flex-direction: column;
22+
gap: 1rem;
23+
align-items: center;
24+
justify-content: center;
25+
text-align: center;
26+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
27+
}
28+
.splash-screen[hidden] {
29+
display: none;
30+
}
31+
.splash-screen[data-theme="dark"] {
32+
background-color: #333;
33+
color: white;
34+
}
35+
.splash-screen > * {
36+
max-width: 80%;
37+
}
38+
.splash-spinner:after {
39+
content: " ";
40+
display: block;
41+
width: 64px;
42+
height: 64px;
43+
border-radius: 50%;
44+
border: 6px solid;
45+
border-color: currentColor transparent currentColor transparent;
46+
animation: splash-spinner 1.2s linear infinite;
47+
}
48+
@keyframes splash-spinner {
49+
0% { transform: rotate(0deg); }
50+
100% { transform: rotate(360deg); }
51+
}
52+
.splash-error-title {
53+
font-weight: bold;
54+
}
55+
.splash-error-title a {
56+
color: inherit;
57+
}
58+
.splash-errors {
59+
font-family: monospace;
60+
}
61+
.splash-error-list {
62+
white-space: pre-wrap;
63+
}
64+
.splash-reset {
65+
color: inherit;
66+
background: none;
67+
padding: 0;
68+
margin: 0;
69+
border: none;
70+
text-decoration: underline;
71+
cursor: pointer;
72+
}
73+
.splash-reset:disabled {
74+
opacity: 0.8;
75+
}
76+
</style>
77+
</head>
78+
<body>
79+
<noscript>
80+
<div class="splash-screen">
81+
<div>
82+
<h1>NitroBolt requires JavaScript</h1>
83+
<p>Consider using <a href="https://desktop.nitrobolt.org/">Nitrobolt Desktop</a> if you are afraid of remote JavaScript.</p>
84+
</div>
85+
</div>
86+
</noscript>
87+
88+
<div class="splash-screen spash-waiting-for-js" hidden>
89+
<div class="splash-spinner"></div>
90+
<div class="splash-error-title" hidden>Something went wrong. <a href="https://scratch.mit.edu/users/CubesterYT/#comments" target="_blank" rel="noreferrer">Please report</a> with the information below.</div>
91+
<div class="splash-errors" hidden></div>
92+
<button class="splash-reset" hidden>Click here to reset caches (can fix some errors)</button>
93+
</div>
94+
95+
<script>
96+
(function () {
97+
'use strict';
98+
99+
var theme = '';
100+
var accent = '#ff5726';
101+
102+
try {
103+
var themeSetting = localStorage.getItem('tw:theme');
104+
} catch (e) {
105+
// ignore
106+
}
107+
if (themeSetting === 'light') {
108+
theme = 'light';
109+
} else if (themeSetting === 'dark') {
110+
theme = 'dark';
111+
} else if (themeSetting) {
112+
try {
113+
var parsed = JSON.parse(themeSetting);
114+
if (parsed.accent === 'purple') {
115+
accent = '#855cd6';
116+
} else if (parsed.accent === 'blue') {
117+
accent = '#4c97ff';
118+
} else if (parsed.accent === 'red') {
119+
accent = '#ff4c4c';
120+
}
121+
if (parsed.gui === 'dark' || parsed.gui === 'light') {
122+
theme = parsed.gui;
123+
}
124+
} catch (e) {
125+
// ignore
126+
}
127+
}
128+
129+
if (!theme) {
130+
theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
131+
}
132+
133+
var splash = document.querySelector('.spash-waiting-for-js');
134+
splash.setAttribute('data-theme', theme);
135+
if (theme !== 'dark') {
136+
137+
splash.style.backgroundColor = accent;
138+
splash.style.color = 'white';
139+
140+
}
141+
splash.hidden = false;
142+
143+
var splashErrorTitle = document.querySelector('.splash-error-title');
144+
var splashError = document.querySelector('.splash-errors');
145+
var splashReset = document.querySelector('.splash-reset');
146+
147+
var totalErrors = 0;
148+
window.onerror = function (event, source, line, col, err) {
149+
if (++totalErrors > 5) return; // dont bother logging more
150+
splashErrorTitle.hidden = splashError.hidden = splashReset.hidden = false;
151+
var el = document.createElement('div');
152+
el.textContent = 'Error (splash) in ' + source + ' (' + line + ':' + col + '): ' + err;
153+
splashError.appendChild(el);
154+
};
155+
156+
splashReset.onclick = function () {
157+
splashReset.disabled = true;
158+
function hardRefresh() {
159+
var search = location.search.replace(/[?&]nocache=[\d.]+(?=$|&)/, '');
160+
// This is a functional cookie used so that we respond with Clear-Site-Data just once. No tracking.
161+
// Can't use nocache parameter to trigger this because people might accidentally bookmark that, and
162+
// then we would be clearing their cache on every visit.
163+
document.cookie = 'tw_clear_cache_once=1; max-age=60; path=/; samesite=strict; secure';
164+
location.replace(location.pathname + search + (search ? '&' : '?') + 'nocache=' + Math.floor(Math.random() * 10000000));
165+
}
166+
if ('serviceWorker' in navigator) {
167+
setTimeout(hardRefresh, 5000);
168+
navigator.serviceWorker.getRegistration("")
169+
.then(function(registration) {
170+
if (registration) {
171+
return registration.unregister();
172+
}
173+
})
174+
.then(hardRefresh)
175+
.catch(hardRefresh);
176+
} else {
177+
hardRefresh();
178+
}
179+
};
180+
181+
window.SplashEnd = () => {
182+
splash.hidden = true;
183+
window.onerror = null;
184+
};
185+
})();
186+
</script>
187+
188+
<div id="app"></div>
189+
<script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/vendors~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings~editor~embed~fullscreen~player.js"></script><script src="js/editor~embed~fullscreen~player.js"></script><script src="js/editor.js"></script></body>
190+
</html>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="google" value="notranslate">
7+
<title>Embedded Project - NitroBolt</title>
8+
<style>
9+
.splash-screen {
10+
position: absolute;
11+
width: 100%;
12+
height: 100%;
13+
top: 0;
14+
left: 0;
15+
background-color: #ff4c4c;
16+
color: white;
17+
display: flex;
18+
flex-direction: column;
19+
align-items: center;
20+
justify-content: center;
21+
text-align: center;
22+
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
23+
}
24+
.splash-screen[hidden] {
25+
display: none;
26+
}
27+
.splash-spinner:after {
28+
content: " ";
29+
display: block;
30+
width: 64px;
31+
height: 64px;
32+
border-radius: 50%;
33+
border: 6px solid;
34+
border-color: white transparent white transparent;
35+
animation: splash-spinner 1.2s linear infinite;
36+
}
37+
@keyframes splash-spinner {
38+
0% { transform: rotate(0deg); }
39+
100% { transform: rotate(360deg); }
40+
}
41+
</style>
42+
</head>
43+
<body>
44+
<noscript>
45+
<div class="splash-screen">
46+
<h1>This embed requires JavaScript</h1>
47+
</div>
48+
</noscript>
49+
50+
<div class="splash-screen" hidden id="splash-need-js">
51+
<div class="splash-spinner"></div>
52+
</div>
53+
54+
<script>
55+
(function() {
56+
'use strict';
57+
58+
var splash = document.getElementById('splash-need-js');
59+
splash.hidden = false;
60+
61+
window.SplashEnd = () => {
62+
splash.hidden = true;
63+
};
64+
}());
65+
</script>
66+
67+
<div id="app"></div>
68+
<script src="js/vendors~addon-settings~credits~editor~embed~fullscreen~player.js"></script><script src="js/vendors~editor~embed~fullscreen~player.js"></script><script src="js/addon-settings~editor~embed~fullscreen~player.js"></script><script src="js/editor~embed~fullscreen~player.js"></script><script src="js/embed.js"></script></body>
69+
</html>

0 commit comments

Comments
 (0)