Commits

Kakadu  committed 61155ad

Update for latest eliom

  • Participants
  • Parent commits c46f097

Comments (0)

Files changed (5)

File edituser.eliom

       | false -> div []
     in
     (* Some shit here: form and roles div don't want to be stacked horizontally *)
-    Manip.replaceAllChild (el |> Of_dom.of_element) [div [roles_switch;br();form]]
+    Manip.replaceChildren (el |> Of_dom.of_element) [div [roles_switch;br();form]]
   ) ~bad:(fun id -> Firebug.console##warn (Js.string @@ sprintf "can't get element by id '%s'" id));
 
   Lwt.return ()

File smartadd.eliom

             ]
           | None -> []
         in
-        Manip.replaceAllChild (Of_dom.of_element el) xs
+        Manip.replaceChildren (Of_dom.of_element el) xs
       in
       let open Ojquery in
       (try_lwt
   ])
 
 let () = Ebapp.App.register Ukraine_services.smart_add_service
-    (Ebapp.Page.connected_page handler)
+    (Ebapp.Page.connected_page ~fallback:LoginError.page handler)

File ukraine_services.eliom

     ~get_params:(string "activationkey") ()
 
 let eba_github_service =
-  Eliom_service.external_service
+  Eliom_service.Http.external_service
     ~prefix:"http://"
     ~path:["github.com"; "ocsigen"; "eliom-base-app"]
     ~get_params:Eliom_parameter.unit ()
 
 let ocsigen_service =
-  Eliom_service.external_service
+  Eliom_service.Http.external_service
     ~prefix:"http://"
     ~path:["ocsigen.org"]
     ~get_params:Eliom_parameter.unit ()
         ; div ~a:[a_class ["questions_block"]] question_divs
 	]
       in
-      Manip.replaceAllChild (el |> Of_dom.of_element) nodes
+      Manip.replaceChildren (el |> Of_dom.of_element) nodes
   ) ~bad:_bad;
   Lwt.return ()
 end
           in
           let eventId = %eventId in
 	  let divs = generate_comments_divs ~mode ~eventId comments in
-	  Manip.removeAllChild %node_comments_real_holder;
-          Manip.appendChilds %node_comments_real_holder divs;
+	  Manip.removeChildren %node_comments_real_holder;
+          Manip.appendChildren %node_comments_real_holder divs;
           Lwt.return ()
         )
     }} in

File wiki_syntax.eliom

          let a = Html.createA d in a##href <- Js.string addr; a <| s);
 
     W.youtube_elem = (fun addr s ->
-        let o = Html.createObject d in
-        let video_link = Printf.sprintf "http://youtube.com/v/%s" addr in
-        let param1 = Html.createParam d in
-        param1##name <- Js.string "movie"; param1##value <- Js.string video_link;
-        let param2 = Html.createParam d in
-        param2##name <- Js.string "allowFullscreen"; param2##value <- Js.string "true";
-        let e = Html.createEmbed d in
-        e##height <- Js.string "385"; e##width <- Js.string "480";
-        e##allowFullscreen <- Js._true; e##_type <- Js.string "application/x-shockwave-flash";
-        e##src <- Js.string video_link;
-        List.iter (fun x -> o##appendChild (x) |> ignore)
-          [(param1 :> Dom.node Js.t); (param2 :> Dom.node Js.t); (e :> Dom.node Js.t)];
-
-        node o);
+        let i = Html.createIframe d in
+        i##width <- Js.string "480";
+        i##height <- Js.string "360";
+        let video_link =
+          "http://youtube.com/embed/" ^
+          Js.to_string (Js.encodeURI (Js.string addr)) in
+        i##src <- Js.string video_link;
+        i##frameBorder <- Js.string "0";
+        node i
+    );
     W.br_elem = (fun () -> node (d##createElement (Js.string "br")));
     W.img_elem =
       (fun addr alt ->