A bit of cleanup in JavaScript, removed repeated var declarations.
authoranuko <support@anuko.com>
Sun, 29 Jan 2017 17:28:58 +0000 (17:28 +0000)
committeranuko <support@anuko.com>
Sun, 29 Jan 2017 17:28:58 +0000 (17:28 +0000)
WEB-INF/templates/footer.tpl
WEB-INF/templates/mobile/time.tpl
WEB-INF/templates/mobile/time_edit.tpl
WEB-INF/templates/time.tpl
WEB-INF/templates/time_edit.tpl

index ca9f38e..2a9bf67 100644 (file)
@@ -12,7 +12,7 @@
       <br>
       <table cellspacing="0" cellpadding="4" width="100%" border="0">
         <tr>
-          <td align="center">&nbsp;Anuko Time Tracker 1.9.35.3555 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+          <td align="center">&nbsp;Anuko Time Tracker 1.9.35.3556 | Copyright &copy; <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
             <a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
             <a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
             <a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>
index bb800ff..29e2718 100644 (file)
@@ -143,39 +143,40 @@ function fillTaskDropdown(id) {
 
 // The formDisable function disables some fields depending on what we have in other fields.
 function formDisable(formField) {
-  formFieldValue = eval("document.timeRecordForm." + formField + ".value");
-  formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var formFieldValue = eval("document.timeRecordForm." + formField + ".value");
+  var formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var x;
 
   if (((formFieldValue != "") && (formFieldName == "start")) || ((formFieldValue != "") && (formFieldName == "finish"))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if (((formFieldValue == "") && (formFieldName == "start") && (document.timeRecordForm.finish.value == "")) || ((formFieldValue == "") && (formFieldName == "finish") && (document.timeRecordForm.start.value == ""))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = false;
     x.style.background = "white";
   }
 
   if ((formFieldValue != "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if ((formFieldValue == "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.disabled = false;
     x.style.background = "white";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.disabled = false;
     x.style.background = "white";
   }
@@ -186,7 +187,7 @@ function setNow(formField) {
   var x = eval("document.timeRecordForm.start");
   x.disabled = false;
   x.style.background = "white";
-  var x = eval("document.timeRecordForm.finish");
+  x = eval("document.timeRecordForm.finish");
   x.disabled = false;
   x.style.background = "white";
   var today = new Date();
index 117e208..f5b9083 100644 (file)
@@ -145,37 +145,38 @@ function fillTaskDropdown(id) {
 function formDisable(formField) {
   var formFieldValue = eval("document.timeRecordForm." + formField + ".value");
   var formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var x;
 
   if (((formFieldValue != "") && (formFieldName == "start")) || ((formFieldValue != "") && (formFieldName == "finish"))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if (((formFieldValue == "") && (formFieldName == "start") && (document.timeRecordForm.finish.value == "")) || ((formFieldValue == "") && (formFieldName == "finish") && (document.timeRecordForm.start.value == ""))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = false;
     x.style.background = "white";
   }
 
   if ((formFieldValue != "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if ((formFieldValue == "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.disabled = false;
     x.style.background = "white";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.disabled = false;
     x.style.background = "white";
   }
@@ -186,7 +187,7 @@ function setNow(formField) {
   var x = eval("document.timeRecordForm.start");
   x.disabled = false;
   x.style.background = "white";
-  var x = eval("document.timeRecordForm.finish");
+  x = eval("document.timeRecordForm.finish");
   x.disabled = false;
   x.style.background = "white";
   var today = new Date();
index 6d294fb..454abf9 100644 (file)
@@ -142,39 +142,40 @@ function fillTaskDropdown(id) {
 
 // The formDisable function disables some fields depending on what we have in other fields.
 function formDisable(formField) {
-  formFieldValue = eval("document.timeRecordForm." + formField + ".value");
-  formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var formFieldValue = eval("document.timeRecordForm." + formField + ".value");
+  var formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var x;
 
   if (((formFieldValue != "") && (formFieldName == "start")) || ((formFieldValue != "") && (formFieldName == "finish"))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if (((formFieldValue == "") && (formFieldName == "start") && (document.timeRecordForm.finish.value == "")) || ((formFieldValue == "") && (formFieldName == "finish") && (document.timeRecordForm.start.value == ""))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = false;
     x.style.background = "white";
   }
 
   if ((formFieldValue != "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if ((formFieldValue == "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.disabled = false;
     x.style.background = "white";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.disabled = false;
     x.style.background = "white";
   }
@@ -185,7 +186,7 @@ function setNow(formField) {
   var x = eval("document.timeRecordForm.start");
   x.disabled = false;
   x.style.background = "white";
-  var x = eval("document.timeRecordForm.finish");
+  x = eval("document.timeRecordForm.finish");
   x.disabled = false;
   x.style.background = "white";
   var today = new Date();
index a4e26a6..863cdb1 100644 (file)
@@ -145,37 +145,38 @@ function fillTaskDropdown(id) {
 function formDisable(formField) {
   var formFieldValue = eval("document.timeRecordForm." + formField + ".value");
   var formFieldName = eval("document.timeRecordForm." + formField + ".name");
+  var x;
 
   if (((formFieldValue != "") && (formFieldName == "start")) || ((formFieldValue != "") && (formFieldName == "finish"))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if (((formFieldValue == "") && (formFieldName == "start") && (document.timeRecordForm.finish.value == "")) || ((formFieldValue == "") && (formFieldName == "finish") && (document.timeRecordForm.start.value == ""))) {
-    var x = eval("document.timeRecordForm.duration");
+    x = eval("document.timeRecordForm.duration");
     x.value = "";
     x.disabled = false;
     x.style.background = "white";
   }
 
   if ((formFieldValue != "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.value = "";
     x.disabled = true;
     x.style.background = "#e9e9e9";
   }
 
   if ((formFieldValue == "") && (formFieldName == "duration")) {
-    var x = eval("document.timeRecordForm.start");
+    x = eval("document.timeRecordForm.start");
     x.disabled = false;
     x.style.background = "white";
-    var x = eval("document.timeRecordForm.finish");
+    x = eval("document.timeRecordForm.finish");
     x.disabled = false;
     x.style.background = "white";
   }
@@ -186,7 +187,7 @@ function setNow(formField) {
   var x = eval("document.timeRecordForm.start");
   x.disabled = false;
   x.style.background = "white";
-  var x = eval("document.timeRecordForm.finish");
+  x = eval("document.timeRecordForm.finish");
   x.disabled = false;
   x.style.background = "white";
   var today = new Date();