Skip to content
Snippets Groups Projects
Select Git revision
  • d835db8bda13aa16c64cd51dc6e07a56d1159b33
  • main default protected
  • renovate/lock-file-maintenance
  • demo protected
  • person-select-custom
  • dbp-translation-component
  • icon-set-mapping
  • port-i18next-parser
  • remove-sentry
  • favorites-and-recent-files
  • revert-6c632dc6
  • lit2
  • advertisement
  • wc-part
  • automagic
  • publish
  • wip-cleanup
  • demo-file-handling
18 results

notification

  • Clone with SSH
  • Clone with HTTPS
  • user avatar
    Renovate Bot authored
    10b9d480
    History

    Notification Web Component

    You can install this component via npm:

    npm i @dbp-toolkit/notification

    Usage

    <dbp-notification></dbp-notification>
    <script type="module" src="node_modules/@dbp-toolkit/notification/dist/dbp-notification.js"></script>

    Or directly via CDN:

    <dbp-notification></dbp-notification>
    <script type="module" src="https://unpkg.com/@dbp-toolkit/notification@0.2.2/dist/dbp-notification.js"></script>

    Attributes

    • lang (optional, default: de): set to de or en for German or English
      • example <dbp-notification lang="de" client-id="my-client-id"></dbp-notification>

    Sending notifications

    import { send } from './notification';
    
    send({
        "summary": "Item deleted",
        "body": "Item foo was deleted!",
        "type": "info",
        "timeout": 5,
    });

    Local development

    # get the source
    git clone git@gitlab.tugraz.at:dbp/web-components/toolkit.git
    cd toolkit/packages/notification
    
    # install dependencies
    yarn install
    
    # constantly build dist/bundle.js and run a local web-server on port 8002 
    yarn run watch
    
    # run tests
    yarn test
    
    # build local packages in dist directory
    yarn run build

    Jump to http://localhost:8002 and you should get a demo page.