Changeset 3066
- Timestamp:
- 11/23/10 20:44:53
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/resources/javascript/bedework/bwClock.js
r3057 r3066 32 32 33 33 var defaults = { 34 hour24: false, 35 withPadding: false, 36 attachToId: null, 37 hourId : null,38 minuteId : null,39 ampmId : null34 hour24: false, // are we in 24 hour clock mode? 35 withPadding: false, // pad the hours with a zero if below 10 36 attachToId: null, // id of element which when clicked will launch the time picker 37 hourIds: null, // array of ids - one for each hour element to be updated 38 minuteIds: null, // array of ids - one for each minute element to be updated 39 ampmIds: null // array of ids - one for each am/pm element to be updated 40 40 }; 41 41 var options = $.extend(defaults, options); … … 87 87 hours = "0" + hours; 88 88 } 89 $("#" + options.hourId).val(hours); 89 for (var i=0; i < options.hourIds.length; i++) { 90 $("#" + options.hourIds[i]).val(hours); 91 } 90 92 }); 91 93 $("#" + options.attachToId + " .bwTimePicker .bwTimePickerMinutes li").click(function(){ 92 94 $("#" + options.attachToId + " .bwTimePicker .bwTimePickerMinutes li").removeClass('bwTimePickerSelected'); 93 95 $(this).addClass('bwTimePickerSelected'); 94 $("#" + options.minuteId).val($(this).html()); 96 for (var i=0; i < options.minuteIds.length; i++) { 97 $("#" + options.minuteIds[i]).val($(this).html()); 98 } 95 99 }); 96 100 $("#" + options.attachToId + " .bwTimePicker .bwTimePickerAmPm li").click(function(){ 97 101 $("#" + options.attachToId + " .bwTimePicker .bwTimePickerAmPm li").removeClass('bwTimePickerSelected'); 98 102 $(this).addClass('bwTimePickerSelected'); 99 $("#" + options.ampmId).val($(this).html()); 103 for (var i=0; i < options.ampmIds.length; i++) { 104 $("#" + options.ampmIds[i]).val($(this).html()); 105 } 100 106 }); 101 107 },
