commit 44aea716ec336fc6a4ff48969a2e28108ce3fb75 Author: t1m0n Date: Sat Sep 26 17:25:04 2015 +0300 initial commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..11022e1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/.idea +node_modules diff --git a/README.md b/README.md new file mode 100644 index 0000000..1b70ac9 --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Datepicker plugin + + + diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..64e46b8 --- /dev/null +++ b/css/style.css @@ -0,0 +1,56 @@ +/* ------------------------------------------------- + Reset + ------------------------------------------------- */ +applet, object, iframe, h1, h2, h3, h4, h5, h6, p, +blockquote, pre, a, abbr, acronym, address, big, +cite, code, del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, sub, sup, tt, var, u, i, center, dl, +dt, dd, ol, ul, li, fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, figure, figcaption, +footer, header, menu, nav, output, ruby, section, +summary, time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; } + +body { + margin: 0; } + +html, body { + width: 100%; + height: 100%; } + +* { + box-sizing: border-box; } + +*:after, *:before { + box-sizing: border-box; } + +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary { + display: block; } + +b, strong { + font-weight: bold; } + +i { + font-style: italic; } + +a { + outline: none; } + +textarea { + overflow: auto; } diff --git a/dist/css/datepicker.css b/dist/css/datepicker.css new file mode 100644 index 0000000..e69de29 diff --git a/dist/js/datepicker.js b/dist/js/datepicker.js new file mode 100644 index 0000000..77f8dfe --- /dev/null +++ b/dist/js/datepicker.js @@ -0,0 +1,36 @@ +;(function () { + var pluginName = 'datepicker'; + + function Datepicker () { + + } + + Datepicker.prototype = { + init: function () { + + } + }; + + + $.fn[pluginName] = function ( options ) { + if (Datepicker.prototype[options]) { + Datepicker.prototype[options].apply(this.data(pluginName), Array.prototype.slice.call(arguments, 1)); + } else { + return this.each(function () { + if (!$.data(this, pluginName)) { + $.data(this, pluginName, + new Datepicker( this, options )); + } else { + var _this = $.data(this, pluginName), + oldOpts = _this.opts; + + _this.opts = $.extend({}, oldOpts, options); + } + }); + } + }; + +})(); +Datepicker.Cell = function () { + +}; \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..dd7dafd --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,48 @@ +var gulp = require('gulp'), + watch = require('gulp-watch'), + rename = require('gulp-rename'), + sass = require('gulp-sass'), + livereload = require('gulp-livereload'), + concat = require('gulp-concat'); + +gulp.task('js', function () { + gulp.src(['js/datepicker/datepicker.js', 'js/datepicker/cell.js']) + .pipe(concat('datepicker.js')) + .pipe(gulp.dest('dist/js/')) + .pipe(livereload()) +}); + +gulp.task('sass', function () { + gulp.src('sass/datepicker.scss') + .pipe(sass().on('error', sass.logError)) + .pipe(rename('datepicker.css')) + .pipe(gulp.dest('dist/css/')) + .pipe(livereload()) +}); + +gulp.task('build', ['js', 'sass']); + +gulp.task('pageSass', function () { + gulp.src('sass/page-init.scss') + .pipe(sass().on('error', sass.logError)) + .pipe(rename('style.css')) + .pipe(gulp.dest('css/')) + .pipe(livereload()) +}); + +gulp.task('watch', function () { + livereload.listen(); + + gulp.watch('sass/**/*.scss', ['pageSass', 'sass']).on('change', function (file) { + livereload.changed(file) + }); + + gulp.watch('js/**/*.js', ['js']).on('change', function (file) { + livereload.changed(file) + }); +}); + +gulp.task('default', ['build', 'pageSass', 'watch']); + + + diff --git a/index.html b/index.html new file mode 100644 index 0000000..296a452 --- /dev/null +++ b/index.html @@ -0,0 +1,17 @@ + + + + + Datepicker + + + + + +
+ + + + \ No newline at end of file diff --git a/js/datepicker/cell.js b/js/datepicker/cell.js new file mode 100644 index 0000000..c3e9c1b --- /dev/null +++ b/js/datepicker/cell.js @@ -0,0 +1,3 @@ +Datepicker.Cell = function () { + +}; \ No newline at end of file diff --git a/js/datepicker/datepicker.js b/js/datepicker/datepicker.js new file mode 100644 index 0000000..af4a212 --- /dev/null +++ b/js/datepicker/datepicker.js @@ -0,0 +1,33 @@ +;(function () { + var pluginName = 'datepicker'; + + function Datepicker () { + + } + + Datepicker.prototype = { + init: function () { + + } + }; + + + $.fn[pluginName] = function ( options ) { + if (Datepicker.prototype[options]) { + Datepicker.prototype[options].apply(this.data(pluginName), Array.prototype.slice.call(arguments, 1)); + } else { + return this.each(function () { + if (!$.data(this, pluginName)) { + $.data(this, pluginName, + new Datepicker( this, options )); + } else { + var _this = $.data(this, pluginName), + oldOpts = _this.opts; + + _this.opts = $.extend({}, oldOpts, options); + } + }); + } + }; + +})(); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..21733e4 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "datepicker", + "version": "0.0.1", + "devDependencies": { + "gulp": "^3.9.0", + "gulp-concat": "^2.6.0", + "gulp-livereload": "^3.8.0", + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.0.4", + "gulp-uglify": "^1.2.0", + "gulp-watch": "^4.3.5" + } +} diff --git a/sass/_page.scss b/sass/_page.scss new file mode 100644 index 0000000..e69de29 diff --git a/sass/_reset.scss b/sass/_reset.scss new file mode 100644 index 0000000..6d6b5f9 --- /dev/null +++ b/sass/_reset.scss @@ -0,0 +1,82 @@ +/* ------------------------------------------------- + Reset + ------------------------------------------------- */ + +applet, object, iframe, h1, h2, h3, h4, h5, h6, p, +blockquote, pre, a, abbr, acronym, address, big, +cite, code, del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, sub, sup, tt, var, u, i, center, dl, +dt, dd, ol, ul, li, fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, figure, figcaption, +footer, header, menu, nav, output, ruby, section, +summary, time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; +} + +body { + margin: 0; +} + +html, body { + width: 100%; + height: 100%; +} + +* { + box-sizing: border-box; +} + +*:after, *:before { + box-sizing: border-box; +} + +// HTML 5 roles for ie8/eie9 +// ------------------------------------------------- + +article, +aside, +details, +figcaption, +figure, +footer, +header, +main, +menu, +nav, +section, +summary { + display: block; +} + +// Default font weight +// ------------------------------------------------- + +b, strong { + font-weight: bold; +} + +// Default font style +// ------------------------------------------------- + +i { + font-style: italic; +} + +// Remove link outline +// ------------------------------------------------- + +a { + outline: none; +} + +// Remove scroll in ie +// ------------------------------------------------- + +textarea { + overflow: auto; +} \ No newline at end of file diff --git a/sass/datepicker.scss b/sass/datepicker.scss new file mode 100644 index 0000000..f59624c --- /dev/null +++ b/sass/datepicker.scss @@ -0,0 +1 @@ +@import "datepicker/datepicker"; \ No newline at end of file diff --git a/sass/datepicker/_datepicker.scss b/sass/datepicker/_datepicker.scss new file mode 100644 index 0000000..e69de29 diff --git a/sass/page-init.scss b/sass/page-init.scss new file mode 100644 index 0000000..b372324 --- /dev/null +++ b/sass/page-init.scss @@ -0,0 +1,2 @@ +@import "reset"; +@import "page"; \ No newline at end of file