mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update some strings and use fetch for the global config
This commit is contained in:
parent
ea9e79f4d3
commit
ed1b35f50f
8 changed files with 34 additions and 53 deletions
|
@ -278,7 +278,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper", "webSettings"], f
|
|||
features.push("targetblank");
|
||||
features.push("screensaver");
|
||||
|
||||
if (webSettings.getMultiserver()) {
|
||||
if (webSettings.getMultiServer()) {
|
||||
features.push("multiserver")
|
||||
}
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
<div class="selectContainer fldDateTimeLocale hide">
|
||||
<select is="emby-select" class="selectDateTimeLocale" label="${LabelDateTimeLocale}">
|
||||
<option value="">${AutoBasedOnLanguageSetting}</option>
|
||||
<option value="">${Auto}</option>
|
||||
<option value="ar">Arabic</option>
|
||||
<option value="be-BY">Belarusian (Belarus)</option>
|
||||
<option value="bg-BG">Bulgarian (Bulgaria)</option>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdrop', 'globalize', 'require', 'appSettings'], function (appHost, userSettings, browser, events, pluginManager, backdrop, globalize, require, appSettings) {
|
||||
define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdrop', 'globalize', 'require', 'appSettings', 'webSettings'], function (appHost, userSettings, browser, events, pluginManager, backdrop, globalize, require, appSettings, webSettings) {
|
||||
'use strict';
|
||||
|
||||
var themeStyleElement;
|
||||
|
@ -116,8 +116,8 @@ define(['apphost', 'userSettings', 'browser', 'events', 'pluginManager', 'backdr
|
|||
|
||||
var linkUrl = info.stylesheetPath;
|
||||
unloadTheme();
|
||||
var link = document.createElement('link');
|
||||
|
||||
var link = document.createElement('link');
|
||||
link.setAttribute('rel', 'stylesheet');
|
||||
link.setAttribute('type', 'text/css');
|
||||
link.onload = function () {
|
||||
|
|
|
@ -2,15 +2,11 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
"use strict";
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''>" + globalize.translate('AnyLanguage') + "</option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.ThreeLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
|
@ -18,7 +14,6 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
}
|
||||
|
||||
function getSubtitleAppearanceObject(context) {
|
||||
|
||||
var appearanceSettings = {};
|
||||
|
||||
appearanceSettings.textSize = context.querySelector('#selectTextSize').value;
|
||||
|
@ -102,14 +97,12 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
}
|
||||
|
||||
function onSubmit(e) {
|
||||
|
||||
var self = this;
|
||||
var apiClient = connectionManager.getApiClient(self.options.serverId);
|
||||
var userId = self.options.userId;
|
||||
var userSettings = self.options.userSettings;
|
||||
|
||||
userSettings.setUserInfo(userId, apiClient).then(function () {
|
||||
|
||||
var enableSaveConfirmation = self.options.enableSaveConfirmation;
|
||||
save(self, self.options.element, userId, userSettings, apiClient, enableSaveConfirmation);
|
||||
});
|
||||
|
@ -118,6 +111,7 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -197,9 +191,7 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
var userSettings = self.options.userSettings;
|
||||
|
||||
apiClient.getUser(userId).then(function (user) {
|
||||
|
||||
userSettings.setUserInfo(userId, apiClient).then(function () {
|
||||
|
||||
self.dataLoaded = true;
|
||||
|
||||
var appearanceSettings = userSettings.getSubtitleAppearanceSettings(self.options.appearanceKey);
|
||||
|
@ -214,9 +206,8 @@ define(['require', 'globalize', 'appSettings', 'apphost', 'focusManager', 'loadi
|
|||
};
|
||||
|
||||
SubtitleSettings.prototype.destroy = function () {
|
||||
|
||||
this.options = null;
|
||||
};
|
||||
|
||||
return SubtitleSettings;
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
<form style="margin:0 auto;">
|
||||
|
||||
<div class="verticalSection">
|
||||
|
||||
<h2 class="sectionTitle">
|
||||
${Subtitles}
|
||||
</h2>
|
||||
|
@ -9,6 +7,7 @@
|
|||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectSubtitleLanguage" label="${LabelPreferredSubtitleLanguage}"></select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectSubtitlePlaybackMode" label="${LabelSubtitlePlaybackMode}">
|
||||
<option value="Default">${Default}</option>
|
||||
|
@ -23,6 +22,7 @@
|
|||
<div class="fieldDescription subtitlesOnlyForcedHelp subtitlesHelp hide">${OnlyForcedSubtitlesHelp}</div>
|
||||
<div class="fieldDescription subtitlesNoneHelp subtitlesHelp hide">${NoSubtitlesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer fldBurnIn hide">
|
||||
<select is="emby-select" id="selectSubtitleBurnIn" label="${LabelBurnSubtitles}">
|
||||
<option value="">${Auto}</option>
|
||||
|
@ -34,7 +34,6 @@
|
|||
</div>
|
||||
|
||||
<div class="verticalSection subtitleAppearanceSection hide">
|
||||
|
||||
<h2 class="sectionTitle">
|
||||
${HeaderSubtitleAppearance}
|
||||
</h2>
|
||||
|
@ -61,6 +60,7 @@
|
|||
<option value="extralarge">${ExtraLarge}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectFont" label="${LabelFont}">
|
||||
<option value="">${Default}</option>
|
||||
|
@ -71,12 +71,15 @@
|
|||
<option value="smallcaps">${SmallCaps}</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="inputContainer hide">
|
||||
<input is="emby-input" id="inputTextBackground" label="${LabelTextBackgroundColor}" type="text" />
|
||||
</div>
|
||||
|
||||
<div class="inputContainer hide">
|
||||
<input is="emby-input" id="inputTextColor" label="${LabelTextColor}" type="text" />
|
||||
</div>
|
||||
|
||||
<div class="selectContainer">
|
||||
<select is="emby-select" id="selectDropShadow" label="${LabelDropShadow}">
|
||||
<option value="none">${None}</option>
|
||||
|
@ -91,4 +94,4 @@
|
|||
<button is="emby-button" type="submit" class="raised button-submit block btnSave hide">
|
||||
<span>${Save}</span>
|
||||
</button>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
@ -20,6 +20,14 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
return this.get('enableAutoLogin') !== 'false';
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
|
||||
if (val != null) {
|
||||
this.set('enableSystemExternalPlayers', val.toString());
|
||||
}
|
||||
|
||||
return this.get('enableSystemExternalPlayers') === 'true';
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableAutomaticBitrateDetection = function (isInNetwork, mediaType, val) {
|
||||
var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork;
|
||||
if (val != null) {
|
||||
|
@ -123,13 +131,5 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
return appStorage.getItem(getKey(name, userId));
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
|
||||
if (val != null) {
|
||||
this.set('enableSystemExternalPlayers', val.toString());
|
||||
}
|
||||
|
||||
return this.get('enableSystemExternalPlayers') === 'true';
|
||||
};
|
||||
|
||||
return new AppSettings();
|
||||
});
|
||||
|
|
|
@ -1,29 +1,16 @@
|
|||
define(['appStorage', 'events'], function (appStorage, events) {
|
||||
'use strict';
|
||||
|
||||
function readConfig(path, callback) {
|
||||
var file = new XMLHttpRequest();
|
||||
file.overrideMimeType("application/json");
|
||||
file.open("GET", path, true);
|
||||
file.onreadystatechange = function() {
|
||||
if (file.readyState === 4 && file.status == "200") {
|
||||
callback(file.responseText);
|
||||
}
|
||||
}
|
||||
|
||||
file.send(null);
|
||||
}
|
||||
|
||||
var data = {};
|
||||
|
||||
function WebSettings() {
|
||||
readConfig("/config.json", function(text) {
|
||||
data = JSON.parse(text);
|
||||
});
|
||||
fetch("/config.json").then(function (response) {
|
||||
data = response.json();
|
||||
})
|
||||
}
|
||||
|
||||
WebSettings.prototype.getMultiserver = function () {
|
||||
return data.multiserver !== false;
|
||||
WebSettings.prototype.getMultiServer = function () {
|
||||
return data.multiServer || false;
|
||||
};
|
||||
|
||||
return new WebSettings();
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
"Alerts": "Alerts",
|
||||
"All": "All",
|
||||
"AllChannels": "All channels",
|
||||
"AllComplexFormats": "All complex formats (ASS, SSA, VOBSUB, PGS, SUB/IDX, etc.)",
|
||||
"AllComplexFormats": "All Complex Formats (ASS, SSA, VOBSUB, PGS, SUB, IDX)",
|
||||
"AllEpisodes": "All episodes",
|
||||
"AllLanguages": "All languages",
|
||||
"AllLibraries": "All libraries",
|
||||
|
@ -27,9 +27,9 @@
|
|||
"AllowRemoteAccess": "Allow remote connections to this Jellyfin Server.",
|
||||
"AllowRemoteAccessHelp": "If unchecked, all remote connections will be blocked.",
|
||||
"AllowedRemoteAddressesHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be allowed to connect remotely. If left blank, all remote addresses will be allowed.",
|
||||
"AlwaysPlaySubtitles": "Always play subtitles",
|
||||
"AlwaysPlaySubtitles": "Always Play",
|
||||
"AlwaysPlaySubtitlesHelp": "Subtitles matching the language preference will be loaded regardless of the audio language.",
|
||||
"AnyLanguage": "Any language",
|
||||
"AnyLanguage": "Any Language",
|
||||
"Anytime": "Anytime",
|
||||
"AroundTime": "Around {0}",
|
||||
"Art": "Art",
|
||||
|
@ -55,7 +55,7 @@
|
|||
"BoxRear": "Box (rear)",
|
||||
"Browse": "Browse",
|
||||
"BrowsePluginCatalogMessage": "Browse our plugin catalog to view available plugins.",
|
||||
"BurnSubtitlesHelp": "Determines if the server should burn in subtitles when converting video depending on the subtitle format. Avoiding burning in subtitles will improve server performance. Select Auto to burn image based formats (VOBSUB, PGS, SUB/IDX, etc) and certain ASS/SSA subtitles.",
|
||||
"BurnSubtitlesHelp": "Determines if the server should burn in subtitles when transcoding videos. Avoiding this will greatly improve performance. Select Auto to burn image based formats (VOBSUB, PGS, SUB, IDX) and certain ASS or SSA subtitles.",
|
||||
"ButtonAdd": "Add",
|
||||
"ButtonAddImage": "Add Image",
|
||||
"ButtonAddMediaLibrary": "Add Media Library",
|
||||
|
@ -199,7 +199,7 @@
|
|||
"DisplayInOtherHomeScreenSections": "Display in home screen sections such as latest media and continue watching",
|
||||
"DisplayMissingEpisodesWithinSeasons": "Display missing episodes within seasons",
|
||||
"DisplayMissingEpisodesWithinSeasonsHelp": "This must also be enabled for TV libraries in the server configuration.",
|
||||
"DisplayModeHelp": "Select the type of screen you're running Jellyfin on.",
|
||||
"DisplayModeHelp": "Select the layout style you want for the interface.",
|
||||
"DoNotRecord": "Do not record",
|
||||
"Down": "Down",
|
||||
"Download": "Download",
|
||||
|
@ -1036,16 +1036,16 @@
|
|||
"NoNextUpItemsMessage": "None found. Start watching your shows!",
|
||||
"NoPluginConfigurationMessage": "This plugin has no settings to configure.",
|
||||
"NoSubtitleSearchResultsFound": "No results found.",
|
||||
"NoSubtitles": "No subtitles",
|
||||
"NoSubtitles": "None",
|
||||
"NoSubtitlesHelp": "Subtitles will not be loaded by default. They can still be turned on manually during playback.",
|
||||
"None": "None",
|
||||
"Normal": "Normal",
|
||||
"NumLocationsValue": "{0} folders",
|
||||
"Off": "Off",
|
||||
"OneChannel": "One channel",
|
||||
"OnlyForcedSubtitles": "Only forced subtitles",
|
||||
"OnlyForcedSubtitles": "Only Forced",
|
||||
"OnlyForcedSubtitlesHelp": "Only subtitles marked as forced will be loaded.",
|
||||
"OnlyImageFormats": "Only image formats (VOBSUB, PGS, SUB, etc)",
|
||||
"OnlyImageFormats": "Only Image Formats (VOBSUB, PGS, SUB)",
|
||||
"Option3D": "3D",
|
||||
"OptionAdminUsers": "Administrators",
|
||||
"OptionAlbum": "Album",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue