@@ -45,13 +45,14 @@ import {APP_NAME} from '../lib/brand.js';
4545
4646import styles from './interface.css' ;
4747
48- const isInvalidEmbed = window . parent ! == window ;
48+ const isInvalidEmbed = window . parent == window ;
4949
5050const handleClickAddonSettings = addonId => {
5151 // addonId might be a string of the addon to focus on, undefined, or an event (treat like undefined)
52- const path = process . env . ROUTING_STYLE === 'wildcard' ? 'addons' : 'addons.html' ;
52+ /* const path = process.env.ROUTING_STYLE === 'wildcard' ? 'addons' : 'addons.html';
5353 const url = `${process.env.ROOT}${path}${typeof addonId === 'string' ? `#${addonId}` : ''}`;
54- window . open ( url ) ;
54+ window.open(url);*/
55+ window . parent . postMessage ( { type : "block-compiler-action" , action : "addonsPage" } , "*" ) ;
5556} ;
5657
5758const messages = defineMessages ( {
@@ -81,117 +82,6 @@ if (AddonChannels.changeChannel) {
8182
8283runAddons ( ) ;
8384
84- const Footer = ( ) => (
85- < footer className = { styles . footer } >
86- < div className = { styles . footerContent } >
87- < div className = { styles . footerText } >
88- < FormattedMessage
89- // eslint-disable-next-line max-len
90- defaultMessage = "{APP_NAME} is not affiliated with Scratch, the Scratch Team, or the Scratch Foundation."
91- description = "Disclaimer that TurboWarp is not connected to Scratch"
92- id = "tw.footer.disclaimer"
93- values = { {
94- APP_NAME
95- } }
96- />
97- </ div >
98-
99- < div className = { styles . footerText } >
100- < FormattedMessage
101- // eslint-disable-next-line max-len
102- defaultMessage = "Scratch is a project of the Scratch Foundation. It is available for free at {scratchDotOrg}."
103- description = "A disclaimer that Scratch requires when referring to Scratch. {scratchDotOrg} is a link with text 'https://scratch.org/'"
104- id = "tw.footer.scratchDisclaimer"
105- values = { {
106- scratchDotOrg : (
107- < a
108- href = "https://scratch.org/"
109- target = "_blank"
110- rel = "noreferrer"
111- >
112- { 'https://scratch.org/' }
113- </ a >
114- )
115- } }
116- />
117- </ div >
118-
119- < div className = { styles . footerColumns } >
120- < div className = { styles . footerSection } >
121- < a href = "credits.html" >
122- < FormattedMessage
123- defaultMessage = "Credits"
124- description = "Credits link in footer"
125- id = "tw.footer.credits"
126- />
127- </ a >
128- < a href = "https://github.com/sponsors/GarboMuffin" >
129- < FormattedMessage
130- defaultMessage = "Donate"
131- description = "Donation link in footer"
132- id = "tw.footer.donate"
133- />
134- </ a >
135- </ div >
136- < div className = { styles . footerSection } >
137- < a href = "https://desktop.turbowarp.org/" >
138- { /* Do not translate */ }
139- { 'TurboWarp Desktop' }
140- </ a >
141- < a href = "https://packager.turbowarp.org/" >
142- { /* Do not translate */ }
143- { 'TurboWarp Packager' }
144- </ a >
145- < a href = "https://docs.turbowarp.org/embedding" >
146- < FormattedMessage
147- defaultMessage = "Embedding"
148- description = "Link in footer to embedding documentation for embedding link"
149- id = "tw.footer.embed"
150- />
151- </ a >
152- < a href = "https://docs.turbowarp.org/url-parameters" >
153- < FormattedMessage
154- defaultMessage = "URL Parameters"
155- description = "Link in footer to URL parameters documentation"
156- id = "tw.footer.parameters"
157- />
158- </ a >
159- < a href = "https://docs.turbowarp.org/" >
160- < FormattedMessage
161- defaultMessage = "Documentation"
162- description = "Link in footer to additional documentation"
163- id = "tw.footer.documentation"
164- />
165- </ a >
166- </ div >
167- < div className = { styles . footerSection } >
168- < a href = "https://scratch.mit.edu/users/GarboMuffin/#comments" >
169- < FormattedMessage
170- defaultMessage = "Feedback & Bugs"
171- description = "Link to feedback/bugs page"
172- id = "tw.feedback"
173- />
174- </ a >
175- < a href = "https://github.com/TurboWarp/" >
176- < FormattedMessage
177- defaultMessage = "Source Code"
178- description = "Link to source code"
179- id = "tw.code"
180- />
181- </ a >
182- < a href = "privacy.html" >
183- < FormattedMessage
184- defaultMessage = "Privacy Policy"
185- description = "Link to privacy policy"
186- id = "tw.privacy"
187- />
188- </ a >
189- </ div >
190- </ div >
191- </ div >
192- </ footer >
193- ) ;
194-
19585class Interface extends React . Component {
19686 constructor ( props ) {
19787 super ( props ) ;
@@ -237,17 +127,6 @@ class Interface extends React.Component {
237127 } ) }
238128 dir = { isRtl ? 'rtl' : 'ltr' }
239129 >
240- { isHomepage ? (
241- < div className = { styles . menu } >
242- < WrappedMenuBar
243- canChangeLanguage
244- canManageFiles
245- canChangeTheme
246- enableSeeInside
247- onClickAddonSettings = { handleClickAddonSettings }
248- />
249- </ div >
250- ) : null }
251130 < div
252131 className = { styles . center }
253132 style = { isPlayerOnly ? ( {
@@ -262,96 +141,7 @@ class Interface extends React.Component {
262141 backpackHost = "_local_"
263142 { ...props }
264143 />
265- { isHomepage ? (
266- < React . Fragment >
267- { isBrowserSupported ( ) ? null : (
268- < BrowserModal isRtl = { isRtl } />
269- ) }
270- < div className = { styles . section } >
271- < ProjectInput />
272- </ div >
273- { (
274- // eslint-disable-next-line max-len
275- description . instructions === 'unshared' || description . credits === 'unshared'
276- ) && (
277- < div className = { classNames ( styles . infobox , styles . unsharedUpdate ) } >
278- < p >
279- < FormattedMessage
280- defaultMessage = "Unshared projects are no longer visible."
281- description = "Appears on unshared projects"
282- id = "tw.unshared2.1"
283- />
284- </ p >
285- < p >
286- < FormattedMessage
287- defaultMessage = "For more information, visit: {link}"
288- description = "Appears on unshared projects"
289- id = "tw.unshared.2"
290- values = { {
291- link : (
292- < a
293- href = "https://docs.turbowarp.org/unshared-projects"
294- target = "_blank"
295- rel = "noopener noreferrer"
296- >
297- { 'https://docs.turbowarp.org/unshared-projects' }
298- </ a >
299- )
300- } }
301- />
302- </ p >
303- < p >
304- < FormattedMessage
305- // eslint-disable-next-line max-len
306- defaultMessage = "If the project was shared recently, this message may appear incorrectly for a few minutes."
307- description = "Appears on unshared projects"
308- id = "tw.unshared.cache"
309- />
310- </ p >
311- < p >
312- < FormattedMessage
313- // eslint-disable-next-line max-len
314- defaultMessage = "If this project is actually shared, please report a bug."
315- description = "Appears on unshared projects"
316- id = "tw.unshared.bug"
317- />
318- </ p >
319- </ div >
320- ) }
321- { hasCloudVariables && projectId !== '0' && (
322- < div className = { styles . section } >
323- < CloudVariableBadge />
324- </ div >
325- ) }
326- { description . instructions || description . credits ? (
327- < div className = { styles . section } >
328- < Description
329- instructions = { description . instructions }
330- credits = { description . credits }
331- projectId = { projectId }
332- />
333- </ div >
334- ) : null }
335- < div className = { styles . section } >
336- < p >
337- < FormattedMessage
338- // eslint-disable-next-line max-len
339- defaultMessage = "{APP_NAME} is a Scratch mod that compiles projects to JavaScript to make them run really fast. Try it out by inputting a project ID or URL above or choosing a featured project below."
340- description = "Description of TurboWarp on the homepage"
341- id = "tw.home.description"
342- values = { {
343- APP_NAME
344- } }
345- />
346- </ p >
347- </ div >
348- < div className = { styles . section } >
349- < FeaturedProjects studio = "27205657" />
350- </ div >
351- </ React . Fragment >
352- ) : null }
353144 </ div >
354- { isHomepage && < Footer /> }
355145 </ div >
356146 ) ;
357147 }
0 commit comments