Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0n committed Sep 26, 2015
0 parents commit 44aea71
Show file tree
Hide file tree
Showing 15 changed files with 297 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.idea
node_modules
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Datepicker plugin



56 changes: 56 additions & 0 deletions css/style.css
Original file line number Diff line number Diff line change
@@ -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; }
Empty file added dist/css/datepicker.css
Empty file.
36 changes: 36 additions & 0 deletions dist/js/datepicker.js
Original file line number Diff line number Diff line change
@@ -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 () {

};
48 changes: 48 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -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']);



17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Datepicker</title>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="dist/css/datepicker.css"/>
<script type="text/javascript" src="dist/js/datepicker.js"></script>
</head>
<body>
<div class="calendar"></div>

<script type="text/javascript">
$('.calendar').datepicker();
</script>
</body>
</html>
3 changes: 3 additions & 0 deletions js/datepicker/cell.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Datepicker.Cell = function () {

};
33 changes: 33 additions & 0 deletions js/datepicker/datepicker.js
Original file line number Diff line number Diff line change
@@ -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);
}
});
}
};

})();
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}
Empty file added sass/_page.scss
Empty file.
82 changes: 82 additions & 0 deletions sass/_reset.scss
Original file line number Diff line number Diff line change
@@ -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;
}
1 change: 1 addition & 0 deletions sass/datepicker.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "datepicker/datepicker";
Empty file.
2 changes: 2 additions & 0 deletions sass/page-init.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@import "reset";
@import "page";

0 comments on commit 44aea71

Please sign in to comment.