1
0
mirror of https://github.com/balkian/Hookio-Calendar.git synced 2024-11-23 03:32:30 +00:00

Initial commit

This commit is contained in:
J.Fernando Sánchez 2012-03-01 16:04:36 +01:00
commit aafb785237
3 changed files with 82 additions and 0 deletions

13
bin/calendar Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env node
var Hook = require('../lib/calendar').CalendarHook;
var hook = new Hook({
name: "calendar"
});
// Hook.start defaults to localhost
// it can accept dnode constructor options ( for remote connections )
// these hooks can be started on diffirent machines / networks / devices
hook.start();

46
lib/calendar.js Normal file
View File

@ -0,0 +1,46 @@
// The modules this hook requires
var Hook = require('hook.io').Hook,
util = require('util'),
calendarModule = require('calendar');
// Things we need to access in different functions
// Set up the hook, and export it at the same time
var CalendarHook = exports.CalendarHook = function(options) {
var self = this;
Hook.call(self, options); // Basic initializations
self.config.use('file', { file: './config.json'});
// Register callback for hook::ready event
self.on('hook::ready', function() {
// When hook is ready, register callbacks for boxcar events
self.on('*::addEvent', function(data) {
self.addEvent(data);
});
self.on('*::delEvent', function(data) {
self.delEvent(data);
});
self.on('*::checkEvent', function(data) {
self.checkEvent(data);
});
self.on('*::editEvent', function(data) {
self.editEvent(data);
});
});
};
// Set up inheritance from Hook
util.inherits(CalendarHook, Hook);
// Callbacks defined below
CalendarHook.prototype.addEvent = function(options){
};
CalendarHook.prototype.delEvent = function(options){
};
CalendarHook.prototype.checkEvent = function(options){
};
CalendarHook.prototype.editEvent = function(options){
};

23
package.json Normal file
View File

@ -0,0 +1,23 @@
{
"author": "J.Fernando Sánchez <balkian@gmail.com>",
"name": "hook.io-calendar",
"description": "Hook for calendar integration",
"keywords" : [ "hook", "hook.io", "calendar" ],
"version": "0.0.1",
"bugs" : { "url" : "http://github.com/balkian" },
"repository": {
"type": "git",
"url": "git://github.com/balkian/hookio-calendar.git"
},
"bin": {
"hookio-calendar": "./bin/calendar"
},
"main": "./lib/calendar",
"engines": {
"node": ">= v0.4.7"
},
"dependencies": {
"hook.io" : "0.8.x"
},
"devDependencies": {}
}