Commit 597bdf8292b4c10b6795b67cb29b56e886e6418f

Authored by Jarrett Jordaan
1 parent 3c68e347

PT-2280465: JS cleanup.

Committed by: Jarrett Jordaan

Reviewed by: Megan Watson
setup/wizard/resources/js/wizard.js
... ... @@ -85,6 +85,9 @@ wizard.prototype.valRegHelper = function() {
85 85 var last = $("#last");
86 86 var email = $("#email");
87 87 var country = $("#country");
  88 + var industry = $("#industry");
  89 + var size = $("#size");
  90 + var reasons = $("#reasons");
88 91 if(first.attr('value').length < 1) {
89 92 $("#reg_error").html('Enter a First Name');
90 93 w.focusElement(first);
... ... @@ -110,19 +113,32 @@ wizard.prototype.valRegHelper = function() {
110 113 w.focusElement(email);
111 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 122 $("#reg_error").html('Please select a Country.');
115 123 w.focusElement(country);
116 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 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 142 return false;
127 143 } else {
128 144 return true;
... ... @@ -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 272 $('form').submit();
257   -}
258   -
259   -wizard.prototype.sendRegistration = function () {
260   - $('form').submit();
261   -}
262   -
263   -wizard.prototype.clearSessions = function () {
264   -
265 273 }
266 274 \ No newline at end of file
... ...
setup/wizard/templates/complete.tpl
... ... @@ -207,10 +207,8 @@
207 207 $redirect = "http://".$_SERVER['SERVER_NAME'].":$port".$root_url."/admin.php";
208 208 ?>
209 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 210 <input type="submit" name="Upgrade" value="Next" class="button_next"/>
212 211 <?php } else { ?>
213   -<!-- <a href="../../login.php" class="back button_next" style="width:50px;" onclick="javascript:{w.clearSessions();}">Finish</a>-->
214 212 <input type="submit" name="Next" value="Finish" class="button_next"/>
215 213 <?php } ?>
216 214 </form>
... ...
setup/wizard/templates/registration.tpl
1 1 <?php if (AJAX) { ?>
2 2 <form id="database_registration_install" action="index.php?step_name=<?php echo $step_name; ?>" method="post" onsubmit="w.dummy();">
3 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 5 <?php } ?>
6 6 <p class="title">Registering KnowledgeTree</p>
7 7 <p class="description">
... ... @@ -42,7 +42,7 @@
42 42 <td><input value="<?php echo $email_address; ?>" name='submitted[email_address]' id='email' size='<?php echo $input_width; ?>' style="float:left;"/></td>
43 43 </tr>
44 44 <tr>
45   - <td><label for='email'>Reasons</label></td>
  45 + <td><label for='reasons'>Reasons</label></td>
46 46 <td><input value="<?php echo $reasons; ?>" name='submitted[reasons]' id='reasons' size='<?php echo $input_width; ?>' style="float:left;"/></td>
47 47 </tr>
48 48 <tr>
... ...
setup/wizard/templates/services.tpl
... ... @@ -45,7 +45,7 @@
45 45 &nbsp;&nbsp;&nbsp;
46 46 <input name='java' id='port' size='25' value='<?php echo $java['location']; ?>' style="float:none;"/>
47 47 &nbsp;&nbsp;&nbsp;
48   - <a href="javascript:{w.sendJavaLocation();}" class="specify">Submit</a>
  48 + <a href="javascript:{w.send();}" class="specify">Submit</a>
49 49 <br/>
50 50 <?php if($javaExeError != '') { ?><span class="error"><?php echo $javaExeMessage; ?></span><?php } ?>
51 51 <br/>
... ... @@ -67,7 +67,7 @@
67 67 &nbsp;&nbsp;&nbsp;
68 68 <input name='soffice' id='port' size='25' value='<?php if(isset($soffice['location'])) echo $soffice['location']; ?>' style="float:none;"/>
69 69 &nbsp;&nbsp;&nbsp;
70   - <a href="javascript:{w.sendJavaLocation();}" class="specify">Submit</a>
  70 + <a href="javascript:{w.send();}" class="specify">Submit</a>
71 71 <br/>
72 72 <?php if($openOfficeExeError != '') { ?><span class="error"><?php echo $openOfficeExeMessage; ?></span><?php } ?>
73 73 <?php } ?>
... ...