Remove unused variables, fix validation warnings

This commit is contained in:
Bartosz Firyn 2012-02-15 12:54:09 +01:00
parent 9b57a88e8c
commit e795b3e7a6

View file

@ -163,8 +163,8 @@ $.extend(Timepicker.prototype, {
}, },
timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker'); timepicker: tp_inst // add timepicker as a property of datepicker: $.datepicker._get(dp_inst, 'timepicker');
}); });
tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase() }); tp_inst.amNames = $.map(tp_inst._defaults.amNames, function(val) { return val.toUpperCase(); });
tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase() }); tp_inst.pmNames = $.map(tp_inst._defaults.pmNames, function(val) { return val.toUpperCase(); });
if (tp_inst._defaults.timezoneList === null) { if (tp_inst._defaults.timezoneList === null) {
var timezoneList = []; var timezoneList = [];
@ -314,7 +314,7 @@ $.extend(Timepicker.prototype, {
$.merge(markers, o.amNames); $.merge(markers, o.amNames);
if (o.pmNames) if (o.pmNames)
$.merge(markers, o.pmNames); $.merge(markers, o.pmNames);
markers = $.map(markers, function(val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&') }); markers = $.map(markers, function(val) { return val.replace(/[.*+?|()\[\]{}\\]/g, '\\$&'); });
return '(' + markers.join('|') + ')?'; return '(' + markers.join('|') + ')?';
}, },
@ -364,7 +364,7 @@ $.extend(Timepicker.prototype, {
minuteGridSize = 0, minuteGridSize = 0,
secondGridSize = 0, secondGridSize = 0,
millisecGridSize = 0, millisecGridSize = 0,
size; size = null;
// Hours // Hours
html += '<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_' + dp_id + '"' + html += '<dd class="ui_tpicker_hour"><div id="ui_tpicker_hour_' + dp_id + '"' +
@ -909,7 +909,6 @@ $.fn.extend({
//######################################################################## //########################################################################
datetimepicker: function(o) { datetimepicker: function(o) {
o = o || {}; o = o || {};
var $input = this,
tmp_args = arguments; tmp_args = arguments;
if (typeof(o) == 'string'){ if (typeof(o) == 'string'){
@ -975,7 +974,7 @@ $.datepicker.formatTime = function(format, time, options) {
tmptime = $.trim(tmptime); tmptime = $.trim(tmptime);
return tmptime; return tmptime;
} };
//######################################################################## //########################################################################
// the bad hack :/ override datepicker so it doesnt close on select // the bad hack :/ override datepicker so it doesnt close on select
@ -1248,10 +1247,7 @@ $.datepicker.parseDate = function(format, value, settings) {
$.datepicker._base_formatDate = $.datepicker._formatDate; $.datepicker._base_formatDate = $.datepicker._formatDate;
$.datepicker._formatDate = function(inst, day, month, year){ $.datepicker._formatDate = function(inst, day, month, year){
var tp_inst = this._get(inst, 'timepicker'); var tp_inst = this._get(inst, 'timepicker');
if(tp_inst) if(tp_inst) {
{
if(day)
var b = this._base_formatDate(inst, day, month, year);
tp_inst._updateDateTime(inst); tp_inst._updateDateTime(inst);
return tp_inst.$input.val(); return tp_inst.$input.val();
} }
@ -1266,7 +1262,7 @@ $.datepicker._optionDatepicker = function(target, name, value) {
var inst = this._getInst(target), var inst = this._getInst(target),
tp_inst = this._get(inst, 'timepicker'); tp_inst = this._get(inst, 'timepicker');
if (tp_inst) { if (tp_inst) {
var min,max,onselect; var min = null, max = null, onselect = null;
if (typeof name == 'string') { // if min/max was set with the string if (typeof name == 'string') { // if min/max was set with the string
if (name === 'minDate' || name === 'minDateTime' ) if (name === 'minDate' || name === 'minDateTime' )
min = value; min = value;
@ -1299,8 +1295,7 @@ $.datepicker._optionDatepicker = function(target, name, value) {
max= new Date(max); max= new Date(max);
tp_inst._defaults.maxDate = max; tp_inst._defaults.maxDate = max;
tp_inst._defaults.maxDateTime = max; tp_inst._defaults.maxDateTime = max;
} } else if (onselect)
else if (onselect)
tp_inst._defaults.onSelect = onselect; tp_inst._defaults.onSelect = onselect;
} }
if (value === undefined) if (value === undefined)
@ -1323,4 +1318,3 @@ $.timepicker = new Timepicker(); // singleton instance
$.timepicker.version = "1.0.0"; $.timepicker.version = "1.0.0";
})(jQuery); })(jQuery);