comparison src/monoize.sml @ 797:2c463eee89fa

cselect
author Adam Chlipala <adamc@hcoop.net>
date Thu, 14 May 2009 09:33:48 -0400
parents 87a7702d681d
children e92cfac1608f
comparison
equal deleted inserted replaced
796:6271f0e3c272 797:2c463eee89fa
2561 loc)), loc), fm) 2561 loc)), loc), fm)
2562 end 2562 end
2563 | SOME (_, src, _) => 2563 | SOME (_, src, _) =>
2564 (strcat [str "<span><script type=\"text/javascript\">inp(\"input\",", 2564 (strcat [str "<span><script type=\"text/javascript\">inp(\"input\",",
2565 (L'.EJavaScript (L'.Script, src, NONE), loc), 2565 (L'.EJavaScript (L'.Script, src, NONE), loc),
2566 str ")</script></span>"], 2566 str ",\"\")</script></span>"],
2567 fm)) 2567 fm))
2568 | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs); 2568 | _ => (Print.prefaces "Targs" (map (fn t => ("T", CorePrint.p_con env t)) targs);
2569 raise Fail "No name passed to textbox tag")) 2569 raise Fail "No name passed to textbox tag"))
2570 | "password" => input "password" 2570 | "password" => input "password"
2571 | "textarea" => 2571 | "textarea" =>
2633 end 2633 end
2634 | SOME (_, src, _) => 2634 | SOME (_, src, _) =>
2635 let 2635 let
2636 val sc = strcat [str "inp(\"input\",", 2636 val sc = strcat [str "inp(\"input\",",
2637 (L'.EJavaScript (L'.Script, src, NONE), loc), 2637 (L'.EJavaScript (L'.Script, src, NONE), loc),
2638 str ",\"\")"]
2639 val sc = setAttrs sc
2640 in
2641 (strcat [str "<span><script type=\"text/javascript\">",
2642 sc,
2643 str "</script></span>"],
2644 fm)
2645 end)
2646
2647 | "cselect" =>
2648 (case List.find (fn ("Source", _, _) => true | _ => false) attrs of
2649 NONE =>
2650 let
2651 val (ts, fm) = tagStart "select"
2652 in
2653 ((L'.EStrcat (ts,
2654 (L'.EPrim (Prim.String "/>"), loc)),
2655 loc), fm)
2656 end
2657 | SOME (_, src, _) =>
2658 let
2659 val (xml, fm) = monoExp (env, st, fm) xml
2660
2661 val sc = strcat [str "inp(\"select\",",
2662 (L'.EJavaScript (L'.Script, src, NONE), loc),
2663 str ",",
2664 (L'.EJavaScript (L'.Script, xml, NONE), loc),
2638 str ")"] 2665 str ")"]
2639 val sc = setAttrs sc 2666 val sc = setAttrs sc
2640 in 2667 in
2641 (strcat [str "<span><script type=\"text/javascript\">", 2668 (strcat [str "<span><script type=\"text/javascript\">",
2642 sc, 2669 sc,
2643 str "</script></span>"], 2670 str "</script></span>"],
2644 fm) 2671 fm)
2645 end) 2672 end)
2673
2674 | "coption" => normal ("option", NONE, NONE)
2646 2675
2647 | "tabl" => normal ("table", NONE, NONE) 2676 | "tabl" => normal ("table", NONE, NONE)
2648 | _ => normal (tag, NONE, NONE) 2677 | _ => normal (tag, NONE, NONE)
2649 end 2678 end
2650 2679