JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q59195F
  • License MIT

Utility Functions for Morse Site/App

Package Exports

  • @djforth/morse-utils

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@djforth/morse-utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

morse-utils

Morse Utility Functions

Build Status

This is a modulised utility functions to use on Morse Sites/App.

It currently sets up 2 modules:

  • Alerts (Close button)
  • Cookiebar (Close and set permission cookie)

Set up is like so:

var utilies   = require("@djforth/morse-utils")
  , alerts    = require(@djforth/morse-utils/alerts)
  , cookiebar = require(@djforth/morse-utils/cookiebar)

var modules = [
    alerts()
  , cookiebar("cookiebar-id") //Should be id of Cookiebar DOM Node
]

utilies(modules);

HTML Set up for Alert

<div id="my-alert">
  Some Alert
  <a href="#" data-alert="my-alert">Close</a>
</div>

HTML set up for Cookiebar

<div id="my-cookiebar">
  Cookiebar info... By closing your accepting that you accept that cookies are in use...
  <a href="#" data-cookiebar="my-cookiebar">Close</a>
</div>

Note: Cookiebar will apply a cookie named permission for 1 year. On set up it will remove the cookiebar if this cookie is present.

Bug reports

If you discover any bugs, feel free to create an issue on GitHub. Please add as much information as possible to help us fixing the possible bug. We also encourage you to help even more by forking and sending us a pull request.

https://github.com/djforth/morse-utils/issues

Contribute

If you'd like to contribute, morse-utils is written using babel in ES6.

Please make sure any additional code should be covered in tests (Jasmine using karma).

If you need to run the test please use:

npm test

or to rebuild the JS run:

npm run build

Maintainers

Adrian Stainforth (https://github.com/djforth)

License

morse-utils is an open source project falling under the MIT License. By using, distributing, or contributing to this project, you accept and agree that all code within the morse-utils project are licensed under MIT license.