11<!DOCTYPE html>
2- < html >
2+ < html ng-app =" tennisApp " >
33< head >
4- < title > Java EE 7 - Websocket - Wildfly 8.2 - OpenShit </ title >
4+ < title > Java EE 7 - Websocket - AngularJS - Wildfly 10 - Docker </ title >
55< meta charset ="UTF-8 ">
66< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
77< meta name ="description " content ="" />
8- <!-- Latest compiled and minified CSS -->
98< link rel ="stylesheet "
109 href ="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css ">
1110< link rel ="stylesheet " href ="css/flags.css ">
1211
1312< style type ="text/css ">
1413.sets {
15- background-color : # e5E5E5 ;
14+ background-color : # ccc ;
1615}
1716
1817.serve {
19- color : yellow;
20- background-color : # ccc
18+ color : black;
19+ background-color : yellow;
20+ }
21+ .th {
22+ text-align : center;
23+
2124}
2225</ style >
2326
2427</ head >
25- < body >
28+ < body ng-app =" tennisApp " ng-controller =" TournamentCtrl " >
2629 < div class ="container ">
27- < h2 > Tennis Game Tournament - Java EE 7 - Java API for Websocket - Javascript API </ h2 >
28- < p class ="lead "> Basic HTML5 sample to illustrate the new Java API
30+ < h2 > Tennis Game Tournament - Java EE 7 - Java API for WebSocket - AngularJS </ h2 >
31+ < p class ="lead "> AngularJS HTML5 app sample to illustrate the new Java API
2932 for WebSocket (JSR 356).</ p >
3033 < p >
31- < a href ="./live.html "> Access to AngularJS app sample with several matches.</ a > or
32- < a href ="http://mgreau.com/posts/2013/09/27/javaee7-api-websocket-html5.html " target ="blog "> Read the blog post.</ a >
34+ < a href ="https://github.com/mgreau/javaee7-websocket " target ="github "> Fork it on Github.</ a >
35+ or
36+ < a href ="http://mgreau.com/posts/2013/11/11/javaee7-websocket-angularjs-wildfly.html " target ="blog "> Read the blog post.</ a >
37+ or < a href ="https://twitter.com/mgreau " target ="twitter "> follow me on twitter : @mgreau</ a >
3338 </ p >
3439 < div class ="row ">
35- < div class ="panel panel-primary ">
36- < div class ="panel-heading ">
37- < span id ="m1-title "> </ span > - < span id ="m1-status "
38- class ="label label-success "> </ span >
40+ < div class ="col-xs-12 col-sm-12 col-md-6 col-lg-6 " ng-repeat ="live in lives ">
41+ < div class ="panel panel-primary ">
42+ < div class ="panel-heading ">
43+ < span > {{live.title}}</ span >
44+ < button class ="btn btn-default active btn-xs " ng-show ="live.status == 'CONNECTED' " ng-click ="disconnect(live.key) " >
45+ < span class ="glyphicon glyphicon-off "> </ span > Exit.</ button >
46+ </ div >
47+ < div class ="panel-body " >
48+ <!-- Message de fin -->
49+ < msg ng-show ="live.match.finished == true "
50+ message ="live.bet " winner ="live.winner "> </ msg >
3951
40- </ div >
41- < div class ="panel-body ">
42- < table class ="table ">
43- < thead >
44- < tr >
45- < th width ="5% "> S1</ th >
46- < th width ="5% "> S2</ th >
47- < th width ="5% "> S3</ th >
48- < th width ="5% " class ="active "> </ th >
49- < th width ="5% " class ="active "> </ th >
50- < th width ="45% " class ="active "> PLAYERS</ th >
51- < th width ="10% " class ="active "> POINTS</ th >
52- < th width ="10% " class ="active "> GAMES</ th >
53- < th width ="10% " class ="active "> SETS</ th >
54- </ tr >
55- </ thead >
56- < tbody >
57- < tr >
58- < td class ="sets "> < span id ="m1-p1-set1 "
59- class ="label label-warning "> 0</ span > </ td >
60- < td class ="sets "> < span id ="m1-p1-set2 "
61- class ="label label-warning "> 0</ span > </ td >
62- < td class ="sets "> < span id ="m1-p1-set3 "
63- class ="label label-warning "> 0</ span > </ td >
64- < td > < span id ="m1-p1-serve " class ="badge serve "> </ span > </ td >
65- < td > < img src ="img/blank.gif " class ="flag flag-rs " /> </ td >
66- < td id ="m1-p1 "> </ td >
67- < td class ="active "> < span id ="m1-p1-points "
68- class ="label label-danger "> -</ span > </ td >
69- < td id ="m1-p1-games "> 0</ td >
70- < td id ="m1-p1-sets "> </ td >
71- </ tr >
72- < tr >
73- < td class ="sets "> < span id ="m1-p2-set1 "
74- class ="label label-warning "> 0</ span > </ td >
75- < td class ="sets "> < span id ="m1-p2-set2 "
76- class ="label label-warning "> 0</ span > </ td >
77- < td class ="sets "> < span id ="m1-p2-set3 "
78- class ="label label-warning "> 0</ span > </ td >
79- < td > < span id ="m1-p2-serve " class ="badge serve "> </ span > </ td >
80- < td > < img src ="img/blank.gif " class ="flag flag-es " /> </ td >
81- < td id ="m1-p2 "> </ td >
82- < td class ="active "> < span id ="m1-p2-points "
83- class ="label label-danger "> -</ span > </ td >
84- < td id ="m1-p2-games "> 0</ td >
85- < td id ="m1-p2-sets "> </ td >
86- </ tr >
87- </ tbody >
88- </ table >
89- < div class ="row ">
90- < div class ="col-sm-6 col-md-3 ">
91- < div class ="thumbnail ">
92- < div class ="media ">
93- < a class ="pull-left " href ="# "> < img class ="media-object "
94- alt ="player1 " src ="img/djokovic.jpg ">
95- </ a >
96- < div class ="media-body ">
97- < h4 id ="m1-p1-card " class ="media-heading "> </ h4 >
98- < p >
99- < a href ="# " class ="btn btn-primary btn-xs "
100- onclick ="betMatchWinner('N. DJOKOVIC') "> Match Winner ?</ a >
101- </ p >
102- </ div >
103- </ div >
104- </ div >
105- </ div >
106- < div class ="col-sm-6 col-md-3 ">
107- < div class ="thumbnail ">
108- < div class ="media ">
109- < a class ="pull-left " href ="# "> < img class ="media-object "
110- alt ="player2 " src ="img/nadal.jpg ">
111- </ a >
112- < div class ="media-body ">
113- < h4 id ="m1-p2-card " class ="media-heading "> </ h4 >
114- < p >
115- < a href ="# " class ="btn btn-primary btn-xs "
116- onclick ="betMatchWinner('R. NADAL') "> Match Winner ?</ a >
117- </ p >
118- </ div >
119- </ div >
120- </ div >
121- </ div >
122- < div class ="col-sm-6 col-md-3 ">
123- < div class ="thumbnail ">
124- < ul >
125- < li > Bet Match Winner : < span id ="m1-betmatchwinner "
126- class ="label label-warning "> </ span > </ li >
127- < li > Result : < span id ="m1-betmatchwinner-result "
128- class ="label label-default "> </ span > </ li >
129- </ ul >
130- </ div >
131- </ div >
132- < div class ="col-sm-6 col-md-3 ">
133- < div class ="thumbnail ">
134- < div class ="media ">
135- < textarea style ="font-size: 11px; background-color: #e5e5e5; "
136- id ="m1-comments " cols ="45 " rows ="4 "> </ textarea >
137- </ div >
52+ <!-- DISCONNECT TABLE -->
53+ < table class ="table " ng-show ="live.status == 'DISCONNECTED' ">
54+ < thead >
55+ < tr >
56+ < th colspan ="4 ">
57+ Game in progress...
58+ < button class ="btn btn-warning active btn-xs " ng-click ="connect(live.key) " >
59+ < span class ="glyphicon glyphicon-power "> </ span > click to access live scores</ button >
60+ </ th >
61+ </ tr >
62+ </ thead >
63+ < tbody >
64+ < tr >
65+ < td > < img alt ="{{live.p1}} " src ="img/{{splitForImage(live.p1,0)}}.jpg "> </ td >
66+ < td > {{live.p1}} < img src ="img/blank.gif " class ="flag flag-{{live.p1c}} " />
67+ </ td >
68+ < td > < img alt ="{{live.p2}} " src ="img/{{splitForImage(live.p2,0)}}.jpg "> </ td >
69+ < td > {{live.p2}} < img src ="img/blank.gif " class ="flag flag-{{live.p2c}} " /> </ td >
70+ </ tr >
71+ </ tbody >
72+ </ table >
73+ <!-- LIVE MODE -->
74+ < bet ng-show ="live.status == 'CONNECTED' " bet ="live.bet " key ="live.key "> </ bet > <!-- Bets Message de fin -->
75+ < match ng-show ="live.status == 'CONNECTED' " match ="live.match " key ="live.key "> </ match > <!-- Match live mode -->
76+ </ table >
77+ </ div >
78+ < div class ="panel-footer " >
79+ <!-- LIVE MODE COMMENTS -->
80+ < div class ="thumbnail " ng-show ="live.status == 'CONNECTED' ">
81+ < div class ="media ">
82+ < textarea style ="font-size: 11px; background-color: #e5e5e5; "
83+ cols ="55 " rows ="4 "> {{live.match.comments}}</ textarea >
13884 </ div >
13985 </ div >
86+ <!-- WS CONNECTION STATUS -->
87+ < div > < em > Connection status : </ em > < span class ="label label-info "> {{live.status}}</ span > </ div >
14088 </ div >
14189 </ div >
142- < div class ="panel-footer ">
143- < em > by < a href ="https://twitter.com/mgreau "> @mgreau</ a > </ em >
144- </ div >
14590 </ div >
14691 </ div >
14792 </ div >
148- < script src ="js/websocket.js "> </ script >
149- < script >
150- ( function ( i , s , o , g , r , a , m ) { i [ 'GoogleAnalyticsObject' ] = r ; i [ r ] = i [ r ] || function ( ) {
151- ( i [ r ] . q = i [ r ] . q || [ ] ) . push ( arguments ) } , i [ r ] . l = 1 * new Date ( ) ; a = s . createElement ( o ) ,
152- m = s . getElementsByTagName ( o ) [ 0 ] ; a . async = 1 ; a . src = g ; m . parentNode . insertBefore ( a , m )
153- } ) ( window , document , 'script' , '//www.google-analytics.com/analytics.js' , 'ga' ) ;
154-
155- ga ( 'create' , 'UA-43902707-1' , 'wildfly-mgreau.rhcloud.com' ) ;
156- ga ( 'send' , 'pageview' ) ;
157-
158- </ script >
93+
94+ < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js "> </ script >
95+ < script src ="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular-resource.min.js "> </ script >
96+ < script src ="js/app.js "> </ script >
97+ < script src ="js/services.js "> </ script >
98+ < script src ="js/controllers.js "> </ script >
99+ < script src ="js/directives.js "> </ script >
159100</ body >
160- </ html >
101+ </ html >
0 commit comments