laravel 样式化 HTML5 桌面通知
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19833814/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Styling HTML5 desktop notifications
提问by Ryan Di
I've included this plugin for desktop notifications in my Laravel 3 project.
我已经在我的 Laravel 3 项目中包含了这个桌面通知插件。
It works fine, only problem is i can't find a way to "style" the notifications!
它工作正常,唯一的问题是我找不到“样式”通知的方法!
Is styling the desktop notifications even possible? If it is can someone please point out for me how it is done!
甚至可以设置桌面通知的样式吗?如果可以,请有人为我指出它是如何完成的!
回答by Antonio Carlos Ribeiro
Unfortunately this library uses only .createNotification()
and not .createHTMLNotification()
, but Google just dropped .createHTMLNotification() support on version 28. There's a warning about this:
不幸的是,这个库只使用.createNotification()
和不使用.createHTMLNotification()
,但谷歌刚刚在版本 28 上放弃了 .createHTMLNotification() 支持。有一个关于这个的警告:
Warning: webKitNotifications.createHTMLNotification() in the web notifications API has been deprecated. The new web notifications API only allows text. Chrome notifications API will be promoted to stable soon and web notifications will be updated to use the new rich notifications format.
警告:Web 通知 API 中的 webKitNotifications.createHTMLNotification() 已被弃用。新的网络通知 API 只允许文本。Chrome 通知 API 将很快升级为稳定版本,网络通知将更新为使用新的丰富通知格式。
But it is doing it differently, using this rich notifications.
但它的做法有所不同,使用了丰富的通知。
But this is just for chrome, so if you need it for all browsers, you will have to write your own implementation or find another library to help you.
但这仅适用于 chrome,因此如果您需要为所有浏览器使用它,您将不得不编写自己的实现或寻找另一个库来帮助您。