Commit 597bdf8292b4c10b6795b67cb29b56e886e6418f
1 parent
3c68e347
PT-2280465: JS cleanup.
Committed by: Jarrett Jordaan Reviewed by: Megan Watson
Showing
4 changed files
with
27 additions
and
21 deletions
setup/wizard/resources/js/wizard.js
| @@ -85,6 +85,9 @@ wizard.prototype.valRegHelper = function() { | @@ -85,6 +85,9 @@ wizard.prototype.valRegHelper = function() { | ||
| 85 | var last = $("#last"); | 85 | var last = $("#last"); |
| 86 | var email = $("#email"); | 86 | var email = $("#email"); |
| 87 | var country = $("#country"); | 87 | var country = $("#country"); |
| 88 | + var industry = $("#industry"); | ||
| 89 | + var size = $("#size"); | ||
| 90 | + var reasons = $("#reasons"); | ||
| 88 | if(first.attr('value').length < 1) { | 91 | if(first.attr('value').length < 1) { |
| 89 | $("#reg_error").html('Enter a First Name'); | 92 | $("#reg_error").html('Enter a First Name'); |
| 90 | w.focusElement(first); | 93 | w.focusElement(first); |
| @@ -110,19 +113,32 @@ wizard.prototype.valRegHelper = function() { | @@ -110,19 +113,32 @@ wizard.prototype.valRegHelper = function() { | ||
| 110 | w.focusElement(email); | 113 | w.focusElement(email); |
| 111 | return false; | 114 | return false; |
| 112 | } | 115 | } |
| 113 | - if(!w.countryCheck(country.attr('value'))) { | 116 | + if(!w.ddCheck(reasons.attr('value'), "")) { |
| 117 | + $("#reg_error").html('Please supply a reason for the installation.'); | ||
| 118 | + w.focusElement(reasons); | ||
| 119 | + return false; | ||
| 120 | + } | ||
| 121 | + if(!w.ddCheck(country.attr('value'), "Select Country...")) { | ||
| 114 | $("#reg_error").html('Please select a Country.'); | 122 | $("#reg_error").html('Please select a Country.'); |
| 115 | w.focusElement(country); | 123 | w.focusElement(country); |
| 116 | return false; | 124 | return false; |
| 117 | } | 125 | } |
| 118 | - | 126 | + if(!w.ddCheck(industry.attr('value'), "Select Industry...")) { |
| 127 | + $("#reg_error").html('Please select a Industry.'); | ||
| 128 | + w.focusElement(industry); | ||
| 129 | + return false; | ||
| 130 | + } | ||
| 131 | + if(!w.ddCheck(size.attr('value'), "Select Organization Size...")) { | ||
| 132 | + $("#reg_error").html('Please select an Organization.'); | ||
| 133 | + w.focusElement(size); | ||
| 134 | + return false; | ||
| 135 | + } | ||
| 136 | + | ||
| 119 | return true; | 137 | return true; |
| 120 | } | 138 | } |
| 121 | 139 | ||
| 122 | -wizard.prototype.countryCheck = function(str) { | ||
| 123 | - //str = w.trim(str); | ||
| 124 | - //alert(str); | ||
| 125 | - if(str == "Select Country...") { | 140 | +wizard.prototype.ddCheck = function(str, check) { |
| 141 | + if(str == check) { | ||
| 126 | return false; | 142 | return false; |
| 127 | } else { | 143 | } else { |
| 128 | return true; | 144 | return true; |
| @@ -252,14 +268,6 @@ wizard.prototype.getUrl = function (address, div) { | @@ -252,14 +268,6 @@ wizard.prototype.getUrl = function (address, div) { | ||
| 252 | }); | 268 | }); |
| 253 | } | 269 | } |
| 254 | 270 | ||
| 255 | -wizard.prototype.sendJavaLocation = function () { | 271 | +wizard.prototype.send = function () { |
| 256 | $('form').submit(); | 272 | $('form').submit(); |
| 257 | -} | ||
| 258 | - | ||
| 259 | -wizard.prototype.sendRegistration = function () { | ||
| 260 | - $('form').submit(); | ||
| 261 | -} | ||
| 262 | - | ||
| 263 | -wizard.prototype.clearSessions = function () { | ||
| 264 | - | ||
| 265 | } | 273 | } |
| 266 | \ No newline at end of file | 274 | \ No newline at end of file |
setup/wizard/templates/complete.tpl
| @@ -207,10 +207,8 @@ | @@ -207,10 +207,8 @@ | ||
| 207 | $redirect = "http://".$_SERVER['SERVER_NAME'].":$port".$root_url."/admin.php"; | 207 | $redirect = "http://".$_SERVER['SERVER_NAME'].":$port".$root_url."/admin.php"; |
| 208 | ?> | 208 | ?> |
| 209 | <?php if($migrate_check) { ?> | 209 | <?php if($migrate_check) { ?> |
| 210 | -<!-- <a href="../upgrade/index.php" class="back button_next" style="width:30px;" onclick="javascript:{w.clearSessions();}">Next</a>--> | ||
| 211 | <input type="submit" name="Upgrade" value="Next" class="button_next"/> | 210 | <input type="submit" name="Upgrade" value="Next" class="button_next"/> |
| 212 | <?php } else { ?> | 211 | <?php } else { ?> |
| 213 | -<!-- <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>--> | ||
| 214 | <input type="submit" name="Next" value="Finish" class="button_next"/> | 212 | <input type="submit" name="Next" value="Finish" class="button_next"/> |
| 215 | <?php } ?> | 213 | <?php } ?> |
| 216 | </form> | 214 | </form> |
setup/wizard/templates/registration.tpl
| 1 | <?php if (AJAX) { ?> | 1 | <?php if (AJAX) { ?> |
| 2 | <form id="database_registration_install" action="index.php?step_name=<?php echo $step_name; ?>" method="post" onsubmit="w.dummy();"> | 2 | <form id="database_registration_install" action="index.php?step_name=<?php echo $step_name; ?>" method="post" onsubmit="w.dummy();"> |
| 3 | <?php } else { ?> | 3 | <?php } else { ?> |
| 4 | -<form id="registration" action="index.php?step_name=<?php echo $step_name; ?>" method="post" onsubmit="javascript:{ if(w.validateRegistration()) { w.sendRegistration() };return false;}"> | 4 | +<form id="registration" action="index.php?step_name=<?php echo $step_name; ?>" method="post" onsubmit="javascript:{ if(w.validateRegistration()) { w.send() };return false;}"> |
| 5 | <?php } ?> | 5 | <?php } ?> |
| 6 | <p class="title">Registering KnowledgeTree</p> | 6 | <p class="title">Registering KnowledgeTree</p> |
| 7 | <p class="description"> | 7 | <p class="description"> |
| @@ -42,7 +42,7 @@ | @@ -42,7 +42,7 @@ | ||
| 42 | <td><input value="<?php echo $email_address; ?>" name='submitted[email_address]' id='email' size='<?php echo $input_width; ?>' style="float:left;"/></td> | 42 | <td><input value="<?php echo $email_address; ?>" name='submitted[email_address]' id='email' size='<?php echo $input_width; ?>' style="float:left;"/></td> |
| 43 | </tr> | 43 | </tr> |
| 44 | <tr> | 44 | <tr> |
| 45 | - <td><label for='email'>Reasons</label></td> | 45 | + <td><label for='reasons'>Reasons</label></td> |
| 46 | <td><input value="<?php echo $reasons; ?>" name='submitted[reasons]' id='reasons' size='<?php echo $input_width; ?>' style="float:left;"/></td> | 46 | <td><input value="<?php echo $reasons; ?>" name='submitted[reasons]' id='reasons' size='<?php echo $input_width; ?>' style="float:left;"/></td> |
| 47 | </tr> | 47 | </tr> |
| 48 | <tr> | 48 | <tr> |
setup/wizard/templates/services.tpl
| @@ -45,7 +45,7 @@ | @@ -45,7 +45,7 @@ | ||
| 45 | | 45 | |
| 46 | <input name='java' id='port' size='25' value='<?php echo $java['location']; ?>' style="float:none;"/> | 46 | <input name='java' id='port' size='25' value='<?php echo $java['location']; ?>' style="float:none;"/> |
| 47 | | 47 | |
| 48 | - <a href="javascript:{w.sendJavaLocation();}" class="specify">Submit</a> | 48 | + <a href="javascript:{w.send();}" class="specify">Submit</a> |
| 49 | <br/> | 49 | <br/> |
| 50 | <?php if($javaExeError != '') { ?><span class="error"><?php echo $javaExeMessage; ?></span><?php } ?> | 50 | <?php if($javaExeError != '') { ?><span class="error"><?php echo $javaExeMessage; ?></span><?php } ?> |
| 51 | <br/> | 51 | <br/> |
| @@ -67,7 +67,7 @@ | @@ -67,7 +67,7 @@ | ||
| 67 | | 67 | |
| 68 | <input name='soffice' id='port' size='25' value='<?php if(isset($soffice['location'])) echo $soffice['location']; ?>' style="float:none;"/> | 68 | <input name='soffice' id='port' size='25' value='<?php if(isset($soffice['location'])) echo $soffice['location']; ?>' style="float:none;"/> |
| 69 | | 69 | |
| 70 | - <a href="javascript:{w.sendJavaLocation();}" class="specify">Submit</a> | 70 | + <a href="javascript:{w.send();}" class="specify">Submit</a> |
| 71 | <br/> | 71 | <br/> |
| 72 | <?php if($openOfficeExeError != '') { ?><span class="error"><?php echo $openOfficeExeMessage; ?></span><?php } ?> | 72 | <?php if($openOfficeExeError != '') { ?><span class="error"><?php echo $openOfficeExeMessage; ?></span><?php } ?> |
| 73 | <?php } ?> | 73 | <?php } ?> |