You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@locus.apache.org on 2000/06/04 21:42:43 UTC

cvs commit: embperl/test/html input.htm

richter     00/06/04 12:42:43

  Modified:    .        Tag: Embperl2 Changes.pod Embperl.xs Makefile.PL
                        TODO ep.h epcmd.c epcmd2.c
               Embperl  Tag: Embperl2 Syntax.pm
               test/cmp Tag: Embperl2 input.htm
               test/html Tag: Embperl2 input.htm
  Log:
  Embperl 2 - Input
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.115.2.5 +4 -0      embperl/Changes.pod
  
  Index: Changes.pod
  ===================================================================
  RCS file: /home/cvs/embperl/Changes.pod,v
  retrieving revision 1.115.2.4
  retrieving revision 1.115.2.5
  diff -u -r1.115.2.4 -r1.115.2.5
  --- Changes.pod	2000/06/01 06:38:12	1.115.2.4
  +++ Changes.pod	2000/06/04 19:42:39	1.115.2.5
  @@ -35,6 +35,10 @@
        dynamic table) inside an if and the /table inside another if.
        (That still works for static tables)
   
  +   - optUndefToEmptyValue is always set and cannot be disabled.
  +
  +
  +
   
   
   =head1 1.3b4_dev -- That's what currently under developement
  
  
  
  1.26.2.14 +23 -4     embperl/Embperl.xs
  
  Index: Embperl.xs
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl.xs,v
  retrieving revision 1.26.2.13
  retrieving revision 1.26.2.14
  diff -u -r1.26.2.13 -r1.26.2.14
  --- Embperl.xs	2000/06/01 06:38:13	1.26.2.13
  +++ Embperl.xs	2000/06/04 19:42:40	1.26.2.14
  @@ -600,7 +600,7 @@
   
   ################################################################################
   
  -MODULE = HTML::Embperl      PACKAGE = XML::Embperl::Cmd     PREFIX = embperl_
  +MODULE = HTML::Embperl      PACKAGE = HTML::Embperl::Cmd     PREFIX = embperl_
   
   
   void
  @@ -615,10 +615,29 @@
   void
   embperl_InputCheck (xDomTree, xNode, sName, sValue)
       int xDomTree
  -    int xOldChild
  -    char * sName
  -    char * sValue
  +    int xNode
  +    SV * sName
  +    SV * sValue
  +CODE:
  +    IV nName ;
  +    IV nValue ;
  +    char * sN = SV2String (sName, nName) ;
  +    char * sV = SV2String (sValue, nValue) ;
  +    embperlCmd_InputCheck (DomTree_self (xDomTree), xNode, sN, nName, sV, nValue) ;
  +    
  +
  +void
  +embperl_Option (xDomTree, xNode, sName, sValue)
  +    int xDomTree
  +    int xNode
  +    SV * sName
  +    SV * sValue
   CODE:
  +    IV nName ;
  +    IV nValue ;
  +    char * sN = SV2String (sName, nName) ;
  +    char * sV = SV2String (sValue, nValue) ;
  +    embperlCmd_Option (DomTree_self (xDomTree), xNode, sN, nName, sV, nValue) ;
       
   
   
  
  
  
  1.28.2.6  +2 -2      embperl/Makefile.PL
  
  Index: Makefile.PL
  ===================================================================
  RCS file: /home/cvs/embperl/Makefile.PL,v
  retrieving revision 1.28.2.5
  retrieving revision 1.28.2.6
  diff -u -r1.28.2.5 -r1.28.2.6
  --- Makefile.PL	2000/06/01 13:00:54	1.28.2.5
  +++ Makefile.PL	2000/06/04 19:42:40	1.28.2.6
  @@ -289,12 +289,12 @@
       {
       if ($win32)
           {
  -        $ccdebug = '-Zi' ;
  +        $ccdebug = '-Zi -W3' ;
           $lddebug = '-debug' ;
           }
       else
           {
  -        $ccdebug = '-g' ;
  +        $ccdebug = '-g -wall' ;
           $lddebug = '-g' ;
           }
       }
  
  
  
  1.90.2.5  +4 -0      embperl/TODO
  
  Index: TODO
  ===================================================================
  RCS file: /home/cvs/embperl/TODO,v
  retrieving revision 1.90.2.4
  retrieving revision 1.90.2.5
  diff -u -r1.90.2.4 -r1.90.2.5
  --- TODO	2000/06/01 06:38:13	1.90.2.4
  +++ TODO	2000/06/04 19:42:40	1.90.2.5
  @@ -62,6 +62,8 @@
   - accpect \0 as separator for multiple with same name in %fdat (as CGI->Vars)
     [Ilia Lobsanov 8.4.00]
   
  +- FlushOutput to sitch to output http headers and flush output [Jim Peters 1.6.00]
  +
   Test
   ----
   - test FORBIDDEN
  @@ -137,5 +139,7 @@
   - $row etc. ende checken
   
   - discard.htm
  +
  +- double nested table (Region/Kategorie) -> table.htm, input.htm
   
   
  
  
  
  1.23.2.5  +26 -0     embperl/ep.h
  
  Index: ep.h
  ===================================================================
  RCS file: /home/cvs/embperl/ep.h,v
  retrieving revision 1.23.2.4
  retrieving revision 1.23.2.5
  diff -u -r1.23.2.4 -r1.23.2.5
  --- ep.h	2000/05/31 06:21:49	1.23.2.4
  +++ ep.h	2000/06/04 19:42:40	1.23.2.5
  @@ -371,6 +371,32 @@
   			/*in*/ struct tCmd *  pCmd,
                           /*in*/ const char *    sArg) ;
   
  +SV * SplitFdat     (/*i/o*/ register req * r,
  +                           /*in*/  SV ** ppSVfdat,
  +                           /*out*/ SV ** ppSVerg,
  +                           /*in*/  char * pName,
  +                           /*in*/  STRLEN nlen) ;
  +
  +
  +/* ---- from epcmd2.c ----- */
  +
  +
  +void embperlCmd_InputCheck  (/*in*/ tDomTree *	    pDomTree,
  +			/*in*/ tNode	    xNode,
  +			/*in*/ const char *     pName,
  +			/*in*/ int              nNameLen,
  +			/*in*/ const char *     pVal,
  +			/*in*/ int              nValLen) ;
  +
  +
  +void embperlCmd_Option      (/*in*/ tDomTree *	    pDomTree,
  +			/*in*/ tNode	    xNode,
  +			/*in*/ const char *     pName,
  +			/*in*/ int              nNameLen,
  +			/*in*/ const char *     pVal,
  +			/*in*/ int              nValLen) ;
  +			
  +			
   /* ---- from eputil.c ----- */
   
   
  
  
  
  1.33.2.1  +1 -1      embperl/epcmd.c
  
  Index: epcmd.c
  ===================================================================
  RCS file: /home/cvs/embperl/epcmd.c,v
  retrieving revision 1.33
  retrieving revision 1.33.2.1
  diff -u -r1.33 -r1.33.2.1
  --- epcmd.c	2000/01/05 05:41:38	1.33
  +++ epcmd.c	2000/06/04 19:42:40	1.33.2.1
  @@ -1451,7 +1451,7 @@
   /* ---------------------------------------------------------------------------- */
   
   
  -static SV * SplitFdat     (/*i/o*/ register req * r,
  +SV * SplitFdat     (/*i/o*/ register req * r,
                              /*in*/  SV ** ppSVfdat,
                              /*out*/ SV ** ppSVerg,
                              /*in*/  char * pName,
  
  
  
  1.1.2.2   +68 -23    embperl/Attic/epcmd2.c
  
  Index: epcmd2.c
  ===================================================================
  RCS file: /home/cvs/embperl/Attic/epcmd2.c,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- epcmd2.c	2000/06/01 13:00:55	1.1.2.1
  +++ epcmd2.c	2000/06/04 19:42:40	1.1.2.2
  @@ -17,35 +17,80 @@
   
   
   
  -embperl_InputCheck (/*in*/ tDomTree *	    pDomTree,
  +static embperlCmd_SetRemove (/*in*/ tDomTree *	    pDomTree,
   		    /*in*/ tNode	    xNode,
                       /*in*/ const char *     pName,
                       /*in*/ int              nNameLen,
                       /*in*/ const char *     pVal,
  -                    /*in*/ int              nValLen) 
  +                    /*in*/ int              nValLen,
  +		    /*in*/ const char *     sAttrName, 
  +		    /*in*/ int              nAttrLen) 
   
       {
  -    int bEqual = 0 ;
  -    SV * pSV ;
  -    SV * * ppSVerg = hv_fetch(r -> pFormSplitHash, (char *)pName, nNameLen, 0) ;  
  -    pSV = SplitFdat (r, ppSV, ppSVerg, (char *)pName, nNameLen) ;
  -
  -    if (SvTYPE (pSV) == SVt_PVHV)
  -        { /* -> Hash -> check if key exists */
  -        if (hv_exists ((HV *)pSV, (char *)pVal, nValLen))
  -            bEqual = 1 ;
  -        }
  -    else
  -        {
  -        IV *  dlen ;
  -        char * pData = SvPV (pSV, dlen) ;
  -        if (dlen == nValLen && strncmp (pVal, pData, dlen) == 0)
  -            bEqual = 1 ;
  -        }
  +    int	    bEqual = 0 ;
  +    SV **   ppSV = hv_fetch(pCurrReq -> pFormHash, (char *)pName, nNameLen, 0) ;  
  +
  +    if (ppSV)
  +	{
  +	SV **   ppSVerg = hv_fetch(pCurrReq -> pFormSplitHash, (char *)pName, nNameLen, 0) ;  
  +	SV *    pSV = SplitFdat (pCurrReq, ppSV, ppSVerg, (char *)pName, nNameLen) ;
  +	tNodeData * pNode = Node_self (pDomTree, xNode) ;
  +
  +	if (SvTYPE (pSV) == SVt_PVHV)
  +	    { /* -> Hash -> check if key exists */
  +	    if (hv_exists ((HV *)pSV, (char *)pVal, nValLen))
  +		{
  +		bEqual = 1 ;
  +		hv_store (pCurrReq -> pInputHash, (char *)pName, nNameLen, newSVpvn ((char *)pVal, nValLen), 0) ;
  +		}
  +	    }
  +	else
  +	    {
  +	    IV   dlen ;
  +	    char * pData = SvPV (pSV, dlen) ;
  +	    if (dlen == nValLen && strncmp (pVal, pData, dlen) == 0)
  +		{
  +		bEqual = 1 ;
  +		hv_store (pCurrReq -> pInputHash, (char *)pName, nNameLen, pSV, 0) ;
  +		}
  +	    }
   
  -    if (bEqual)
  -        Element_setAttribut (pDomTree, xNode, "checked", NULL) ;
  +	if (bEqual)
  +	    {
  +	    Element_selfSetAttribut (pDomTree, pNode, sAttrName, nAttrLen, NULL, 0) ;
  +	    }
  +	else
  +	    Element_selfRemoveAttribut (pDomTree, pNode, sAttrName, nAttrLen) ;
  +	}
       else
  -        Element_removeAttribut (pDomTree, xNode, "checked") ;
  -        
  +	hv_store (pCurrReq -> pInputHash, (char *)pName, nNameLen, newSVpvn ((char *)pVal, nValLen), 0) ;
  +
       }
  +
  +
  +
  +void embperlCmd_InputCheck (/*in*/ tDomTree *	    pDomTree,
  +		    /*in*/ tNode	    xNode,
  +                    /*in*/ const char *     pName,
  +                    /*in*/ int              nNameLen,
  +                    /*in*/ const char *     pVal,
  +                    /*in*/ int              nValLen) 
  +
  +    {
  +    embperlCmd_SetRemove (pDomTree, xNode, pName, nNameLen, pVal, nValLen, "checked", 7) ;
  +    }
  +
  +
  +
  +
  +void embperlCmd_Option (/*in*/ tDomTree *	    pDomTree,
  +		    /*in*/ tNode	    xNode,
  +                    /*in*/ const char *     pName,
  +                    /*in*/ int              nNameLen,
  +                    /*in*/ const char *     pVal,
  +                    /*in*/ int              nValLen) 
  +
  +    {
  +    embperlCmd_SetRemove (pDomTree, xNode, pName, nNameLen, pVal, nValLen, "selected", 8) ;
  +    }
  +
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.17  +8 -8      embperl/Embperl/Attic/Syntax.pm
  
  Index: Syntax.pm
  ===================================================================
  RCS file: /home/cvs/embperl/Embperl/Attic/Syntax.pm,v
  retrieving revision 1.1.2.16
  retrieving revision 1.1.2.17
  diff -u -r1.1.2.16 -r1.1.2.17
  --- Syntax.pm	2000/06/01 13:00:55	1.1.2.16
  +++ Syntax.pm	2000/06/04 19:42:41	1.1.2.17
  @@ -10,7 +10,7 @@
   #   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
   #   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
   #
  -#   $Id: Syntax.pm,v 1.1.2.16 2000/06/01 13:00:55 richter Exp $
  +#   $Id: Syntax.pm,v 1.1.2.17 2000/06/04 19:42:41 richter Exp $
   #
   ###################################################################################
   
  @@ -273,9 +273,9 @@
               embperl => { 
                   perlcode =>
                       [ 
  -                    'if ($fdat{%&*\'name%} eq %&*\'value%) { XML::Embperl::DOM::Element_setAttribut (%$n%, \'checked\', undef) } else {XML::Embperl::DOM::Element_removeAttribut (%$n%, \'checked\') };  %&=-type:radio|checkbox% ',
  -                    '$idat{%&*\'name%} = %&*\'value% ; XML::Embperl::DOM::Element_setAttribut (%$n%, \'value\', $fdat{%&*\'name%} || \'\') ;   %&!value%',
  -                    '$idat{%&*\'name%} = %&*\'value% ; ',
  +                    'HTML::Embperl::Cmd::InputCheck (%$n%, %&*\'name%, %&*\'value%) ;  %&=-type:radio|checkbox% ',
  +                    '$idat{%&*\'name%}=$fdat{%&*\'name%} ; XML::Embperl::DOM::Element_setAttribut (%$n%, \'value\', $fdat{%&*\'name%} || \'\') ;   %&!value%',
  +                    '$idat{%&*\'name%}=%&*\'value% ; ',
                       ]
                   }                     
               },
  @@ -294,8 +294,8 @@
               embperl => { 
                   perlcode =>
                       [ 
  -                    'XML::Embperl::DOM::Node_appendChild (%$n%, HTML::Embperl::Syntax::ntypText, $fdat{%&*\'name%}) ;   %#!-0%',
  -                    '$idat{%&*\'name%} = \'%#*0%\' ; ',
  +                    '$idat{%&*\'name%}=$fdat{%&*\'name%};XML::Embperl::DOM::Node_appendChild (%$n%, HTML::Embperl::Syntax::ntypText, $fdat{%&*\'name%}) ;   %#!-0%',
  +                    '$idat{%&*\'name%}=\'%#*0%\' ; ',
                       ]
                   }                     
               },
  @@ -448,8 +448,8 @@
               embperl => { 
                   perlcode =>
                       [ 
  -                    'if ($fdat{\'%^*htmlselect%\'} eq %&*\'value%) { XML::Embperl::DOM::Element_setAttribut (%$n%, \'selected\', undef) } else {XML::Embperl::DOM::Element_removeAttribut (%$n%, \'selected\') };  %&*-value% ',
  -                    'if ($fdat{\'%^*htmlselect%\'} eq %#*\'0%) { XML::Embperl::DOM::Element_setAttribut (%$n%, \'selected\', undef) } else {XML::Embperl::DOM::Element_removeAttribut (%$n%, \'selected\') };  %&*-value% ',
  +                    'HTML::Embperl::Cmd::Option (%$n%, %^*\'htmlselect%, %&*\'value%);',
  +                    'HTML::Embperl::Cmd::Option (%$n%, %^*\'htmlselect%, %#*\'0%);',
                       ]
                   }                     
               },
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.10.2.2  +13 -13    embperl/test/cmp/input.htm
  
  Index: input.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/cmp/input.htm,v
  retrieving revision 1.10.2.1
  retrieving revision 1.10.2.2
  diff -u -r1.10.2.1 -r1.10.2.2
  --- input.htm	2000/06/01 06:38:15	1.10.2.1
  +++ input.htm	2000/06/04 19:42:41	1.10.2.2
  @@ -7,35 +7,35 @@
       <p>&nbsp;</p>
   
       <input name="neu1" value="no">
  -    <input name="undef" value="">
  +    <input name="undef" value="no">
   
       <input>
  -    <input  >
  +    <input>
       <input name="feld1" value="">
  -    <INPUT name="feld5" VALUE="Wert5">
  +    <input name="feld5" value="Wert5">
       <input name="feld1" value="Wert1">
       <input name="feld5" value="Wert15">
       <input name="feld1" value="">
       <input name="feld5" value="">
  +    <input type="text">
       <input type="text">
  -    <input type = "text">
       <input typo="text2">
       <input typo = "text2" >
       <input foo>
       <input foo >
  -  
  -    <input name="neu1" value="">
  -    <input name="neu2" value=">>">
  +
  +    <input name="neu2" value="">
  +    <input name="neu3" value=">>">
     
       <input type="text" name="feld1" value="Wert1">
  -    <input type="text" name="feld2">
  -    <input type="text" size=10 name="feld3">
  -    <input type="text" name="feld4" size=10>
  +    <input type="text" name="feld2" value="">
  +    <input type="text" size=10  name="feld3" value="">
  +    <input type="text" name="feld4" size=10 value="">
       
   	<input type="text" name="feld5" value="Wert5">
  -    <INPUT type="text" name="feld6" VALUE="Wert6">
  -    <INPUT type="text" size=10 name="feld7" VALUE="Wert7">
  -    <INPUT type="text" name="feld8" size=10 VALUE="Wert8">
  +    <input type="text" name="feld6" value="Wert6">
  +    <input type="text" size=10  name="feld7" value="Wert7">
  +    <input type="text" name="feld8" size=10 value="Wert8">
       
   	
   	<input type="checkbox" value="cbv1" name="cb1" checked>
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.9.2.7   +5 -3      embperl/test/html/input.htm
  
  Index: input.htm
  ===================================================================
  RCS file: /home/cvs/embperl/test/html/input.htm,v
  retrieving revision 1.9.2.6
  retrieving revision 1.9.2.7
  diff -u -r1.9.2.6 -r1.9.2.7
  --- input.htm	2000/06/01 06:38:16	1.9.2.6
  +++ input.htm	2000/06/04 19:42:42	1.9.2.7
  @@ -71,7 +71,7 @@
       <textarea Name=feld1>text1</textarea>
       <textarea Name=feld5>text5</textarea>
   
  -
  +[#
       <table border="0" width="100%">
           <tr>
               <td><table border="0">
  @@ -95,7 +95,7 @@
               </td>
           </tr>
       </table>
  -
  +#]
   	<select name="foo">
   		<option value="feld1">feld1</option>
   		<option value="feld2">feld2</option>
  @@ -143,9 +143,11 @@
   	
   	[- @ks = sort keys %idat -]
   
  +	ks = [+ "@ks" +]<p>
  +
   	<table>
   		<tr>
  -			<td>[+ $ks[$row] +]</td><td>[+ $idat{$ks[$row] || ''} +]</td>
  +			<td>[+ $ks[$row] +]</td><td>[+ $idat{$ks[$row]}  || '' +]</td>
   		</tr>
   	</table>