Skip to content

Commit ba4655c

Browse files
yufenggJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
added region tags (#292)
1 parent 08752a3 commit ba4655c

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

appengine/channel/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@
137137
return state.userX == state.me ? 'X' : 'O';
138138
};
139139

140+
// [START open_socket]
140141
sendMessage = function(path, opt_param) {
141142
path += '?g=' + state.game_key;
142143
if (opt_param) {
@@ -147,11 +148,18 @@
147148
xhr.send();
148149
};
149150

151+
onOpened = function() {
152+
sendMessage('/opened');
153+
};
154+
// [END open_socket]
155+
156+
// [START update_state]
150157
moveInSquare = function(id) {
151158
if (isMyMove() && state.board[id] == ' ') {
152159
sendMessage('/move', 'i=' + id);
153160
}
154161
};
162+
// [END update_state]
155163

156164
highlightSquare = function(id) {
157165
if (state.winner != "") {
@@ -172,10 +180,6 @@
172180
}
173181
};
174182

175-
onOpened = function() {
176-
sendMessage('/opened');
177-
};
178-
179183
onMessage = function(m) {
180184
newState = JSON.parse(m.data);
181185
state.board = newState.board || state.board;

0 commit comments

Comments
 (0)