mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update channels
This commit is contained in:
parent
1ccf18adbe
commit
658b824d5a
1 changed files with 34 additions and 21 deletions
|
@ -70,25 +70,7 @@ if (!Array.prototype.filter) {
|
|||
var WebNotifications = {
|
||||
|
||||
show: function (data) {
|
||||
if (window.webkitNotifications) {
|
||||
if (!webkitNotifications.checkPermission()) {
|
||||
var notif = webkitNotifications.createNotification(data.icon, data.title, data.body);
|
||||
notif.show();
|
||||
|
||||
if (data.timeout) {
|
||||
setTimeout(function () {
|
||||
notif.cancel();
|
||||
}, data.timeout);
|
||||
}
|
||||
|
||||
return notif;
|
||||
} else {
|
||||
webkitNotifications.requestPermission(function () {
|
||||
return WebNotifications.show(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (window.Notification) {
|
||||
if (window.Notification) {
|
||||
|
||||
var level = Notification.permissionLevel ? Notification.permissionLevel() : Notification.permission;
|
||||
|
||||
|
@ -99,9 +81,15 @@ var WebNotifications = {
|
|||
notif.show();
|
||||
}
|
||||
|
||||
if (data.timeout && notif.cancel) {
|
||||
if (data.timeout) {
|
||||
setTimeout(function () {
|
||||
notif.cancel();
|
||||
|
||||
if (notif.close) {
|
||||
notif.close();
|
||||
}
|
||||
else if (notif.cancel) {
|
||||
notif.cancel();
|
||||
}
|
||||
}, data.timeout);
|
||||
}
|
||||
|
||||
|
@ -112,6 +100,31 @@ var WebNotifications = {
|
|||
});
|
||||
}
|
||||
}
|
||||
|
||||
else if (window.webkitNotifications) {
|
||||
if (!webkitNotifications.checkPermission()) {
|
||||
var notif = webkitNotifications.createNotification(data.icon, data.title, data.body);
|
||||
notif.show();
|
||||
|
||||
if (data.timeout) {
|
||||
setTimeout(function () {
|
||||
|
||||
if (notif.close) {
|
||||
notif.close();
|
||||
}
|
||||
else if (notif.cancel) {
|
||||
notif.cancel();
|
||||
}
|
||||
}, data.timeout);
|
||||
}
|
||||
|
||||
return notif;
|
||||
} else {
|
||||
webkitNotifications.requestPermission(function () {
|
||||
return WebNotifications.show(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
requestPermission: function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue