From d285cf728360b9c2a5639c5a8a2a39511f2f7326 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 22 May 2024 18:19:19 +0200 Subject: [PATCH] moved inject_info fn to forum script --- res/forum/admin/admin.html | 24 +----------------------- res/forum/script.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/res/forum/admin/admin.html b/res/forum/admin/admin.html index 3a532c1..9e41652 100644 --- a/res/forum/admin/admin.html +++ b/res/forum/admin/admin.html @@ -35,7 +35,7 @@ username = event.target.innerHTML; - inject_info("#right_panel", username); + inject_info("#right_panel", username, right_panel_buffer); }); function remove_user() @@ -84,26 +84,4 @@ }) }); } - - function inject_info(id, username) - { - $.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:
- Přezdívka:
- Admin: ${admin_select}
- Pohlaví: ${sex_select}
- Bio:
`; - - $(id).html(output + right_panel_buffer); - } - }); - } \ No newline at end of file diff --git a/res/forum/script.js b/res/forum/script.js index 4633980..3809daf 100644 --- a/res/forum/script.js +++ b/res/forum/script.js @@ -13,4 +13,26 @@ function show(file) $("#main_panel").html(main_panel_buffer + data); } }); +} + +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:
+ Přezdívka:
+ Admin: ${admin_select}
+ Pohlaví: ${sex_select}
+ Bio:
`; + + $(id).html(output + postfix); + } + }); } \ No newline at end of file