{"id":17771205,"url":"https://github.com/azproduction/jquery.notification","last_synced_at":"2025-03-15T15:30:53.357Z","repository":{"id":1816335,"uuid":"2740517","full_name":"azproduction/jquery.notification","owner":"azproduction","description":"Webkit Notification API wrapper","archived":false,"fork":false,"pushed_at":"2015-05-25T11:30:03.000Z","size":202,"stargazers_count":153,"open_issues_count":3,"forks_count":17,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-02-27T01:04:51.772Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"android10/Android-CleanArchitecture","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/azproduction.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-11-09T09:27:12.000Z","updated_at":"2024-10-01T03:24:08.000Z","dependencies_parsed_at":"2022-08-19T22:30:23.854Z","dependency_job_id":null,"html_url":"https://github.com/azproduction/jquery.notification","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azproduction%2Fjquery.notification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azproduction%2Fjquery.notification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azproduction%2Fjquery.notification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/azproduction%2Fjquery.notification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/azproduction","download_url":"https://codeload.github.com/azproduction/jquery.notification/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243750478,"owners_count":20342066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-26T21:30:18.485Z","updated_at":"2025-03-15T15:30:53.036Z","avatar_url":"https://github.com/azproduction.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webkit Notification API jQuery Wrapper\n\n  - It requests permission when it required (do not distrubs user on the start) you just call `$.notification` and this plugin will do the rest for you.\n  - It abstracts 2 type of notifications (createHTMLNotification, createNotification) in one simple interface.\n  - It allows you to specify auto-hide notification inteval (`timeout` parameter). \n  - It closes notification on click by default (`autoclose` parameter). Default browser action: user must click small close button on the top right corner to do that. \n  - You also can specify `replaceId` parameter to replace existed notification with new one (prevents from notifications flooding when showing chat messages in notifications, for eaxmple).\n  - You can pass `onclick`, `onclose`, `onshow`, `onerror` to watch Notification's events.\n\nThis plug-in now works in Yandex.Mail WebChat (in production) and it does not have a strong dependence on jQuery.\n\n## CDN\n\n * jsDelivr [1.0.5/jquery.notification.js](//cdn.jsdelivr.net/jquery.notification/1.0.3/jquery.notification.js),\n[1.0.5/jquery.notification.min.js](//cdn.jsdelivr.net/jquery.notification/1.0.3/jquery.notification.min.js)\n\n## Usage\n\n```javascript\n// icon + text + title\n\nvar options = {\n    iconUrl: 'avatar.png',\n    title: 'Title',\n    body: 'Message',\n    onclick: function () {\n        console.log('Pewpew');\n    }\n};\n\n$.notification(options);\n// notification will be displayed as soon as user permit notifications\n```\n\n```javascript\n// just text\n$.notification(\"Message\");\n// notification will be displayed as soon as user permit notifications\n```\n\n```javascript\n// $.notification returns Deferred\n\n$.notification(\"Hello from jQuery.notifications!\")\n.then(function (notification) {\n    setTimeout(function () {\n        notification.close();\n    }, 2000);\n}, function () {\n    console.error('Rejected!');\n});\n```\n\n[Live example](http://jsfiddle.net/tgjb6hh8/)\n\n## Note\n\nBefore the notification will occur the ***user must click on the page*** and allow the notifications.\nBut you can ask user beforehand:\n\n```javascript\n$.notification.requestPermission(function () {\n    console.log($.notification.permissionLevel());\n});\n```\n\n## Read\n\nhttp://www.chromium.org/developers/design-documents/desktop-notifications/api-specification\n\nhttp://www.html5rocks.com/en/tutorials/notifications/quick/\n\n## Licence\n\n(The MIT License)\n\nCopyright (c) 2011 Mikhail Davydov \u0026lt;azazel.private@gmail.com\u0026gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazproduction%2Fjquery.notification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fazproduction%2Fjquery.notification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fazproduction%2Fjquery.notification/lists"}