Git Product home page Git Product logo

master-calendar's Introduction

A web application that displays data from several sources, built with jQuery and FullCalendar.

Current features:

  • user togglable list of event sources
  • creation of events in the sources
  • sources can customize event display
  • sources can provide general menu options
  • week/day agenda views fit to window height
  • view saved in URL hash for reload/back

Future goals:

  • let sources provide event filtering controls
  • good mobile device support

Development

Open public/index.html and edit the code in src/.

Deployment

Run build.sh to combine and minify (using YUI Compressor) the JS and CSS files, then copy the contents of the build directory to an appropriate location.

Configuring event sources

Sources are specified in the array in calendar-sources.js. A source provides event data for the calendar through a JSON API.

A source must have a name and color specified. Most uses will probably involve a JSON feed. A minimal specification for a source is as

{
  name: 'Community Events',
  url: '/events/api',
  color: '#006600'
}

Event properties

Recognized additional (optional) properties for Event Objects are demonstrated here. The body property uses JsonML.

{
  // content to be rendered as part of the event
  "body": ["dl", ["dt", "Location"], ["dd", "Social Room"]],
  // boolean indicating the calendar user's "participation" in an event
  "participation": true
}

Menu content "events"

Zero or more Event Objects with "id": "menu" may be included. Instead of being rendered within the calendar display, these will be used to display accompanying content within the source's entry in the list of sources.

[
  ...
  {
    "id": "menu",
    // ignored (but required by FullCalendar)
    "title": "menu",
    // range of viewing windows for which this content
    // should be rendered; for best results, the "menu
    // events" should cover the entire requested range
    // without overlapping.
    "start": "2012-01-01T00:00:00Z",
    "end": "2012-02-01T00:00:00Z",
    // JsonML content again
    "body": ["p", ["a", {"href": "#"}, "Manage my account"]]
  }
]

Event creation

A second API can enable calendar users to create events in a source. To specify an event creation API, the URL may be specified as the value of create, or create can contain properties as below:

{
  name: 'Events',
  url: '/events/api?events',
  create: {
    url:  '/events/api?new',
    startParam: 'time',    // UNIX timestamp of event start
    endParam: false,       // UNIX timestamp of event end
    allDayParam: 'fullDay' // no specific time-of-day
  },
  color: '#006600',
}

The default parameter names will result in a link like:

/events/api?new&start=1341162000&end=1341165600&allDay=false

The parameter names specified above will result in:

/events/api?new&time=1341162000&fullDay=true

master-calendar's People

Contributors

coyotebush avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

frogsong

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.