File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed
coder-apps/tests/socket_test
raspbian-addons/home/coder/coder-dist/coder-base Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,24 @@ $(document).ready( function() {
3
3
4
4
//This code will run after your page loads
5
5
Coder . socketConnection . init ( function ( ) {
6
- console . log ( "connected with ID: " + Coder . socketConnection . socketID ) ;
7
6
8
- Coder . socketConnection . sendData ( 'connect' , { 'name' :'jimmy' } ) ;
7
+ addOutputMessage ( "Connected with ID: " + Coder . socketConnection . socketID ) ;
8
+
9
+
10
+ Coder . socketConnection . sendData ( 'connect' , { 'name' :'testing' } ) ;
9
11
10
12
Coder . socketConnection . addListener ( 'message' , function ( d ) {
11
13
console . log ( "message from: " + d . name + " : " + d . message ) ;
12
14
} ) ;
13
15
} ) ;
14
16
17
+ addOutputMessage ( "Connecting... see the debug console for log messages." ) ;
18
+
15
19
} ) ;
16
20
21
+ var addOutputMessage = function ( text ) {
22
+ var $output = $ ( "#output" ) ;
23
+ $output . prepend ( $ ( "<p/>" ) . text ( text ) ) ;
24
+ console . log ( text ) ;
25
+ }
26
+
Original file line number Diff line number Diff line change 25
25
</ head >
26
26
< body class ="">
27
27
< div class ="pagecontent ">
28
- < h1 > Hello World</ h1 >
29
- < p > Your html goes here.</ p >
30
-
28
+ < h1 > Socket Test</ h1 >
29
+ < div id ="output ">
30
+
31
+ </ div >
31
32
</ div >
32
33
</ body >
33
34
</ html >
Original file line number Diff line number Diff line change 13
13
"bcrypt" : " 0.7.4" ,
14
14
"connect" : " *" ,
15
15
"cookie" : " *" ,
16
- "gpio" : " *" ,
16
+ "gpio" : " *"
17
17
}
18
18
}
You can’t perform that action at this time.
0 commit comments