Refactor navbar implementation: replace navbar.js with main.js, update HTML references, and enhance button styles. Add author username to paste retrieval response and implement clipboard notification feature.

### Copilot Generated Commit Message
This commit is contained in:
whoswhip
2025-05-19 02:11:24 -04:00
parent 704d7149fc
commit 1382fb9f07
12 changed files with 189 additions and 23 deletions
+22 -3
View File
@@ -843,6 +843,7 @@ namespace SharpbinV2.Server
return;
}
var paste = await Database.GetPasteFromID(pasteid);
string authorUsername = null;
if (paste == null)
{
context.Response.StatusCode = 400;
@@ -852,15 +853,33 @@ namespace SharpbinV2.Server
if (paste.AuthorUUID != "0")
{
var user = await Database.UserFromUUID(paste.AuthorUUID);
paste.AuthorUUID = user.Username;
authorUsername = user?.Username;
}
else
{
paste.AuthorUUID = "Anonymous";
authorUsername = "Anonymous";
}
paste.FilePath = null;
context.Response.StatusCode = 200;
await context.Response.WriteAsJsonAsync(new { success = true, paste = paste });
await context.Response.WriteAsJsonAsync(new
{
success = true,
paste = new
{
paste.UUID,
paste.ID,
paste.Visibility,
paste.Title,
paste.AuthorUUID,
username = authorUsername,
paste.Created,
paste.Edited,
paste.Size,
paste.TrueSize,
paste.Views,
paste.Syntax
}
});
});
app.MapGet("/api/pastes/{pasteid}", async (HttpContext context) =>
{