Revision: 2320
          http://mrbs.svn.sourceforge.net/mrbs/?rev=2320&view=rev
Author:   cimorrison
Date:     2012-07-06 15:53:05 +0000 (Fri, 06 Jul 2012)
Log Message:
-----------
Fixed bug introduced during JavaScript reorganisation causing browser language 
settings not to be respected by the datepickers.

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

Modified: mrbs/trunk/web/js/datepicker.js.php
===================================================================
--- mrbs/trunk/web/js/datepicker.js.php 2012-07-06 15:10:10 UTC (rev 2319)
+++ mrbs/trunk/web/js/datepicker.js.php 2012-07-06 15:53:05 UTC (rev 2320)
@@ -10,73 +10,7 @@
 
 // Set the default values for datepicker, including the default regional 
setting
 ?>
-/*
 $(function() {
-
-});
-*/
-
-<?php
-// Writes out the day, month and year values to the three hidden inputs
-// created by the PHP function genDateSelector().    It gets the date values
-// from the _alt input, which is the alternate field populated by datepicker
-// and is populated by datepicker with a date in yy-mm-dd format.
-//
-// (datepicker can only have one alternate field, which is why we need to write
-// to the three fields ourselves).
-//
-// Blur the datepicker input field on close, so that the datepicker will 
reappear
-// if you select it.    (Not quite sure why you need this.  It only seems
-// to be necessary when you are using Firefox and the datepicker is draggable).
-//
-// Then go and adjust the start and end time/period select options, because
-// they are dependent on the start and end dates
-//
-// Finally, if formId is defined, submit the form
-?>
-function datepicker_close(dateText, inst, formId)
-{
-  var alt_id = inst.id + '_alt';
-  var date = document.getElementById(alt_id).value.split('-');
-  document.getElementById(alt_id + '_year').value  = date[0];
-  document.getElementById(alt_id + '_month').value = date[1];
-  document.getElementById(alt_id + '_day').value   = date[2];
-  document.getElementById(inst.id).blur();
-  
-  if ($('body').hasClass('edit_entry'))
-  {
-    adjustSlotSelectors(document.getElementById('main'));
-    <?php
-    if (function_exists('json_encode'))
-    {
-      // If we're doing Ajax checking of the form then we have to check
-      // for conflicts the form when the datepicker is closed
-      ?>
-      checkConflicts();
-      <?php
-    }
-    ?>
-  }
-
-  if (formId)
-  {
-    var form = document.getElementById(formId);
-    form.submit();
-  }
-}
-
-
-
-<?php
-// 
=================================================================================
-
-// Extend the init() function 
-?>
-
-var oldInitDatepicker = init;
-init = function(args) {
-  oldInitDatepicker.apply(this, [args]);
-
   <?php
   // We set the regional setting by setting locales in reverse order of 
priority.
   // If you try and set a datepicker locale that doesn't exist, then nothing is
@@ -145,7 +79,6 @@
       }
     }
   }
-  
   ?>
   $.datepicker.setDefaults({
     showOtherMonths: true,
@@ -158,4 +91,52 @@
     altFormat: 'yy-mm-dd',
     onClose: function(dateText, inst) {datepicker_close(dateText, inst);}
   });
-}
\ No newline at end of file
+});
+
+
+<?php
+// Writes out the day, month and year values to the three hidden inputs
+// created by the PHP function genDateSelector().    It gets the date values
+// from the _alt input, which is the alternate field populated by datepicker
+// and is populated by datepicker with a date in yy-mm-dd format.
+//
+// (datepicker can only have one alternate field, which is why we need to write
+// to the three fields ourselves).
+//
+// Blur the datepicker input field on close, so that the datepicker will 
reappear
+// if you select it.    (Not quite sure why you need this.  It only seems
+// to be necessary when you are using Firefox and the datepicker is draggable).
+//
+// Then go and adjust the start and end time/period select options, because
+// they are dependent on the start and end dates
+//
+// Finally, if formId is defined, submit the form
+?>
+function datepicker_close(dateText, inst, formId)
+{
+  var alt_id = inst.id + '_alt';
+  var date = document.getElementById(alt_id).value.split('-');
+  document.getElementById(alt_id + '_year').value  = date[0];
+  document.getElementById(alt_id + '_month').value = date[1];
+  document.getElementById(alt_id + '_day').value   = date[2];
+  document.getElementById(inst.id).blur();
+  if ($('body').hasClass('edit_entry'))
+  {
+    adjustSlotSelectors(document.getElementById('main'));
+    <?php
+    if (function_exists('json_encode'))
+    {
+      // If we're doing Ajax checking of the form then we have to check
+      // for conflicts the form when the datepicker is closed
+      ?>
+      checkConflicts();
+      <?php
+    }
+    ?>
+  }
+  if (formId)
+  {
+    var form = document.getElementById(formId);
+    form.submit();
+  }
+}

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mrbs-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mrbs-commits

Reply via email to