npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@jbelien/openstreetmap-calendar-widget

v0.4.1

Published

Widget to embed OpenStreetMap Calendar (https://osmcal.org/) events in your application/website.

Downloads

434

Readme

OpenStreetMap Calendar Widget

Widget to embed OpenStreetMap Calendar events in your application/website.

Usage

<script
  src="https://unpkg.com/@jbelien/[email protected]/dist/osmcal.js"
  integrity="sha512-5BkMcVKZ6nX+ddTRrnbd3cwVwp5bNvc/7aikO4iEmqydJcoyf8sUA+qx7Y9vb/nnoNXGOvPTcfUzriOA559W/Q=="
  crossorigin=""
></script>

Events list

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"));
widget.display();

Filter

Country (in)

Using data-in attribute:

<div id="osmcal" data-in="Belgium"></div>
const widget = new OSMCal.WidgetList(document.getElementById("osmcal"));
widget.display();

Using JavaScript:

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"), {
  filter: { in: "Belgium" },
});
widget.display();

Options

Locale(s)

Using data-locales attribute:

<div id="osmcal" data-locales="fr"></div>
const widget = new OSMCal.WidgetList(document.getElementById("osmcal"));
widget.display();

Using JavaScript:

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"), {
  locales: "fr",
});
widget.display();

Limit

Using data-limit attribute:

<div id="osmcal" data-in="5"></div>
const widget = new OSMCal.WidgetList(document.getElementById("osmcal"));
widget.display();

Using JavaScript:

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"), {
  limit: 5,
});
widget.display();

Past events

By default, only future events are displayed. If you want to display past events, here is how to do it.

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"), {
  past: true,
});
widget.display();

Classes

Following classes are available for customization:

| Class | Element | Description | | -------------------------------- | ------- | ---------------------------------------------- | | .osmcal-list__list | ul | List of events | | .osmcal-list__event | li | Event list item (containing the template) | | .osmcal-list__event--cancelled | li | Cancelled event list item | | .osmcal-list__event__name | div | Event name (default template) | | .osmcal-list__event__details | div | Event datetime and location (default template) |

Events calendar

const widget = new OSMCal.WidgetCalendar(document.getElementById("osmcal"));
widget.display();

All parameters described for WidgetList are also available for WidgetCalendar (filter, limit, past, locales, ...).

Options

Position

Using data-position attribute:

<div id="osmcal" data-position="bottom"></div>
const widget = new OSMCal.WidgetList(document.getElementById("osmcal"));
widget.display();

Using JavaScript:

const widget = new OSMCal.WidgetList(document.getElementById("osmcal"), {
  position: "bottom",
});
widget.display();

Classes

Following classes are available for customization:

| Class | Element | Description | | ------------------------------------ | ------- | ---------------------------------------------- | | .osmcal-calendar__btn-previous | div | Button to switch to previous month | | .osmcal-calendar__btn-next | div | Button to switch to next month | | .osmcal-calendar__month | div | Element containing month and year | | .osmcal-calendar__table | tbody | Element containing dates | | .osmcal-calendar__date | td | Table cell containing date | | .osmcal-calendar__date--today | td | Table cell containing today's date | | .osmcal-calendar__date--has-event | td | Table cell containing date with event(s) | | .osmcal-calendar__list | ul | List of events | | .osmcal-calendar__event | li | Event list item (containing the template) | | .osmcal-calendar__event--cancelled | li | Cancelled event list item | | .osmcal-calendar__event__name | div | Event name (default template) | | .osmcal-calendar__event__details | div | Event datetime and location (default template) |

Events map

const widget = new OSMCal.WidgetMap(document.getElementById("osmcal"));
widget.display();

All parameters described for WidgetList are also available for WidgetMap (filter, limit, past, locales, ...).

Classes

Following classes are available for customization:

| Class | Element | Description | | ------------------------------- | ------- | ---------------------------------------------- | | .osmcal-map__event | div | Event item (containing the template) | | .osmcal-map__event--cancelled | li | Cancelled event list item | | .osmcal-map__event__name | div | Event name (default template) | | .osmcal-map__event__details | div | Event datetime and location (default template) |