mirror of
https://git.srhtnin.garden/sarah/SaraView.git
synced 2026-10-14 18:38:11 +02:00
Removed random comments and replaced em-dashes with hyphens.
This commit is contained in:
1 parent
6083e00504
commit
ee7e163837
24 files changed
+198
-363
No files matched your search
@@ -27,8 +27,6 @@ function JsonBody(Body) {
|
||||
return { headers: { "Content-Type": "application/json" }, body: JSON.stringify(Body) };
|
||||
}
|
||||
|
||||
// --- Auth -------------------------------------------------------------
|
||||
|
||||
export function FetchAuthStatus() {
|
||||
return FetchJson("/auth/status");
|
||||
}
|
||||
@@ -92,8 +90,6 @@ export function ChangePassword(CurrentPassword, NewPassword) {
|
||||
});
|
||||
}
|
||||
|
||||
// --- Groups ---------------------------------------------------------------
|
||||
|
||||
export function FetchGroups() {
|
||||
return FetchJson("/groups");
|
||||
}
|
||||
@@ -112,8 +108,6 @@ export function SetGroupMembersApi(Name, Members) {
|
||||
return FetchJson(`/groups/members?${Params}`, { method: "PUT", ...JsonBody({ Members }) });
|
||||
}
|
||||
|
||||
// --- Locked files/directories -----------------------------------------
|
||||
|
||||
export function FetchLocks() {
|
||||
return FetchJson("/locks");
|
||||
}
|
||||
@@ -133,8 +127,6 @@ export function RemoveLock(RootName, RelativePath) {
|
||||
return FetchJson(`/lock?${Params}`, { method: "DELETE" });
|
||||
}
|
||||
|
||||
// --- Files --------------------------------------------------------------
|
||||
|
||||
export function FetchRoots() {
|
||||
return FetchJson("/roots");
|
||||
}
|
||||
@@ -199,8 +191,6 @@ export function EnsureDirectoryNote(RootName, RelativePath) {
|
||||
return FetchJson(`/note?${Params}`, { method: "POST" });
|
||||
}
|
||||
|
||||
// --- Settings / themes -------------------------------------------------
|
||||
|
||||
export function FetchSettings() {
|
||||
return FetchJson("/settings");
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function GetParentPath(FilePath) {
|
||||
}
|
||||
|
||||
export default function App() {
|
||||
const [AuthState, SetAuthState] = useState("Loading"); // Loading | Bootstrap | LoggedOut | LoggedIn
|
||||
const [AuthState, SetAuthState] = useState("Loading");
|
||||
const [CurrentUser, SetCurrentUser] = useState(null);
|
||||
|
||||
const [Roots, SetRoots] = useState([]);
|
||||
@@ -128,9 +128,6 @@ export default function App() {
|
||||
SetCurrentDirectoryPath(DirectoryPath);
|
||||
}
|
||||
|
||||
// A directory is opened the same way a file is - via its own note file -
|
||||
// rather than by drilling into its listing. Browsing a directory's
|
||||
// contents happens separately, through the sidebar tree.
|
||||
function HandleSelectDirectoryNote(DirectoryPath, NoteName, NoteFileType) {
|
||||
SetViewPath(DirectoryPath);
|
||||
SetViewIsDirectory(false);
|
||||
@@ -169,8 +166,6 @@ export default function App() {
|
||||
RefreshSidebar();
|
||||
|
||||
if (ViewNoteFilePath && ViewPath === OldPath) {
|
||||
// Viewing this directory's own note - the server already renamed the
|
||||
// note file to match, so just re-resolve it under the new path.
|
||||
OpenDirectoryNote(NewPath, null);
|
||||
} else if (!ViewIsDirectory && ViewPath === OldPath) {
|
||||
HandleSelectFile(NewPath, ViewFileType);
|
||||
@@ -203,8 +198,6 @@ export default function App() {
|
||||
return <LoginScreen IsBootstrap={false} OnAuthenticated={HandleAuthenticated} />;
|
||||
}
|
||||
|
||||
// Only take up a TopBar row at all if there's something to put in it —
|
||||
// otherwise turning breadcrumbs off with a single root left a blank strip.
|
||||
const ShowTopBar = (Settings && Settings.ShowBreadcrumbs) || Roots.length > 1;
|
||||
const ConfirmBeforeDelete = Settings ? Settings.ConfirmBeforeDelete : true;
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ export default function LoginScreen({ IsBootstrap, OnAuthenticated }) {
|
||||
</div>
|
||||
{IsBootstrap && (
|
||||
<div className="LoginSubtitle">
|
||||
No accounts exist yet — this first one becomes an admin.
|
||||
No accounts exist yet - this first one becomes an admin.
|
||||
</div>
|
||||
)}
|
||||
<div className="SettingsRow">
|
||||
|
||||
@@ -141,7 +141,7 @@ function BuildBlameGutter(BlameMap, ShowAvatars) {
|
||||
return new BlameMarker("hidden", "•••", null, Title);
|
||||
}
|
||||
|
||||
const Title = `${Entry.Username} — ${new Date(Entry.Timestamp).toLocaleString()}`;
|
||||
const Title = `${Entry.Username} - ${new Date(Entry.Timestamp).toLocaleString()}`;
|
||||
|
||||
if (ShowAvatars && Entry.HasAvatar) {
|
||||
return new BlameMarker("avatar", GetAvatarUrl(Entry.Username), null, Title);
|
||||
@@ -242,9 +242,6 @@ export default function PreviewPane({
|
||||
<div className={ToolbarClass}>
|
||||
<button onClick={() => SetIsEditing(true)}>Edit</button>
|
||||
</div>
|
||||
{/* Raw, path-shaped URL (not the query-param /api/file form) so
|
||||
relative <link>/<script>/<img> references inside the HTML
|
||||
resolve against their real sibling files. */}
|
||||
<iframe title={FilePath} sandbox="" src={GetRawFileUrl(RootName, FilePath)} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -488,7 +488,7 @@ export default function SettingsPanel({
|
||||
</div>
|
||||
{UsernameError && <div className="SettingsSaveError">{UsernameError}</div>}
|
||||
<div className="SettingsHint">
|
||||
Renaming logs out any other devices/browsers you're signed in on — this one
|
||||
Renaming logs out any other devices/browsers you're signed in on - this one
|
||||
stays signed in under the new name.
|
||||
</div>
|
||||
</div>
|
||||
@@ -573,14 +573,14 @@ export default function SettingsPanel({
|
||||
<div className="SettingsSectionTitle">Locked Directories (admin)</div>
|
||||
{Locks && Locks.length === 0 && (
|
||||
<div className="SettingsHint">
|
||||
Nothing locked yet — use the 🔒 button next to any directory to lock it.
|
||||
Nothing locked yet - use the 🔒 button next to any directory to lock it.
|
||||
</div>
|
||||
)}
|
||||
{Locks &&
|
||||
Locks.map((Lock, Index) => (
|
||||
<div className="SettingsRowInline" key={`${Lock.Root}:${Lock.Path}:${Index}`}>
|
||||
<span className="SettingsLabel">
|
||||
{Lock.Root}/{Lock.Path} —{" "}
|
||||
{Lock.Root}/{Lock.Path} -{" "}
|
||||
{[...(Lock.Users || []), ...(Lock.Groups || []).map((G) => `@${G}`)].join(
|
||||
", "
|
||||
)}
|
||||
|
||||
@@ -4,12 +4,6 @@
|
||||
font-display: swap;
|
||||
}
|
||||
|
||||
/*
|
||||
* Palette roles below are DEFAULTS ONLY. The active theme's actual values
|
||||
* are applied at runtime (see App.jsx), which sets these same custom
|
||||
* property names on :root via JS after fetching the chosen theme from the
|
||||
* backend. Any theme file just needs to supply this same set of roles.
|
||||
*/
|
||||
:root {
|
||||
--Background: #1e1e2e;
|
||||
--Surface: #181825;
|
||||
@@ -62,8 +56,6 @@ img,
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
/* Sidebar / file tree */
|
||||
|
||||
.Sidebar {
|
||||
width: 260px;
|
||||
flex-shrink: 0;
|
||||
@@ -246,8 +238,6 @@ img,
|
||||
padding-left: 14px;
|
||||
}
|
||||
|
||||
/* Main column */
|
||||
|
||||
.MainColumn {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
@@ -481,8 +471,6 @@ img,
|
||||
background: white;
|
||||
}
|
||||
|
||||
/* Tag panel — bordered box style, mirroring the Statistics panel look */
|
||||
|
||||
.TagPanel {
|
||||
width: 280px;
|
||||
flex-shrink: 0;
|
||||
@@ -530,8 +518,6 @@ img,
|
||||
color: var(--Orange);
|
||||
}
|
||||
|
||||
/* Settings modal */
|
||||
|
||||
.SettingsOverlay {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
@@ -831,8 +817,6 @@ img,
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
/* Login screen */
|
||||
|
||||
.LoginScreen {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
|
||||
Reference in new issue
Block a user