Skip to content

Commit

Permalink
fix for trunk ocamljs
Browse files Browse the repository at this point in the history
git-svn-id: http://orpc2.googlecode.com/svn/trunk@128 220da7d2-e253-0410-a747-191e32cba5d1
  • Loading branch information
duckpilot committed Nov 20, 2009
1 parent d4549c6 commit 3a47450
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions examples/clicks/clicks.ml
Expand Up @@ -5,14 +5,14 @@ let (>>=) = Lwt.(>>=)

;;

Dom.window#_set_onload (Ocamljs.jsfun (fun () ->
Dom.window#_set_onload (fun () ->
let clicks = (Dom.document#getElementById "clicks" : Dom.span) in
let click = (Dom.document#getElementById "click" : Dom.button) in

let set_clicks n = Lwt.return (clicks#_set_innerHTML (string_of_int n)) in

click#_set_onclick (Ocamljs.jsfun (fun _ ->
click#_set_onclick (fun _ ->
ignore(Server.click () >>= set_clicks);
Ocamljs.false_ ()));
Ocamljs.false_ ());

ignore(Server.clicks () >>= set_clicks)))
ignore(Server.clicks () >>= set_clicks))
8 changes: 4 additions & 4 deletions examples/sudoku/sudoku.ml
Expand Up @@ -24,7 +24,7 @@ let make_board () =
| "1" | "2" | "3" | "4" | "5"
| "6" | "7" | "8" | "9" -> ()
| _ -> input#_set_value "" in
input#_set_onchange (Ocamljs.jsfun enforce_digit);
input#_set_onchange enforce_digit;
input in

let make_td i j input =
Expand Down Expand Up @@ -152,12 +152,12 @@ let get_board rows _ =
let onload () =
let (rows, table) = make_board () in
let check = d#getElementById "check" in
check#_set_onclick (Ocamljs.jsfun (check_board rows));
check#_set_onclick (check_board rows);
let new_game = d#getElementById "new_game" in
new_game#_set_onclick (Ocamljs.jsfun (get_board rows));
new_game#_set_onclick (get_board rows);
let board = d#getElementById "board" in
ignore (board#appendChild table)

;;

D.window#_set_onload (Ocamljs.jsfun onload)
D.window#_set_onload onload

0 comments on commit 3a47450

Please sign in to comment.