2024-05-16 21:17:40 +02:00
|
|
|
let main_panel_buffer = null;
|
|
|
|
|
2024-05-16 21:07:07 +02:00
|
|
|
function show(file)
|
|
|
|
{
|
2024-05-16 21:17:40 +02:00
|
|
|
if (main_panel_buffer == null) main_panel_buffer = document.getElementById("main_panel").innerHTML;
|
|
|
|
|
2024-05-16 21:07:07 +02:00
|
|
|
$.ajax
|
|
|
|
({
|
2024-05-22 16:18:18 +02:00
|
|
|
url: "./res/forum/" + file + "/" + file + ".html",
|
2024-05-16 21:07:07 +02:00
|
|
|
dataType: "html",
|
|
|
|
success: function(data)
|
|
|
|
{
|
2024-05-16 21:17:40 +02:00
|
|
|
$("#main_panel").html(main_panel_buffer + data);
|
2024-05-16 21:07:07 +02:00
|
|
|
}
|
|
|
|
});
|
2024-05-22 18:19:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function inject_info(id, username, postfix)
|
|
|
|
{
|
|
|
|
$.ajax
|
|
|
|
({
|
|
|
|
url: "./res/forum/api/user_info.php?username=" + username,
|
|
|
|
success: async function(result)
|
|
|
|
{
|
|
|
|
let admin_select = await selection("admin", result.admin);
|
|
|
|
let sex_select = await selection("sex", result.sex);
|
|
|
|
|
|
|
|
let output =
|
|
|
|
`Uživatelské jméno: <input id="username" class="editable" type="text" value="${result.username}"><br>
|
|
|
|
Přezdívka: <input id="nickname" class="editable" type="text" value="${result.nickname}"><br>
|
|
|
|
Admin: ${admin_select}<br>
|
|
|
|
Pohlaví: ${sex_select}<br>
|
|
|
|
Bio: <input id="bio" class="editable" type="text" value="${result.bio}"><br>`;
|
|
|
|
|
|
|
|
$(id).html(output + postfix);
|
|
|
|
}
|
|
|
|
});
|
2024-05-16 21:07:07 +02:00
|
|
|
}
|