Commit f2338a4b authored by Dominik Schuhmann's avatar Dominik Schuhmann
Browse files

more Units as ID with ';' as Seperator possible

parent b4aae08e
......@@ -23,30 +23,36 @@
<h1 style = "text-align: center">Checkbox 1</h1>
<!--einzellne Units-->
<h3 style = "text-align: center">Checkbox 1</h3>
<div style="text-align: center">
<input type="checkbox" id="stack" class="checkboxunit" name="horns" onclick="myfunction()">
<h1 style = "text-align: center">Checkbox 2</h1>
<h3 style = "text-align: center">Checkbox 2</h3>
<div style="text-align: center">
<input type="checkbox" id="unit" class="checkboxunit" name="horns" style onclick="myfunction()">
<h1 style = "text-align: center">Checkbox 3</h1>
<h3 style = "text-align: center">Checkbox 3</h3>
<div style="text-align: center">
<input type="checkbox" id="rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
<h1 style = "text-align: center">Checkbox 4</h1>
<h3 style = "text-align: center">Checkbox 4</h3>
<div style="text-align: center">
<input type="checkbox" id="hub" class="checkboxunit" name="horns" style onclick="myfunction()">
<h1 style = "text-align: center">Checkbox 5</h1>
<h3 style = "text-align: center">Checkbox 5</h3>
<div style="text-align: center">
<input type="checkbox" id="dual-B" class="checkboxunit" name="horns" style onclick="myfunction()">
<h1 style = "text-align: center">Checkbox 6</h1>
<h3 style = "text-align: center">Checkbox 6</h3>
<div style="text-align: center">
<input type="checkbox" id="pir" class="checkboxunit" name="horns" style onclick="myfunction()">
<!--mehrere Units müssen mit einem Semikolon unterteilt werden-->
<h3 style = "text-align: center">Checkbox 7 pir and rgb</h3>
<div style="text-align: center">
<input type="checkbox" id="pir;rgbUnit" class="checkboxunit" name="horns" style onclick="myfunction()">
<p id="result"></p>
......@@ -60,7 +66,8 @@
<h3 id="infoseiten"></h3>
<script src="C:\Users\Dominik\Documents\PhpStorm_Workspace\Nerdtree\js\main.js"></script>
<!--muss immer an den jeweiligen Pfad der main.js datei angepasst werden.-->
<script src="C:\Users\Dominik\Documents\Jku\M5Stack\PHPStorm\Nerdtree\js\main.js"></script>
function myfunction() {
//deklaration aller checkboxen, mit dem namen der Unit als ID und eine checked function
var check1 = document.getElementById('stack');
var check2 = document.getElementById('unit');
var check3 = document.getElementById('rgbUnit');
var check4 = document.getElementById('hub');
var check5 = document.getElementById('dual-B');
var check6 = document.getElementById('pir');
var check7 = document.getElementById('pir;rgbUnit')
var array = [];
if (check1.checked == true) {
......@@ -24,10 +26,19 @@ function myfunction() {
if (check6.checked == true) {
if (check7.checked == true) {
//function to split more Units IDs
function split(string){
return string.split(';');
function getmoeglicheAufgaben(array){
//deklaration Aufgaben
if(array!=null) array = array.flat();
//deklaration Aufgaben
var aufledsleucht = [["rgbUnit"],"", "LEDs zum Leuchten bringen"];
var leuchtenpir = [["pir"],"", "Licht leuchten lassen mit Bewegungssensor"];
var ledsbewegungssensor =[["rgbUnit","pir"], "", "LEDs leuchten lassen mithilfe eines Bewegungssensors"];
......@@ -105,5 +116,4 @@ function getmoeglicheAufgaben(array){
function printInfo (x){
textinfos += "<li>"+"<a href="+x[1] +">"+x[2]+"</a>"+"<p>Verwendete Units: "+x[0]+"</p>"+"</li>";
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment