Changeset 1209


Ignore:
Timestamp:
12/08/08 05:12:51 (3 years ago)
Author:
ArthurClemens
Message:

Item113: fix couple of unit tests

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/EditTablePlugin/test/unit/EditTablePlugin/EditTablePluginTests.pm

    r1206 r1209  
    308308<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    309309        <tbody> 
    310                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    311                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">0<input type="hidden" name="etcell1x1" value="0" /></span> </td> 
    312                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x2" size="10" value="test1" /> </td> 
     310                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     311                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">0<input type="hidden" name="etcell1x1" value="0" /></span> </td> 
     312                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x2" size="10" value="test1" /> </td> 
    313313                </tr> 
    314                 <tr class="foswikiTableEven twikiTableRowdataBgSorted1 twikiTableRowdataBg1"> 
    315                         <td bgcolor="#f2f3f6" valign="top" class="twikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">1<input type="hidden" name="etcell2x1" value="1" /></span> </td> 
    316                         <td bgcolor="#f2f3f6" valign="top" class="twikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell2x2" size="10" value="test2" /> </td> 
     314                <tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1"> 
     315                        <td bgcolor="#f2f3f6" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">1<input type="hidden" name="etcell2x1" value="1" /></span> </td> 
     316                        <td bgcolor="#f2f3f6" valign="top" class="foswikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell2x2" size="10" value="test2" /> </td> 
    317317                </tr> 
    318                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    319                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">2<input type="hidden" name="etcell3x1" value="2" /></span> </td> 
    320                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell3x2" size="10" value="test3" /> </td> 
     318                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     319                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol"> <span class="et_rowlabel">2<input type="hidden" name="etcell3x1" value="2" /></span> </td> 
     320                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol"> <input class="foswikiInputField editTableInput" type="text" name="etcell3x2" size="10" value="test3" /> </td> 
    321321                </tr> 
    322                 <tr class="foswikiTableEven twikiTableRowdataBgSorted1 twikiTableRowdataBg1"> 
    323                         <td bgcolor="#f2f3f6" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLast"> <span class="et_rowlabel">3<input type="hidden" name="etcell4x1" value="3" /></span> </td> 
    324                         <td bgcolor="#f2f3f6" valign="top" class="twikiTableCol1 foswikiLastCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell4x2" size="10" value="init" /> </td> 
     322                <tr class="foswikiTableEven foswikiTableRowdataBgSorted1 foswikiTableRowdataBg1"> 
     323                        <td bgcolor="#f2f3f6" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <span class="et_rowlabel">3<input type="hidden" name="etcell4x1" value="3" /></span> </td> 
     324                        <td bgcolor="#f2f3f6" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell4x2" size="10" value="init" /> </td> 
    325325                </tr> 
    326326        </tbody></table> 
     
    426426<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    427427        <tbody> 
    428                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    429                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLast"> <select class="foswikiSelect" name="etcell1x1" size="1"> <option>a</option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
    430                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLast"> <select class="foswikiSelect" name="etcell1x2" size="1"> <option>a</option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
    431                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol2 foswikiLast"> <select class="foswikiSelect" name="etcell1x3" size="1 "> <option>a </option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
    432                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol3 foswikiLastCol foswikiLast"> <select class="foswikiSelect" name="etcell1x4" size="1 "> <option>a </option> <option>b </option> <option selected="selected">c </option> <option>d</option></select> </td> 
     428                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     429                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <select class="foswikiSelect" name="etcell1x1" size="1"> <option>a</option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
     430                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLast"> <select class="foswikiSelect" name="etcell1x2" size="1"> <option>a</option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
     431                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol2 foswikiLast"> <select class="foswikiSelect" name="etcell1x3" size="1 "> <option>a </option> <option>b</option> <option selected="selected">c</option> <option>d</option></select> </td> 
     432                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol3 foswikiLastCol foswikiLast"> <select class="foswikiSelect" name="etcell1x4" size="1 "> <option>a </option> <option>b </option> <option selected="selected">c </option> <option>d</option></select> </td> 
    433433                </tr> 
    434434        </tbody> 
     
    490490<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    491491        <tbody> 
    492                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    493                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLast"> <table class="editTableInnerTable"><tr><td valign="top"> <input type="radio" name="etcell1x1" value=":skull:" /> <img src="$pubPathSystemWeb/SmiliesPlugin/skull.gif" alt="dead!" title="dead!" border="0" /> <br /> <input type="radio" name="etcell1x1" value=":cool:" /> <img src="$pubPathSystemWeb/SmiliesPlugin/cool.gif" alt="cool!" title="cool!" border="0" /> </td></tr></table> </td> 
    494                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLastCol foswikiLast"> <table class="editTableInnerTable"><tr><td valign="top"> <input type="checkbox" name="etcell1x2x2" value=":skull:" checked="checked" /> <img src="$pubPathSystemWeb/SmiliesPlugin/skull.gif" alt="dead!" title="dead!" border="0" /> <br /> <input type="checkbox" name="etcell1x2x3" value=":cool:" checked="checked" /> <img src="$pubPathSystemWeb/SmiliesPlugin/cool.gif" alt="cool!" title="cool!" border="0" /> </td></tr></table><input type="hidden" name="etcell1x2" value="Chkbx: etcell1x2x2 etcell1x2x3" /> </td> 
     492                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     493                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <table class="editTableInnerTable"><tr><td valign="top"> <input type="radio" name="etcell1x1" value=":skull:" /> <img src="$pubPathSystemWeb/SmiliesPlugin/skull.gif" alt="dead!" title="dead!" border="0" /> <br /> <input type="radio" name="etcell1x1" value=":cool:" /> <img src="$pubPathSystemWeb/SmiliesPlugin/cool.gif" alt="cool!" title="cool!" border="0" /> </td></tr></table> </td> 
     494                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> <table class="editTableInnerTable"><tr><td valign="top"> <input type="checkbox" name="etcell1x2x2" value=":skull:" checked="checked" /> <img src="$pubPathSystemWeb/SmiliesPlugin/skull.gif" alt="dead!" title="dead!" border="0" /> <br /> <input type="checkbox" name="etcell1x2x3" value=":cool:" checked="checked" /> <img src="$pubPathSystemWeb/SmiliesPlugin/cool.gif" alt="cool!" title="cool!" border="0" /> </td></tr></table><input type="hidden" name="etcell1x2" value="Chkbx: etcell1x2x2 etcell1x2x3" /> </td> 
    495495                </tr> 
    496496        </tbody> 
     
    546546<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    547547        <tbody> 
    548                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    549                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLast"> <img src="%PUBURLPATH%/%SYSTEMWEB%/DocumentGraphics/choice-yes.gif" alt="DONE" title="DONE" width="16" height="16" border="0" /> </td> 
    550                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLastCol foswikiLast"> <a href="$viewUrl" class="foswikiCurrentTopicLink foswikiLink">$topicName</a> </td> 
     548                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     549                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <img src="%PUBURLPATH%/%SYSTEMWEB%/DocumentGraphics/choice-yes.gif" alt="DONE" title="DONE" width="16" height="16" border="0" /> </td> 
     550                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> <a href="$viewUrl" class="foswikiCurrentTopicLink">$topicName</a> </td> 
    551551                </tr> 
    552552        </tbody> 
     
    600600<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    601601        <tbody> 
    602                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    603                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x1" size="30" value="%Y%" /> </td> 
    604                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol1 foswikiLastCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x2" size="30" value="%TOPIC%" /> </td> 
     602                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     603                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x1" size="30" value="%Y%" /> </td> 
     604                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol1 foswikiLastCol foswikiLast"> <input class="foswikiInputField editTableInput" type="text" name="etcell1x2" size="30" value="%TOPIC%" /> </td> 
    605605                </tr> 
    606606        </tbody>         
     
    965965<table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 
    966966        <tbody> 
    967                 <tr class="foswikiTableOdd twikiTableRowdataBgSorted0 twikiTableRowdataBg0"> 
    968                         <td bgcolor="#ffffff" valign="top" class="twikiTableCol0 foswikiFirstCol foswikiLastCol foswikiLast"> blablabla <br /> there's still a bug <br /> lurking around <br /> <em>italic</em> <br /> <strong>bold</strong> </td> 
     967                <tr class="foswikiTableOdd foswikiTableRowdataBgSorted0 foswikiTableRowdataBg0"> 
     968                        <td bgcolor="#ffffff" valign="top" class="foswikiTableCol0 foswikiFirstCol foswikiLastCol foswikiLast"> blablabla <br /> there's still a bug <br /> lurking around <br /> <em>italic</em> <br /> <strong>bold</strong> </td> 
    969969                </tr> 
    970970        </tbody></table> 
  • trunk/UnitTestContrib/test/unit/InitFormTests.pm

    r1178 r1209  
    200200    my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\"" ); 
    201201 
    202     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
    203     $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    204 Simple description of problem</textarea>', get_formfield(2, $text)); 
    205     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     202    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
     203    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
     204Simple description of problem</textarea>', get_formfield(2, $text)); 
     205    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    206206    $this->assert_html_matches('<input type="hidden" name="History1" value="' . $aurl . '"  />', get_formfield(4, $text)); 
    207     $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
    208     $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
    209     $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     207    $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
     208    $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
     209    $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    210210} 
    211211 
     
    216216    my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    217217 
    218     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
    219     $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    220 Simple description of problem</textarea>', get_formfield(2, $text)); 
    221     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     218    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
     219    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
     220Simple description of problem</textarea>', get_formfield(2, $text)); 
     221    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    222222    $this->assert_html_matches('<input type="hidden" name="History1" value="' . $aurl . '" />', get_formfield(4, $text)); 
    223     $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
    224     $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
    225     $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     223    $this->assert_html_matches('<input type="text" name="History2" value="' . $aurl . '" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
     224    $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
     225    $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    226226 
    227227} 
     
    233233    my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    234234 
    235     $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
     235    $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
    236236    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    237237---+ Example problem</textarea>', get_formfield(2, $text)); 
    238     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     238    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    239239    $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%"  />', get_formfield(4, $text)); 
    240     $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
     240    $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
    241241    $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%"  />', get_formfield(6, $text)); 
    242     $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     242    $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    243243 
    244244} 
     
    250250    my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 
    251251 
    252     $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
     252    $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
    253253    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    254254---+ Example problem</textarea>', get_formfield(2, $text)); 
    255     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     255    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    256256    $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%"  />', get_formfield(4, $text)); 
    257     $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
     257    $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
    258258    $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%"  />', get_formfield(6, $text)); 
    259     $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     259    $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    260260 
    261261} 
     
    267267    my $text = setup_formtests( $this, $testweb, "$testtopic1", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"_An issue_\" IssueDescription=\"---+ Example problem\" IssueType=\"Defect\" History1=\"%SCRIPTURL%\" History2=\"%SCRIPTURL%\" History3=\"\$percntSCRIPTURL%\" History4=\"\$percntSCRIPTURL%\" " ); 
    268268 
    269     $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
     269    $this->assert_html_matches('<input type="text" name="IssueName" value="_An issue_" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
    270270    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    271271---+ Example problem</textarea>', get_formfield(2, $text)); 
    272     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     272    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    273273    $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%"  />', get_formfield(4, $text)); 
    274     $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
     274    $this->assert_html_matches('<input type="text" name="History2" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
    275275    $this->assert_html_matches('<input type="hidden" name="History3" value="%SCRIPTURL%"  />', get_formfield(6, $text)); 
    276     $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     276    $this->assert_html_matches('<input type="text" name="History4" value="%SCRIPTURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    277277 
    278278} 
     
    284284    my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" " ); 
    285285 
    286     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
    287     $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    288 Simple description of problem</textarea>', get_formfield(2, $text)); 
    289     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     286    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
     287    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
     288Simple description of problem</textarea>', get_formfield(2, $text)); 
     289    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    290290    $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%"  />', get_formfield(4, $text)); 
    291     $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
    292     $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
    293     $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     291    $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
     292    $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
     293    $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    294294 
    295295} 
     
    301301    my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" " ); 
    302302 
    303     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
    304     $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    305 Simple description of problem</textarea>', get_formfield(2, $text)); 
    306     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     303    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
     304    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
     305Simple description of problem</textarea>', get_formfield(2, $text)); 
     306    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    307307    $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%"  />', get_formfield(4, $text)); 
    308     $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
    309     $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
    310     $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     308    $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
     309    $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
     310    $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    311311 
    312312} 
     
    318318    my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\" IssueName=\"My first defect\" IssueDescription=\"Simple description of problem\" IssueType=\"Enhancement\" History1=\"%ATTACHURL%\" History2=\"%ATTACHURL%\" History3=\"\$percntATTACHURL%\" History4=\"\$percntATTACHURL%\" text=\"\"" ); 
    319319 
    320     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
    321     $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    322 Simple description of problem</textarea>', get_formfield(2, $text)); 
    323     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption">Defect</option><option class="twikiEditFormOption" selected="selected">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     320    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
     321    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
     322Simple description of problem</textarea>', get_formfield(2, $text)); 
     323    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption">Defect</option><option class="foswikiOption" selected="selected">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    324324    $this->assert_html_matches('<input type="hidden" name="History1" value="%ATTACHURL%"  />', get_formfield(4, $text)); 
    325     $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(5, $text)); 
    326     $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
    327     $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="twikiInputField" />', get_formfield(7, $text)); 
     325    $this->assert_html_matches('<input type="text" name="History2" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(5, $text)); 
     326    $this->assert_html_matches('<input type="hidden" name="History3" value="%ATTACHURL%"  />', get_formfield(6, $text)); 
     327    $this->assert_html_matches('<input type="text" name="History4" value="%ATTACHURL%" size="20" class="foswikiInputField" />', get_formfield(7, $text)); 
    328328 
    329329} 
     
    339339    my $text = setup_formtests( $this, $testweb, $testtopic3 ); 
    340340 
    341     $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="twikiInputField twikiMandatory" />', get_formfield(1, $text)); 
     341    $this->assert_html_matches('<input type="text" name="IssueName" value="My first defect" size="73" class="foswikiInputField foswikiMandatory" />', get_formfield(1, $text)); 
    342342    $this->assert_html_matches('<textarea name="IssueDescription"  rows="5" cols="55" class="foswikiTextarea"> 
    343343Simple description of problem</textarea>', get_formfield(2, $text)); 
    344344    #  $this->assert_matches(qr/<select [^>]+><option ([^>]+| selected)>Defect<\/option>/, get_formfield(3, $text)); 
    345     $this->assert_html_matches('<select name="IssueType" class="twikiSelect twikiEditFormSelect" size="1"><option class="twikiEditFormOption" selected="selected">Defect</option><option class="twikiEditFormOption">Enhancement</option><option class="twikiEditFormOption">Other</option></select>', get_formfield(3, $text)); 
     345    $this->assert_html_matches('<select name="IssueType" class="foswikiSelect" size="1"><option class="foswikiOption" selected="selected">Defect</option><option class="foswikiOption">Enhancement</option><option class="foswikiOption">Other</option></select>', get_formfield(3, $text)); 
    346346    $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%"  />', get_formfield(4, $text)); 
    347347    $this->assert_html_matches('<input type="hidden" name="History3" value="$percntSCRIPTURL%"  />', get_formfield(6, $text)); 
  • trunk/core/data/System/CascadingStyleSheets.txt

    r1206 r1209  
    8686|=.foswikiFormTableFooter=        | Table container for form elements  | 
    8787|=.foswikiEditForm=               | Edit state of data form  | 
     88|=.foswikiMandaroty=              | Indication of mandatory field | 
    8889 
    8990---+++ HTML Forms 
  • trunk/core/lib/Foswiki/Form/FieldDefinition.pm

    r1178 r1209  
    146146    my $this = shift; 
    147147    if ( $this->isMandatory() ) { 
    148         push( @_, 'twikiMandatory' ); 
     148        push( @_, 'foswikiMandatory' ); 
    149149    } 
    150150    return join( ' ', @_ ); 
  • trunk/core/pub/System/JavascriptFiles/foswiki_edit.js

    r1206 r1209  
    111111    } 
    112112    var ok = true; 
    113     var els = foswiki.getElementsByClassName(document, 'twikiMandatory', 'select'); 
     113    var els = foswiki.getElementsByClassName(document, 'foswikiMandatory', 'select'); 
    114114    for (var j = 0; j < els.length; j++) { 
    115115        var one = false; 
     
    128128    var taglist = new Array('input', 'textarea'); 
    129129    for (var i = 0; i < taglist.length; i++) { 
    130         els = foswiki.getElementsByClassName(document, 'twikiMandatory', taglist[i]); 
     130        els = foswiki.getElementsByClassName(document, 'foswikiMandatory', taglist[i]); 
    131131        for (var j = 0; j < els.length; j++) { 
    132132            if (els[j].value == null || els[j].value.length == 0) { 
Note: See TracChangeset for help on using the changeset viewer.