comparison lib/ur/basis.urs @ 892:e04af9641067

Try to add all applicable JavaScript events
author Adam Chlipala <adamc@hcoop.net>
date Sat, 18 Jul 2009 11:58:54 -0400
parents 0f7e2cca6d9b
children 062d97847473
comparison
equal deleted inserted replaced
891:8f2159040bbb 892:e04af9641067
535 535
536 val head : unit -> tag [] html head [] [] 536 val head : unit -> tag [] html head [] []
537 val title : unit -> tag [] head [] [] [] 537 val title : unit -> tag [] head [] [] []
538 val link : unit -> tag [Rel = string, Typ = string, Href = url, Media = string] head [] [] [] 538 val link : unit -> tag [Rel = string, Typ = string, Href = url, Media = string] head [] [] []
539 539
540 val body : unit -> tag [Onload = transaction unit] html body [] [] 540 val body : unit -> tag [Onload = transaction unit, Onresize = transaction unit, Onunload = transaction unit]
541 html body [] []
541 con bodyTag = fn (attrs :: {Type}) => 542 con bodyTag = fn (attrs :: {Type}) =>
542 ctx ::: {Unit} -> 543 ctx ::: {Unit} ->
543 [[Body] ~ ctx] => 544 [[Body] ~ ctx] =>
544 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] [] 545 unit -> tag attrs ([Body] ++ ctx) ([Body] ++ ctx) [] []
545 con bodyTagStandalone = fn (attrs :: {Type}) => 546 con bodyTagStandalone = fn (attrs :: {Type}) =>
547 -> [[Body] ~ ctx] => 548 -> [[Body] ~ ctx] =>
548 unit -> tag attrs ([Body] ++ ctx) [] [] [] 549 unit -> tag attrs ([Body] ++ ctx) [] [] []
549 550
550 val br : bodyTagStandalone [] 551 val br : bodyTagStandalone []
551 552
552 val span : bodyTag [] 553 con focusEvents = [Onblur = transaction unit, Onfocus = transaction unit]
553 val div : bodyTag [] 554 con mouseEvents = [Onclick = transaction unit, Ondblclick = transaction unit,
554 555 Onmousedown = transaction unit, Onmousemove = transaction unit,
555 val p : bodyTag [] 556 Onmouseout = transaction unit, Onmouseover = transaction unit,
556 val b : bodyTag [] 557 Onmouseup = transaction unit, ]
557 val i : bodyTag [] 558 con keyEvents = [Onkeydown = transaction unit, Onkeypress = transaction unit,
558 val tt : bodyTag [] 559 Onkeyup = transaction unit]
559 val font : bodyTag [Size = int, Face = string] 560 con resizeEvents = [Onresize = transaction unit]
560 561
561 val h1 : bodyTag [] 562 con boxEvents = focusEvents ++ mouseEvents ++ keyEvents ++ resizeEvents
562 val h2 : bodyTag [] 563 con tableEvents = focusEvents ++ mouseEvents ++ keyEvents
563 val h3 : bodyTag [] 564
564 val h4 : bodyTag [] 565 val span : bodyTag boxEvents
565 566 val div : bodyTag boxEvents
566 val li : bodyTag [] 567
567 val ol : bodyTag [] 568 val p : bodyTag boxEvents
568 val ul : bodyTag [] 569 val b : bodyTag boxEvents
569 570 val i : bodyTag boxEvents
570 val hr : bodyTag [] 571 val tt : bodyTag boxEvents
571 572 val font : bodyTag ([Size = int, Face = string] ++ boxEvents)
572 val a : bodyTag [Link = transaction page, Href = url, Onclick = transaction unit] 573
573 574 val h1 : bodyTag boxEvents
574 val img : bodyTag [Src = url] 575 val h2 : bodyTag boxEvents
575 576 val h3 : bodyTag boxEvents
577 val h4 : bodyTag boxEvents
578
579 val li : bodyTag boxEvents
580 val ol : bodyTag boxEvents
581 val ul : bodyTag boxEvents
582
583 val hr : bodyTag boxEvents
584
585 val a : bodyTag ([Link = transaction page, Href = url] ++ boxEvents)
586
587 val img : bodyTag ([Src = url, Onabort = transaction unit, Onerror = transaction unit,
588 Onload = transaction unit] ++ boxEvents)
589
576 val form : ctx ::: {Unit} -> bind ::: {Type} 590 val form : ctx ::: {Unit} -> bind ::: {Type}
577 -> [[Body] ~ ctx] => 591 -> [[Body] ~ ctx] =>
578 xml form [] bind 592 xml form [] bind
579 -> xml ([Body] ++ ctx) [] [] 593 -> xml ([Body] ++ ctx) [] []
580 594
599 ctx ::: {Unit} 613 ctx ::: {Unit}
600 -> [[Form] ~ ctx] => 614 -> [[Form] ~ ctx] =>
601 nm :: Name -> unit 615 nm :: Name -> unit
602 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty] 616 -> tag attrs ([Form] ++ ctx) inner [] [nm = ty]
603 val hidden : formTag string [] [Value = string] 617 val hidden : formTag string [] [Value = string]
604 val textbox : formTag string [] [Value = string, Size = int, Source = source string] 618 val textbox : formTag string [] ([Value = string, Size = int, Source = source string, Onchange = transaction unit,
605 val password : formTag string [] [Value = string, Size = int] 619 Ontext = transaction unit] ++ boxEvents)
606 val textarea : formTag string [] [Rows = int, Cols = int] 620 val password : formTag string [] ([Value = string, Size = int] ++ boxEvents)
607 621 val textarea : formTag string [] ([Rows = int, Cols = int, Onchange = transaction unit,
608 val checkbox : formTag bool [] [Checked = bool] 622 Ontext = transaction unit] ++ boxEvents)
623
624 val checkbox : formTag bool [] ([Checked = bool] ++ boxEvents)
609 625
610 type file 626 type file
611 val fileName : file -> option string 627 val fileName : file -> option string
612 val fileMimeType : file -> string 628 val fileMimeType : file -> string
613 val fileData : file -> blob 629 val fileData : file -> blob
614 630
615 val upload : formTag file [] [Value = string, Size = int] 631 val upload : formTag file [] ([Value = string, Size = int] ++ boxEvents)
616 632
617 type mimeType 633 type mimeType
618 val blessMime : string -> mimeType 634 val blessMime : string -> mimeType
619 val checkMime : string -> option mimeType 635 val checkMime : string -> option mimeType
620 val returnBlob : t ::: Type -> blob -> mimeType -> transaction t 636 val returnBlob : t ::: Type -> blob -> mimeType -> transaction t
621 val blobSize : blob -> int 637 val blobSize : blob -> int
622 638
623 con radio = [Body, Radio] 639 con radio = [Body, Radio]
624 val radio : formTag string radio [] 640 val radio : formTag string radio []
625 val radioOption : unit -> tag [Value = string] radio [] [] [] 641 val radioOption : unit -> tag ([Value = string] ++ boxEvents) radio [] [] []
626 642
627 con select = [Select] 643 con select = [Select]
628 val select : formTag string select [] 644 val select : formTag string select ([Onchange = transaction unit] ++ boxEvents)
629 val option : unit -> tag [Value = string, Selected = bool] select [] [] [] 645 val option : unit -> tag [Value = string, Selected = bool] select [] [] []
630 646
631 val submit : ctx ::: {Unit} -> use ::: {Type} 647 val submit : ctx ::: {Unit} -> use ::: {Type}
632 -> [[Form] ~ ctx] => 648 -> [[Form] ~ ctx] =>
633 unit 649 unit
634 -> tag [Value = string, Action = $use -> transaction page] 650 -> tag ([Value = string, Action = $use -> transaction page] ++ boxEvents)
635 ([Form] ++ ctx) ([Form] ++ ctx) use [] 651 ([Form] ++ ctx) ([Form] ++ ctx) use []
636 652
637 (*** AJAX-oriented widgets *) 653 (*** AJAX-oriented widgets *)
638 654
639 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) => 655 con cformTag = fn (attrs :: {Type}) (inner :: {Unit}) =>
640 ctx ::: {Unit} 656 ctx ::: {Unit}
641 -> [[Body] ~ ctx] => 657 -> [[Body] ~ ctx] =>
642 unit -> tag attrs ([Body] ++ ctx) inner [] [] 658 unit -> tag attrs ([Body] ++ ctx) inner [] []
643 659
644 val ctextbox : cformTag [Value = string, Size = int, Source = source string] [] 660 val ctextbox : cformTag ([Value = string, Size = int, Source = source string, Onchange = transaction unit,
645 val button : cformTag [Value = string, Onclick = transaction unit] [] 661 Ontext = transaction unit] ++ boxEvents) []
646 662 val button : cformTag ([Value = string] ++ boxEvents) []
647 val ccheckbox : cformTag [Value = bool, Size = int, Source = source bool] [] 663
664 val ccheckbox : cformTag ([Value = bool, Size = int, Source = source bool] ++ boxEvents) []
648 665
649 con cselect = [Cselect] 666 con cselect = [Cselect]
650 val cselect : cformTag [Source = source string, 667 val cselect : cformTag ([Source = source string, Onchange = transaction unit] ++ boxEvents) cselect
651 Onchange = transaction unit] cselect
652 val coption : unit -> tag [Value = string, Selected = bool] cselect [] [] [] 668 val coption : unit -> tag [Value = string, Selected = bool] cselect [] [] []
653 669
654 (*** Tables *) 670 (*** Tables *)
655 671
656 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => 672 val tabl : other ::: {Unit} -> [other ~ [Body, Table]] => unit
657 unit -> tag [Border = int] ([Body] ++ other) ([Body, Table] ++ other) [] [] 673 -> tag ([Border = int] ++ boxEvents)
658 val tr : other ::: {Unit} -> [other ~ [Body, Table, Tr]] => 674 ([Body] ++ other) ([Body, Table] ++ other) [] []
659 unit -> tag [] ([Body, Table] ++ other) ([Body, Tr] ++ other) [] [] 675 val tr : other ::: {Unit} -> [other ~ [Body, Table, Tr]] => unit
660 val th : other ::: {Unit} -> [other ~ [Body, Tr]] => 676 -> tag tableEvents
661 unit -> tag [] ([Body, Tr] ++ other) ([Body] ++ other) [] [] 677 ([Body, Table] ++ other) ([Body, Tr] ++ other) [] []
662 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => 678 val th : other ::: {Unit} -> [other ~ [Body, Tr]] => unit
663 unit -> tag [] ([Body, Tr] ++ other) ([Body] ++ other) [] [] 679 -> tag tableEvents
680 ([Body, Tr] ++ other) ([Body] ++ other) [] []
681 val td : other ::: {Unit} -> [other ~ [Body, Tr]] => unit
682 -> tag tableEvents
683 ([Body, Tr] ++ other) ([Body] ++ other) [] []
664 684
665 685
666 (** Aborting *) 686 (** Aborting *)
667 687
668 val error : t ::: Type -> xbody -> t 688 val error : t ::: Type -> xbody -> t