Merge remote-tracking branch 'upstream/master' into fix-subtitle-line-spacing
Conflicts: src/components/subtitlesettings/subtitleappearancehelper.js src/plugins/htmlVideoPlayer/plugin.js
This commit is contained in:
commit
48886918d3
278 changed files with 2125 additions and 5109 deletions
|
@ -1,4 +1,3 @@
|
|||
import require from 'require';
|
||||
import globalize from 'globalize';
|
||||
import appHost from 'apphost';
|
||||
import appSettings from 'appSettings';
|
||||
|
@ -37,9 +36,7 @@ function getSubtitleAppearanceObject(context) {
|
|||
}
|
||||
|
||||
function loadForm(context, user, userSettings, appearanceSettings, apiClient) {
|
||||
|
||||
apiClient.getCultures().then(function (allCultures) {
|
||||
|
||||
if (appHost.supports('subtitleburnsettings') && user.Policy.EnableVideoPlaybackTranscoding) {
|
||||
context.querySelector('.fldBurnIn').classList.remove('hide');
|
||||
}
|
||||
|
@ -71,7 +68,6 @@ function loadForm(context, user, userSettings, appearanceSettings, apiClient) {
|
|||
}
|
||||
|
||||
function saveUser(context, user, userSettingsInstance, appearanceKey, apiClient) {
|
||||
|
||||
let appearanceSettings = userSettingsInstance.getSubtitleAppearanceSettings(appearanceKey);
|
||||
appearanceSettings = Object.assign(appearanceSettings, getSubtitleAppearanceObject(context));
|
||||
|
||||
|
@ -84,15 +80,12 @@ function saveUser(context, user, userSettingsInstance, appearanceKey, apiClient)
|
|||
}
|
||||
|
||||
function save(instance, context, userId, userSettings, apiClient, enableSaveConfirmation) {
|
||||
|
||||
loading.show();
|
||||
|
||||
appSettings.set('subtitleburnin', context.querySelector('#selectSubtitleBurnIn').value);
|
||||
|
||||
apiClient.getUser(userId).then(function (user) {
|
||||
|
||||
saveUser(context, user, userSettings, instance.appearanceKey, apiClient).then(function () {
|
||||
|
||||
loading.hide();
|
||||
if (enableSaveConfirmation) {
|
||||
import('toast').then(({default: toast}) => {
|
||||
|
@ -101,7 +94,6 @@ function save(instance, context, userId, userSettings, apiClient, enableSaveConf
|
|||
}
|
||||
|
||||
events.trigger(instance, 'saved');
|
||||
|
||||
}, function () {
|
||||
loading.hide();
|
||||
});
|
||||
|
@ -109,7 +101,6 @@ function save(instance, context, userId, userSettings, apiClient, enableSaveConf
|
|||
}
|
||||
|
||||
function onSubtitleModeChange(e) {
|
||||
|
||||
let view = dom.parentWithClass(e.target, 'subtitlesettings');
|
||||
|
||||
let subtitlesHelp = view.querySelectorAll('.subtitlesHelp');
|
||||
|
@ -120,7 +111,6 @@ function onSubtitleModeChange(e) {
|
|||
}
|
||||
|
||||
function onAppearanceFieldChange(e) {
|
||||
|
||||
let view = dom.parentWithClass(e.target, 'subtitlesettings');
|
||||
|
||||
let appearanceSettings = getSubtitleAppearanceObject(view);
|
||||
|
@ -169,9 +159,7 @@ function hideSubtitlePreview(persistent) {
|
|||
}
|
||||
|
||||
function embed(options, self) {
|
||||
|
||||
import('text!./subtitlesettings.template.html').then(({default: template}) => {
|
||||
|
||||
options.element.classList.add('subtitlesettings');
|
||||
options.element.innerHTML = globalize.translateHtml(template, 'core');
|
||||
|
||||
|
@ -231,9 +219,7 @@ function embed(options, self) {
|
|||
}
|
||||
|
||||
export class SubtitleSettings {
|
||||
|
||||
constructor(options) {
|
||||
|
||||
this.options = options;
|
||||
|
||||
embed(options, this);
|
||||
|
@ -275,7 +261,6 @@ export class SubtitleSettings {
|
|||
let userSettings = self.options.userSettings;
|
||||
|
||||
userSettings.setUserInfo(userId, apiClient).then(function () {
|
||||
|
||||
let enableSaveConfirmation = self.options.enableSaveConfirmation;
|
||||
save(self, self.options.element, userId, userSettings, apiClient, enableSaveConfirmation);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue