mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update shared components
This commit is contained in:
parent
f2e02b7c2d
commit
feb3d5ae05
12 changed files with 76 additions and 110 deletions
|
@ -14,12 +14,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.190",
|
||||
"_release": "1.4.190",
|
||||
"version": "1.4.193",
|
||||
"_release": "1.4.193",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.190",
|
||||
"commit": "09067acafeb54ce135205fe22bdd67c5e04f53cc"
|
||||
"tag": "1.4.193",
|
||||
"commit": "e97de63ae9ed4e9f10fbd27da9de8e8a77ffd3fb"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.1",
|
||||
|
|
|
@ -172,15 +172,7 @@ define(['dom'], function (dom) {
|
|||
return elem;
|
||||
}
|
||||
|
||||
function getWindowData(win, documentElement) {
|
||||
|
||||
return {
|
||||
clientTop: documentElement.clientTop,
|
||||
clientLeft: documentElement.clientLeft
|
||||
};
|
||||
}
|
||||
|
||||
function getOffset(elem, windowData) {
|
||||
function getOffset(elem) {
|
||||
|
||||
var box;
|
||||
|
||||
|
@ -197,16 +189,16 @@ define(['dom'], function (dom) {
|
|||
};
|
||||
}
|
||||
return {
|
||||
top: box.top - windowData.clientTop,
|
||||
left: box.left - windowData.clientLeft,
|
||||
top: box.top,
|
||||
left: box.left,
|
||||
width: box.width,
|
||||
height: box.height
|
||||
};
|
||||
}
|
||||
|
||||
function getViewportBoundingClientRect(elem, windowData) {
|
||||
function getViewportBoundingClientRect(elem) {
|
||||
|
||||
var offset = getOffset(elem, windowData);
|
||||
var offset = getOffset(elem);
|
||||
|
||||
var posY = offset.top;
|
||||
var posX = offset.left;
|
||||
|
@ -243,9 +235,7 @@ define(['dom'], function (dom) {
|
|||
|
||||
var focusableContainer = dom.parentWithClass(activeElement, 'focusable');
|
||||
|
||||
var doc = activeElement.ownerDocument;
|
||||
var windowData = getWindowData(doc.defaultView, doc.documentElement);
|
||||
var rect = getViewportBoundingClientRect(activeElement, windowData);
|
||||
var rect = getViewportBoundingClientRect(activeElement);
|
||||
var focusableElements = [];
|
||||
|
||||
var focusable = container.querySelectorAll(focusableQuery);
|
||||
|
@ -264,7 +254,7 @@ define(['dom'], function (dom) {
|
|||
// continue;
|
||||
//}
|
||||
|
||||
var elementRect = getViewportBoundingClientRect(curr, windowData);
|
||||
var elementRect = getViewportBoundingClientRect(curr);
|
||||
|
||||
// not currently visible
|
||||
if (!elementRect.width && !elementRect.height) {
|
||||
|
|
|
@ -11,7 +11,7 @@ define(function () {
|
|||
|
||||
var url = cssId + '.html';
|
||||
|
||||
if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
||||
if (url.indexOf('://') == -1) {
|
||||
url = config.baseUrl + url;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ define(function () {
|
|||
|
||||
load: function (url, req, load, config) {
|
||||
|
||||
if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
||||
if (url.indexOf('://') == -1) {
|
||||
url = config.baseUrl + url;
|
||||
}
|
||||
|
||||
|
|
|
@ -104,8 +104,6 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
}
|
||||
}
|
||||
|
||||
var htmlCache = {};
|
||||
var cacheParam = new Date().getTime();
|
||||
function loadContentUrl(ctx, next, route, request) {
|
||||
|
||||
var url = route.contentPath || route.path;
|
||||
|
@ -125,32 +123,10 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
url += '?' + ctx.querystring;
|
||||
}
|
||||
|
||||
if (route.enableCache !== false) {
|
||||
var cachedHtml = htmlCache[url];
|
||||
if (cachedHtml) {
|
||||
loadContent(ctx, route, cachedHtml, request);
|
||||
return;
|
||||
}
|
||||
}
|
||||
require(['text!' + url], function (html) {
|
||||
|
||||
url += url.indexOf('?') == -1 ? '?' : '&';
|
||||
url += 'v=' + cacheParam;
|
||||
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.onload = xhr.onerror = function () {
|
||||
if (this.status < 400) {
|
||||
var html = this.response;
|
||||
if (route.enableCache !== false) {
|
||||
htmlCache[url.split('?')[0]] = html;
|
||||
}
|
||||
loadContent(ctx, route, html, request);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
};
|
||||
xhr.onerror = next;
|
||||
xhr.open('GET', url, true);
|
||||
xhr.send();
|
||||
loadContent(ctx, route, html, request);
|
||||
});
|
||||
}
|
||||
|
||||
function handleRoute(ctx, next, route) {
|
||||
|
|
|
@ -452,7 +452,7 @@ define(['browser', 'layoutManager', 'dom', 'scrollStyles'], function (browser, l
|
|||
|
||||
var offset = o.horizontal ? itemOffset.left - slideeOffset.left : itemOffset.top - slideeOffset.top;
|
||||
var size = o.horizontal ? itemOffset.width : itemOffset.height;
|
||||
if (!size) {
|
||||
if (!size && size !== 0) {
|
||||
size = item[o.horizontal ? 'offsetWidth' : 'offsetHeight'];
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ define(['focusManager', 'dom', 'scrollStyles'], function (focusManager, dom) {
|
|||
|
||||
var offset = horizontal ? itemOffset.left - slideeOffset.left : itemOffset.top - slideeOffset.top;
|
||||
var size = horizontal ? itemOffset.width : itemOffset.height;
|
||||
if (!size) {
|
||||
if (!size && size !== 0) {
|
||||
size = item[horizontal ? 'offsetWidth' : 'offsetHeight'];
|
||||
}
|
||||
|
||||
|
|
48
dashboard-ui/bower_components/emby-webcomponents/serviceworker/notifications.js
vendored
Normal file
48
dashboard-ui/bower_components/emby-webcomponents/serviceworker/notifications.js
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
var connectionManager;
|
||||
|
||||
function getApiClient(serverId) {
|
||||
|
||||
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) {
|
||||
|
||||
switch (action) {
|
||||
case 'cancel-install':
|
||||
var id = data.id;
|
||||
return apiClient.cancelPackageInstallation(id);
|
||||
case 'restart':
|
||||
return apiClient.restartServer();
|
||||
default:
|
||||
clients.openWindow("/");
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
|
||||
var notification = event.notification;
|
||||
notification.close();
|
||||
|
||||
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);
|
4
dashboard-ui/bower_components/emby-webcomponents/serviceworker/sync.js
vendored
Normal file
4
dashboard-ui/bower_components/emby-webcomponents/serviceworker/sync.js
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
self.addEventListener('sync', function (event) {
|
||||
if (event.tag == 'emby-sync') {
|
||||
}
|
||||
});
|
|
@ -10,7 +10,7 @@
|
|||
* the user visible viewport of a web browser.
|
||||
* only accounts for vertical position, not horizontal.
|
||||
*/
|
||||
function visibleInViewport(elem, partial, thresholdX, thresholdY, windowSize) {
|
||||
function visibleInViewport(elem, partial, thresholdX, thresholdY) {
|
||||
|
||||
thresholdX = thresholdX || 0;
|
||||
thresholdY = thresholdY || 0;
|
||||
|
@ -19,7 +19,7 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
windowSize = windowSize || dom.getWindowSize();
|
||||
var windowSize = dom.getWindowSize();
|
||||
|
||||
var vpWidth = windowSize.innerWidth,
|
||||
vpHeight = windowSize.innerHeight;
|
||||
|
|
|
@ -32,14 +32,14 @@
|
|||
"iron-component-page": "polymerElements/iron-component-page#^1.1.6"
|
||||
},
|
||||
"private": true,
|
||||
"homepage": "https://github.com/Polymer/polymer",
|
||||
"homepage": "https://github.com/polymer/polymer",
|
||||
"_release": "1.6.1",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "v1.6.1",
|
||||
"commit": "1f197d9d7874b1e5808b2a5c26f34446a7d912fc"
|
||||
},
|
||||
"_source": "git://github.com/Polymer/polymer.git",
|
||||
"_source": "git://github.com/polymer/polymer.git",
|
||||
"_target": "^1.1.0",
|
||||
"_originalSource": "Polymer/polymer"
|
||||
"_originalSource": "polymer/polymer"
|
||||
}
|
|
@ -7,8 +7,6 @@ var staticFileBaseUrl = baseUrl + '/staticfiles';
|
|||
console.log('service worker location: ' + self.location);
|
||||
console.log('service worker base url: ' + baseUrl);
|
||||
|
||||
var connectionManager;
|
||||
|
||||
function getStaticFileList() {
|
||||
|
||||
if (staticFileList) {
|
||||
|
@ -101,54 +99,4 @@ self.addEventListener('activate', function (event) {
|
|||
);
|
||||
});
|
||||
|
||||
function getApiClient(serverId) {
|
||||
|
||||
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) {
|
||||
|
||||
switch (action) {
|
||||
case 'cancel-install':
|
||||
var id = data.id;
|
||||
return apiClient.cancelPackageInstallation(id);
|
||||
case 'restart':
|
||||
return apiClient.restartServer();
|
||||
default:
|
||||
clients.openWindow("/");
|
||||
return Promise.resolve();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
|
||||
var notification = event.notification;
|
||||
notification.close();
|
||||
|
||||
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);
|
||||
|
||||
self.addEventListener('sync', function (event) {
|
||||
if (event.tag == 'emby-sync') {
|
||||
}
|
||||
});
|
||||
importScripts("bower_components/emby-webcomponents/serviceworker/notifications.js", "bower_components/emby-webcomponents/serviceworker/sync.js");
|
Loading…
Add table
Add a link
Reference in a new issue