Permalink
Browse files

Merge pull request #59 from cago/master

No message anymore in the toplevel when you change your language
  • Loading branch information...
OCamlPro-Bozman committed Jan 18, 2012
2 parents 9dcd29a + 39518c0 commit 4e4477e86810bda9c678b7408fb1f704a98fdcd4
Showing with 4 additions and 8 deletions.
  1. +1 −1 tryocaml/toplevel.js
  2. +3 −7 tryocaml/toplevel.ml
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -535,10 +535,6 @@ let run _ =
(fun () -> assert false)
in
(* Choose your language *)
- let set_lang lang =
- textbox##value <- Js.string ("set_lang \"" ^ lang ^ "\";;" );
- execute ()
- in
let form = Html.createDiv doc in
let sel = Dom_html.createSelect doc in
sel##id <- Js.string "languages";
@@ -550,7 +546,7 @@ let run _ =
sel##onchange <-
Html.handler
(fun _ ->
- set_lang (fst (List.nth Tutorial.langs sel##selectedIndex));
+ Tutorial.set_lang (fst (List.nth Tutorial.langs sel##selectedIndex));
set_cookie "lang" (Tutorial.lang ());
Js._true);
Dom.appendChild form sel;
@@ -570,7 +566,7 @@ let run _ =
(* Setting language *)
let set_lang_from_cookie () =
let lang = get_lang_from_cookie () in
- if lang <> "" then set_lang lang
+ if lang <> "" then Tutorial.set_lang lang
in
(* Check if language has change in URL *)
let url = Js.decodeURI loc##href in
@@ -581,7 +577,7 @@ let run _ =
| Some r ->
match (Regexp.matched_group r 1) with
None -> set_lang_from_cookie ()
- | Some s -> set_lang s; set_cookie "lang" (Tutorial.lang ());
+ | Some s -> Tutorial.set_lang s; set_cookie "lang" (Tutorial.lang ());
in
Js._false

0 comments on commit 4e4477e

Please sign in to comment.