not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

115 lines
6.0 KiB

  1. var GUI =
  2. (window["webpackJsonpGUI"] = window["webpackJsonpGUI"] || []).push([["compatibilitytesting"],{
  3. /***/ "./src/playground/compatibility-testing.jsx":
  4. /*!**************************************************!*\
  5. !*** ./src/playground/compatibility-testing.jsx ***!
  6. \**************************************************/
  7. /*! no exports provided */
  8. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  9. "use strict";
  10. __webpack_require__.r(__webpack_exports__);
  11. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "./node_modules/react/index.js");
  12. /* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
  13. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ "./node_modules/react-dom/index.js");
  14. /* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);
  15. /* harmony import */ var _containers_gui_jsx__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../containers/gui.jsx */ "./src/containers/gui.jsx");
  16. /* harmony import */ var _lib_hash_parser_hoc_jsx__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../lib/hash-parser-hoc.jsx */ "./src/lib/hash-parser-hoc.jsx");
  17. /* harmony import */ var _lib_app_state_hoc_jsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../lib/app-state-hoc.jsx */ "./src/lib/app-state-hoc.jsx");
  18. function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  19. function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
  20. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  21. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  22. function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
  23. function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
  24. function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
  25. function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
  26. function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
  27. var WrappedGui = Object(_lib_app_state_hoc_jsx__WEBPACK_IMPORTED_MODULE_4__["default"])(Object(_lib_hash_parser_hoc_jsx__WEBPACK_IMPORTED_MODULE_3__["default"])(_containers_gui_jsx__WEBPACK_IMPORTED_MODULE_2__["default"]));
  28. var DEFAULT_PROJECT_ID = '10015059';
  29. var Player =
  30. /*#__PURE__*/
  31. function (_React$Component) {
  32. _inherits(Player, _React$Component);
  33. function Player(props) {
  34. var _this;
  35. _classCallCheck(this, Player);
  36. _this = _possibleConstructorReturn(this, _getPrototypeOf(Player).call(this, props));
  37. _this.updateProject = _this.updateProject.bind(_assertThisInitialized(_this));
  38. _this.state = {
  39. projectId: window.location.hash.substring(1) || DEFAULT_PROJECT_ID
  40. };
  41. return _this;
  42. }
  43. _createClass(Player, [{
  44. key: "componentDidMount",
  45. value: function componentDidMount() {
  46. window.addEventListener('hashchange', this.updateProject);
  47. if (!window.location.hash.substring(1)) {
  48. window.location.hash = DEFAULT_PROJECT_ID;
  49. }
  50. }
  51. }, {
  52. key: "componentWillUnmount",
  53. value: function componentWillUnmount() {
  54. window.addEventListener('hashchange', this.updateProject);
  55. }
  56. }, {
  57. key: "updateProject",
  58. value: function updateProject() {
  59. this.setState({
  60. projectId: window.location.hash.substring(1)
  61. });
  62. }
  63. }, {
  64. key: "render",
  65. value: function render() {
  66. return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {
  67. style: {
  68. display: 'flex'
  69. }
  70. }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(WrappedGui, {
  71. isPlayerOnly: true,
  72. isFullScreen: false
  73. }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("iframe", {
  74. allowFullScreen: true,
  75. allowTransparency: true,
  76. frameBorder: "0",
  77. height: "402",
  78. src: "https://scratch.mit.edu/projects/embed/".concat(this.state.projectId, "/?autostart=true"),
  79. width: "485"
  80. }));
  81. }
  82. }]);
  83. return Player;
  84. }(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component);
  85. var appTarget = document.createElement('div');
  86. document.body.appendChild(appTarget);
  87. react_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(Player, null), appTarget);
  88. /***/ })
  89. },[["./src/playground/compatibility-testing.jsx","lib.min"]]]);
  90. //# sourceMappingURL=compatibilitytesting.js.map