Skip to content

Commit

Permalink
set up bower and grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
khornberg committed Nov 25, 2013
1 parent 0d78b46 commit 7bec183
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
bower_components/
56 changes: 56 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
module.exports = function(grunt) {

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
options: {
separator: ';'
},
dist: {
src: ['ics.js'],
dest: '<%= pkg.name %>.js'
}
},
uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today("mm-dd-yyyy") %> */\n'
},
dist: {
files: {
'ics.min.js': ['ics.js']
}
}
},
qunit: {
files: ['tests/**/*.html']
},
jshint: {
files: ['Gruntfile.js', '*.js', 'tests/tests.js'],
options: {
// options here to override JSHint defaults
globals: {
jQuery: true,
console: true,
module: true,
document: true,
},
laxcomma: true
}
},
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint', 'qunit']
}
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-concat');

grunt.registerTask('test', ['jshint', 'qunit']);

grunt.registerTask('default', ['jshint', 'qunit', 'uglify']);

};
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ Now you can make calendar friendly files client-side. It outputs .ics files, so

How To Use
----------
Simply use the function...

download_ics(filename, subject, description, location, begin, end);
Simply use invoke the object and use the functions...

var cal = ics();
cal.addEvent(subject, description, location, begin, end);
cal.download(filename);

`begin` and `end` need to be formatted in a way that is friendly to `Date()`

Expand All @@ -19,7 +21,11 @@ Example
* **[Demo](http://htmlpreview.github.io/?https://github.com/nwcell/ics.js/blob/master/demo/demo.html)**

```
<a href="javascript:download_ics('demo', 'Demo Event', 'This is an awesome demo event', 'Sexy Land, AK', '8/7/2013', '8/9/2013')">Demo</a>
<script>
var cal = ics();
cal.addEvent('Demo Event', 'This is an awesome demo event', 'Nome, AK', '8/7/2013', '8/9/2013');
</script>
<a href="javascript:cal.download()">Demo</a>
```


Expand Down
29 changes: 29 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "ics.js",
"main": "ics.js",
"version": "0.0.0",
"homepage": "https://github.com/khornberg/ics.js"
"contributors": [
"Travis Krause <[email protected]>",
"Kyle Hornberg <[email protected]>"
],
"description": "A browser firendly .ics/.vcs file generator written entirely in javascript",
"keywords": [
"ics",
"iCal",
"iCalendar"
],
"license": "MIT",
"private": true,
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"Blob.js": "eligrey/Blob.js",
"FileSaver": "*"
}
}
9 changes: 6 additions & 3 deletions demo/demo.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<!DOCTYPE html>
<head>
<script type="text/javascript" async="" src="ics-min.js"></script>
<script type="text/javascript" src="../bower_components/FileSaver/FileSaver.js"></script>
<script type="text/javascript" src="../bower_components/Blob.js/Blob.js"></script>
<script type="text/javascript" src="../ics.min.js"></script>
<script type="text/javascript" src="demo.js"></script>
<style>
html, body {
height: 100%;
Expand Down Expand Up @@ -44,7 +47,7 @@
</head>
<body>
<div class="wrap">
<a href="javascript:download_ics('demo', 'Demo Event', 'This is an awesome demo event', 'Sexy Land, AK', '8/7/2013', '8/9/2013')">Demo Event</a>
<a href="javascript:cal.download('christmas')">Download iCal</a>
Look at the console too!
</div>
</body>
</html>
6 changes: 6 additions & 0 deletions demo/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// Demo
var cal = ics();
cal.addEvent('Christmas', 'Christian holiday celebrating the birth of Jesus Christ', 'Bethlehem', '12/25/2013', '12/25/2013');
cal.addEvent('Christmas', 'Christian holiday celebrating the birth of Jesus Christ', 'Bethlehem', '12/25/2014', '12/25/2014');
console.log('Events\n' + cal.events());
console.log('Calendar\n' + cal.calendar());
2 changes: 2 additions & 0 deletions ics.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "ics.js",
"version": "0.0.0",
"description": "A browser firendly .ics/.vcs file generator written entirely in javascript",
"main": "icsjs",
"dependencies": {
"grunt": "~0.4.2",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-jshint": "~0.7.2",
"grunt-contrib-qunit": "~0.3.0",
"grunt-contrib-uglify": "~0.2.7",
"grunt-mocha": "~0.4.6"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "https://github.com/khornberg/ics.js.git"
},
"keywords": [
"ics",
"iCal",
"iCalendar"
],
"contributors": [
"Travis Krause <[email protected]>",
"Kyle Hornberg <[email protected]>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/khornberg/ics.js/issues"
}
}

0 comments on commit 7bec183

Please sign in to comment.