1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

merge branch master into strings

This commit is contained in:
dkanada 2020-08-27 09:20:03 +09:00
commit 75a4b73a83
30 changed files with 194 additions and 156 deletions

View file

@ -41,7 +41,7 @@ class AppRouter {
}
});
this.baseRoute = self.location.href.split('?')[0].replace(this.getRequestFile(), '');
this.baseRoute = window.location.href.split('?')[0].replace(this.getRequestFile(), '');
// support hashbang
this.baseRoute = this.baseRoute.split('#')[0];
if (this.baseRoute.endsWith('/') && !this.baseRoute.endsWith('://')) {
@ -55,7 +55,7 @@ class AppRouter {
* @private
*/
setBaseRoute() {
let baseRoute = self.location.pathname.replace(this.getRequestFile(), '');
let baseRoute = window.location.pathname.replace(this.getRequestFile(), '');
if (baseRoute.lastIndexOf('/') === baseRoute.length - 1) {
baseRoute = baseRoute.substring(0, baseRoute.length - 1);
}
@ -182,7 +182,7 @@ class AppRouter {
return false;
}
return history.length > 1;
return window.history.length > 1;
}
current() {
@ -258,7 +258,7 @@ class AppRouter {
pushState(state, title, url) {
state.navigate = false;
history.pushState(state, title, url);
window.history.pushState(state, title, url);
}
enableNativeHistory() {
@ -594,7 +594,7 @@ class AppRouter {
}
getRequestFile() {
let path = self.location.pathname || '';
let path = window.location.pathname || '';
const index = path.lastIndexOf('/');
if (index !== -1) {

View file

@ -55,7 +55,7 @@ function replaceAll(originalString, strReplace, strWith) {
function generateDeviceId() {
const keys = [];
if (keys.push(navigator.userAgent), keys.push(new Date().getTime()), self.btoa) {
if (keys.push(navigator.userAgent), keys.push(new Date().getTime()), window.btoa) {
const result = replaceAll(btoa(keys.join('|')), '=', '1');
return Promise.resolve(result);
}
@ -404,9 +404,9 @@ document.addEventListener(visibilityChange, function () {
}
}, false);
if (self.addEventListener) {
self.addEventListener('focus', onAppVisible);
self.addEventListener('blur', onAppHidden);
if (window.addEventListener) {
window.addEventListener('focus', onAppVisible);
window.addEventListener('blur', onAppHidden);
}
export default appHost;

View file

@ -19,7 +19,7 @@ export default (() => {
}
const text = replaceAll(options.text || '', '<br/>', '\n');
const result = confirm(text);
const result = window.confirm(text);
if (result) {
return Promise.resolve();

View file

@ -85,9 +85,9 @@ import 'scrollStyles';
}
if (!self.closedByBack && isHistoryEnabled(dlg)) {
const state = history.state || {};
const state = window.history.state || {};
if (state.dialogId === hash) {
history.back();
window.history.back();
}
}
@ -213,7 +213,7 @@ import 'scrollStyles';
export function close(dlg) {
if (isOpened(dlg)) {
if (isHistoryEnabled(dlg)) {
history.back();
window.history.back();
} else {
closeDialog(dlg);
}

View file

@ -18,7 +18,7 @@ events.on(playbackManager, 'playbackstart', function (e, player, state) {
if (isLocalVideo && layoutManager.mobile) {
/* eslint-disable-next-line compat/compat */
var lockOrientation = screen.lockOrientation || screen.mozLockOrientation || screen.msLockOrientation || (screen.orientation && screen.orientation.lock);
var lockOrientation = window.screen.lockOrientation || window.screen.mozLockOrientation || window.screen.msLockOrientation || (window.screen.orientation && window.screen.orientation.lock);
if (lockOrientation) {
try {
@ -39,7 +39,7 @@ events.on(playbackManager, 'playbackstart', function (e, player, state) {
events.on(playbackManager, 'playbackstop', function (e, playbackStopInfo) {
if (orientationLocked && !playbackStopInfo.nextMediaType) {
/* eslint-disable-next-line compat/compat */
var unlockOrientation = screen.unlockOrientation || screen.mozUnlockOrientation || screen.msUnlockOrientation || (screen.orientation && screen.orientation.unlock);
var unlockOrientation = window.screen.unlockOrientation || window.screen.mozUnlockOrientation || window.screen.msUnlockOrientation || (window.screen.orientation && window.screen.orientation.unlock);
if (unlockOrientation) {
try {

View file

@ -2,7 +2,7 @@ define(function () {
'use strict';
// hack to work around the server's auto-redirection feature
var addRedirectPrevention = self.dashboardVersion != null && self.Dashboard && !self.AppInfo.isNativeApp;
var addRedirectPrevention = window.dashboardVersion != null && window.Dashboard && !window.AppInfo.isNativeApp;
return {

View file

@ -26,7 +26,7 @@
});
}
self.addEventListener('notificationclick', function (event) {
window.addEventListener('notificationclick', function (event) {
var notification = event.notification;
notification.close();