From 79bf2525510c7678e7e917d1f544a9aa5710f29c Mon Sep 17 00:00:00 2001 From: Ramiro Rikkert Date: Mon, 18 Mar 2013 17:27:52 -0400 Subject: [PATCH] Add project configuration files. Had to make small changes to be jshint compliant. --- .editorconfig | 15 +++++++++++++++ .gitattributes | 1 + .jshintrc | 21 +++++++++++++++++++++ pikaday.js | 22 +++++++++++----------- plugins/pikaday.jquery.js | 25 +++++++++++++------------ 5 files changed, 61 insertions(+), 23 deletions(-) create mode 100644 .editorconfig create mode 100644 .gitattributes create mode 100644 .jshintrc diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..7f30d1b9 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +; http://EditorConfig.org +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.{js,css}] +indent_style = space +indent_size = 4 + +[*.md] +trim_trailing_whitespace = false \ No newline at end of file diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..176a458f --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text=auto diff --git a/.jshintrc b/.jshintrc new file mode 100644 index 00000000..a7bd30d4 --- /dev/null +++ b/.jshintrc @@ -0,0 +1,21 @@ +{ + "node": true, + "browser": true, + "es5": true, + "esnext": true, + "bitwise": true, + "camelcase": true, + "eqeqeq": true, + "immed": true, + "indent": 4, + "latedef": true, + "newcap": true, + "noarg": true, + "quotmark": "single", + "regexp": true, + "undef": true, + "unused": true, + "strict": true, + "trailing": true, + "smarttabs": true +} diff --git a/pikaday.js b/pikaday.js index 24eb6eda..b0dacfe8 100644 --- a/pikaday.js +++ b/pikaday.js @@ -174,12 +174,11 @@ // internationalization i18n: { - previousMonth : 'Previous Month', - nextMonth : 'Next Month', - months : ['January','February','March','April','May','June','July','August','September','October','November','December'], - //monthsShort : ['Jan_Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], - weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], - weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] + previousMonth : 'Previous Month', + nextMonth : 'Next Month', + months : ['January','February','March','April','May','June','July','August','September','October','November','December'], + weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], + weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] }, // callback function @@ -334,7 +333,8 @@ if (e.preventDefault) { e.preventDefault(); } else { - return e.returnValue = false; + e.returnValue = false; + return false; } } else { self._c = true; @@ -376,17 +376,17 @@ } }; - self._onInputFocus = function(e) + self._onInputFocus = function() { self.show(); }; - self._onInputClick = function(e) + self._onInputClick = function() { self.show(); }; - self._onInputBlur = function(e) + self._onInputBlur = function() { if (!self._c) { self._b = sto(function() { @@ -595,7 +595,7 @@ if (this._o.field) { this._o.field.value = this.toString(); - fireEvent(this._o.field, "change", { firedBy: this }); + fireEvent(this._o.field, 'change', { firedBy: this }); } if (!preventOnSelect && typeof this._o.onSelect === 'function') { this._o.onSelect.call(this, this.getDate()); diff --git a/plugins/pikaday.jquery.js b/plugins/pikaday.jquery.js index 34e1ce7e..51b0a944 100644 --- a/plugins/pikaday.jquery.js +++ b/plugins/pikaday.jquery.js @@ -5,6 +5,7 @@ (function($) { + 'use strict'; $.fn.pikaday = function() { @@ -23,7 +24,7 @@ if (typeof args[0] === 'object') { var options = $.extend({}, args[0]); options.field = self[0]; - self.data('pikaday', new Pikaday(options)); + self.data('pikaday', new window.Pikaday(options)); } } else { if (typeof args[0] === 'string' && typeof plugin[args[0]] === 'function') { @@ -211,12 +212,11 @@ // internationalization i18n: { - previousMonth : 'Previous Month', - nextMonth : 'Next Month', - months : ['January','February','March','April','May','June','July','August','September','October','November','December'], - //monthsShort : ['Jan_Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'], - weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], - weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] + previousMonth : 'Previous Month', + nextMonth : 'Next Month', + months : ['January','February','March','April','May','June','July','August','September','October','November','December'], + weekdays : ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'], + weekdaysShort : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'] }, // callback function @@ -371,7 +371,8 @@ if (e.preventDefault) { e.preventDefault(); } else { - return e.returnValue = false; + e.returnValue = false; + return false; } } else { self._c = true; @@ -413,17 +414,17 @@ } }; - self._onInputFocus = function(e) + self._onInputFocus = function() { self.show(); }; - self._onInputClick = function(e) + self._onInputClick = function() { self.show(); }; - self._onInputBlur = function(e) + self._onInputBlur = function() { if (!self._c) { self._b = sto(function() { @@ -632,7 +633,7 @@ if (this._o.field) { this._o.field.value = this.toString(); - fireEvent(this._o.field, "change", { firedBy: this }); + fireEvent(this._o.field, 'change', { firedBy: this }); } if (!preventOnSelect && typeof this._o.onSelect === 'function') { this._o.onSelect.call(this, this.getDate());