mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #1232 from MrTimscampi/sonarcloud-3
Fix more sonarqube bugs
This commit is contained in:
commit
9556949885
19 changed files with 99 additions and 127 deletions
|
@ -72,12 +72,12 @@ define(['dialogHelper', 'datetime', 'globalize', 'emby-select', 'paper-icon-butt
|
||||||
reject();
|
reject();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dlg.querySelector('.btnCancel').addEventListener('click', function (e) {
|
dlg.querySelector('.btnCancel').addEventListener('click', function () {
|
||||||
dialogHelper.close(dlg);
|
dialogHelper.close(dlg);
|
||||||
});
|
});
|
||||||
dlg.querySelector('form').addEventListener('submit', function (e) {
|
dlg.querySelector('form').addEventListener('submit', function (event) {
|
||||||
submitSchedule(dlg, options);
|
submitSchedule(dlg, options);
|
||||||
e.preventDefault();
|
event.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -16,15 +16,8 @@ function getOffsets(elems) {
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
||||||
let box;
|
|
||||||
for (let elem of elems) {
|
for (let elem of elems) {
|
||||||
// Support: BlackBerry 5, iOS 3 (original iPhone)
|
let box = elem.getBoundingClientRect();
|
||||||
// If we don't have gBCR, just use 0,0 rather than error
|
|
||||||
if (elem.getBoundingClientRect) {
|
|
||||||
box = elem.getBoundingClientRect();
|
|
||||||
} else {
|
|
||||||
box = { top: 0, left: 0 };
|
|
||||||
}
|
|
||||||
|
|
||||||
results.push({
|
results.push({
|
||||||
top: box.top,
|
top: box.top,
|
||||||
|
@ -153,7 +146,9 @@ export function show(options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (layoutManager.tv) {
|
if (layoutManager.tv) {
|
||||||
html += '<button is="paper-icon-button-light" class="btnCloseActionSheet hide-mouse-idle-tv" tabindex="-1"><span class="material-icons arrow_back"></span></button>';
|
html += `<button is="paper-icon-button-light" class="btnCloseActionSheet hide-mouse-idle-tv" tabindex="-1">
|
||||||
|
<span class="material-icons arrow_back"></span>
|
||||||
|
</button>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If any items have an icon, give them all an icon just to make sure they're all lined up evenly
|
// If any items have an icon, give them all an icon just to make sure they're all lined up evenly
|
||||||
|
@ -216,7 +211,7 @@ export function show(options) {
|
||||||
itemIcon = icons[i];
|
itemIcon = icons[i];
|
||||||
|
|
||||||
if (itemIcon) {
|
if (itemIcon) {
|
||||||
html += '<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons ' + itemIcon + '"></span>';
|
html += `<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons ${itemIcon}"></span>`;
|
||||||
} else if (renderIcon && !center) {
|
} else if (renderIcon && !center) {
|
||||||
html += '<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons check" style="visibility:hidden;"></span>';
|
html += '<span class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons check" style="visibility:hidden;"></span>';
|
||||||
}
|
}
|
||||||
|
@ -228,13 +223,13 @@ export function show(options) {
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (item.secondaryText) {
|
if (item.secondaryText) {
|
||||||
html += '<div class="listItemBodyText secondary">' + item.secondaryText + '</div>';
|
html += `<div class="listItemBodyText secondary">${item.secondaryText}</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (item.asideText) {
|
if (item.asideText) {
|
||||||
html += '<div class="listItemAside actionSheetItemAsideText">' + item.asideText + '</div>';
|
html += `<div class="listItemAside actionSheetItemAsideText">${item.asideText}</div>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</button>';
|
html += '</button>';
|
||||||
|
@ -242,7 +237,7 @@ export function show(options) {
|
||||||
|
|
||||||
if (options.showCancel) {
|
if (options.showCancel) {
|
||||||
html += '<div class="buttons">';
|
html += '<div class="buttons">';
|
||||||
html += '<button is="emby-button" type="button" class="btnCloseActionSheet">' + globalize.translate('ButtonCancel') + '</button>';
|
html += `<button is="emby-button" type="button" class="btnCloseActionSheet">${globalize.translate('ButtonCancel')}</button>`;
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
}
|
}
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
|
@ -34,10 +34,14 @@ define(['events', 'globalize', 'dom', 'date-fns', 'dfnshelper', 'userSettings',
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
if (entry.Overview) {
|
if (entry.Overview) {
|
||||||
html += '<button type="button" is="paper-icon-button-light" class="btnEntryInfo" data-id="' + entry.Id + '" title="' + globalize.translate('Info') + '"><span class="material-icons info"></span></button>';
|
html += `<button type="button" is="paper-icon-button-light" class="btnEntryInfo" data-id="${entry.Id}" title="${globalize.translate('Info')}">
|
||||||
|
<span class="material-icons info"></span>
|
||||||
|
</button>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderList(elem, apiClient, result, startIndex, limit) {
|
function renderList(elem, apiClient, result, startIndex, limit) {
|
||||||
|
|
|
@ -26,11 +26,11 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
connectionManager.connect({
|
connectionManager.connect({
|
||||||
enableAutoLogin: appSettings.enableAutoLogin()
|
enableAutoLogin: appSettings.enableAutoLogin()
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
handleConnectionResult(result, loading);
|
handleConnectionResult(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleConnectionResult(result, loading) {
|
function handleConnectionResult(result) {
|
||||||
switch (result.State) {
|
switch (result.State) {
|
||||||
case 'SignedIn':
|
case 'SignedIn':
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
@ -246,13 +246,11 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setQuality) {
|
if (setQuality) {
|
||||||
|
var quality;
|
||||||
var quality = 100;
|
|
||||||
|
|
||||||
var type = options.type || 'Primary';
|
var type = options.type || 'Primary';
|
||||||
|
|
||||||
if (browser.tv || browser.slow) {
|
if (browser.tv || browser.slow) {
|
||||||
|
// TODO: wtf
|
||||||
if (browser.chrome) {
|
if (browser.chrome) {
|
||||||
// webp support
|
// webp support
|
||||||
quality = type === 'Primary' ? 40 : 50;
|
quality = type === 'Primary' ? 40 : 50;
|
||||||
|
@ -384,7 +382,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
|
|
||||||
if (firstResult.State !== 'SignedIn' && !route.anonymous) {
|
if (firstResult.State !== 'SignedIn' && !route.anonymous) {
|
||||||
|
|
||||||
handleConnectionResult(firstResult, loading);
|
handleConnectionResult(firstResult);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -463,7 +461,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
var isHandlingBackToDefault;
|
|
||||||
var isDummyBackToHome;
|
var isDummyBackToHome;
|
||||||
|
|
||||||
function loadContent(ctx, route, html, request) {
|
function loadContent(ctx, route, html, request) {
|
||||||
|
@ -589,8 +586,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
path = '/' + path;
|
path = '/' + path;
|
||||||
}
|
}
|
||||||
|
|
||||||
var baseRoute = baseUrl();
|
path = path.replace(baseUrl(), '');
|
||||||
path = path.replace(baseRoute, '');
|
|
||||||
|
|
||||||
if (currentRouteInfo && currentRouteInfo.path === path) {
|
if (currentRouteInfo && currentRouteInfo.path === path) {
|
||||||
// can't use this with home right now due to the back menu
|
// can't use this with home right now due to the back menu
|
||||||
|
@ -621,10 +617,11 @@ define(['loading', 'globalize', 'events', 'viewManager', 'skinManager', 'backdro
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItem(item, serverId, options) {
|
function showItem(item, serverId, options) {
|
||||||
|
// TODO: Refactor this so it only gets items, not strings.
|
||||||
if (typeof (item) === 'string') {
|
if (typeof (item) === 'string') {
|
||||||
var apiClient = serverId ? connectionManager.getApiClient(serverId) : connectionManager.currentApiClient();
|
var apiClient = serverId ? connectionManager.getApiClient(serverId) : connectionManager.currentApiClient();
|
||||||
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
|
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (itemObject) {
|
||||||
appRouter.showItem(item, options);
|
appRouter.showItem(itemObject, options);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (arguments.length === 2) {
|
if (arguments.length === 2) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
||||||
var disableHlsVideoAudioCodecs = [];
|
var disableHlsVideoAudioCodecs = [];
|
||||||
|
|
||||||
if (item && htmlMediaHelper.enableHlsJsPlayer(item.RunTimeTicks, item.MediaType)) {
|
if (item && htmlMediaHelper.enableHlsJsPlayer(item.RunTimeTicks, item.MediaType)) {
|
||||||
if (browser.edge || browser.msie) {
|
if (browser.edge) {
|
||||||
disableHlsVideoAudioCodecs.push('mp3');
|
disableHlsVideoAudioCodecs.push('mp3');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -93,18 +93,36 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
||||||
|
|
||||||
function getDeviceName() {
|
function getDeviceName() {
|
||||||
var deviceName;
|
var deviceName;
|
||||||
deviceName = browser.tizen ? 'Samsung Smart TV' : browser.web0s ? 'LG Smart TV' : browser.operaTv ? 'Opera TV' : browser.xboxOne ? 'Xbox One' : browser.ps4 ? 'Sony PS4' : browser.chrome ? 'Chrome' : browser.edge ? 'Edge' : browser.firefox ? 'Firefox' : browser.msie ? 'Internet Explorer' : browser.opera ? 'Opera' : browser.safari ? 'Safari' : 'Web Browser';
|
if (browser.tizen) {
|
||||||
|
deviceName = 'Samsung Smart TV';
|
||||||
|
} else if (browser.web0s) {
|
||||||
|
deviceName = 'LG Smart TV';
|
||||||
|
} else if (browser.operaTv) {
|
||||||
|
deviceName = 'Opera TV';
|
||||||
|
} else if (browser.xboxOne) {
|
||||||
|
deviceName = 'Xbox One';
|
||||||
|
} else if (browser.ps4) {
|
||||||
|
deviceName = 'Sony PS4';
|
||||||
|
} else if (browser.chrome) {
|
||||||
|
deviceName = 'Chrome';
|
||||||
|
} else if (browser.edge) {
|
||||||
|
deviceName = 'Edge';
|
||||||
|
} else if (browser.firefox) {
|
||||||
|
deviceName = 'Firefox';
|
||||||
|
} else if (browser.opera) {
|
||||||
|
deviceName = 'Opera';
|
||||||
|
} else if (browser.safari) {
|
||||||
|
deviceName = 'Safari';
|
||||||
|
} else {
|
||||||
|
deviceName = 'Web Browser';
|
||||||
|
}
|
||||||
|
|
||||||
if (browser.ipad) {
|
if (browser.ipad) {
|
||||||
deviceName += ' iPad';
|
deviceName += ' iPad';
|
||||||
} else {
|
} else if (browser.iphone) {
|
||||||
if (browser.iphone) {
|
deviceName += ' iPhone';
|
||||||
deviceName += ' iPhone';
|
} else if (browser.android) {
|
||||||
} else {
|
deviceName += ' Android';
|
||||||
if (browser.android) {
|
|
||||||
deviceName += ' Android';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return deviceName;
|
return deviceName;
|
||||||
|
@ -267,7 +285,7 @@ define(['appSettings', 'browser', 'events', 'htmlMediaHelper', 'webSettings', 'g
|
||||||
if (enabled) features.push('multiserver');
|
if (enabled) features.push('multiserver');
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!browser.orsay && !browser.msie && (browser.firefox || browser.ps4 || browser.edge || supportsCue())) {
|
if (!browser.orsay && (browser.firefox || browser.ps4 || browser.edge || supportsCue())) {
|
||||||
features.push('subtitleappearancesettings');
|
features.push('subtitleappearancesettings');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -281,14 +281,6 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
}
|
}
|
||||||
|
|
||||||
self.play = function (options) {
|
self.play = function (options) {
|
||||||
|
|
||||||
if (browser.msie) {
|
|
||||||
if (options.playMethod === 'Transcode' && !window.MediaSource) {
|
|
||||||
alert('Playback of this content is not supported in Internet Explorer. For a better experience, try a modern browser such as Microsoft Edge, Google Chrome, Firefox or Opera.');
|
|
||||||
return Promise.reject();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
self._started = false;
|
self._started = false;
|
||||||
self._timeUpdated = false;
|
self._timeUpdated = false;
|
||||||
|
|
||||||
|
@ -1425,13 +1417,6 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
||||||
var video = document.createElement('video');
|
var video = document.createElement('video');
|
||||||
if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' || document.pictureInPictureEnabled) {
|
if (video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function' || document.pictureInPictureEnabled) {
|
||||||
list.push('PictureInPicture');
|
list.push('PictureInPicture');
|
||||||
} else if (browser.ipad) {
|
|
||||||
// Unfortunately this creates a false positive on devices where its' not actually supported
|
|
||||||
if (navigator.userAgent.toLowerCase().indexOf('os 9') === -1) {
|
|
||||||
if (video.webkitSupportsPresentationMode && video.webkitSupportsPresentationMode && typeof video.webkitSetPresentationMode === 'function') {
|
|
||||||
list.push('PictureInPicture');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (window.Windows) {
|
} else if (window.Windows) {
|
||||||
if (Windows.UI.ViewManagement.ApplicationView.getForCurrentView().isViewModeSupported(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay)) {
|
if (Windows.UI.ViewManagement.ApplicationView.getForCurrentView().isViewModeSupported(Windows.UI.ViewManagement.ApplicationViewMode.compactOverlay)) {
|
||||||
list.push('PictureInPicture');
|
list.push('PictureInPicture');
|
||||||
|
|
|
@ -120,7 +120,12 @@ define(['globalize', 'dom', 'emby-checkbox', 'emby-select', 'emby-input'], funct
|
||||||
html += plugin.Name;
|
html += plugin.Name;
|
||||||
html += '</h3>';
|
html += '</h3>';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
index > 0 ? html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate('ButtonUp') + '" class="btnSortableMoveUp btnSortable" data-pluginindex="' + index + '"><span class="material-icons keyboard_arrow_up"></span></button>' : plugins.length > 1 && (html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate('ButtonDown') + '" class="btnSortableMoveDown btnSortable" data-pluginindex="' + index + '"><span class="material-icons keyboard_arrow_down"></span></button>'), html += '</div>';
|
if (index > 0) {
|
||||||
|
html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate('ButtonUp') + '" class="btnSortableMoveUp btnSortable" data-pluginindex="' + index + '"><span class="material-icons keyboard_arrow_up"></span></button>';
|
||||||
|
} else if (plugins.length > 1) {
|
||||||
|
html += '<button type="button" is="paper-icon-button-light" title="' + globalize.translate('ButtonDown') + '" class="btnSortableMoveDown btnSortable" data-pluginindex="' + index + '"><span class="material-icons keyboard_arrow_down"></span></button>';
|
||||||
|
}
|
||||||
|
html += '</div>';
|
||||||
});
|
});
|
||||||
|
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
|
@ -57,7 +57,6 @@ define(['apphost', 'userSettings', 'browser', 'events', 'backdrop', 'globalize',
|
||||||
var selectedTheme;
|
var selectedTheme;
|
||||||
|
|
||||||
for (var i = 0, length = themes.length; i < length; i++) {
|
for (var i = 0, length = themes.length; i < length; i++) {
|
||||||
|
|
||||||
var theme = themes[i];
|
var theme = themes[i];
|
||||||
if (theme[isDefaultProperty]) {
|
if (theme[isDefaultProperty]) {
|
||||||
defaultTheme = theme;
|
defaultTheme = theme;
|
||||||
|
|
|
@ -29,14 +29,18 @@ define(['jQuery', 'dom', 'loading', 'libraryMenu', 'globalize', 'listViewStyle']
|
||||||
var promises = [ApiClient.getServerConfiguration(), populateLanguages(page.querySelector('#selectLanguage')), populateCountries(page.querySelector('#selectCountry'))];
|
var promises = [ApiClient.getServerConfiguration(), populateLanguages(page.querySelector('#selectLanguage')), populateCountries(page.querySelector('#selectCountry'))];
|
||||||
Promise.all(promises).then(function(responses) {
|
Promise.all(promises).then(function(responses) {
|
||||||
var config = responses[0];
|
var config = responses[0];
|
||||||
page.querySelector('#selectLanguage').value = config.PreferredMetadataLanguage || '', page.querySelector('#selectCountry').value = config.MetadataCountryCode || '', loading.hide();
|
page.querySelector('#selectLanguage').value = config.PreferredMetadataLanguage || '';
|
||||||
|
page.querySelector('#selectCountry').value = config.MetadataCountryCode || '';
|
||||||
|
loading.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
var form = this;
|
var form = this;
|
||||||
return loading.show(), ApiClient.getServerConfiguration().then(function(config) {
|
return loading.show(), ApiClient.getServerConfiguration().then(function(config) {
|
||||||
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value, config.MetadataCountryCode = form.querySelector('#selectCountry').value, ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
|
||||||
|
config.MetadataCountryCode = form.querySelector('#selectCountry').value;
|
||||||
|
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||||
}), !1;
|
}), !1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,6 +63,8 @@ define(['jQuery', 'dom', 'loading', 'libraryMenu', 'globalize', 'listViewStyle']
|
||||||
$(document).on('pageinit', '#metadataImagesConfigurationPage', function() {
|
$(document).on('pageinit', '#metadataImagesConfigurationPage', function() {
|
||||||
$('.metadataImagesConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
$('.metadataImagesConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
}).on('pageshow', '#metadataImagesConfigurationPage', function() {
|
}).on('pageshow', '#metadataImagesConfigurationPage', function() {
|
||||||
libraryMenu.setTabs('metadata', 2, getTabs), loading.show(), loadPage(this);
|
libraryMenu.setTabs('metadata', 2, getTabs);
|
||||||
|
loading.show();
|
||||||
|
loadPage(this);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -58,10 +58,10 @@ define(['jQuery', 'emby-checkbox', 'fnchecked'], function ($) {
|
||||||
function save(page) {
|
function save(page) {
|
||||||
var type = getParameterByName('type');
|
var type = getParameterByName('type');
|
||||||
var promise1 = ApiClient.getNamedConfiguration(notificationsConfigurationKey);
|
var promise1 = ApiClient.getNamedConfiguration(notificationsConfigurationKey);
|
||||||
|
// TODO: Check if this promise is really needed, as it's unused.
|
||||||
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Notifications/Types'));
|
var promise2 = ApiClient.getJSON(ApiClient.getUrl('Notifications/Types'));
|
||||||
Promise.all([promise1, promise2]).then(function (responses) {
|
Promise.all([promise1, promise2]).then(function (responses) {
|
||||||
var notificationOptions = responses[0];
|
var notificationOptions = responses[0];
|
||||||
var types = responses[1];
|
|
||||||
var notificationConfig = notificationOptions.Options.filter(function (n) {
|
var notificationConfig = notificationOptions.Options.filter(function (n) {
|
||||||
return n.Type == type;
|
return n.Type == type;
|
||||||
})[0];
|
})[0];
|
||||||
|
@ -73,9 +73,6 @@ define(['jQuery', 'emby-checkbox', 'fnchecked'], function ($) {
|
||||||
notificationOptions.Options.push(notificationConfig);
|
notificationOptions.Options.push(notificationConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
types.filter(function (n) {
|
|
||||||
return n.Type == type;
|
|
||||||
})[0];
|
|
||||||
notificationConfig.Enabled = $('#chkEnabled', page).checked();
|
notificationConfig.Enabled = $('#chkEnabled', page).checked();
|
||||||
notificationConfig.SendToUserMode = $('#selectUsers', page).val();
|
notificationConfig.SendToUserMode = $('#selectUsers', page).val();
|
||||||
notificationConfig.DisabledMonitorUsers = $('.chkMonitor', page).get().filter(function (c) {
|
notificationConfig.DisabledMonitorUsers = $('.chkMonitor', page).get().filter(function (c) {
|
||||||
|
|
|
@ -157,7 +157,7 @@ define(['playbackManager', 'dom', 'inputManager', 'datetime', 'itemHelper', 'med
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!displayName) {
|
if (!displayName) {
|
||||||
displayItem.Type;
|
displayName = displayItem.Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
titleElement.innerHTML = displayName;
|
titleElement.innerHTML = displayName;
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
<a is="emby-linkbutton" href="dlnaprofile.html" class="fab submit" style="margin:0 0 0 1em">
|
<a is="emby-linkbutton" href="dlnaprofile.html" class="fab submit" style="margin:0 0 0 1em">
|
||||||
<span class="material-icons add"></span>
|
<span class="material-icons add"></span>
|
||||||
</a>
|
</a>
|
||||||
<a style="margin-left:2em!important;" is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Dlna-profiles">${Help}</a>
|
<a is="emby-linkbutton" style="margin-left:2em!important;" rel="noopener noreferrer" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Dlna-profiles">${Help}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>${CustomDlnaProfilesHelp}</p>
|
<p>${CustomDlnaProfilesHelp}</p>
|
||||||
|
|
|
@ -148,7 +148,7 @@ define(['browser', 'dom', 'layoutManager', 'keyboardnavigation', 'css!./emby-sli
|
||||||
this.classList.add('mdl-slider');
|
this.classList.add('mdl-slider');
|
||||||
this.classList.add('mdl-js-slider');
|
this.classList.add('mdl-js-slider');
|
||||||
|
|
||||||
if (browser.edge || browser.msie) {
|
if (browser.edge) {
|
||||||
this.classList.add('slider-browser-edge');
|
this.classList.add('slider-browser-edge');
|
||||||
}
|
}
|
||||||
if (!layoutManager.mobile) {
|
if (!layoutManager.mobile) {
|
||||||
|
|
|
@ -14,10 +14,6 @@ define([], function () {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (userAgent.indexOf('nintendo') !== -1) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (userAgent.indexOf('viera') !== -1) {
|
if (userAgent.indexOf('viera') !== -1) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +89,7 @@ define([], function () {
|
||||||
var _supportsCssAnimation;
|
var _supportsCssAnimation;
|
||||||
var _supportsCssAnimationWithPrefix;
|
var _supportsCssAnimationWithPrefix;
|
||||||
function supportsCssAnimation(allowPrefix) {
|
function supportsCssAnimation(allowPrefix) {
|
||||||
|
// TODO: Assess if this is still needed, as all of our targets should natively support CSS animations.
|
||||||
if (allowPrefix) {
|
if (allowPrefix) {
|
||||||
if (_supportsCssAnimationWithPrefix === true || _supportsCssAnimationWithPrefix === false) {
|
if (_supportsCssAnimationWithPrefix === true || _supportsCssAnimationWithPrefix === false) {
|
||||||
return _supportsCssAnimationWithPrefix;
|
return _supportsCssAnimationWithPrefix;
|
||||||
|
@ -145,7 +141,6 @@ define([], function () {
|
||||||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
/(firefox)[ \/]([\w.]+)/.exec(ua) ||
|
/(firefox)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
/(msie) ([\w.]+)/.exec(ua) ||
|
|
||||||
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||||
[];
|
[];
|
||||||
|
|
||||||
|
@ -161,14 +156,6 @@ define([], function () {
|
||||||
|
|
||||||
if (browser === 'edge') {
|
if (browser === 'edge') {
|
||||||
platform_match = [''];
|
platform_match = [''];
|
||||||
} else {
|
|
||||||
if (ua.indexOf('windows phone') !== -1 || ua.indexOf('iemobile') !== -1) {
|
|
||||||
|
|
||||||
// http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update
|
|
||||||
browser = 'msie';
|
|
||||||
} else if (ua.indexOf('like gecko') !== -1 && ua.indexOf('webkit') === -1 && ua.indexOf('opera') === -1 && ua.indexOf('chrome') === -1 && ua.indexOf('safari') === -1) {
|
|
||||||
browser = 'msie';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser === 'opr') {
|
if (browser === 'opr') {
|
||||||
|
@ -211,7 +198,7 @@ define([], function () {
|
||||||
browser[matched.platform] = true;
|
browser[matched.platform] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf('webkit') !== -1) {
|
if (!browser.chrome && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf('webkit') !== -1) {
|
||||||
browser.safari = true;
|
browser.safari = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +211,10 @@ define([], function () {
|
||||||
browser.mobile = true;
|
browser.mobile = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
browser.xboxOne = userAgent.toLowerCase().indexOf('xbox') !== -1;
|
if (userAgent.toLowerCase().indexOf('xbox') !== -1) {
|
||||||
|
browser.xboxOne = true;
|
||||||
|
browser.tv = true;
|
||||||
|
}
|
||||||
browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null;
|
browser.animate = typeof document !== 'undefined' && document.documentElement.animate != null;
|
||||||
browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || self.tizen != null;
|
browser.tizen = userAgent.toLowerCase().indexOf('tizen') !== -1 || self.tizen != null;
|
||||||
browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1;
|
browser.web0s = userAgent.toLowerCase().indexOf('Web0S'.toLowerCase()) !== -1;
|
||||||
|
|
|
@ -188,20 +188,6 @@ define(['browser'], function (browser) {
|
||||||
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
return browser.tizen || browser.orsay || browser.web0s || browser.edgeUwp;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFlvMseDirectPlayProfile() {
|
|
||||||
var videoAudioCodecs = ['aac'];
|
|
||||||
if (!browser.edge && !browser.msie) {
|
|
||||||
videoAudioCodecs.push('mp3');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
Container: 'flv',
|
|
||||||
Type: 'Video',
|
|
||||||
VideoCodec: 'h264',
|
|
||||||
AudioCodec: videoAudioCodecs.join(',')
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs, videoTestElement, options) {
|
function getDirectPlayProfileForVideoContainer(container, videoAudioCodecs, videoTestElement, options) {
|
||||||
var supported = false;
|
var supported = false;
|
||||||
var profileContainer = container;
|
var profileContainer = container;
|
||||||
|
@ -230,9 +216,6 @@ define(['browser'], function (browser) {
|
||||||
break;
|
break;
|
||||||
case 'flv':
|
case 'flv':
|
||||||
supported = browser.tizen || browser.orsay;
|
supported = browser.tizen || browser.orsay;
|
||||||
//if (!supported && window.MediaSource != null && window.MediaSource.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"')) {
|
|
||||||
// return getFlvMseDirectPlayProfile();
|
|
||||||
//}
|
|
||||||
break;
|
break;
|
||||||
case '3gp':
|
case '3gp':
|
||||||
case 'mts':
|
case 'mts':
|
||||||
|
|
|
@ -209,7 +209,7 @@ define(['datetime', 'jQuery', 'globalize', 'material-icons'], function (datetime
|
||||||
function onNodeOpen(event, data) {
|
function onNodeOpen(event, data) {
|
||||||
var page = $(this).parents('.page')[0];
|
var page = $(this).parents('.page')[0];
|
||||||
var node = data.node;
|
var node = data.node;
|
||||||
if (node.children && node.children) {
|
if (node.children) {
|
||||||
loadNodesToLoad(page, node);
|
loadNodesToLoad(page, node);
|
||||||
}
|
}
|
||||||
if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
|
if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
|
||||||
|
@ -221,7 +221,7 @@ define(['datetime', 'jQuery', 'globalize', 'material-icons'], function (datetime
|
||||||
function onNodeLoad(event, data) {
|
function onNodeLoad(event, data) {
|
||||||
var page = $(this).parents('.page')[0];
|
var page = $(this).parents('.page')[0];
|
||||||
var node = data.node;
|
var node = data.node;
|
||||||
if (node.children && node.children) {
|
if (node.children) {
|
||||||
loadNodesToLoad(page, node);
|
loadNodesToLoad(page, node);
|
||||||
}
|
}
|
||||||
if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
|
if (node.li_attr && node.id != '#' && !node.li_attr.loadedFromServer) {
|
||||||
|
|
|
@ -602,27 +602,25 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
||||||
if (libraryMenuOptions) {
|
if (libraryMenuOptions) {
|
||||||
getUserViews(apiClient, userId).then(function (result) {
|
getUserViews(apiClient, userId).then(function (result) {
|
||||||
var items = result;
|
var items = result;
|
||||||
var html = '';
|
var html = `<h3 class="sidebarHeader">${globalize.translate('HeaderMedia')}</h3>`;
|
||||||
html += '<h3 class="sidebarHeader">';
|
|
||||||
html += globalize.translate('HeaderMedia');
|
|
||||||
html += '</h3>';
|
|
||||||
html += items.map(function (i) {
|
html += items.map(function (i) {
|
||||||
var icon = i.icon || imageHelper.getLibraryIcon(i.CollectionType);
|
var icon = i.icon || imageHelper.getLibraryIcon(i.CollectionType);
|
||||||
var itemId = i.Id;
|
var itemId = i.Id;
|
||||||
|
|
||||||
if (i.onclick) {
|
const linkHtml = `<a is="emby-linkbutton" data-itemid="${itemId}" class="lnkMediaFolder navMenuOption" href="${getItemHref(i, i.CollectionType)}">
|
||||||
i.onclick;
|
<span class="material-icons navMenuOptionIcon ${icon}"></span>
|
||||||
}
|
<span class="sectionName navMenuOptionText">${i.Name}</span>
|
||||||
|
</a>`;
|
||||||
|
|
||||||
return '<a is="emby-linkbutton" data-itemid="' + itemId + '" class="lnkMediaFolder navMenuOption" href="' + getItemHref(i, i.CollectionType) + '"><span class="material-icons navMenuOptionIcon ' + icon + '"></span><span class="sectionName navMenuOptionText">' + i.Name + '</span></a>';
|
return linkHtml;
|
||||||
}).join('');
|
}).join('');
|
||||||
libraryMenuOptions.innerHTML = html;
|
libraryMenuOptions.innerHTML = html;
|
||||||
var elem = libraryMenuOptions;
|
var elem = libraryMenuOptions;
|
||||||
var sidebarLinks = elem.querySelectorAll('.navMenuOption');
|
var sidebarLinks = elem.querySelectorAll('.navMenuOption');
|
||||||
|
|
||||||
for (var i = 0, length = sidebarLinks.length; i < length; i++) {
|
for (const sidebarLink of sidebarLinks) {
|
||||||
sidebarLinks[i].removeEventListener('click', onSidebarLinkClick);
|
sidebarLink.removeEventListener('click', onSidebarLinkClick);
|
||||||
sidebarLinks[i].addEventListener('click', onSidebarLinkClick);
|
sidebarLink.addEventListener('click', onSidebarLinkClick);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -936,6 +934,7 @@ define(['dom', 'layoutManager', 'inputManager', 'connectionManager', 'events', '
|
||||||
|
|
||||||
updateMenuForPageType(isDashboardPage, isLibraryPage);
|
updateMenuForPageType(isDashboardPage, isLibraryPage);
|
||||||
|
|
||||||
|
// TODO: Seems to do nothing? Check if needed (also in other views).
|
||||||
if (!e.detail.isRestored) {
|
if (!e.detail.isRestored) {
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,10 +69,11 @@ define(['loading', 'listView', 'cardBuilder', 'libraryMenu', 'libraryBrowser', '
|
||||||
showLoadingMessage();
|
showLoadingMessage();
|
||||||
var query = getQuery(view);
|
var query = getQuery(view);
|
||||||
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), query);
|
||||||
|
// TODO: promise2 is unused, check if necessary.
|
||||||
var promise2 = Dashboard.getCurrentUser();
|
var promise2 = Dashboard.getCurrentUser();
|
||||||
Promise.all([promise1, promise2]).then(function (responses) {
|
Promise.all([promise1, promise2]).then(function (responses) {
|
||||||
var result = responses[0];
|
var result = responses[0];
|
||||||
responses[1];
|
// TODO: Is the scroll necessary?
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
var html = '';
|
var html = '';
|
||||||
var viewStyle = getPageData(view).view;
|
var viewStyle = getPageData(view).view;
|
||||||
|
|
|
@ -375,8 +375,7 @@ var AppInfo = {};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function initRequireWithBrowser(browser) {
|
function initRequireWithBrowser() {
|
||||||
var bowerPath = getBowerPath();
|
|
||||||
var componentsPath = getComponentsPath();
|
var componentsPath = getComponentsPath();
|
||||||
var scriptsPath = getScriptsPath();
|
var scriptsPath = getScriptsPath();
|
||||||
|
|
||||||
|
@ -385,13 +384,7 @@ var AppInfo = {};
|
||||||
define('lazyLoader', [componentsPath + '/lazyLoader/lazyLoaderIntersectionObserver'], returnFirstDependency);
|
define('lazyLoader', [componentsPath + '/lazyLoader/lazyLoaderIntersectionObserver'], returnFirstDependency);
|
||||||
define('shell', [scriptsPath + '/shell'], returnFirstDependency);
|
define('shell', [scriptsPath + '/shell'], returnFirstDependency);
|
||||||
|
|
||||||
if ('registerElement' in document) {
|
define('registerElement', ['document-register-element'], returnFirstDependency);
|
||||||
define('registerElement', []);
|
|
||||||
} else if (browser.msie) {
|
|
||||||
define('registerElement', ['webcomponents'], returnFirstDependency);
|
|
||||||
} else {
|
|
||||||
define('registerElement', ['document-register-element'], returnFirstDependency);
|
|
||||||
}
|
|
||||||
|
|
||||||
define('alert', [componentsPath + '/alert'], returnFirstDependency);
|
define('alert', [componentsPath + '/alert'], returnFirstDependency);
|
||||||
|
|
||||||
|
@ -618,8 +611,8 @@ var AppInfo = {};
|
||||||
/* eslint-enable compat/compat */
|
/* eslint-enable compat/compat */
|
||||||
}
|
}
|
||||||
|
|
||||||
function onWebComponentsReady(browser) {
|
function onWebComponentsReady() {
|
||||||
initRequireWithBrowser(browser);
|
initRequireWithBrowser();
|
||||||
|
|
||||||
if (self.appMode === 'cordova' || self.appMode === 'android' || self.appMode === 'standalone') {
|
if (self.appMode === 'cordova' || self.appMode === 'android' || self.appMode === 'standalone') {
|
||||||
AppInfo.isNativeApp = true;
|
AppInfo.isNativeApp = true;
|
||||||
|
@ -1140,7 +1133,7 @@ var AppInfo = {};
|
||||||
});
|
});
|
||||||
})();
|
})();
|
||||||
|
|
||||||
return require(['browser'], onWebComponentsReady);
|
return onWebComponentsReady();
|
||||||
}();
|
}();
|
||||||
|
|
||||||
pageClassOn('viewshow', 'standalonePage', function () {
|
pageClassOn('viewshow', 'standalonePage', function () {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue