Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stanisław committed Sep 18, 2018
2 parents b7c8df0 + 7895baa commit 984120b
Show file tree
Hide file tree
Showing 29 changed files with 869 additions and 1,487 deletions.
49 changes: 49 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"extends": "airbnb",
"globals": {
"window": true,
"document": true,
"fetch": true,
"btoa": true,
"atob": true,
"history": true,
"location": true,
"addEventListener": true
},
"rules": {
"no-undef": "error",
"no-unused-vars": [2, {
"varsIgnorePattern": "h"
}],
"linebreak-style": "off",
"indent": ["error", 4],

"react/jsx-indent": ["error", 4],
"react/jsx-indent-props": ["error", 4],
"react/no-unknown-property": "off",
"react/react-in-jsx-scope": 0,
"react/sort-comp": 0,
"react/require-render-return": 2,
"react/jsx-closing-bracket-location": 0,
"react/jsx-space-before-closing": 0,
"react/jsx-first-prop-new-line": 0,
"react/prop-types": 0,
"react/jsx-filename-extension": [1, {"extensions": [".js", ".jsx"]}],
"react/jsx-uses-vars": 2,

"no-use-before-define": "off",
"jsx-quotes": "off",
"react/jsx-wrap-multilines": "off",
"implicit-arrow-linebreak": "off",
"arrow-parens": "off",
"semi": ["warn"],
"max-len": ["warn", 130],
"no-console": "off",
"no-extra-semi": "warn",
"import/no-dynamic-require": 0,
"import/no-extraneous-dependencies": 0,
"import/prefer-default-export": 0,
"strict": 0
}

}
140 changes: 22 additions & 118 deletions client/src/index.html
Original file line number Diff line number Diff line change
@@ -1,132 +1,36 @@
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no, shrink-to-fit=no">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no, shrink-to-fit=no">

<title>Turtle</title>
<title>Turtle</title>

<meta name="application-name" content="Turtle Control Software">
<meta name="apple-mobile-web-app-title" content="Turtle Control Software">
<meta name="application-name" content="Turtle Control Software">
<meta name="apple-mobile-web-app-title" content="Turtle Control Software">

<meta name="theme-color" content="#000000">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="theme-color" content="#000000">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<!-- icons -->
<link rel="shortcut icon" href="./img/icon/favicon.png">
<link rel="apple-touch-icon-precomposed" href="./img/icon/launcher-4x.png">
<!-- icons -->
<link rel="shortcut icon" href="./img/icon/favicon.png">
<link rel="apple-touch-icon-precomposed" href="./img/icon/launcher-4x.png">

<link rel="manifest" href="./manifest.webmanifest">
<link rel="manifest" href="./manifest.webmanifest">

<!-- critical styles -->
<link rel="stylesheet" href="./scss/bootscreen.scss">
<!-- critical styles -->
<link rel="stylesheet" href="./scss/splashscreen.scss">

</head>
</head>

<body>
<script src="./js/app.js"></script>



<link rel="stylesheet" href="./scss/main.scss">
<!-- <link href="client/vendors/jquery_flagstrap/css/flags.css" rel="stylesheet"> -->
<!-- <link href="client/vendors/vex/css/vex.css" rel="stylesheet"> -->
<!-- <link href="client/vendors/vex/css/vex-theme-os.css" rel="stylesheet"> -->


<!-- include all JavaScript files -->
<!-- <script src="client/vendors/jquery-3.3.1.min.js" -->

<!-- js-Cookie -->
<!-- <script src='client/vendors/js_cookie/js.cookie.js'></script> -->


<!-- jQuery Flagstrap -->

<!-- Amplify JS -->
<!-- <script src='client/vendors/amplify_js/src/core.js'></script>
<script src='client/vendors/amplify_js/src/request.js'></script>
<script src='client/vendors/amplify_js/src/store.js'></script>
<script src="client/vendors/socket.io.js"></script> -->

<!-- user interface -->
<!-- <script src='client/js/namespace.js'></script>
<script src='client/js/utils.js'></script>
<script src='client/js/sockets.js'></script>
<script src='client/js/telemetry.js'></script>
<script src='client/js/frameBuilder.js'></script>
<script src='client/js/webrtc.js'></script> -->

<!-- controller -->
<!-- <script src='client/js/controller.js'></script> -->

<!-- linux communication -->
<!-- <script src='client/js/linux.js'></script> -->

