|
{"version":3,"file":"chunks/compatibilitytesting.js","sources":["webpack://GUI/./src/playground/compatibility-testing.jsx"],"sourcesContent":["import React from 'react';\nimport ReactDOM from 'react-dom';\n\nimport GUI from '../containers/gui.jsx';\nimport HashParserHOC from '../lib/hash-parser-hoc.jsx';\nimport AppStateHOC from '../lib/app-state-hoc.jsx';\nconst WrappedGui = AppStateHOC(HashParserHOC(GUI));\n\n\nconst DEFAULT_PROJECT_ID = '10015059';\n\nclass Player extends React.Component {\n constructor (props) {\n super(props);\n this.updateProject = this.updateProject.bind(this);\n\n this.state = {\n projectId: window.location.hash.substring(1) || DEFAULT_PROJECT_ID\n };\n }\n componentDidMount () {\n window.addEventListener('hashchange', this.updateProject);\n if (!window.location.hash.substring(1)) {\n window.location.hash = DEFAULT_PROJECT_ID;\n }\n }\n componentWillUnmount () {\n window.addEventListener('hashchange', this.updateProject);\n }\n updateProject () {\n this.setState({projectId: window.location.hash.substring(1)});\n }\n render () {\n return (\n <div style={{display: 'flex'}}>\n <WrappedGui\n isPlayerOnly\n isFullScreen={false}\n />\n <iframe\n allowFullScreen\n allowTransparency\n frameBorder=\"0\"\n height=\"402\"\n src={`https://scratch.mit.edu/projects/embed/${this.state.projectId}/?autostart=true`}\n width=\"485\"\n />\n </div>\n );\n }\n}\n\nconst appTarget = document.createElement('div');\ndocument.body.appendChild(appTarget);\n\nReactDOM.render(<Player />, appTarget);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAGA;AACA;AACA;;;;;AACA;AAAA;AACA;AADA;AACA;AAAA;AACA;AAEA;AACA;AADA;AAJA;AAOA;AACA;;;AAAA;AACA;AACA;AAAA;AACA;AACA;AACA;;;AACA;AACA;AACA;;;AACA;AACA;AAAA;AAAA;AACA;;;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAEA;AACA;AAFA;AAKA;AACA;AACA;AACA;AACA;AACA;AANA;AAUA;;;;AAtCA;AACA;AAwCA;AACA;AAEA;;;;A","sourceRoot":""}
|