app-notifications

WebJar for app-notifications

License

License

MIT
GroupId

GroupId

org.webjars.bowergithub.jifalops
ArtifactId

ArtifactId

app-notifications
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

app-notifications
WebJar for app-notifications
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/jifalops/app-notifications

Download app-notifications

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.bowergithub.jifalops/app-notifications/ -->
<dependency>
    <groupId>org.webjars.bowergithub.jifalops</groupId>
    <artifactId>app-notifications</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bowergithub.jifalops/app-notifications/
implementation 'org.webjars.bowergithub.jifalops:app-notifications:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.bowergithub.jifalops/app-notifications/
implementation ("org.webjars.bowergithub.jifalops:app-notifications:1.0.0")
'org.webjars.bowergithub.jifalops:app-notifications:jar:1.0.0'
<dependency org="org.webjars.bowergithub.jifalops" name="app-notifications" rev="1.0.0">
  <artifact name="app-notifications" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bowergithub.jifalops', module='app-notifications', version='1.0.0')
)
libraryDependencies += "org.webjars.bowergithub.jifalops" % "app-notifications" % "1.0.0"
[org.webjars.bowergithub.jifalops/app-notifications "1.0.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.bowergithub.polymer : polymer jar [2.0.0,3)

Project Modules

There are no modules declared in this project.

Published on Vaadin  Directory Stars on vaadin.com/directory Published on webcomponents.org

app-notifications

Web component for using the notifications API.

Installation

bower install --save app-notifications

Usage

  • Give it an id and call the show() method.
  • Pass event handlers to show() or as attributes like on-show="...".

Demo

<app-notifications id="notifications"></app-notifications>
Title:<br/>
<input id="title" value="title"/><br/>
Options:<br/>
<textarea id="options" rows="3" cols="30">
{"tag": "app", "body": "body", "icon": "demo/icon.png"}
</textarea><br/>
Duration (ms):<br/>
<input id="duration" value="0"/><br/>
<button onclick="_showNotification();">Show Notification</button>
Last event: <span id="feedback"></span>
<script>
  var notifications = document.getElementById('notifications');
  var title = document.getElementById('title');
  var options = document.getElementById('options');
  var duration = document.getElementById('duration');
  var feedback = document.getElementById('feedback');
  _showNotification = function() {
    notifications.show(
      title.value,
      JSON.parse(options.value),
      duration.value,
      function(e, n) { feedback.innerHTML = 'Notification shown'; },
      function(e, n) { feedback.innerHTML = 'Notification clicked'; },
      function(e, n) { feedback.innerHTML = 'Notification closed'; },
      function(e, n) { feedback.innerHTML = 'Notification error'; });
  }
</script>

Full demo: webcomponents.org | github.

API: webcomponents.org | github.

Contributing

  1. Fork it on Github.
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request

License

MIT

Versions

Version
1.0.0