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

fix some other code clarity issues

This commit is contained in:
dkanada 2019-03-09 11:37:40 +09:00
parent 06d2154434
commit 90290d30db
5 changed files with 28 additions and 26 deletions

View file

@ -143,6 +143,7 @@ define(["appSettings", "browser", "events", "htmlMediaHelper"], function(appSett
features.push("displaylanguage"); features.push("displaylanguage");
features.push("otherapppromotions"); features.push("otherapppromotions");
features.push("targetblank"); features.push("targetblank");
// allows users to connect to more than one server
//features.push("multiserver"); //features.push("multiserver");
browser.orsay || browser.tizen || browser.msie || !(browser.firefox || browser.ps4 || browser.edge || cueSupported()) || features.push("subtitleappearancesettings"); browser.orsay || browser.tizen || browser.msie || !(browser.firefox || browser.ps4 || browser.edge || cueSupported()) || features.push("subtitleappearancesettings");
browser.orsay || browser.tizen || features.push("subtitleburnsettings"); browser.orsay || browser.tizen || features.push("subtitleburnsettings");

View file

@ -10,8 +10,8 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
page.querySelector("#txtCachePath").value = config.CachePath || ""; page.querySelector("#txtCachePath").value = config.CachePath || "";
$("#txtMetadataPath", page).val(config.MetadataPath || ""); $("#txtMetadataPath", page).val(config.MetadataPath || "");
$("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || ""); $("#txtMetadataNetworkPath", page).val(config.MetadataNetworkPath || "");
$("#selectLocalizationLanguage", page).html(languageOptions.map(function(l) { $("#selectLocalizationLanguage", page).html(languageOptions.map(function(language) {
return '<option value="' + l.Value + '">' + l.Name + "</option>" return '<option value="' + language.Value + '">' + language.Name + "</option>"
})).val(config.UICulture); })).val(config.UICulture);
currentLanguage = config.UICulture; currentLanguage = config.UICulture;
if (systemInfo.CanSelfUpdate) { if (systemInfo.CanSelfUpdate) {
@ -43,10 +43,7 @@ define(["jQuery", "loading", "fnchecked", "emby-checkbox", "emby-textarea", "emb
config.CachePath = form.querySelector("#txtCachePath").value; config.CachePath = form.querySelector("#txtCachePath").value;
config.MetadataPath = $("#txtMetadataPath", form).val(); config.MetadataPath = $("#txtMetadataPath", form).val();
config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val(); config.MetadataNetworkPath = $("#txtMetadataNetworkPath", form).val();
var requiresReload = false; var requiresReload = (config.UICulture !== currentLanguage);
if (config.UICulture !== currentLanguage) {
requiresReload = true;
}
config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked(); config.EnableAutomaticRestart = $("#chkEnableAutomaticRestart", form).checked();
config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked(); config.EnableAutoUpdate = $("#chkEnableAutomaticServerUpdates", form).checked();
ApiClient.updateServerConfiguration(config).then(function() { ApiClient.updateServerConfiguration(config).then(function() {

View file

@ -8,12 +8,14 @@ define(["globalize", "loading", "libraryMenu", "dom", "emby-input", "emby-button
function fillTypes(view, currentId) { function fillTypes(view, currentId) {
ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types) { ApiClient.getJSON(ApiClient.getUrl("LiveTv/TunerHosts/Types")).then(function(types) {
var selectType = view.querySelector(".selectType"); var selectType = view.querySelector(".selectType");
selectType.innerHTML = types.map(function(t) { var html = "";
return '<option value="' + t.Id + '">' + t.Name + "</option>"; html += types.map(function(tuner) {
return '<option value="' + tuner.Id + '">' + tuner.Name + "</option>";
}).join(""); }).join("");
selectType.innerHTML += '<option value="other">'; html += '<option value="other">';
selectType.innerHTML += globalize.translate("TabOther"); html += globalize.translate("TabOther");
selectType.innerHTML += "</option>"; html += "</option>";
selectType.innerHTML = html;
selectType.disabled = null != currentId; selectType.disabled = null != currentId;
selectType.value = ""; selectType.value = "";
@ -39,9 +41,10 @@ define(["globalize", "loading", "libraryMenu", "dom", "emby-input", "emby-button
var selectType = view.querySelector(".selectType"); var selectType = view.querySelector(".selectType");
var type = info.Type || ""; var type = info.Type || "";
if (info.Source && isM3uVariant(info.Source)) { if (info.Source && isM3uVariant(info.Source)) {
selectType.value = info.Source; type = info.Source;
onTypeChange.call(selectType);
} }
selectType.value = type;
onTypeChange.call(selectType);
view.querySelector(".txtDevicePath").value = info.Url || ""; view.querySelector(".txtDevicePath").value = info.Url || "";
view.querySelector(".txtFriendlyName").value = info.FriendlyName || ""; view.querySelector(".txtFriendlyName").value = info.FriendlyName || "";
view.querySelector(".txtUserAgent").value = info.UserAgent || ""; view.querySelector(".txtUserAgent").value = info.UserAgent || "";

View file

@ -7,10 +7,10 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton
var html = ""; var html = "";
var lastCategory = ""; var lastCategory = "";
var showHelp = true; var showHelp = true;
html += list.map(function(i) { html += list.map(function(notification) {
var itemHtml = ""; var itemHtml = "";
if (i.Category !== lastCategory) { if (notification.Category !== lastCategory) {
lastCategory = i.Category; lastCategory = notification.Category;
if (lastCategory) { if (lastCategory) {
itemHtml += "</div>"; itemHtml += "</div>";
itemHtml += "</div>"; itemHtml += "</div>";
@ -18,7 +18,7 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton
itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">'; itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">';
itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">'; itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">';
itemHtml += '<h2 class="sectionTitle">'; itemHtml += '<h2 class="sectionTitle">';
itemHtml += i.Category; itemHtml += notification.Category;
itemHtml += "</h2>"; itemHtml += "</h2>";
if (showHelp) { if (showHelp) {
showHelp = false; showHelp = false;
@ -29,14 +29,14 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton
itemHtml += "</div>"; itemHtml += "</div>";
itemHtml += '<div class="paperList">'; itemHtml += '<div class="paperList">';
} }
itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + i.Type + '">'; itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + notification.Type + '">';
if (i.Enabled) { if (notification.Enabled) {
itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>'; itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>';
} else { } else {
itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>'; itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>';
} }
itemHtml += '<div class="listItemBody">'; itemHtml += '<div class="listItemBody">';
itemHtml += '<div class="listItemBodyText">' + i.Name + "</div>"; itemHtml += '<div class="listItemBodyText">' + notification.Name + "</div>";
itemHtml += "</div>"; itemHtml += "</div>";
itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>'; itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>';
itemHtml += "</a>"; itemHtml += "</a>";

View file

@ -59,15 +59,19 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
return 0; return 0;
}); });
var i__q;
var length; var length;
var plugin; var plugin;
var currentCategory; var currentCategory;
var html = ""; var html = "";
var hasOpenTag = false; var hasOpenTag = false;
for (currentCategory = null, false === options.showCategory && (html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = true), i__q = 0, length = availablePlugins.length; i__q < length; i__q++) { currentCategory = null;
plugin = availablePlugins[i__q]; if (options.showCategory === false) {
html += '<div class="itemsContainer vertical-wrap">';
hasOpenTag = true;
}
for (var i = 0; i < availablePlugins.length; i++) {
plugin = availablePlugins[i];
var category = plugin.categoryDisplayName; var category = plugin.categoryDisplayName;
if (category != currentCategory) { if (category != currentCategory) {
@ -77,16 +81,13 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
html += "</div>"; html += "</div>";
html += "</div>"; html += "</div>";
} }
html += '<div class="verticalSection">'; html += '<div class="verticalSection">';
html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>"; html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>";
html += '<div class="itemsContainer vertical-wrap">'; html += '<div class="itemsContainer vertical-wrap">';
hasOpenTag = true; hasOpenTag = true;
} }
currentCategory = category; currentCategory = category;
} }
html += getPluginHtml(plugin, options, installedPlugins); html += getPluginHtml(plugin, options, installedPlugins);
} }