Revision: 2594
          https://sourceforge.net/p/mrbs/code/2594/
Author:   cimorrison
Date:     2012-12-14 22:22:23 +0000 (Fri, 14 Dec 2012)
Log Message:
-----------
Tidied up the JavaScript, fixing some JSHint problems.

Modified Paths:
--------------
    mrbs/trunk/web/js/edit_area_room.js.php

Modified: mrbs/trunk/web/js/edit_area_room.js.php
===================================================================
--- mrbs/trunk/web/js/edit_area_room.js.php     2012-12-14 21:51:21 UTC (rev 
2593)
+++ mrbs/trunk/web/js/edit_area_room.js.php     2012-12-14 22:22:23 UTC (rev 
2594)
@@ -46,19 +46,38 @@
    // rarely used admin page.
    ?>
    var ap,
+       timeString,
        minutes = time % 60;
    time -= minutes;
    var hour = time/60;
    if (!twentyfourhour_format)
    {
-     ap = "<?php echo utf8_strftime($strftime_format['ampm'], mktime(10, 0, 
0)) ?>";
-     if (hour > 11) {ap = "<?php echo utf8_strftime($strftime_format['ampm'], 
mktime(14, 0, 0)) ?>";}
-     if (hour > 12) {hour = hour - 12;}
-     if (hour == 0) {hour = 12;}
+     if (hour > 11)
+     {
+       ap = "<?php echo utf8_strftime($strftime_format['ampm'], mktime(14, 0, 
0)) ?>";
+     }
+     else
+     {
+       ap = "<?php echo utf8_strftime($strftime_format['ampm'], mktime(10, 0, 
0)) ?>";
+     }
+     if (hour > 12)
+     {
+       hour = hour - 12;
+     }
+     if (hour === 0)
+     {
+       hour = 12;
+     }
    }
-   if (hour < 10) {hour   = "0" + hour;}
-   if (minutes < 10) {minutes = "0" + minutes;}
-   var timeString = hour + ':' + minutes;
+   if (hour < 10)
+   {
+     hour   = "0" + hour;
+   }
+   if (minutes < 10)
+   {
+     minutes = "0" + minutes;
+   }
+   timeString = hour + ':' + minutes;
    if (!twentyfourhour_format)
    {
      timeString += ap;
@@ -69,11 +88,11 @@
 
 function convertTo24(hour, ampm)
 {
-  if ((ampm == "pm") && (hour < 12))
+  if ((ampm === "pm") && (hour < 12))
   {
     hour += 12;
   }
-  if ((ampm == "am") && (hour > 11))
+  if ((ampm === "am") && (hour > 11))
   {
     hour -= 12;
   }
@@ -94,7 +113,7 @@
       minsPerDay = 24*60;
       
   resMins = parseInt($('#area_res_mins').val(), 10);
-  if (resMins == 0)
+  if (resMins === 0)
   {
     return;  <?php // avoid endless loops and divide by zero errors ?>
   }
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to