8000 fix lint issues, grunt less error · samozihu/jQuery-Timepicker-Addon@cc200e3 · GitHub
Skip to content

Commit cc200e3

Browse files
fix lint issues, grunt less error
1 parent 86ef1ba commit cc200e3

7 files changed

+430
-423
lines changed

Gruntfile.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ module.exports = function(grunt) {
102102
},
103103
src: {
104104
files: 'src/**',//'<%= jshint.src.src %>',
105-
tasks: ['jshint:src', 'clean', 'less', 'copy', 'concat', 'uglify', 'cssmin']
105+
//tasks: ['jshint:src', 'jasmine', 'clean', 'copy', 'concat', 'uglify', 'cssmin']
106+
tasks: ['jshint:src', 'jasmine']
106107
},
107108
test: {
108109
files: '<%= jshint.test.src %>',

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,14 @@ About
1010
Use
1111
---
1212
- To use this plugin you must include jQuery and jQuery UI with datepicker and slider
13-
- Include timepicker-addon script
13+
- Include timepicker-addon script located in the *dist* directory
1414
- now use timepicker with $('#selector').datetimepicker() or $('#selector').timepicker()
1515

1616
Contributing Code - Please Read!
1717
--------------------------------
1818
- All code contributions and bug reports are much appreciated.
1919
- Please be sure to apply your fixes to the "dev" branch.
20-
- Also note tabs are appreciated over spaces.
20+
- Also note tabs are appreciated over spaces.
21+
- Please read the [CONTRIBUTING.md][contributingmd] for more on using Grunt to produce builds.
22+
23+
[contributingmd]: CONTRIBUTING.md

dist/jquery-ui-timepicker-addon.js

Lines changed: 411 additions & 406 deletions
Large diffs are not rendered by default.

dist/jquery-ui-timepicker-addon.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery-ui-timepicker-addon.min.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"evil": true,
23
"curly": true,
34
"eqeqeq": true,
45
"immed": true,

src/jquery-ui-timepicker-addon.js

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
* http://trentrichardson.com/Impromptu/MIT-LICENSE.txt
1111
*/
1212

13-
/*jslint evil: true, white: false, undef: false */
14-
1513
(function ($) {
1614

1715
/*
@@ -756,9 +754,8 @@
756754

757755
// If the update was done in the input field, the input field should not be updated.
758756
// If the update was done using the sliders, update the input field.
759-
var hasChanged = (hour != this.hour || minute != this.minute || second != this.second || millisec != this.millisec || microsec != this.microsec
760-
|| (this.ampm.length > 0 && (hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1))
761-
|| (this.timezone !== null && timezone != this.timezone));
757+
var hasChanged = (hour !== this.hour || minute !== this.minute || second !== this.second || millisec !== this.millisec || microsec !== this.microsec ||
758+
(this.ampm.length > 0 && (hour < 12) !== ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) || (this.timezone !== null && timezone !== this.timezone));
762759

763760
if (hasChanged) {
764761

@@ -1358,7 +1355,7 @@
13581355

13591356
// don't popup the datepicker if there is another instance already opened
13601357
var input = inst.input[0];
1361-
if ($.datepicker._curInst && $.datepicker._curInst != inst && $.datepicker._datepickerShowing && $.datepicker._lastInput != input) {
1358+
if ($.datepicker._curInst && $.datepicker._curInst !== inst && $.datepicker._datepickerShowing && $.datepicker._lastInput !== input) {
13621359
return;
13631360
}
13641361

@@ -1410,9 +1407,9 @@
14101407

14111408
/*
14121409
* Fourth bad hack :/ override _updateAlternate function used in inline mode to init altField
1410+
* Update any alternate field to synchronise with the main field.
14131411
*/
14141412
$.datepicker._base_updateAlternate = $.datepicker._updateAlternate;
1415-
/* Update any alternate field to synchronise with the main field. */
14161413
$.datepicker._updateAlternate = function (inst) {
14171414
var tp_inst = this._get(inst, 'timepicker');
14181415
if (tp_inst) {
@@ -1452,7 +1449,7 @@
14521449
tp_inst = $.datepicker._get(inst, 'timepicker');
14531450

14541451
if (tp_inst) {
1455-
if (tp_inst._defaults.timeOnly && (inst.input.val() != inst.lastVal)) {
1452+
if (tp_inst._defaults.timeOnly && (inst.input.val() !== inst.lastVal)) {
14561453
try {
14571454
$.datepicker._updateDatepicker(inst);
14581455
} catch (err) {
@@ -1803,7 +1800,7 @@
18031800
var detectSupport = function (timeFormat) {
18041801
var tf = timeFormat.replace(/'.*?'/g, '').toLowerCase(), // removes literals
18051802
isIn = function (f, t) { // does the format contain the token?
1806-
return !!(f.indexOf(t) !== -1);
1803+
return f.indexOf(t) !== -1 ? true : false;
18071804
};
18081805
return {
18091806
hour: isIn(tf, 'h'),
@@ -2098,7 +2095,7 @@
20982095
*/
20992096
$.timepicker.log = function (err) {
21002097
if (window.console) {
2101-
console.log(err);
2098+
window.console.log(err);
21022099
}
21032100
};
21042101

0 commit comments

Comments
 (0)