moved inject_info fn to forum script
This commit is contained in:
parent
bf951c25dc
commit
d285cf7283
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
username = event.target.innerHTML;
|
username = event.target.innerHTML;
|
||||||
|
|
||||||
inject_info("#right_panel", username);
|
inject_info("#right_panel", username, right_panel_buffer);
|
||||||
});
|
});
|
||||||
|
|
||||||
function remove_user()
|
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: <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 + right_panel_buffer);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
@ -13,4 +13,26 @@ function show(file)
|
|||||||
$("#main_panel").html(main_panel_buffer + data);
|
$("#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: <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);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user