mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Apply suggestions from code review
This commit is contained in:
parent
bf03a7ba57
commit
aa12a79625
9 changed files with 29 additions and 22 deletions
|
@ -2,8 +2,8 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function authorizeRequest(event) {
|
function authorizeRequest(event) {
|
||||||
var lookup = event.data.lookup;
|
let lookup = event.data.lookup;
|
||||||
var url = ApiClient.getUrl("/QuickConnect/Authorize");
|
let url = ApiClient.getUrl("/QuickConnect/Authorize");
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: url,
|
url: url,
|
||||||
|
@ -23,12 +23,12 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
QuickConnectSettings.prototype.list = function(argPage) {
|
QuickConnectSettings.prototype.list = function(argPage) {
|
||||||
ApiClient.getJSON("/QuickConnect/List").then(json => {
|
ApiClient.getJSON("/QuickConnect/List").then(json => {
|
||||||
let found = false;
|
let found = false;
|
||||||
var elem = $(argPage.querySelector("#quickConnectIncoming"));
|
var elem = argPage.querySelector('#quickConnectIncoming');
|
||||||
elem.text("No pending login requests");
|
elem.innerText = globalize.translate('QuickConnectNoPending');
|
||||||
|
|
||||||
for (var i = 0; i < json.length; i++) {
|
for (var i = 0; i < json.length; i++) {
|
||||||
if (!found) {
|
if (!found) {
|
||||||
elem.html("");
|
elem.innerHTML = "";
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,13 +40,11 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
html += '<div class="listItemBodyText secondary listItemBodyText-nowrap">';
|
html += '<div class="listItemBodyText secondary listItemBodyText-nowrap">';
|
||||||
|
|
||||||
if (!current.Authenticated) {
|
if (!current.Authenticated) {
|
||||||
html += '<a style="color:rgb(15,150,255)" href="#" id="qc' + current.Lookup + '">authorize</a>';
|
html += '<a style="color:rgb(15,150,255)" href="#" id="qc' + current.Lookup + '">' + globalize.translate('Authorize') + '</a>';
|
||||||
} else {
|
|
||||||
html += " (authorized)";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '</div></div></div>';
|
html += '</div></div></div>';
|
||||||
elem.append(html);
|
elem.innerHTML += html;
|
||||||
|
|
||||||
$("#qc" + current.Lookup).click({ lookup: current.Lookup }, authorizeRequest);
|
$("#qc" + current.Lookup).click({ lookup: current.Lookup }, authorizeRequest);
|
||||||
$("#div" + current.Lookup).click({ lookup: current.Lookup }, authorizeRequest);
|
$("#div" + current.Lookup).click({ lookup: current.Lookup }, authorizeRequest);
|
||||||
|
@ -68,7 +66,6 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
}).then((json) => {
|
}).then((json) => {
|
||||||
let message = json.Error;
|
let message = json.Error;
|
||||||
|
|
||||||
console.log("message is \"" + message + "\"");
|
|
||||||
if (message && message !== "") {
|
if (message && message !== "") {
|
||||||
console.error("Error activating quick connect. Error: ", json.Error);
|
console.error("Error activating quick connect. Error: ", json.Error);
|
||||||
|
|
||||||
|
@ -81,7 +78,7 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
}
|
}
|
||||||
|
|
||||||
require(["toast"], function (toast) {
|
require(["toast"], function (toast) {
|
||||||
toast("Successfully activated");
|
toast(globalize.translate("QuickConnectActivationSuccessful"));
|
||||||
});
|
});
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -167,8 +167,8 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout
|
||||||
}
|
}
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: "Authorize request " + json.Code + " to continue",
|
message: Globalize.translate('QuickConnectAuthorizeCode', json.Code),
|
||||||
title: "Quick Connect Code"
|
title: Globalize.translate('QuickConnect')
|
||||||
});
|
});
|
||||||
|
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
|
@ -20,7 +20,7 @@ define(["quickConnectSettings", "dom", "globalize", "loading", "userSettings", "
|
||||||
let btn = view.querySelector("#btnQuickConnectActivate");
|
let btn = view.querySelector("#btnQuickConnectActivate");
|
||||||
|
|
||||||
if (status === "Unavailable") {
|
if (status === "Unavailable") {
|
||||||
btn.textContent = "Quick connect is not available on this server";
|
btn.textContent = globalize.translate("QuickConnectNotAvailable");
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
return false;
|
return false;
|
||||||
} else if (status === "Available") {
|
} else if (status === "Available") {
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button is="emby-button" type="button" class="raised cancel block btnQuick">
|
<button is="emby-button" type="button" class="raised cancel block btnQuick">
|
||||||
<span>Use Quick Connect</span>
|
<span>${ButtonUseQuickConnect}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button is="emby-button" type="button" class="raised cancel block btnForgotPassword">
|
<button is="emby-button" type="button" class="raised cancel block btnForgotPassword">
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<div class="listItem">
|
<div class="listItem">
|
||||||
<em class="material-icons listItemIcon listItemIcon-transparent">tap_and_play</em>
|
<em class="material-icons listItemIcon listItemIcon-transparent">tap_and_play</em>
|
||||||
<div class="listItemBody">
|
<div class="listItemBody">
|
||||||
<div class="listItemBodyText">Quick Connect</div>
|
<div class="listItemBodyText">${QuickConnect}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
<div id="quickConnectPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage noSecondaryNavPage" data-title="${HeaderHome}" data-backbutton="true">
|
<div id="quickConnectPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage noSecondaryNavPage" data-title="${HeaderHome}" data-backbutton="true">
|
||||||
<button is="emby-button" id="btnQuickConnectActivate" type="button" class="raised button-submit block">
|
<button is="emby-button" id="btnQuickConnectActivate" type="button" class="raised button-submit block">
|
||||||
<span>Activate</span>
|
<span>${ButtonActivate}</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div class="quickConnectSettingsContainer padded-left padded-right padded-bottom-page">
|
<div class="quickConnectSettingsContainer padded-left padded-right padded-bottom-page">
|
||||||
<div id="quickConnectIncoming" class="paperList">
|
<div id="quickConnectIncoming" class="paperList">
|
||||||
<div>Failed to load incoming requests</div>
|
<div>${MessagePleaseWait}</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
<div class="content-primary">
|
<div class="content-primary">
|
||||||
<div class="verticalSection">
|
<div class="verticalSection">
|
||||||
<div class="sectionTitleContainer flex align-items-center">
|
<div class="sectionTitleContainer flex align-items-center">
|
||||||
<h2 class="sectionTitle">Quick Connect</h2>
|
<h2 class="sectionTitle">${QuickConnect}</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Quick connect is: <span id="quickConnectStatus">Failed to load status</span>
|
${LabelCurrentStatus} <span id="quickConnectStatus"></span>
|
||||||
|
|
||||||
<div class="checkboxList paperList" style="padding:.5em 1em;">
|
<div class="checkboxList paperList" style="padding:.5em 1em;">
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" is="emby-checkbox" id="chkQuickConnectAvailable" />
|
<input type="checkbox" is="emby-checkbox" id="chkQuickConnectAvailable" />
|
||||||
<span>Enable quick connect on this server</span>
|
<span>${EnableQuickConnect}</span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
||||||
icon: "devices"
|
icon: "devices"
|
||||||
});
|
});
|
||||||
links.push({
|
links.push({
|
||||||
name: "Quick Connect",
|
name: globalize.translate("QuickConnect"),
|
||||||
href: "quickconnect.html",
|
href: "quickconnect.html",
|
||||||
pageIds: ["quickConnectPage", "quickConnectPage"],
|
pageIds: ["quickConnectPage", "quickConnectPage"],
|
||||||
icon: "tap_and_play"
|
icon: "tap_and_play"
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
"AuthProviderHelp": "Select an Authentication Provider to be used to authenticate this user's password.",
|
"AuthProviderHelp": "Select an Authentication Provider to be used to authenticate this user's password.",
|
||||||
"Auto": "Auto",
|
"Auto": "Auto",
|
||||||
"AutoBasedOnLanguageSetting": "Auto (based on language setting)",
|
"AutoBasedOnLanguageSetting": "Auto (based on language setting)",
|
||||||
|
"Authorize": "authorize",
|
||||||
"Backdrop": "Backdrop",
|
"Backdrop": "Backdrop",
|
||||||
"Backdrops": "Backdrops",
|
"Backdrops": "Backdrops",
|
||||||
"Banner": "Banner",
|
"Banner": "Banner",
|
||||||
|
@ -63,6 +64,7 @@
|
||||||
"Browse": "Browse",
|
"Browse": "Browse",
|
||||||
"BrowsePluginCatalogMessage": "Browse our plugin catalog to view available plugins.",
|
"BrowsePluginCatalogMessage": "Browse our plugin catalog to view available plugins.",
|
||||||
"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.",
|
"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.",
|
||||||
|
"ButtonActivate": "Activate",
|
||||||
"ButtonAdd": "Add",
|
"ButtonAdd": "Add",
|
||||||
"ButtonAddImage": "Add Image",
|
"ButtonAddImage": "Add Image",
|
||||||
"ButtonAddMediaLibrary": "Add Media Library",
|
"ButtonAddMediaLibrary": "Add Media Library",
|
||||||
|
@ -140,6 +142,7 @@
|
||||||
"ButtonTrailer": "Trailer",
|
"ButtonTrailer": "Trailer",
|
||||||
"ButtonUninstall": "Uninstall",
|
"ButtonUninstall": "Uninstall",
|
||||||
"ButtonUp": "Up",
|
"ButtonUp": "Up",
|
||||||
|
"ButtonUseQuickConnect": "Use Quick Connect",
|
||||||
"ButtonViewWebsite": "View website",
|
"ButtonViewWebsite": "View website",
|
||||||
"ButtonWebsite": "Website",
|
"ButtonWebsite": "Website",
|
||||||
"CancelRecording": "Cancel recording",
|
"CancelRecording": "Cancel recording",
|
||||||
|
@ -231,6 +234,7 @@
|
||||||
"EnableNextVideoInfoOverlayHelp": "At the end of a video, display info about the next video coming up in the current playlist.",
|
"EnableNextVideoInfoOverlayHelp": "At the end of a video, display info about the next video coming up in the current playlist.",
|
||||||
"EnablePhotos": "Display photos",
|
"EnablePhotos": "Display photos",
|
||||||
"EnablePhotosHelp": "Images will be detected and displayed alongside other media files.",
|
"EnablePhotosHelp": "Images will be detected and displayed alongside other media files.",
|
||||||
|
"EnableQuickConnect": "Enable quick connect on this server",
|
||||||
"EnableStreamLooping": "Auto-loop live streams",
|
"EnableStreamLooping": "Auto-loop live streams",
|
||||||
"EnableStreamLoopingHelp": "Enable this if live streams only contain a few seconds of data and need to be continuously requested. Enabling this when not needed may cause problems.",
|
"EnableStreamLoopingHelp": "Enable this if live streams only contain a few seconds of data and need to be continuously requested. Enabling this when not needed may cause problems.",
|
||||||
"EnableThemeSongs": "Theme songs",
|
"EnableThemeSongs": "Theme songs",
|
||||||
|
@ -587,6 +591,7 @@
|
||||||
"LabelCountry": "Country:",
|
"LabelCountry": "Country:",
|
||||||
"LabelCriticRating": "Critic rating:",
|
"LabelCriticRating": "Critic rating:",
|
||||||
"LabelCurrentPassword": "Current password:",
|
"LabelCurrentPassword": "Current password:",
|
||||||
|
"LabelCurrentStatus": "Current status:",
|
||||||
"LabelCustomCertificatePath": "Custom SSL certificate path:",
|
"LabelCustomCertificatePath": "Custom SSL certificate path:",
|
||||||
"LabelCustomCertificatePathHelp": "Path to a PKCS #12 file containing a certificate and private key to enable TLS support on a custom domain.",
|
"LabelCustomCertificatePathHelp": "Path to a PKCS #12 file containing a certificate and private key to enable TLS support on a custom domain.",
|
||||||
"LabelCustomCss": "Custom CSS:",
|
"LabelCustomCss": "Custom CSS:",
|
||||||
|
@ -1260,6 +1265,11 @@
|
||||||
"Programs": "Programs",
|
"Programs": "Programs",
|
||||||
"Quality": "Quality",
|
"Quality": "Quality",
|
||||||
"QueueAllFromHere": "Queue all from here",
|
"QueueAllFromHere": "Queue all from here",
|
||||||
|
"QuickConnect": "Quick Connect",
|
||||||
|
"QuickConnectActivationSuccessful": "Successfully activated",
|
||||||
|
"QuickConnectAuthorizeCode": "Authorize request {0} to continue",
|
||||||
|
"QuickConnectNoPending": "No pending login requests",
|
||||||
|
"QuickConnectNotAvailable": "Quick connect is not available on this server",
|
||||||
"Raised": "Raised",
|
"Raised": "Raised",
|
||||||
"Rate": "Rate",
|
"Rate": "Rate",
|
||||||
"RecentlyWatched": "Recently watched",
|
"RecentlyWatched": "Recently watched",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue