Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Minor updates to text based syntax generator to support IE8. Unfortunately, IE8 doesn't support radius styles on tables. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
4f317a713be93e08233b463f42015320 |
User & Date: | shaneh 2010-03-24 03:36:41.000 |
Context
2010-03-24
| ||
03:44 | More updates to text bubble-generator. (check-in: 3d6edd87ad user: shaneh tags: trunk) | |
03:36 | Minor updates to text based syntax generator to support IE8. Unfortunately, IE8 doesn't support radius styles on tables. (check-in: 4f317a713b user: shaneh tags: trunk) | |
2010-03-23
| ||
21:39 | Attempt to provide a renderer for the bubble syntax that produces all text output for users not wanting the graphical version. (check-in: b1e7df7e11 user: shaneh tags: trunk) | |
Changes
Changes to art/syntax/bubble-generator-text.tcl.
︙ | ︙ | |||
412 413 414 415 416 417 418 | {or */ /end-of-input}} } } # used for curves set rad "4px" # used for bubble text | | | | | | | | | > > | | | | | | | | | | 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 | {or */ /end-of-input}} } } # used for curves set rad "4px" # used for bubble text set font1 "9px" # used for arrows set font2 "12px" # used for set font3 "14px" # | set c9474 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>" # -| set c9488 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>" # |- set c9484 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr><tr><td class=\"rside\"></td><td class=\"top\"></td></tr></table>" # |_ set c9492 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>" # _| set c9496 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>" #-(- top left set c9581 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-top-style:solid; border-left-style:solid; border-width:1px; border-top-left-radius:$rad; -moz-border-radius-topleft:$rad; -webkit-border-top-left-radius:$rad;\"></td></tr></table>" #-)- top right set c9582 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"bottom\"></td></tr><tr><td class=\"empty\" style=\"border-top-style:solid; border-right-style:solid; border-width:1px; border-top-right-radius:$rad; -moz-border-radius-topright:$rad; -webkit-border-top-right-radius:$rad;\"></td><td class=\"empty\"></td></tr></table>" #-|- set c9516 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr><tr><td class=\"top rside\"></td><td class=\"top\"></td></tr></table>" #( bot left set c9584 "<table class=\"draw\"><tr><td class=\"empty\"></td><td class=\"empty\" style=\"border-bottom-style:solid; border-left-style:solid; border-width:1px; border-bottom-left-radius:$rad; -moz-border-radius-bottomleft:$rad; -webkit-border-bottom-left-radius:$rad;\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>" # ) bot right set c9583 "<table class=\"draw\"><tr><td class=\"empty\" style=\"border-bottom-style:solid; border-right-style:solid; border-width:1px; border-bottom-right-radius:$rad; -moz-border-radius-bottomright:$rad; -webkit-border-bottom-right-radius:$rad;\"></td><td class=\"empty\"></td></tr><tr><td class=\"empty\"></td><td class=\"empty\"></td></tr></table>" # |- set c9500 "<table class=\"draw\"><tr><td class=\"rside\"></td><td class=\"bottom\"></td></tr><tr><td class=\"rside\"></td><td class=\"empty\"></td></tr></table>" # -| set c9508 "<table class=\"draw\"><tr><td class=\"bottom\"></td><td class=\"lside\"></td></tr><tr><td class=\"empty\"></td><td class=\"lside\"></td></tr></table>" #-> set rarr "<table class=\"draw\"><tr><td class=\"bottom\"></td><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\">></td></tr><tr><td class=\"empty\"></td></tr></table>" # <- set larr "<table class=\"draw\"><tr><td rowspan=2 style=\"vertical-align:middle; font-size:$font2;\"><</td><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td></tr></table>" # --- set hr "<table class=\"draw\" width=100%><tr><td class=\"bottom\"></td></tr><tr><td class=\"empty\"></td></tr></table>" # Draw a bubble containing $txt. # proc draw_bubble {txt} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr if {$txt=="nil"} { return [list 1 "<table><tr><td width=100%>$hr</td></tr></table>"] } elseif {$txt=="bullet"} { return [list 1 "<table><tr><td>⊗</td></tr></table>"] } |
︙ | ︙ | |||
483 484 485 486 487 488 489 | return [list 0 ""] } # Draw a sequence of terms from left to write. Each element of $lx # descripts a single term. # proc draw_line {lx} { | | | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | return [list 0 ""] } # Draw a sequence of terms from left to write. Each element of $lx # descripts a single term. # proc draw_line {lx} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set n [llength $lx] set h 1 set content "" set i 0 foreach term $lx { |
︙ | ︙ | |||
513 514 515 516 517 518 519 | return [list $h $content] } # Draw a sequence of terms from right to left. # proc draw_backwards_line {lx} { | | | 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 | return [list $h $content] } # Draw a sequence of terms from right to left. # proc draw_backwards_line {lx} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set n [llength $lx] set h 1 if {$n < 1} { set content "<td width=100%>$hr</td>" } { |
︙ | ︙ | |||
546 547 548 549 550 551 552 | return [list $h $content] } # Draw a sequence of terms from top to bottom. # proc draw_stack {indent lx} { | | | 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 | return [list $h $content] } # Draw a sequence of terms from top to bottom. # proc draw_stack {indent lx} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set n [llength $lx] set h 0 set content "<table>" set i 0 |
︙ | ︙ | |||
586 587 588 589 590 591 592 | } set content "$content</table>" return [list $h $content] } proc draw_loop {forward back} { | | | | | | | | | | > | | > | | | | | | | | | | | | | | | | | | | | | | | | | < | | 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 | } set content "$content</table>" return [list $h $content] } proc draw_loop {forward back} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set h 0 set content "<table>" set rc [draw_diagram $forward 1] set th [lindex $rc 0] set tcontent [lindex $rc 1] set v [ expr { $th - 1 } ] set vert [string repeat "<tr><td>$c9474</td><tr>" $v] set up "$c9581" set down "$c9582" if { $v > 0 } { set up "<table><tr><td>$up</td></tr>$vert</table>" set down "<table><tr><td>$down</td></tr>$vert</table>" } set h [ expr { $h + $th } ] set content "$content<tr><td>$up</td><td>$rarr</td><td>$tcontent</td><td>$rarr</td><td>$down</td></tr>" set rc [draw_backwards_line $back] set th [lindex $rc 0] set tcontent [lindex $rc 1] set h [ expr { $h + $th } ] set content "$content<tr><td>$c9584</td><td>$larr</td><td>$tcontent</td><td>$larr</td><td>$c9583</td></tr>" set content "$content</table>" return [list $h $content] } proc draw_toploop {forward back} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set h 0 set content "<table>" set rc [draw_diagram $forward 1] set th [lindex $rc 0] set tcontent [lindex $rc 1] set v [ expr { $th - 1 } ] set vert [string repeat "<tr><td>$c9474</td><tr>" $v] set up "$c9581" set down "$c9582" if { $v > 0 } { set up "<table><tr><td>$up</td></tr>$vert</table>" set down "<table><tr><td>$down</td></tr>$vert</table>" } set h [ expr { $h + $th } ] set content "$content<tr><td>$up</td><td>$rarr</td><td>$tcontent</td><td>$rarr</td><td>$down</td></tr>" set rc [draw_backwards_line $back] set th [lindex $rc 0] set tcontent [lindex $rc 1] set h [ expr { $h + $th } ] set content "$content<tr><td>$c9584</td><td>$larr</td><td>$tcontent</td><td>$larr</td><td>$c9583</td></tr>" set content "$content</table>" return [list $h $content] } proc draw_or {lx} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set n [llength $lx] set h 0 if {$n < 1} { set content "<tr><td width=100%>$hr</td></tr>" } else { set content "" set i 0 foreach term $lx { set rc [draw_diagram $term 1] set th [lindex $rc 0] set tcontent [lindex $rc 1] set v [ expr { $th - 1 } ] set vert [string repeat "<tr><td>$c9474</td><tr>" $v] incr i if {$i == 1} { set beg "<tr><td>$c9582</td><tr>" set end "<tr><td>$c9581</td><tr>" } elseif {$i == $n} { set beg "<tr><td>$c9584</td><tr>" set end "<tr><td>$c9583</td><tr>" set vert "" } else { set beg "<tr><td>$c9500</td><tr>" set end "<tr><td>$c9508</td><tr>" } set h [ expr { $h + $th } ] set content "$content<tr><td><table>$beg$vert</table></td><td>$rarr</td><td>$tcontent</td><td>$rarr</td><td><table>$end$vert</table></td></tr>" } } set content "<table>$content</table>" return [list $h $content] } proc draw_diagram {spec {draw_hr 0}} { global c9474 c9488 c9484 c9492 c9496 c9581 c9582 c9516 c9584 c9583 c9500 c9508 rarr larr hr set n [llength $spec] set cmd [lindex $spec 0] if {$n==1} { set rc [draw_bubble $spec] } elseif {$n==0} { |
︙ | ︙ | |||
758 759 760 761 762 763 764 765 766 767 768 | set rc [ draw_diagram "line bullet [list $spec] bullet"] set h [lindex $rc 0] set content [lindex $rc 1] return [list $h $content] } set f [open all-text.html w] puts $f "<html>" puts $f "<head>" puts $f "<style type='text/css'>" puts $f "h3 { font-family:helvetica; font-size:$font3; }" | > | > | | | | | > | | | | | > | 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 | set rc [ draw_diagram "line bullet [list $spec] bullet"] set h [lindex $rc 0] set content [lindex $rc 1] return [list $h $content] } set f [open all-text.html w] puts $f "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\" \"http://www.w3.org/TR/html4/strict.dtd\">" puts $f "<html>" puts $f "<head>" puts $f "<style type='text/css'>" puts $f "h3 { font-family:helvetica; font-size:$font3; }" puts $f "table, td { border-collapse:collapse; border-style:none; margin:0px; padding:0px; border-spacing:0px; }" puts $f "td { vertical-align:top; white-space:nowrap; font-family:helvetica; font-size:$font3; }" puts $f "hr { height:1px; }" puts $f ".round { font-size:$font1; border-style:solid; border-width:1px; margin:0px; padding:1px; border-spacing:0px; border-radius:$rad; -moz-border-radius:$rad; -webkit-border-radius:$rad; }" puts $f ".square { font-size:$font1; border-style:solid; border-width:1px; margin:0px; padding:1px; border-spacing:0px; }" puts $f ".side { border-style:solid; border-width:1px; }" puts $f ".draw { border-collapse:separate; empty-cells:show; }" puts $f ".top { padding:$rad; border-top-style:solid; border-width:1px; }" puts $f ".bottom { padding:$rad; border-bottom-style:solid; border-width:1px; }" puts $f ".rside { padding:$rad; border-right-style:solid; border-width:1px; }" puts $f ".lside { padding:$rad; border-left-style:solid; border-width:1px; }" puts $f ".empty { padding:$rad; }" puts $f "</style>" puts $f "</head>" puts $f "<body>" foreach {name graph} $all_graphs { if {$name == "sql-stmt-list" || 1} { puts $f "<h3>$name:</h3>" set rc [draw_graph $name $graph] set h [lindex $rc 0] set content [lindex $rc 1] puts $f "$content" } } puts $f "</body>" puts $f "</html>" close $f |