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

create option for bold subtitles

This commit is contained in:
Danny Michel 2022-05-11 14:08:01 -04:00 committed by Dmitry Lyzo
parent 4d75c88e28
commit add1bbf285
5 changed files with 23 additions and 0 deletions

View file

@ -28,6 +28,16 @@ function getTextStyles(settings, preview) {
break;
}
switch (settings.textWeight || '') {
case 'bold':
list.push({ name: 'font-weight', value: 'bold' });
break;
case 'normal':
default:
list.push({ name: 'font-weight', value: 'normal' });
break;
}
switch (settings.dropShadow || '') {
case 'raised':
list.push({ name: 'text-shadow', value: '-1px -1px white, 0px -1px white, -1px 0px white, 1px 1px black, 0px 1px black, 1px 0px black' });

View file

@ -28,6 +28,7 @@ function getSubtitleAppearanceObject(context) {
const appearanceSettings = {};
appearanceSettings.textSize = context.querySelector('#selectTextSize').value;
appearanceSettings.textWeight = context.querySelector('#selectTextWeight').value;
appearanceSettings.dropShadow = context.querySelector('#selectDropShadow').value;
appearanceSettings.font = context.querySelector('#selectFont').value;
appearanceSettings.textBackground = context.querySelector('#inputTextBackground').value;
@ -53,6 +54,7 @@ function loadForm(context, user, userSettings, appearanceSettings, apiClient) {
context.querySelector('#selectSubtitlePlaybackMode').dispatchEvent(new CustomEvent('change', {}));
context.querySelector('#selectTextSize').value = appearanceSettings.textSize || '';
context.querySelector('#selectTextWeight').value = appearanceSettings.textWeight || 'normal';
context.querySelector('#selectDropShadow').value = appearanceSettings.dropShadow || '';
context.querySelector('#inputTextBackground').value = appearanceSettings.textBackground || 'transparent';
context.querySelector('#inputTextColor').value = appearanceSettings.textColor || '#ffffff';
@ -166,6 +168,7 @@ function embed(options, self) {
options.element.querySelector('#selectSubtitlePlaybackMode').addEventListener('change', onSubtitleModeChange);
options.element.querySelector('#selectTextSize').addEventListener('change', onAppearanceFieldChange);
options.element.querySelector('#selectTextWeight').addEventListener('change', onAppearanceFieldChange);
options.element.querySelector('#selectDropShadow').addEventListener('change', onAppearanceFieldChange);
options.element.querySelector('#selectFont').addEventListener('change', onAppearanceFieldChange);
options.element.querySelector('#inputTextColor').addEventListener('change', onAppearanceFieldChange);

View file

@ -72,6 +72,13 @@
</select>
</div>
<div class="selectContainer">
<select is="emby-select" id="selectTextWeight" label="${LabelTextWeight}">
<option value="normal">${Normal}</option>
<option value="bold">${Bold}</option>
</select>
</div>
<div class="selectContainer">
<select is="emby-select" id="selectFont" label="${LabelFont}">
<option value="">${Default}</option>