Compare commits

...
Sign in to create a new pull request.

3 commits
master ... dev

Author SHA1 Message Date
Trent Richardson
978cc0cb98 Merge pull request #318 from sarxos/dev
Remove unused variables, fix validation warnings
2012-02-15 05:06:39 -08:00
Bartosz Firyn
e795b3e7a6 Remove unused variables, fix validation warnings 2012-02-15 12:57:10 +01:00
Trent Richardson
9b57a88e8c Update dev version 2012-02-11 17:44:20 -05:00

View file

@ -1,7 +1,7 @@
/* /*
* jQuery timepicker addon * jQuery timepicker addon
* By: Trent Richardson [http://trentrichardson.com] * By: Trent Richardson [http://trentrichardson.com]
* Version 0.9.9 * Version 1.0.0-dev
* Last Modified: 02/05/2012 * Last Modified: 02/05/2012
* *
* Copyright 2012 Trent Richardson * Copyright 2012 Trent Richardson
@ -20,7 +20,7 @@
(function($) { (function($) {
$.extend($.ui, { timepicker: { version: "0.9.9" } }); $.extend($.ui, { timepicker: { version: "1.0.0" } });
/* Time picker manager. /* Time picker manager.
Use the singleton instance of this class, $.timepicker, to interact with the time picker. Use the singleton instance of this class, $.timepicker, to interact with the time picker.
@ -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)
@ -1320,7 +1315,6 @@ function extendRemove(target, props) {
}; };
$.timepicker = new Timepicker(); // singleton instance $.timepicker = new Timepicker(); // singleton instance
$.timepicker.version = "0.9.9"; $.timepicker.version = "1.0.0";
})(jQuery); })(jQuery);