-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
110 lines (77 loc) · 2.89 KB
/
Copy pathindex.html
File metadata and controls
110 lines (77 loc) · 2.89 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<html>
<head>
<script type="text/javascript" src="sb-1.4.1.min.js"></script>
<script type="text/javascript" src="jquery-3.2.1.min.js"></script>
</head>
<body>
<BR><BR>
This is a simple tool for sending values to the spacebrew server, which is at: <a href="http://192.168.1.96:9000/?server=192.168.1.96" target="_blank">http://192.168.1.96:9000/?server=192.168.1.96</a>
<BR><BR>
String1: <input type="text" id="String1" length=40/><span id="String1Send">Send</span><BR>
String2: <input type="text" id="String2" length=40/><span id="String2Send">Send</span><BR>
String3: <input type="text" id="String3" length=40/><span id="String3Send">Send</span><BR>
String4: <input type="text" id="String4" length=40/><span id="String4Send">Send</span><BR>
Button1 : <span id="Button1Send">Send</span><BR>
Button2 : <span id="Button2Send">Send</span><BR>
Button3 : <span id="Button3Send">Send</span><BR>
Button4 : <span id="Button4Send">Send</span><BR>
<script>
var sb_server = "192.168.1.96";
var sb = false;
var app_name = "simple spacebrew controller";
$( document ).ready(function() {
console.log( "ready!" );
sb = new Spacebrew.Client(sb_server, app_name, app_name, {reconnect: true} );
sb.addPublish("String1", "string");
sb.addPublish("String2", "string");
sb.addPublish("String3", "string");
sb.addPublish("String4", "string");
sb.addPublish("click1", "boolean");
sb.addPublish("click2", "boolean");
sb.addPublish("click3", "boolean");
sb.addPublish("click4", "boolean");
sb.connect();
$("#String1Send").click(function(){
console.log("clieck");
console.log($("#String1").val());
var value = $("#String1").val();
sb.send("String1", "string", value.trim() );
});
$("#String2Send").click(function(){
console.log("clieck");
console.log($("#String2").val());
var value = $("#String2").val();
sb.send("String2", "string", value.trim() );
});
$("#String3Send").click(function(){
console.log("clieck");
console.log($("#String3").val());
var value = $("#String3").val();
sb.send("String3", "string", value.trim() );
});
$("#String4Send").click(function(){
console.log("clieck");
console.log($("#String4").val());
var value = $("#String4").val();
sb.send("String4", "string", value.trim() );
});
$("#Button1Send").click(function(){
console.log("clieck");
sb.send("click1", "boolean", "true" );
});
$("#Button2Send").click(function(){
console.log("clieck");
sb.send("click2", "boolean", "true" );
});
$("#Button3Send").click(function(){
console.log("clieck");
sb.send("click3", "boolean", "true" );
});
$("#Button4Send").click(function(){
console.log("clieck");
sb.send("click4", "boolean", "true" );
});
});
</script>
</body>
</html>