Skip to content

Commit 984120b

Browse files
author
Stanisław
committed
Merge branch 'dev'
2 parents b7c8df0 + 7895baa commit 984120b

29 files changed

+869
-1487
lines changed

.eslintrc.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"extends": "airbnb",
3+
"globals": {
4+
"window": true,
5+
"document": true,
6+
"fetch": true,
7+
"btoa": true,
8+
"atob": true,
9+
"history": true,
10+
"location": true,
11+
"addEventListener": true
12+
},
13+
"rules": {
14+
"no-undef": "error",
15+
"no-unused-vars": [2, {
16+
"varsIgnorePattern": "h"
17+
}],
18+
"linebreak-style": "off",
19+
"indent": ["error", 4],
20+
21+
"react/jsx-indent": ["error", 4],
22+
"react/jsx-indent-props": ["error", 4],
23+
"react/no-unknown-property": "off",
24+
"react/react-in-jsx-scope": 0,
25+
"react/sort-comp": 0,
26+
"react/require-render-return": 2,
27+
"react/jsx-closing-bracket-location": 0,
28+
"react/jsx-space-before-closing": 0,
29+
"react/jsx-first-prop-new-line": 0,
30+
"react/prop-types": 0,
31+
"react/jsx-filename-extension": [1, {"extensions": [".js", ".jsx"]}],
32+
"react/jsx-uses-vars": 2,
33+
34+
"no-use-before-define": "off",
35+
"jsx-quotes": "off",
36+
"react/jsx-wrap-multilines": "off",
37+
"implicit-arrow-linebreak": "off",
38+
"arrow-parens": "off",
39+
"semi": ["warn"],
40+
"max-len": ["warn", 130],
41+
"no-console": "off",
42+
"no-extra-semi": "warn",
43+
"import/no-dynamic-require": 0,
44+
"import/no-extraneous-dependencies": 0,
45+
"import/prefer-default-export": 0,
46+
"strict": 0
47+
}
48+
49+
}

client/src/index.html

Lines changed: 22 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -1,132 +1,36 @@
11
<!DOCTYPE html>
22
<html>
33

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

9-
<title>Turtle</title>
9+
<title>Turtle</title>
1010

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

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

17-
<meta name="mobile-web-app-capable" content="yes">
18-
<meta name="apple-mobile-web-app-capable" content="yes">
17+
<meta name="mobile-web-app-capable" content="yes">
18+
<meta name="apple-mobile-web-app-capable" content="yes">
1919

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

24-
<link rel="manifest" href="./manifest.webmanifest">
24+
<link rel="manifest" href="./manifest.webmanifest">
2525

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

29-
</head>
29+
</head>
3030

31-
<body>
32-
<script src="./js/app.js"></script>
33-
34-
35-
36-
<link rel="stylesheet" href="./scss/main.scss">
37-
<!-- <link href="client/vendors/jquery_flagstrap/css/flags.css" rel="stylesheet"> -->
38-
<!-- <link href="client/vendors/vex/css/vex.css" rel="stylesheet"> -->
39-
<!-- <link href="client/vendors/vex/css/vex-theme-os.css" rel="stylesheet"> -->
40-
41-
42-
<!-- include all JavaScript files -->
43-
<!-- <script src="client/vendors/jquery-3.3.1.min.js" -->
44-
45-
<!-- js-Cookie -->
46-
<!-- <script src='client/vendors/js_cookie/js.cookie.js'></script> -->
47-
48-
49-
<!-- jQuery Flagstrap -->
50-
51-
<!-- Amplify JS -->
52-
<!-- <script src='client/vendors/amplify_js/src/core.js'></script>
53-
<script src='client/vendors/amplify_js/src/request.js'></script>
54-
<script src='client/vendors/amplify_js/src/store.js'></script>
55-
56-
<script src="client/vendors/socket.io.js"></script> -->
57-
58-
<!-- user interface -->
59-
<!-- <script src='client/js/namespace.js'></script>
60-
<script src='client/js/utils.js'></script>
61-
<script src='client/js/sockets.js'></script>
62-
<script src='client/js/telemetry.js'></script>
63-
<script src='client/js/frameBuilder.js'></script>
64-
65-
<script src='client/js/webrtc.js'></script> -->
66-
67-
<!-- controller -->
68-
<!-- <script src='client/js/controller.js'></script> -->
69-
70-
<!-- linux communication -->
71-
<!-- <script src='client/js/linux.js'></script> -->
72-
73-
<!-- i18next -->
74-
<!-- <script src='client/vendors/i18next/i18next.js'></script>
75-
<script src='client/vendors/i18next/i18nextXHRBackend.js'></script>
76-
-->
77-
78-
<!-- manipulator -->
79-
<!-- <script src='client/js/manipulator.js'></script> -->
80-
81-
<!-- canvas controller -->
82-
<!-- <script src='client/js/controlcanvas.js'></script> -->
83-
84-
85-
<!-- socket server communication -->
86-
<!-- <script src='client/js/servercommunication.js'></script> -->
87-
88-
<!-- vex dialogs -->
89-
<!-- <script src='client/vendors/vex/js/vex.combined.js'></script> -->
90-
91-
<!-- html2canvas -->
92-
<!-- <script src='client/vendors/html2canvas/html2canvas.js'></script> -->
93-
94-
<!-- canvas2image -->
95-
<!-- <script src='client/vendors/canvas2image/canvas2image.js'></script> -->
96-
97-
<!-- FileSaver -->
98-
<!-- <script src='client/vendors/file_saver/FileSaver.js'></script> -->
99-
100-
<!-- Keyboard support -->
101-
<!-- <script src='client/vendors/keyboardjs/keyboard.min.js'></script> -->
102-
103-
<!-- keboard controller -->
104-
<!-- <script src='client/js/controlkeyboard.js'></script> -->
105-
106-
107-
<script>
108-
/* accordion buttons - the menu ones */
109-
/* ----------------------------------- */
110-
var acc = document.getElementsByClassName("accordion");
111-
var i;
112-
113-
for (i = 0; i < acc.length; i++) {
114-
acc[i].onclick = function() {
115-
this.classList.toggle("active");
116-
var panel = this.nextElementSibling;
117-
if (panel.style.maxHeight) {
118-
panel.style.maxHeight = null;
119-
} else {
120-
panel.style.maxHeight = panel.scrollHeight + "px";
121-
}
122-
}
123-
}
124-
/* ----------------------------------- */
125-
</script>
126-
<!-- <script src='client/js/ui.js'></script>
127-
<script src='client/js/ui/bootscreen.js'></script>
128-
<script src='client/js/ui/menu.js'></script>
129-
<script src='client/js/ui/modeswitcher.js'></script> -->
130-
</body>
31+
<body>
32+
<script src="./js/app.js"></script>
33+
<link rel="stylesheet" href="./scss/main.scss">
34+
</body>
13135

13236
</html>

client/src/js/actions/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const actions = {
2121

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

24-
setBootScreenState: value => state => ({ showBootScreen: value }),
24+
setSplashScreenState: value => state => ({ showSplashScreen: value }),
2525
setMode: value => state => save('', { mode: value }),
2626

2727
settings: {

client/src/js/app.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import { app } from 'hyperapp'
2-
import actions from './actions'
3-
import state from './state'
4-
import view from './view'
1+
import { app } from 'hyperapp';
2+
import actions from './actions';
3+
import state from './state';
4+
import view from './view';
55

6-
import { hyperlog } from "./utils/logger";
7-
import core from './core'
6+
import { hyperlog } from './utils/logger';
7+
import core from './core';
88

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

11-
document.onreadystatechange = function() {
12-
if (document.readyState === "complete") {
11+
document.onreadystatechange = () => {
12+
if (document.readyState === 'complete') {
1313
wiredActions.restoreState();
14-
wiredActions.setBootScreenState(false);
14+
wiredActions.setSplashScreenState(false);
1515
console.log(wiredActions);
1616
}
1717
};
@@ -23,3 +23,9 @@ core(wiredActions);
2323
// https://stackoverflow.com/a/50856621/1589989
2424
// this is commented out since its prevents from moving thumb on mobile devices
2525
// window.addEventListener("touchmove", (event) => event.preventDefault(), {passive: false} );
26+
27+
window.oncontextmenu = (event) => {
28+
event.preventDefault();
29+
event.stopPropagation();
30+
return false;
31+
};

client/src/js/controller.js

Lines changed: 0 additions & 98 deletions
This file was deleted.

client/src/js/core/stream.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Stream.prototype.createPeerConnection = function() {
5353

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

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

204204
this.close();
205205

client/src/js/errors.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)