2
2
< html >
3
3
< head >
4
4
< title > VotesApp WebClient Frontend</ title >
5
- < script src ="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/ jquery.min.js "> </ script >
6
- < script src ="//cdn.jsdelivr.net/sockjs/0.3.4/ sockjs.min.js "> </ script >
5
+ < script src ="jquery.min.js "> </ script >
6
+ < script src ="sockjs.min.js "> </ script >
7
7
< script src ="stomp.min.js "> </ script >
8
8
< script type ="text/javascript ">
9
9
$ ( function ( ) {
14
14
console . log ( 'Connected: ' + frame ) ;
15
15
stompClient . subscribe ( '/receive' , function ( msg ) {
16
16
var body = JSON . parse ( msg . body ) ;
17
- var content = { text : body . text , groupId : body . groupId } ;
18
- $ ( "#msgs" ) . append ( '<div class="alert alert-info" role="alert"><strong>' + body . groupId + '</strong> ' + body . text + '</div>' ) ;
17
+ var content = { text : body . text . replace ( / \n / g , '<br>' ) , groupId : body . groupId } ;
18
+ $ ( "#msgs" ) . append ( '<div class="alert alert-info" role="alert"><strong>' + content . groupId + '</strong> ' + content . text + '</div>' ) ;
19
19
} ) ;
20
20
} ) ;
21
21
}
30
30
type : "POST" ,
31
31
url : "/send" ,
32
32
data : JSON . stringify ( { phone : phone , group : group , text : text } ) ,
33
- contentType : "application/json; charset=utf-8" ,
34
- dataType : "json"
33
+ contentType : "application/json; charset=utf-8"
35
34
} ) ;
36
35
$ ( "#msgs" ) . append ( '<div class="alert alert-success" role="alert"><strong>' + group + '</strong> ' + text + '</div>' ) ;
37
36
} ) ;
38
37
} ) ;
39
38
</ script >
40
39
41
- < link rel ="stylesheet " href ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/ bootstrap.min.css ">
40
+ < link rel ="stylesheet " href ="bootstrap.min.css ">
42
41
</ head >
43
42
< body >
44
43
< noscript > < h2 style ="color: #ff0000 "> Please enable Javascript and reload this page!</ h2 > </ noscript >
@@ -63,6 +62,6 @@ <h1>Debug VotestApp Interface</h1>
63
62
< div id ="msgs "> </ div >
64
63
</ div >
65
64
66
- < script src ="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/ bootstrap.min.js "> </ script >
65
+ < script src ="bootstrap.min.js "> </ script >
67
66
</ body >
68
67
</ html >
0 commit comments