<!-- i18next -->
<!-- <script src='client/vendors/i18next/i18next.js'></script>
<script src='client/vendors/i18next/i18nextXHRBackend.js'></script>
-->

<!-- manipulator -->
<!-- <script src='client/js/manipulator.js'></script> -->

<!-- canvas controller -->
<!-- <script src='client/js/controlcanvas.js'></script> -->


<!-- socket server communication -->
<!-- <script src='client/js/servercommunication.js'></script> -->

<!-- vex dialogs -->
<!-- <script src='client/vendors/vex/js/vex.combined.js'></script> -->

<!-- html2canvas -->
<!-- <script src='client/vendors/html2canvas/html2canvas.js'></script> -->

<!-- canvas2image -->
<!-- <script src='client/vendors/canvas2image/canvas2image.js'></script> -->

<!-- FileSaver -->
<!-- <script src='client/vendors/file_saver/FileSaver.js'></script> -->

<!-- Keyboard support -->
<!-- <script src='client/vendors/keyboardjs/keyboard.min.js'></script> -->

<!-- keboard controller -->
<!-- <script src='client/js/controlkeyboard.js'></script> -->


<script>
/* accordion buttons - the menu ones */
/* ----------------------------------- */
var acc = document.getElementsByClassName("accordion");
var i;

for (i = 0; i < acc.length; i++) {
acc[i].onclick = function() {
this.classList.toggle("active");
var panel = this.nextElementSibling;
if (panel.style.maxHeight) {
panel.style.maxHeight = null;
} else {
panel.style.maxHeight = panel.scrollHeight + "px";
}
}
}
/* ----------------------------------- */
</script>
<!-- <script src='client/js/ui.js'></script>
<script src='client/js/ui/bootscreen.js'></script>
<script src='client/js/ui/menu.js'></script>
<script src='client/js/ui/modeswitcher.js'></script> -->
</body>
<body>
<script src="./js/app.js"></script>
<link rel="stylesheet" href="./scss/main.scss">
</body>

</html>
2 changes: 1 addition & 1 deletion client/src/js/actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const actions = {

setSystemInfo: value => state => ({system_info: value}),

setBootScreenState: value => state => ({ showBootScreen: value }),
setSplashScreenState: value => state => ({ showSplashScreen: value }),
setMode: value => state => save('', { mode: value }),

settings: {
Expand Down
24 changes: 15 additions & 9 deletions client/src/js/app.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { app } from 'hyperapp'
import actions from './actions'
import state from './state'
import view from './view'
import { app } from 'hyperapp';
import actions from './actions';
import state from './state';
import view from './view';

import { hyperlog } from "./utils/logger";
import core from './core'
import { hyperlog } from './utils/logger';
import core from './core';

const wiredActions = hyperlog(app)(state, actions, view, document.body);

document.onreadystatechange = function() {
if (document.readyState === "complete") {
document.onreadystatechange = () => {
if (document.readyState === 'complete') {
wiredActions.restoreState();
wiredActions.setBootScreenState(false);
wiredActions.setSplashScreenState(false);
console.log(wiredActions);
}
};
Expand All @@ -23,3 +23,9 @@ core(wiredActions);
// https://stackoverflow.com/a/50856621/1589989
// this is commented out since its prevents from moving thumb on mobile devices
// window.addEventListener("touchmove", (event) => event.preventDefault(), {passive: false} );

window.oncontextmenu = (event) => {
event.preventDefault();
event.stopPropagation();
return false;
};
98 changes: 0 additions & 98 deletions client/src/js/controller.js

This file was deleted.

4 changes: 2 additions & 2 deletions client/src/js/core/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Stream.prototype.createPeerConnection = function() {

this.peerConnection.ontrack = (event) => {
console.log("[stream] remote stream added:", event.streams[0]);
let remoteVideoElement = document.getElementById('remote-video');
let remoteVideoElement = document.getElementById('stream');
remoteVideoElement.srcObject = event.streams[0];
remoteVideoElement.play();
}
Expand Down Expand Up @@ -199,7 +199,7 @@ Stream.prototype.error = function(event) {

Stream.prototype.stop = function() {
// stop_record();
document.getElementById('remote-video').src = '';
document.getElementById('stream').src = '';

this.close();

Expand Down
10 changes: 0 additions & 10 deletions client/src/js/errors.js

This file was deleted.

Loading

0 comments on commit 984120b

Please sign in to comment.