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

31 lines
1 KiB
JavaScript
Raw Normal View History

2019-10-08 01:30:02 +03:00
define(["jQuery", "loading", "libraryMenu"], function ($, loading, libraryMenu) {
2018-10-23 01:05:09 +03:00
"use strict";
function loadUser(page, user) {
2019-10-08 01:30:02 +03:00
libraryMenu.setTitle(user.Name);
if ("Guest" == user.ConnectLinkType) {
$(".connectMessage", page).show();
} else {
$(".connectMessage", page).hide();
}
loading.hide();
2018-10-23 01:05:09 +03:00
}
function loadData(page) {
loading.show();
var userId = getParameterByName("userId");
2019-10-08 01:30:02 +03:00
ApiClient.getUser(userId).then(function (user) {
loadUser(page, user);
});
2018-10-23 01:05:09 +03:00
}
2019-10-08 01:30:02 +03:00
$(document).on("pageinit", "#userPasswordPage", function () {
$(".adminUpdatePasswordForm").off("submit", UpdatePasswordPage.onSubmit).on("submit", UpdatePasswordPage.onSubmit);
$(".adminLocalAccessForm").off("submit", UpdatePasswordPage.onLocalAccessSubmit).on("submit", UpdatePasswordPage.onLocalAccessSubmit);
}).on("pagebeforeshow", "#userPasswordPage", function () {
loadData(this);
});
});