comparison src/monoize.sml @ 816:26e911ee924c

Split JavaScript inp() into separate functions
author Adam Chlipala <adamc@hcoop.net>
date Thu, 21 May 2009 10:18:20 -0400
parents 493f44759879
children 4585f744574a
comparison
equal deleted inserted replaced
815:493f44759879 816:26e911ee924c
2563 ((L'.EStrcat (ts, 2563 ((L'.EStrcat (ts,
2564 (L'.EPrim (Prim.String (" name=\"" ^ name ^ "\" />")), 2564 (L'.EPrim (Prim.String (" name=\"" ^ name ^ "\" />")),
2565 loc)), loc), fm) 2565 loc)), loc), fm)
2566 end 2566 end
2567 | SOME (_, src, _) => 2567 | SOME (_, src, _) =>
2568 (strcat [str "<span><script type=\"text/javascript\">inp(\"input\",", 2568 (strcat [str "<span><script type=\"text/javascript\">inp(",
2569 (L'.EJavaScript (L'.Script, src), loc), 2569 (L'.EJavaScript (L'.Script, src), loc),
2570 str ",\"\")</script></span>"], 2570 str ")</script></span>"],
2571 fm)) 2571 fm))
2572 | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs); 2572 | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs);
2573 raise Fail "No name passed to textbox tag")) 2573 raise Fail "No name passed to textbox tag"))
2574 | "password" => input "password" 2574 | "password" => input "password"
2575 | "textarea" => 2575 | "textarea" =>
2635 (L'.EPrim (Prim.String " />"), loc)), 2635 (L'.EPrim (Prim.String " />"), loc)),
2636 loc), fm) 2636 loc), fm)
2637 end 2637 end
2638 | SOME (_, src, _) => 2638 | SOME (_, src, _) =>
2639 let 2639 let
2640 val sc = strcat [str "inp(\"input\",", 2640 val sc = strcat [str "inp(",
2641 (L'.EJavaScript (L'.Script, src), loc), 2641 (L'.EJavaScript (L'.Script, src), loc),
2642 str ",\"\")"] 2642 str ")"]
2643 val sc = setAttrs sc 2643 val sc = setAttrs sc
2644 in 2644 in
2645 (strcat [str "<span><script type=\"text/javascript\">", 2645 (strcat [str "<span><script type=\"text/javascript\">",
2646 sc, 2646 sc,
2647 str "</script></span>"], 2647 str "</script></span>"],
2660 end 2660 end
2661 | SOME (_, src, _) => 2661 | SOME (_, src, _) =>
2662 let 2662 let
2663 val (xml, fm) = monoExp (env, st, fm) xml 2663 val (xml, fm) = monoExp (env, st, fm) xml
2664 2664
2665 val sc = strcat [str "inp(\"select\",", 2665 val sc = strcat [str "sel(",
2666 (L'.EJavaScript (L'.Script, src), loc), 2666 (L'.EJavaScript (L'.Script, src), loc),
2667 str ",", 2667 str ",",
2668 (L'.EJavaScript (L'.Script, xml), loc), 2668 (L'.EJavaScript (L'.Script, xml), loc),
2669 str ")"] 2669 str ")"]
2670 val sc = setAttrs sc 2670 val sc = setAttrs sc