Index: date_popup/date_popup.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/date/date_popup/date_popup.module,v
retrieving revision 1.42.2.1.2.53
diff -u -p -r1.42.2.1.2.53 date_popup.module
--- date_popup/date_popup.module	13 Apr 2010 20:09:42 -0000	1.42.2.1.2.53
+++ date_popup/date_popup.module	16 Jul 2010 05:16:18 -0000
@@ -40,6 +40,9 @@ function date_popup_load() {
   if (variable_get('date_popup_timepicker', 'default') == 'default') {
     drupal_add_js($path .'/lib/jquery.timeentry.pack.js');
   }
+  elseif (variable_get('date_popup_timepicker', 'default') == 'dropdown') {
+    drupal_add_js($path .'/date_popup.timedropdown.js');
+  }
   $loaded = TRUE;
 }
 
@@ -562,7 +565,11 @@ function date_popup_settings() {
   
   $form['date_popup_timepicker'] = array(
     '#type' => 'select',
-    '#options' => array('default' => t('Use default jQuery timepicker'), 'none' => t('Manual time entry, no jQuery timepicker')),
+    '#options' => array(
+      'default' => t('Use default jQuery timepicker'),
+      'dropdown' => t('Use dropdown jQuery timepicker'),
+      'none' => t('Manual time entry, no jQuery timepicker'),
+      ),
     '#title' => t('Timepicker'),
     '#default_value' => variable_get('date_popup_timepicker', 'default'),
     '#description' => t("Choose the jQuery timepicker to user."),
Index: date_popup/date_popup.timedropdown.js
===================================================================
RCS file: date_popup/date_popup.timedropdown.js
diff -N date_popup/date_popup.timedropdown.js
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ date_popup/date_popup.timedropdown.js	16 Jul 2010 05:16:18 -0000
@@ -0,0 +1,98 @@
+// $Id$
+
+/**
+ * Attaches dropdown select behavior to time textfields.
+ */
+Drupal.behaviors.datePopupTimeDropdown = function (context) {
+  for (var id in Drupal.settings.datePopup) {
+    var datePopup = Drupal.settings.datePopup[id];
+    var $timeWrapper = $('#' + id).parent();
+    if (datePopup.func == 'timeEntry' && !$timeWrapper.hasClass('timeDropdown-processed')) {
+      $timeWrapper.addClass('timeDropdown-processed').attr('style', 'display:none');
+
+      // Compute default values.
+      var def_hours = datePopup.settings.show24Hours ? '00' : '12';
+      var def_mins = '00';
+      var def_secs = '00';
+      var def_ampm = 'AM';
+      var current = $('#' + id).val();
+      if (current != undefined && current.length) {
+        def_hours = current.substr(0, 2);
+        def_mins = current.substr(3, 2);
+        if (datePopup.settings.showSeconds) {
+          def_secs = current.substr(6, 2);
+        }
+        if (!datePopup.settings.show24Hours) {
+          def_ampm = current.substr(current.length - 2, 2);
+        }
+      }
+
+      // Generate the dropdowns.
+      // Hours
+      var hours = '<select id="' + id + '-hours">';
+      for (var i = 0; i < 24; i++) {
+        var val = i;
+        if (i < 10) {
+          val = '0' + val;
+        }
+        if (datePopup.settings.show24Hours || (i > 0 && i < 13)) {
+          hours += '<option value="' + val + '"' + (i == def_hours ? ' selected="selected"' : '') + '>' + i + '</option>';
+        }
+      }
+      hours += '</select>';
+
+      // Minutes
+      var mins = '<select id="' + id + '-mins">';
+      for (var i = 0; i < 60; i++) {
+        if (i < 10) {
+          i = '0' + i;
+        }
+        if (i % datePopup.settings.timeSteps[1] == 0) {
+          mins += '<option value="' + i + '"' + (i == def_mins ? ' selected="selected"' : '') + '>' + i + '</option>';
+        }
+      }
+      mins += '</select>';
+
+      // Seconds
+      var secs = '';
+      if (datePopup.settings.showSeconds) {
+        secs = '<select id="' + id + '-secs">';
+        for (var i = 0; i < 60; i++) {
+          if (i < 10) {
+            i = '0' + i;
+          }
+          if (i % datePopup.settings.timeSteps[1] == 0) {
+            secs += '<option value="' + i + '"' + (i == def_secs ? ' selected="selected"' : '') + '>' + i + '</option>';
+          }
+        }
+        secs += '</select>';
+      }
+
+      // AM / PM
+      var ampm = '';
+      if (!datePopup.settings.show24Hours) {
+        ampm = '<select id="' + id + '-ampm">';
+        ampm += '<option value="AM"' + ('AM' == def_ampm ? ' selected="selected"' : '') + '>AM</option>';
+        ampm += '<option value="PM"' + ('PM' == def_ampm ? ' selected="selected"' : '') + '>PM</option>';
+        ampm += '</select>';      
+      }
+
+      var dropdowns = '<span id="datedroplabel">at</span> ' + hours + mins + secs + ampm;
+      $timeWrapper.after(dropdowns);
+
+      // Update real time field on dropdown change.
+      $('#' + id + '-hours, #' + id + '-mins, #' + id + '-secs, #' + id + '-ampm').bind('change', id, function(e) {
+        var id = e.data;
+        var time = $('#' + id + '-hours option:selected').val();
+        time += ':' + $('#' + id + '-mins option:selected').val();
+        if ($('#' + id + '-secs').length != 0) {
+          time += ':' + $('#' + id + '-secs option:selected').val();
+        }
+        if ($('#' + id + '-ampm').length != 0) {
+          time += $('#' + id + '-ampm option:selected').val();
+        }
+        $('#' + id).val(time);
+      });
+    }
+  }
+};
