-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcode.js
More file actions
83 lines (82 loc) · 2.04 KB
/
code.js
File metadata and controls
83 lines (82 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//This code runs through code.org
//You can view the full project here:
//https://studio.code.org/projects/applab/nHcLbGI0Hx1dV-Omxoahc19BC0SYvC3yV-xiWjKmOUk/view
onEvent("checkboxcon", "click", function( ) {
setScreen("user_type");
setChecked("checkboxcon", false);
});
onEvent("button_back1", "click", function( ) {
setScreen("start");
});
onEvent("button_customer", "click", function( ) {
setScreen("screen_customer");
});
onEvent("button_owner", "click", function( ) {
setScreen("screen_owner");
});
onEvent("button_back2", "click", function( ) {
setScreen("user_type");
});
onEvent("res", "click", function( ) {
Reservation();
setScreen("tables");
});
onEvent("super", "click", function( ) {
Reservation();
});
onEvent("hairsalon", "click", function( ) {
Reservation();
});
onEvent("other", "click", function( ) {
Reservation();
});
function Reservation() {
setScreen("screen_reserv");
var x;
while (1) {
x = getText("text_input18");
if (x >= 15 && x <= 18 || x.length != 2) {
showElement("label2");
hideElement("label26");
hideElement("checkbox_finish");
} else {
hideElement("label2");
showElement("label26");
showElement("checkbox_finish");
}
if (getChecked("checkbox_finish")) {
setScreen("done");
setChecked("checkbox_finish", false);
setText("text_input15", "");
setText("text_input17", "");
setText("text_input18", "");
setText("text_input1", "");
return;
}
}
}
onEvent("button1", "click", function( ) {
Reservation();
setScreen("tables");
});
onEvent("button2", "click", function( ) {
setScreen("done");
});
onEvent("button3", "click", function( ) {
setScreen("done");
});
onEvent("button4", "click", function( ) {
setScreen("done");
});
onEvent("button_owner", "click", function( ) {
setScreen("screen_owner");
});
onEvent("buttonback3", "click", function( ) {
setScreen("user_type");
});
onEvent("checkbox3", "click", function( ) {
setScreen("done");
});
onEvent("logo1", "click", function( ) {
setScreen("start");
});