update some old string references

This commit is contained in:
dkanada 2019-03-22 12:14:41 -07:00
parent 4df59cc345
commit ed812281bc
5 changed files with 20 additions and 40 deletions

View file

@ -2,22 +2,17 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
"use strict";
function getApiClient() {
return ApiClient
return ApiClient;
}
function nextWizardPage() {
Dashboard.navigate("wizardlibrary.html")
Dashboard.navigate("wizardlibrary.html");
}
function onUpdateUserComplete(result) {
if (loading.hide(), result.UserLinkResult) {
var msgKey = result.UserLinkResult.IsPending ? "MessagePendingEmbyAccountAdded" : "MessageEmbyAccountAdded";
Dashboard.alert({
message: globalize.translate(msgKey),
title: globalize.translate("HeaderEmbyAccountAdded"),
callback: nextWizardPage
})
} else nextWizardPage()
console.log(result);
loading.hide();
nextWizardPage();
}
function submit(form) {
@ -27,12 +22,10 @@ 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")
}).then(onUpdateUserComplete, function(response) {
console.log(response);
})
}).then(onUpdateUserComplete);
}
function onSubmit(e) {
@ -50,8 +43,8 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
function onViewShow() {
loading.show();
var page = this,
apiClient = getApiClient();
var page = this;
var apiClient = getApiClient();
apiClient.getJSON(apiClient.getUrl("Startup/User")).then(function(user) {
page.querySelector("#txtUsername").value = user.Name || "";
page.querySelector("#txtManualPassword").value = user.Password || "";
@ -59,10 +52,13 @@ define(["loading", "globalize", "dashboardcss", "emby-input", "emby-button", "em
})
}
return function(view, params) {
view.querySelector(".wizardUserForm").addEventListener("submit", onSubmit), view.addEventListener("viewshow", function() {
view.querySelector(".wizardUserForm").addEventListener("submit", onSubmit);
view.addEventListener("viewshow", function() {
document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")
}), view.addEventListener("viewhide", function() {
});
view.addEventListener("viewhide", function() {
document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")
}), view.addEventListener("viewshow", onViewShow)
});
view.addEventListener("viewshow", onViewShow);
}
});