mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
697257670c
commit
02ae9ec81e
123 changed files with 13600 additions and 531 deletions
|
@ -15,6 +15,14 @@
|
|||
} else {
|
||||
$('#fldRunAtStartup', page).hide();
|
||||
}
|
||||
|
||||
if (systemInfo.CanSelfUpdate) {
|
||||
$('.fldAutomaticUpdates', page).show();
|
||||
} else {
|
||||
$('.fldAutomaticUpdates', page).hide();
|
||||
}
|
||||
|
||||
$('#chkEnableAutomaticServerUpdates', page).checked(config.EnableAutoUpdate).checkboxradio("refresh");
|
||||
$('#chkEnableAutomaticRestart', page).checked(config.EnableAutomaticRestart).checkboxradio("refresh");
|
||||
|
||||
if (systemInfo.CanSelfRestart) {
|
||||
|
@ -47,6 +55,7 @@
|
|||
config.RunAtStartup = $('#chkRunAtStartup', form).checked();
|
||||
config.SystemUpdateLevel = $('#selectAutomaticUpdateLevel', form).val();
|
||||
config.EnableAutomaticRestart = $('#chkEnableAutomaticRestart', form).checked();
|
||||
config.EnableAutoUpdate = $('#chkEnableAutomaticServerUpdates', form).checked();
|
||||
|
||||
config.EnableDashboardResourceMinification = $('#chkEnableMinification', form).checked();
|
||||
config.EnableDashboardResponseCaching = $('#chkEnableDashboardResponseCache', form).checked();
|
||||
|
|
|
@ -1347,9 +1347,17 @@
|
|||
|
||||
function refreshWithOptions(page, options) {
|
||||
|
||||
$('#refreshLoading', page).show();
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.refreshItem(currentItem.Id, options);
|
||||
|
||||
if (!ApiClient.isWebSocketOpen()) {
|
||||
|
||||
// For now this is a hack
|
||||
setTimeout(function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
}, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
function onWebSocketMessageReceived(e, data) {
|
||||
|
@ -1364,7 +1372,6 @@
|
|||
|
||||
Logger.log('Item updated - reloading metadata');
|
||||
reload(page);
|
||||
$('#refreshLoading', page).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
|
||||
function getPosterShape() {
|
||||
return enableScrollX() ? 'overflowportrait' : 'portrait';
|
||||
return enableScrollX() ? 'overflowPortrait' : 'portrait';
|
||||
}
|
||||
|
||||
function getSquareShape() {
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
var supportsTextTracks;
|
||||
var isViblastStarted;
|
||||
var requiresSettingStartTimeOnStart;
|
||||
|
||||
function htmlMediaRenderer(options) {
|
||||
|
||||
|
@ -13,6 +14,21 @@
|
|||
}
|
||||
|
||||
function onTimeUpdate() {
|
||||
|
||||
if (isViblastStarted) {
|
||||
|
||||
// This is a workaround for viblast not stopping playback at the end
|
||||
var time = this.currentTime;
|
||||
var duration = this.duration;
|
||||
|
||||
if (duration) {
|
||||
if (time >= duration) {
|
||||
MediaPlayer.nextTrack();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$(self).trigger('timeupdate');
|
||||
}
|
||||
|
||||
|
@ -54,8 +70,7 @@
|
|||
|
||||
function onLoadedMetadata() {
|
||||
|
||||
// The IE video player won't autoplay without this
|
||||
if ($.browser.msie) {
|
||||
if (!isViblastStarted) {
|
||||
this.play();
|
||||
}
|
||||
}
|
||||
|
@ -96,15 +111,9 @@
|
|||
return htmlMediaRenderer.customViblastKey || viblastKey;
|
||||
}
|
||||
|
||||
function onOneVideoPlaying() {
|
||||
function getStartTime(url) {
|
||||
|
||||
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||
|
||||
if (requiresNativeControls) {
|
||||
$(this).attr('controls', 'controls');
|
||||
}
|
||||
|
||||
var src = (self.currentSrc() || '').toLowerCase();
|
||||
var src = url;
|
||||
|
||||
var parts = src.split('#');
|
||||
|
||||
|
@ -114,15 +123,32 @@
|
|||
|
||||
if (parts.length == 2) {
|
||||
|
||||
var startPositionInSeekParam = parseFloat(parts[1]);
|
||||
return parseFloat(parts[1]);
|
||||
}
|
||||
}
|
||||
|
||||
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
||||
if (startPositionInSeekParam && src.indexOf('.m3u8') != -1) {
|
||||
var element = this;
|
||||
setTimeout(function () {
|
||||
element.currentTime = startPositionInSeekParam;
|
||||
}, 2500);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
function onOneVideoPlaying() {
|
||||
|
||||
var requiresNativeControls = !self.enableCustomVideoControls();
|
||||
|
||||
if (requiresNativeControls) {
|
||||
$(this).attr('controls', 'controls');
|
||||
}
|
||||
|
||||
if (requiresSettingStartTimeOnStart) {
|
||||
var src = (self.currentSrc() || '').toLowerCase();
|
||||
|
||||
var startPositionInSeekParam = getStartTime(src);
|
||||
|
||||
// Appending #t=xxx to the query string doesn't seem to work with HLS
|
||||
if (startPositionInSeekParam && src.indexOf('.m3u8') != -1) {
|
||||
var element = this;
|
||||
setTimeout(function () {
|
||||
element.currentTime = startPositionInSeekParam;
|
||||
}, 2500);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -298,6 +324,9 @@
|
|||
return;
|
||||
}
|
||||
|
||||
requiresSettingStartTimeOnStart = false;
|
||||
var startTime = getStartTime(val);
|
||||
|
||||
if (elem.tagName.toLowerCase() == 'audio') {
|
||||
|
||||
elem.src = val;
|
||||
|
@ -306,6 +335,15 @@
|
|||
}
|
||||
else {
|
||||
|
||||
if (startTime) {
|
||||
try {
|
||||
elem.currentTime = startTime;
|
||||
} catch (err) {
|
||||
// IE will throw an invalid state exception when trying to set currentTime before starting playback
|
||||
}
|
||||
requiresSettingStartTimeOnStart = elem.currentTime == 0;
|
||||
}
|
||||
|
||||
if (enableViblast(val)) {
|
||||
|
||||
setTracks(elem, tracks || []);
|
||||
|
@ -318,6 +356,7 @@
|
|||
isViblastStarted = true;
|
||||
|
||||
} else {
|
||||
|
||||
elem.src = val;
|
||||
|
||||
setTracks(elem, tracks || []);
|
||||
|
|
|
@ -128,15 +128,29 @@
|
|||
|
||||
var pageCount = pages.querySelectorAll('neon-animatable').length;
|
||||
|
||||
function allowSwipeOn(elem) {
|
||||
|
||||
if (elem.tagName == 'PAPER-SLIDER') {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (elem.classList) {
|
||||
return !elem.classList.contains('hiddenScrollX') && !elem.classList.contains('smoothScrollX');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function allowSwipe(e) {
|
||||
|
||||
var target = e.target;
|
||||
|
||||
if (target.classList.contains('noSwipe')) {
|
||||
return false;
|
||||
}
|
||||
if ($(target).parents('.noSwipe').length) {
|
||||
return false;
|
||||
var parent = target.parentNode;
|
||||
while (parent != null) {
|
||||
if (!allowSwipeOn(parent)) {
|
||||
return false;
|
||||
}
|
||||
parent = parent.parentNode;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -1157,11 +1157,6 @@
|
|||
|
||||
mediaRenderer.setCurrentSrc(videoUrl, item, mediaSource, tracks);
|
||||
|
||||
// IE wont autoplay without this
|
||||
if (videoUrl.indexOf('.m3u8') == -1) {
|
||||
mediaRenderer.unpause();
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
|
|
@ -54,10 +54,10 @@
|
|||
options.push({ name: '1080p - 25Mbps', maxHeight: 1080, bitrate: 25000000 });
|
||||
options.push({ name: '1080p - 20Mbps', maxHeight: 1080, bitrate: 20000000 });
|
||||
options.push({ name: '1080p - 15Mbps', maxHeight: 1080, bitrate: 15000000 });
|
||||
options.push({ name: '1080p - 10Mbps', maxHeight: 1080, bitrate: 10000000 });
|
||||
options.push({ name: '1080p - 8Mbps', maxHeight: 1080, bitrate: 8000000 });
|
||||
options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000000 });
|
||||
options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000000 });
|
||||
options.push({ name: '1080p - 10Mbps', maxHeight: 1080, bitrate: 10000001 });
|
||||
options.push({ name: '1080p - 8Mbps', maxHeight: 1080, bitrate: 8000001 });
|
||||
options.push({ name: '1080p - 6Mbps', maxHeight: 1080, bitrate: 6000001 });
|
||||
options.push({ name: '1080p - 5Mbps', maxHeight: 1080, bitrate: 5000001 });
|
||||
|
||||
} else if (maxAllowedWidth >= 1260) {
|
||||
options.push({ name: '720p - 10Mbps', maxHeight: 720, bitrate: 10000000 });
|
||||
|
@ -66,11 +66,11 @@
|
|||
options.push({ name: '720p - 5Mbps', maxHeight: 720, bitrate: 5000000 });
|
||||
|
||||
} else if (maxAllowedWidth >= 700) {
|
||||
options.push({ name: '480p - 4Mbps', maxHeight: 480, bitrate: 4000000 });
|
||||
options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000000 });
|
||||
options.push({ name: '480p - 4Mbps', maxHeight: 480, bitrate: 4000001 });
|
||||
options.push({ name: '480p - 3Mbps', maxHeight: 480, bitrate: 3000001 });
|
||||
options.push({ name: '480p - 2.5Mbps', maxHeight: 480, bitrate: 2500000 });
|
||||
options.push({ name: '480p - 2Mbps', maxHeight: 480, bitrate: 2000000 });
|
||||
options.push({ name: '480p - 1.5Mbps', maxHeight: 480, bitrate: 1500000 });
|
||||
options.push({ name: '480p - 2Mbps', maxHeight: 480, bitrate: 2000001 });
|
||||
options.push({ name: '480p - 1.5Mbps', maxHeight: 480, bitrate: 1500001 });
|
||||
}
|
||||
|
||||
if (maxAllowedWidth >= 1260) {
|
||||
|
@ -79,7 +79,7 @@
|
|||
options.push({ name: '720p - 2Mbps', maxHeight: 720, bitrate: 2000000 });
|
||||
|
||||
// The extra 1 is because they're keyed off the bitrate value
|
||||
options.push({ name: '720p - 1.5Mbps', maxHeight: 720, bitrate: 1500001 });
|
||||
options.push({ name: '720p - 1.5Mbps', maxHeight: 720, bitrate: 1500000 });
|
||||
options.push({ name: '720p - 1Mbps', maxHeight: 720, bitrate: 1000001 });
|
||||
}
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@
|
|||
if (result.Items.length) {
|
||||
html += '<h1 class="listHeader">' + Globalize.translate('HeaderResume') + '</h1>';
|
||||
if (enableScrollX()) {
|
||||
html += '<div class="hiddenScrollX itemsContainer noSwipe">';
|
||||
html += '<div class="hiddenScrollX itemsContainer">';
|
||||
} else {
|
||||
html += '<div class="itemsContainer">';
|
||||
}
|
||||
|
|
|
@ -647,7 +647,7 @@ var Dashboard = {
|
|||
var apiClient = ApiClient;
|
||||
|
||||
if (apiClient && apiClient.accessToken()) {
|
||||
if (apiClient.enableFooterNotifications) {
|
||||
if (AppInfo.enableFooterNotifications) {
|
||||
apiClient.getSystemInfo().done(function (info) {
|
||||
|
||||
Dashboard.updateSystemInfo(info);
|
||||
|
@ -1246,7 +1246,7 @@ var Dashboard = {
|
|||
|
||||
var newItems = data.ItemsAdded;
|
||||
|
||||
if (!newItems.length) {
|
||||
if (!newItems.length || AppInfo.isNativeApp) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1778,7 +1778,7 @@ var AppInfo = {};
|
|||
|
||||
function initFastClick() {
|
||||
|
||||
require(["thirdparty/fastclick"], function (FastClick) {
|
||||
require(["bower_components/fastclick/lib/fastclick"], function (FastClick) {
|
||||
|
||||
FastClick.attach(document.body);
|
||||
|
||||
|
@ -1845,6 +1845,10 @@ var AppInfo = {};
|
|||
}
|
||||
}
|
||||
|
||||
if ($.browser.msie && ($.browser.version || 11) <= 10) {
|
||||
Dashboard.importCss('thirdparty/paper-ie10.css');
|
||||
}
|
||||
|
||||
if ($.browser.safari && $.browser.mobile) {
|
||||
initFastClick();
|
||||
}
|
||||
|
@ -1989,8 +1993,8 @@ var AppInfo = {};
|
|||
return {};
|
||||
});
|
||||
|
||||
if (Dashboard.isRunningInCordova() && $.browser.safari) {
|
||||
define("actionsheet", ["cordova/ios/actionsheet"]);
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
define("actionsheet", ["cordova/actionsheet"]);
|
||||
} else {
|
||||
define("actionsheet", ["scripts/actionsheet"]);
|
||||
}
|
||||
|
@ -2011,48 +2015,45 @@ var AppInfo = {};
|
|||
|
||||
$.extend(AppInfo, Dashboard.getAppInfo(appName, deviceId, deviceName));
|
||||
|
||||
$(document).on('WebComponentsReady', function () {
|
||||
var drawer = document.querySelector('.mainDrawerPanel');
|
||||
drawer.classList.remove('mainDrawerPanelPreInit');
|
||||
drawer.forceNarrow = true;
|
||||
drawer.drawerWidth = screen.availWidth >= 330 ? "310px" : "270px";
|
||||
|
||||
var drawer = document.querySelector('.mainDrawerPanel');
|
||||
drawer.classList.remove('mainDrawerPanelPreInit');
|
||||
drawer.forceNarrow = true;
|
||||
drawer.drawerWidth = screen.availWidth >= 330 ? "310px" : "270px";
|
||||
if ($.browser.safari && !AppInfo.isNativeApp) {
|
||||
drawer.disableEdgeSwipe = true;
|
||||
}
|
||||
|
||||
if ($.browser.safari && !AppInfo.isNativeApp) {
|
||||
drawer.disableEdgeSwipe = true;
|
||||
if (Dashboard.isConnectMode()) {
|
||||
|
||||
if (AppInfo.isNativeApp && $.browser.android) {
|
||||
require(['cordova/android/logging']);
|
||||
}
|
||||
|
||||
if (Dashboard.isConnectMode()) {
|
||||
require(['appstorage'], function () {
|
||||
|
||||
if (AppInfo.isNativeApp && $.browser.android) {
|
||||
require(['cordova/android/logging']);
|
||||
}
|
||||
|
||||
require(['appstorage'], function () {
|
||||
|
||||
capabilities.DeviceProfile = MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
|
||||
createConnectionManager(capabilities).done(function () {
|
||||
$(function () {
|
||||
onDocumentReady();
|
||||
Dashboard.initPromiseDone = true;
|
||||
$.mobile.initializePage();
|
||||
deferred.resolve();
|
||||
});
|
||||
capabilities.DeviceProfile = MediaPlayer.getDeviceProfile(Math.max(screen.height, screen.width));
|
||||
createConnectionManager(capabilities).done(function () {
|
||||
$(function () {
|
||||
onDocumentReady();
|
||||
Dashboard.initPromiseDone = true;
|
||||
$.mobile.initializePage();
|
||||
deferred.resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
} else {
|
||||
createConnectionManager(capabilities);
|
||||
} else {
|
||||
createConnectionManager(capabilities);
|
||||
|
||||
$(function () {
|
||||
$(function () {
|
||||
|
||||
onDocumentReady();
|
||||
Dashboard.initPromiseDone = true;
|
||||
$.mobile.initializePage();
|
||||
deferred.resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
onDocumentReady();
|
||||
Dashboard.initPromiseDone = true;
|
||||
$.mobile.initializePage();
|
||||
deferred.resolve();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function initCordovaWithDeviceId(deferred, deviceId) {
|
||||
|
@ -2086,11 +2087,13 @@ var AppInfo = {};
|
|||
setAppInfo();
|
||||
setDocumentClasses();
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
initCordova(initDeferred);
|
||||
} else {
|
||||
init(initDeferred, Dashboard.capabilities());
|
||||
}
|
||||
$(document).on('WebComponentsReady', function () {
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
initCordova(initDeferred);
|
||||
} else {
|
||||
init(initDeferred, Dashboard.capabilities());
|
||||
}
|
||||
});
|
||||
|
||||
})();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue