From a72fce15a6d76224495c6e5e9f74cb2850774715 Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 20:03:54 -0600 Subject: [PATCH 1/8] Added frontend support for a password field on setup --- src/scripts/wizarduserpage.js | 12 ++++++++++-- src/strings/en-GB.json | 1 + src/strings/en-US.json | 1 + src/wizardstart.html | 2 +- src/wizarduser.html | 7 +++++++ 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/scripts/wizarduserpage.js b/src/scripts/wizarduserpage.js index 9ada1b724f..dac1abf913 100644 --- a/src/scripts/wizarduserpage.js +++ b/src/scripts/wizarduserpage.js @@ -26,7 +26,9 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em apiClient.ajax({ type: "POST", data: { - Name: form.querySelector("#txtUsername").value + Name: form.querySelector("#txtUsername").value, + Password: form.querySelector("#txtManualPassword").value + }, url: apiClient.getUrl("Startup/User"), dataType: "json" @@ -36,7 +38,12 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em } function onSubmit(e) { - return submit(this), e.preventDefault(), !1 + + var form = this; + return form.querySelector("#txtManualPassword").value != form.querySelector("#txtPasswordConfirm").value ? require(["toast"], function(toast) { + toast(Globalize.translate("PasswordMatchError")) + }) : submit(this), e.preventDefault(), !1 + } function onViewShow() { @@ -45,6 +52,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em apiClient = getApiClient(); apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) { page.querySelector("#txtUsername").value = user.Name || "", loading.hide() + page.querySelector("#txtManualPassword").value = user.Password || "", loading.hide() }) } return function(view, params) { diff --git a/src/strings/en-GB.json b/src/strings/en-GB.json index ac8a0354d6..e710f1e811 100644 --- a/src/strings/en-GB.json +++ b/src/strings/en-GB.json @@ -82,6 +82,7 @@ "LabelUrl": "URL:", "LabelZipCode": "Post Code:", "LabelffmpegPathHelp": "The path to the ffmpeg application file or folder containing ffmpeg.", + "LeaveBlankToNotSetAPassword": "This field can be left blank.", "LinkApi": "API", "MessageConfirmRevokeApiKey": "Are you sure you wish to revoke this API key? The application's connection to Jellyfin Server will be abruptly terminated.", "MessageForgotPasswordFileExpiration": "The reset PIN will expire at {0}.", diff --git a/src/strings/en-US.json b/src/strings/en-US.json index c4c13fa256..43b3098d35 100644 --- a/src/strings/en-US.json +++ b/src/strings/en-US.json @@ -1028,6 +1028,7 @@ "LanNetworksHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network.", "LatestFromLibrary": "Latest {0}", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", + "LeaveBlankToNotSetAPassword": "This field can be left blank.", "LetterButtonAbbreviation": "A", "LibraryAccessHelp": "Select the media folders to share with this user. Administrators will be able to edit all folders using the metadata manager.", "LinkApi": "Api", diff --git a/src/wizardstart.html b/src/wizardstart.html index a144b8cd12..723afa2aef 100644 --- a/src/wizardstart.html +++ b/src/wizardstart.html @@ -29,4 +29,4 @@ - \ No newline at end of file + diff --git a/src/wizarduser.html b/src/wizarduser.html index 0df4d3bc07..26064d32fb 100644 --- a/src/wizarduser.html +++ b/src/wizarduser.html @@ -16,6 +16,13 @@
${MoreUsersCanBeAddedLater}
+
+ +
${LeaveBlankToNotSetAPassword}
+
+
+ +
From 3b7c7536301d1e0670f1db3141c54dd513059b5e Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 20:13:08 -0600 Subject: [PATCH 2/8] Adding RazeLighter777 to the list of contributors --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 4cadf33ac4..6ae333bdee 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -18,6 +18,7 @@ - [ViXXoR](https://github.com/ViXXoR) - [nkmerrill] (https://github.com/nkmerrill) - [TtheCreator] (https://github.com/Tthecreator) + - [RazeLighter777](https://github.com/RazeLighter777) # Emby Contributors From a62d70fc780e97ce2abfe1b06e277f4230e3841c Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Mon, 28 Jan 2019 20:19:08 -0600 Subject: [PATCH 3/8] Changed the optional message to be more clear --- src/strings/en-GB.json | 2 +- src/strings/en-US.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/strings/en-GB.json b/src/strings/en-GB.json index e710f1e811..4b6068f5c0 100644 --- a/src/strings/en-GB.json +++ b/src/strings/en-GB.json @@ -82,7 +82,7 @@ "LabelUrl": "URL:", "LabelZipCode": "Post Code:", "LabelffmpegPathHelp": "The path to the ffmpeg application file or folder containing ffmpeg.", - "LeaveBlankToNotSetAPassword": "This field can be left blank.", + "LeaveBlankToNotSetAPassword": "Optional - leave blank to set no password", "LinkApi": "API", "MessageConfirmRevokeApiKey": "Are you sure you wish to revoke this API key? The application's connection to Jellyfin Server will be abruptly terminated.", "MessageForgotPasswordFileExpiration": "The reset PIN will expire at {0}.", diff --git a/src/strings/en-US.json b/src/strings/en-US.json index 43b3098d35..049f0c68e9 100644 --- a/src/strings/en-US.json +++ b/src/strings/en-US.json @@ -1028,7 +1028,7 @@ "LanNetworksHelp": "Comma separated list of IP addresses or IP/netmask entries for networks that will be considered on local network when enforcing bandwidth restrictions. If set, all other IP addresses will be considered to be on the external network and will be subject to the external bandwidth restrictions. If left blank, only the server's subnet is considered to be on the local network.", "LatestFromLibrary": "Latest {0}", "LearnHowToCreateSynologyShares": "Learn how to share folders in Synology.", - "LeaveBlankToNotSetAPassword": "This field can be left blank.", + "LeaveBlankToNotSetAPassword": "Optional - leave blank to set no password", "LetterButtonAbbreviation": "A", "LibraryAccessHelp": "Select the media folders to share with this user. Administrators will be able to edit all folders using the metadata manager.", "LinkApi": "Api", From 52010486b92705bbc6bf2490f0db1b89c7611ff3 Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Tue, 29 Jan 2019 05:57:03 -0600 Subject: [PATCH 4/8] addressed suggested changes in pull request. --- src/scripts/wizarduserpage.js | 22 +++++++++++++--------- src/strings/en-GB.json | 1 - 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/scripts/wizarduserpage.js b/src/scripts/wizarduserpage.js index dac1abf913..97b3dd6155 100644 --- a/src/scripts/wizarduserpage.js +++ b/src/scripts/wizarduserpage.js @@ -27,8 +27,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em type: "POST", data: { Name: form.querySelector("#txtUsername").value, - Password: form.querySelector("#txtManualPassword").value - + Password: form.querySelector("#txtManualPassword").value }, url: apiClient.getUrl("Startup/User"), dataType: "json" @@ -38,12 +37,16 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em } function onSubmit(e) { - var form = this; - return form.querySelector("#txtManualPassword").value != form.querySelector("#txtPasswordConfirm").value ? require(["toast"], function(toast) { - toast(Globalize.translate("PasswordMatchError")) - }) : submit(this), e.preventDefault(), !1 - + if (form.querySelector("#txtManualPassword").value != form.querySelector("#txtPasswordConfirm").value) { + require(["toast"], function(toast) { + toast(Globalize.translate("PasswordMatchError")); + }); + } else { + submit(form); + } + e.preventDefault(); + return false; } function onViewShow() { @@ -51,8 +54,9 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em var page = this, apiClient = getApiClient(); apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) { - page.querySelector("#txtUsername").value = user.Name || "", loading.hide() - page.querySelector("#txtManualPassword").value = user.Password || "", loading.hide() + page.querySelector("#txtUsername").value = user.Name || "", + page.querySelector("#txtManualPassword").value = user.Password || "", + loading.hide() }) } return function(view, params) { diff --git a/src/strings/en-GB.json b/src/strings/en-GB.json index 4b6068f5c0..ac8a0354d6 100644 --- a/src/strings/en-GB.json +++ b/src/strings/en-GB.json @@ -82,7 +82,6 @@ "LabelUrl": "URL:", "LabelZipCode": "Post Code:", "LabelffmpegPathHelp": "The path to the ffmpeg application file or folder containing ffmpeg.", - "LeaveBlankToNotSetAPassword": "Optional - leave blank to set no password", "LinkApi": "API", "MessageConfirmRevokeApiKey": "Are you sure you wish to revoke this API key? The application's connection to Jellyfin Server will be abruptly terminated.", "MessageForgotPasswordFileExpiration": "The reset PIN will expire at {0}.", From d37919cbf0c2be6acbcb37f9311bb4fd7cb7e3c5 Mon Sep 17 00:00:00 2001 From: Justin Suess Date: Tue, 29 Jan 2019 05:58:03 -0600 Subject: [PATCH 5/8] Fixed syntax error in en-GB.json --- src/strings/en-GB.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings/en-GB.json b/src/strings/en-GB.json index ac8a0354d6..6e92b7757f 100644 --- a/src/strings/en-GB.json +++ b/src/strings/en-GB.json @@ -122,5 +122,5 @@ "XmlTvMovieCategoriesHelp": "Programmes with these categories will be displayed as movies. Separate multiple with '|'.", "XmlTvNewsCategoriesHelp": "Programmes with these categories will be displayed as news programmes. Separate multiple with '|'.", "XmlTvPathHelp": "A path to an XML TV file. Jellyfin will read this file and periodically check it for updates. You are responsible for creating and updating the file.", - "XmlTvSportsCategoriesHelp": "Programmes with these categories will be displayed as sports programmes. Separate multiple with '|'.", + "XmlTvSportsCategoriesHelp": "Programmes with these categories will be displayed as sports programmes. Separate multiple with '|'." } From ba0c888960d467e93b3fc3b2cacb4a3b47ebeadf Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Tue, 29 Jan 2019 11:38:57 -0600 Subject: [PATCH 6/8] Update src/scripts/wizarduserpage.js Co-Authored-By: RazeLighter777 --- src/scripts/wizarduserpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/wizarduserpage.js b/src/scripts/wizarduserpage.js index 97b3dd6155..5cc36cc8b7 100644 --- a/src/scripts/wizarduserpage.js +++ b/src/scripts/wizarduserpage.js @@ -55,7 +55,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em apiClient = getApiClient(); apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) { page.querySelector("#txtUsername").value = user.Name || "", - page.querySelector("#txtManualPassword").value = user.Password || "", + page.querySelector("#txtManualPassword").value = user.Password || ""; loading.hide() }) } From 1d7854541b7786c9059acdae12c8177d9bf07ad6 Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Tue, 29 Jan 2019 11:39:11 -0600 Subject: [PATCH 7/8] Update src/scripts/wizarduserpage.js Co-Authored-By: RazeLighter777 --- src/scripts/wizarduserpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/wizarduserpage.js b/src/scripts/wizarduserpage.js index 5cc36cc8b7..2fe055332c 100644 --- a/src/scripts/wizarduserpage.js +++ b/src/scripts/wizarduserpage.js @@ -56,7 +56,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) { page.querySelector("#txtUsername").value = user.Name || "", page.querySelector("#txtManualPassword").value = user.Password || ""; - loading.hide() + loading.hide(); }) } return function(view, params) { From 94bab172f02c1d6d9d7329fb7c3e4d1d105514f6 Mon Sep 17 00:00:00 2001 From: Claus Vium Date: Tue, 29 Jan 2019 11:39:27 -0600 Subject: [PATCH 8/8] Update src/scripts/wizarduserpage.js Co-Authored-By: RazeLighter777 --- src/scripts/wizarduserpage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scripts/wizarduserpage.js b/src/scripts/wizarduserpage.js index 2fe055332c..039962eda3 100644 --- a/src/scripts/wizarduserpage.js +++ b/src/scripts/wizarduserpage.js @@ -54,7 +54,7 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em var page = this, apiClient = getApiClient(); apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) { - page.querySelector("#txtUsername").value = user.Name || "", + page.querySelector("#txtUsername").value = user.Name || ""; page.querySelector("#txtManualPassword").value = user.Password || ""; loading.hide(); })