Skip to content

Commit

Permalink
Merge pull request #32 from EditVR/develop
Browse files Browse the repository at this point in the history
Deploy changes in October
  • Loading branch information
mirzu authored Nov 19, 2018
2 parents c428725 + 5ba8280 commit ae4d3f4
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 9 deletions.
39 changes: 39 additions & 0 deletions 404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>404 Redirect Page</title>
<script type="text/javascript">
// Source:
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script takes the current url and converts the path and query
// string into just a query string, and then redirects the browser
// to the new url with only a query string and hash fragment,
// e.g. http://www.foo.tld/one/two?a=b&c=d#qwe, becomes
// http://www.foo.tld/?p=/one/two&q=a=b~and~c=d#qwe
// Note: this 404.html file must be at least 512 bytes for it to work
// with Internet Explorer (it is currently > 512 bytes)
// If you're creating a Project Pages site and NOT using a custom domain,
// then set segmentCount to 1 (enterprise users may need to set it to > 1).
// This way the code will only replace the route part of the path, and not
// the real directory in which the app resides, for example:
// https://username.github.io/repo-name/one/two?a=b&c=d#qwe becomes
// https://username.github.io/repo-name/?p=/one/two&q=a=b~and~c=d#qwe
// Otherwise, leave segmentCount as 0.
var segmentCount = 0;
var l = window.location;
l.replace(
l.protocol + '//' + l.hostname + (l.port ? ':' + l.port : '') +
l.pathname.split('/').slice(0, 1 + segmentCount).join('/') + '/?p=/' +
l.pathname.slice(1).split('/').slice(segmentCount).join('/').replace(/&/g, '~and~') +
(l.search ? '&q=' + l.search.slice(1).replace(/&/g, '~and~') : '') +
l.hash
);
</script>
</head>
<body>
</body>
</html>
2 changes: 1 addition & 1 deletion public/CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
editvr.io
www.editvr.io
31 changes: 31 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,37 @@
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!-- Start Single Page Apps for GitHub Pages -->
<script type="text/javascript">
// Single Page Apps for GitHub Pages
// https://github.com/rafrex/spa-github-pages
// Copyright (c) 2016 Rafael Pedicini, licensed under the MIT License
// ----------------------------------------------------------------------
// This script checks to see if a redirect is present in the query string
// and converts it back into the correct url and adds it to the
// browser's history using window.history.replaceState(...),
// which won't cause the browser to attempt to load the new url.
// When the single page app is loaded further down in this file,
// the correct url will be waiting in the browser's history for
// the single page app to route accordingly.
(function(l) {
if (l.search) {
var q = {};
l.search.slice(1).split('&').forEach(function(v) {
var a = v.split('=');
q[a[0]] = a.slice(1).join('=').replace(/~and~/g, '&');
});
if (q.p !== undefined) {
window.history.replaceState(null, null,
l.pathname.slice(0, -1) + (q.p || '') +
(q.q ? ('?' + q.q) : '') +
l.hash
);
}
}
}(window.location))
</script>
<!-- End Single Page Apps for GitHub Pages -->
</head>
<body>
<noscript>
Expand Down
17 changes: 13 additions & 4 deletions src/components/ComponentForm/ComponentForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import { string, object, mixed } from 'yup';
import { string, object, number } from 'yup';
import { withFormik } from 'formik';
import {
withStyles,
Expand Down Expand Up @@ -266,6 +266,7 @@ class ComponentForm extends Component {
: 'Use this field to set the positional X coordinate for this component'
}
value={values.field_x}
inputProps={{ step: 'any' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_x && touched.field_x}
Expand All @@ -283,6 +284,7 @@ class ComponentForm extends Component {
: 'Use this field to set the positional Y coordinate for this component'
}
value={values.field_y}
inputProps={{ step: 'any' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_y && touched.field_y}
Expand All @@ -300,6 +302,7 @@ class ComponentForm extends Component {
: 'Use this field to set the positional Z coordinate for this component'
}
value={values.field_z}
inputProps={{ step: 'any' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_z && touched.field_z}
Expand Down Expand Up @@ -391,9 +394,15 @@ const FormikComponentForm = withFormik({
.required()
.min(3)
.max(200),
field_x: mixed(),
field_y: mixed(),
field_z: mixed()
field_x: number()
.min(-6)
.max(6),
field_y: number()
.min(-3)
.max(6),
field_z: number()
.min(-6)
.max(6)
}),
handleSubmit: (values, { props, setSubmitting }) => {
const {
Expand Down
17 changes: 13 additions & 4 deletions src/components/SceneRotationForm/SceneRotationForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { object, mixed } from 'yup';
import { object, number } from 'yup';
import { withFormik } from 'formik';
import { withStyles, TextField, Button } from '@material-ui/core';

Expand Down Expand Up @@ -132,6 +132,7 @@ class SceneRotationForm extends Component {
: 'Use this field to set the X value for this scenes sky rotation.'
}
value={values.field_sky_rotation_x}
inputProps={{ step: '0.5' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_sky_rotation_x && touched.field_sky_rotation_x}
Expand All @@ -149,6 +150,7 @@ class SceneRotationForm extends Component {
: 'Use this field to set the Y value for this scenes sky rotation.'
}
value={values.field_sky_rotation_y}
inputProps={{ step: '0.5' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_sky_rotation_y && touched.field_sky_rotation_y}
Expand All @@ -166,6 +168,7 @@ class SceneRotationForm extends Component {
: 'Use this field to set the Z value for this scenes sky rotation.'
}
value={values.field_sky_rotation_z}
inputProps={{ step: '0.5' }}
onChange={this.handleChange}
onBlur={handleBlur}
error={!!errors.field_sky_rotation_z && touched.field_sky_rotation_z}
Expand Down Expand Up @@ -212,9 +215,15 @@ const FormikSceneRotationForm = withFormik({
};
},
validationSchema: object().shape({
field_sky_rotation_x: mixed(),
field_sky_rotation_y: mixed(),
field_sky_rotation_z: mixed()
field_sky_rotation_x: number()
.min(-180)
.max(180),
field_sky_rotation_y: number()
.min(-180)
.max(180),
field_sky_rotation_z: number()
.min(-180)
.max(180)
}),
handleSubmit: (values, { props, setSubmitting }) => {
const {
Expand Down

0 comments on commit ae4d3f4

Please sign in to comment.