-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Web Notification implement #7 #75
base: master
Are you sure you want to change the base?
Conversation
fishroom/web/chat_log.html
Outdated
@@ -125,6 +125,19 @@ | |||
msg.id = fishLogData.current_id; | |||
fishLogData.current_id++; | |||
fishLogData.msgs.push(msg); | |||
// Notification sending... | |||
var noti_title = msg.sender + "sent a new message"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A space between sender and "sent a new message"?
fishroom/web/chat_log.html
Outdated
@@ -125,6 +125,19 @@ | |||
msg.id = fishLogData.current_id; | |||
fishLogData.current_id++; | |||
fishLogData.msgs.push(msg); | |||
// Notification sending... | |||
var noti_title = msg.sender + "sent a new message"; | |||
if (Notification.permission === "granted") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check browser compatibility pls.
alert is too verbose, just ignore it.
@Page-David good job. |
You are welcome, by the way, is this good to merge or improvement is in need? |
Fair enough. I'm waiting for @bigeagle to merge. I have no access to the production environment. |
Oh, thanks. |
fishroom/web/chat_log.html
Outdated
@@ -125,6 +125,21 @@ | |||
msg.id = fishLogData.current_id; | |||
fishLogData.current_id++; | |||
fishLogData.msgs.push(msg); | |||
// Notification sending... | |||
var notification = 'New message from ' + msg.sender; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
抱歉,突然发现标题名和Notification实例名冲突了。
Variable conflict solved. |
已知悉 |
一点微小的代码,谢谢大家