You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by da...@apache.org on 2002/09/30 01:24:03 UTC

cvs commit: tcl-site/presentations/apache-tcl examples.ttml

davidw      2002/09/29 16:24:03

  Modified:    .        index.ttml
               presentations/apache-tcl examples.ttml
  Log:
  Updated index.ttml to redirect to index.rvt.
  
  Revision  Changes    Path
  1.14      +1 -0      tcl-site/index.ttml
  
  Index: index.ttml
  ===================================================================
  RCS file: /home/cvs/tcl-site/index.ttml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- index.ttml	28 Mar 2002 17:01:03 -0000	1.13
  +++ index.ttml	29 Sep 2002 23:24:03 -0000	1.14
  @@ -3,6 +3,7 @@
     <head>
       <title>Apache Tcl</title>
       <link rel="stylesheet" href="style.css">
  +    <meta HTTP-EQUIV="REFRESH" content="1;URL=http://tcl.apache.org/">
     </head>
     <body>
       <? title ?>
  
  
  
  1.2       +55 -7     tcl-site/presentations/apache-tcl/examples.ttml
  
  Index: examples.ttml
  ===================================================================
  RCS file: /home/cvs/tcl-site/presentations/apache-tcl/examples.ttml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- examples.ttml	16 May 2002 15:19:12 -0000	1.1
  +++ examples.ttml	29 Sep 2002 23:24:03 -0000	1.2
  @@ -3,23 +3,71 @@
     <head>
       <title>Example Tcl Code</title>
       <link rel="stylesheet" href="style.css">
  +    <script language="javascript" type="text/javascript">
  +      function MouseOn(el) {
  +      el.OldBG = el.style.getPropertyValue("background-color");
  +      el.OldColor = el.style.getPropertyValue("color");
  +      el.style.setProperty("background-color", '#ffffff', "");
  +      el.style.setProperty("color", '#000000', "");
  +      }
  +      function MouseOff(el) {
  +      el.style.setProperty("color", el.OldColor, "");
  +      el.style.setProperty("background-color", el.OldBG, "");
  +      }
  +    </script>
     </head>
   
     <body>
       <? prevnext "<h1>Example Tcl Code</h1>" ?>
   
  +<?
  +
  +proc dospan {txt} {
  +    return [format {<span onmouseover="MouseOn(this)" onmouseout="MouseOff(this)">%s</span>} $txt]
  +}
  +
  +proc pdospan {txt} {
  +    puts -nonewline [dospan $txt]
  +}
  +
  +set Code {
  +if { [var exists customerid] } {
  +    array set customer [get_customer_info $customerid]
  +    puts "Welcome, Mr. $customer(Surname)"
  +} else {
  +    puts "Hi, would you like to register a new account?"
  +}
  +}
  +
  +puts "<hr>"
  +foreach el $Code {
  +    if {[llength $el] > 1} {
  +	set el [string map {\n <br> " " &nbsp;} $el]
  +	puts [dospan "{ $el }"]
  +    } else {
  +	puts "[dospan $el]"
  +    }
  +}
  +puts "<hr>"
  +
  +?>
  +
  +
       So, Dave, show us the code...
   
  -    <PRE>
  +<b>
   
  -<B><FONT COLOR="#A020F0">if</FONT></B> { [var exists customerid] } {
  -    <B><FONT COLOR="#A020F0">array</FONT></B> <B><FONT COLOR="#A020F0">set</FONT></B> customer [get_customer_info $<FONT COLOR="#B8860B">customerid</FONT>]
  -    <B><FONT COLOR="#A020F0">puts</FONT></B> <B><FONT COLOR="#BC8F8F">&quot;Welcome, Mr. $customer(Surname)&quot;</FONT></B>
  +<pre>
  +<? pdospan {if { [var exists customerid] }} ?> {
  +    array set customer <? pdospan {[get_customer_info $customerid]} ?>
  +    puts "Welcome, Mr. <? pdospan {$customer(Surname)} ?>"
   } else {
  -    <B><FONT COLOR="#A020F0">puts</FONT></B> <B><FONT COLOR="#BC8F8F">&quot;Hi, would you like to register a new account?&quot;</FONT></B>
  -}</PRE>
  +    puts "Hi, would you like to register a new account?"
  +}
  +</pre>
  +</b>
   
  -Simple enough...
  +Simple enough!
   
   
     </body>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tcl-site-cvs-unsubscribe@tcl.apache.org
For additional commands, e-mail: tcl-site-cvs-help@tcl.apache.org