Changeset 1209
- Timestamp:
- 12/08/08 05:12:51 (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
EditTablePlugin/test/unit/EditTablePlugin/EditTablePluginTests.pm (modified) (6 diffs)
-
UnitTestContrib/test/unit/InitFormTests.pm (modified) (9 diffs)
-
core/data/System/CascadingStyleSheets.txt (modified) (1 diff)
-
core/lib/Foswiki/Form/FieldDefinition.pm (modified) (1 diff)
-
core/pub/System/JavascriptFiles/foswiki_edit.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/EditTablePlugin/test/unit/EditTablePlugin/EditTablePluginTests.pm
r1206 r1209 308 308 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 309 309 <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> 313 313 </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> 317 317 </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> 321 321 </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> 325 325 </tr> 326 326 </tbody></table> … … 426 426 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 427 427 <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> 433 433 </tr> 434 434 </tbody> … … 490 490 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 491 491 <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> 495 495 </tr> 496 496 </tbody> … … 546 546 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 547 547 <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> 551 551 </tr> 552 552 </tbody> … … 600 600 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 601 601 <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> 605 605 </tr> 606 606 </tbody> … … 965 965 <table cellspacing="0" id="table1" cellpadding="0" class="foswikiTable" rules="cols" border="1"> 966 966 <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> 969 969 </tr> 970 970 </tbody></table> -
trunk/UnitTestContrib/test/unit/InitFormTests.pm
r1178 r1209 200 200 my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\"" ); 201 201 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"> 204 Simple 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)); 206 206 $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)); 210 210 } 211 211 … … 216 216 my $text = setup_formtests( $this, $testweb, $testtopic1, "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 217 217 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"> 220 Simple 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)); 222 222 $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)); 226 226 227 227 } … … 233 233 my $text = setup_formtests( $this, $testweb, "${testtopic1}XXXXXXXXXX", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 234 234 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)); 236 236 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 237 237 ---+ 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)); 239 239 $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)); 241 241 $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)); 243 243 244 244 } … … 250 250 my $text = setup_formtests( $this, $testweb, "$testtopic2", "formtemplate=\"$testweb.$testform\" templatetopic=\"$testweb.$testtmpl\"" ); 251 251 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)); 253 253 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 254 254 ---+ 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)); 256 256 $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)); 258 258 $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)); 260 260 261 261 } … … 267 267 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%\" " ); 268 268 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)); 270 270 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 271 271 ---+ 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)); 273 273 $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)); 275 275 $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)); 277 277 278 278 } … … 284 284 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%\" " ); 285 285 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"> 288 Simple 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)); 290 290 $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)); 294 294 295 295 } … … 301 301 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%\" " ); 302 302 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"> 305 Simple 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)); 307 307 $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)); 311 311 312 312 } … … 318 318 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=\"\"" ); 319 319 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"> 322 Simple 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)); 324 324 $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)); 328 328 329 329 } … … 339 339 my $text = setup_formtests( $this, $testweb, $testtopic3 ); 340 340 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)); 342 342 $this->assert_html_matches('<textarea name="IssueDescription" rows="5" cols="55" class="foswikiTextarea"> 343 343 Simple description of problem</textarea>', get_formfield(2, $text)); 344 344 # $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)); 346 346 $this->assert_html_matches('<input type="hidden" name="History1" value="%SCRIPTURL%" />', get_formfield(4, $text)); 347 347 $this->assert_html_matches('<input type="hidden" name="History3" value="$percntSCRIPTURL%" />', get_formfield(6, $text)); -
trunk/core/data/System/CascadingStyleSheets.txt
r1206 r1209 86 86 |=.foswikiFormTableFooter= | Table container for form elements | 87 87 |=.foswikiEditForm= | Edit state of data form | 88 |=.foswikiMandaroty= | Indication of mandatory field | 88 89 89 90 ---+++ HTML Forms -
trunk/core/lib/Foswiki/Form/FieldDefinition.pm
r1178 r1209 146 146 my $this = shift; 147 147 if ( $this->isMandatory() ) { 148 push( @_, ' twikiMandatory' );148 push( @_, 'foswikiMandatory' ); 149 149 } 150 150 return join( ' ', @_ ); -
trunk/core/pub/System/JavascriptFiles/foswiki_edit.js
r1206 r1209 111 111 } 112 112 var ok = true; 113 var els = foswiki.getElementsByClassName(document, ' twikiMandatory', 'select');113 var els = foswiki.getElementsByClassName(document, 'foswikiMandatory', 'select'); 114 114 for (var j = 0; j < els.length; j++) { 115 115 var one = false; … … 128 128 var taglist = new Array('input', 'textarea'); 129 129 for (var i = 0; i < taglist.length; i++) { 130 els = foswiki.getElementsByClassName(document, ' twikiMandatory', taglist[i]);130 els = foswiki.getElementsByClassName(document, 'foswikiMandatory', taglist[i]); 131 131 for (var j = 0; j < els.length; j++) { 132 132 if (els[j].value == null || els[j].value.length == 0) {
Note: See TracChangeset
for help on using the changeset viewer.
