|
@@ -21,7 +21,12 @@ body() ->
|
|
#button{ id = attach, body = <<"Attach">>, postback = attach},
|
|
#button{ id = attach, body = <<"Attach">>, postback = attach},
|
|
#button{ id = join, body = <<"Join">>, postback = join},
|
|
#button{ id = join, body = <<"Join">>, postback = join},
|
|
#button{ id = take, body = <<"Take">>, postback = take},
|
|
#button{ id = take, body = <<"Take">>, postback = take},
|
|
- #textbox{ id = tbcolor }, #textbox{ id = tbvalue }, #button{ id = discard, body = <<"Discard">>, postback = discard, source = [tbcolor, tbvalue]}
|
|
|
|
|
|
+ #select { id=dropdown1, value="2", options=[
|
|
|
|
+ #option { body="Option 1", value="1" },
|
|
|
|
+ #option { body="Option 2", value="2" },
|
|
|
|
+ #option { body="Option 3", value="3" }
|
|
|
|
+ ]},
|
|
|
|
+ #button{ id = discard, body = <<"Discard">>, postback = discard}
|
|
].
|
|
].
|
|
|
|
|
|
event(init) ->
|
|
event(init) ->
|
|
@@ -67,13 +72,12 @@ event(take) ->
|
|
|
|
|
|
|
|
|
|
event(discard) ->
|
|
event(discard) ->
|
|
- Color = wf:q(tbcolor),
|
|
|
|
- Value = wf:q(tbvalue),
|
|
|
|
|
|
+ Color = "1", %%wf:q(cardcolor),
|
|
|
|
+ Value = "1", %%wf:q(cardvalue),
|
|
Msg = "ws.send(Bert.encodebuf(Bert.tuple(Bert.atom('client'),"
|
|
Msg = "ws.send(Bert.encodebuf(Bert.tuple(Bert.atom('client'),"
|
|
" Bert.tuple(Bert.atom('game_action'), 1000001, Bert.atom('okey_discard'),"
|
|
" Bert.tuple(Bert.atom('game_action'), 1000001, Bert.atom('okey_discard'),"
|
|
" [Bert.tuple(Bert.atom('tile'), Bert.tuple(Bert.atom('OkeyPiece'), " ++ Color ++ ", " ++ Value ++ "))]) )));",
|
|
" [Bert.tuple(Bert.atom('tile'), Bert.tuple(Bert.atom('OkeyPiece'), " ++ Color ++ ", " ++ Value ++ "))]) )));",
|
|
wf:wire(Msg);
|
|
wf:wire(Msg);
|
|
|
|
|
|
-
|
|
|
|
event(Event) -> wf:info("Event: ~p", [Event]).
|
|
event(Event) -> wf:info("Event: ~p", [Event]).
|
|
|
|
|