mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Unminify using 1.5.323
Repo with tag: https://github.com/MediaBrowser/emby-webcomponents/tree/1.5.323
This commit is contained in:
parent
4678528d00
commit
de6ac33ec1
289 changed files with 78483 additions and 54701 deletions
|
@ -1,31 +1,52 @@
|
|||
! function() {
|
||||
"use strict";
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var connectionManager;
|
||||
|
||||
function getApiClient(serverId) {
|
||||
return connectionManager ? Promise.resolve(connectionManager.getApiClient(serverId)) : Promise.reject()
|
||||
|
||||
if (connectionManager) {
|
||||
return Promise.resolve(connectionManager.getApiClient(serverId));
|
||||
}
|
||||
|
||||
//importScripts('serviceworker-cache-polyfill.js');
|
||||
|
||||
return Promise.reject();
|
||||
}
|
||||
|
||||
function executeAction(action, data, serverId) {
|
||||
return getApiClient(serverId).then(function(apiClient) {
|
||||
|
||||
return getApiClient(serverId).then(function (apiClient) {
|
||||
|
||||
switch (action) {
|
||||
case "cancel-install":
|
||||
case 'cancel-install':
|
||||
var id = data.id;
|
||||
return apiClient.cancelPackageInstallation(id);
|
||||
case "restart":
|
||||
case 'restart':
|
||||
return apiClient.restartServer();
|
||||
default:
|
||||
return clients.openWindow("/"), Promise.resolve()
|
||||
clients.openWindow("/");
|
||||
return Promise.resolve();
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
var connectionManager;
|
||||
self.addEventListener("notificationclick", function(event) {
|
||||
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
|
||||
var notification = event.notification;
|
||||
notification.close();
|
||||
var data = notification.data,
|
||||
serverId = data.serverId,
|
||||
action = event.action;
|
||||
if (!action) return clients.openWindow("/"), void event.waitUntil(Promise.resolve());
|
||||
event.waitUntil(executeAction(action, data, serverId))
|
||||
}, !1)
|
||||
}();
|
||||
|
||||
var data = notification.data;
|
||||
var serverId = data.serverId;
|
||||
var action = event.action;
|
||||
|
||||
if (!action) {
|
||||
clients.openWindow("/");
|
||||
event.waitUntil(Promise.resolve());
|
||||
return;
|
||||
}
|
||||
|
||||
event.waitUntil(executeAction(action, data, serverId));
|
||||
|
||||
}, false);
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue