diff --git a/CHANGELOG.md b/CHANGELOG.md
index fc661cfd..f81c8cd4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,65 @@
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
+## [2.43.0](https://github.com/filebrowser/filebrowser/compare/v2.42.5...v2.43.0) (2025-09-13)
+
+
+### Features
+
+* "save changes" button to discard changes dialog ([84e8632](https://github.com/filebrowser/filebrowser/commit/84e8632b98e315bfef2da77dd7d1049daec99241))
+* Translate frontend/src/i18n/en.json in es ([571ce6c](https://github.com/filebrowser/filebrowser/commit/571ce6cb0d7c8725d1cc1a3238ea506ddc72b060))
+* Translate frontend/src/i18n/en.json in fr ([6b1fa87](https://github.com/filebrowser/filebrowser/commit/6b1fa87ad38ebbb1a9c5d0e5fc88ba796c148bcf))
+* Updates for project File Browser ([#5427](https://github.com/filebrowser/filebrowser/issues/5427)) ([8950585](https://github.com/filebrowser/filebrowser/commit/89505851414bfcee6b9ff02087eb4cec51c330f6))
+
+
+### Bug Fixes
+
+* optimize markdown preview height ([783503a](https://github.com/filebrowser/filebrowser/commit/783503aece7fca9e26f7e849b0e7478aba976acb))
+
+
+### Reverts
+
+* build(deps): bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 ([0769265](https://github.com/filebrowser/filebrowser/commit/07692653ffe0ea5e517e6dc1fd3961172e931843))
+
+
+### Build
+
+* **deps-dev:** bump vite from 6.1.6 to 6.3.6 in /frontend ([36c6cc2](https://github.com/filebrowser/filebrowser/commit/36c6cc203e10947439519a0413d5817921a1690d))
+* **deps:** bump github.com/go-viper/mapstructure/v2 in /tools ([280fa56](https://github.com/filebrowser/filebrowser/commit/280fa562a67824887ae6e2530a3b73739d6e1bb4))
+* **deps:** bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 ([950028a](https://github.com/filebrowser/filebrowser/commit/950028abebe2898bac4ecfd8715c0967246310cb))
+
+
+### Refactorings
+
+* to use strings.Lines ([b482a9b](https://github.com/filebrowser/filebrowser/commit/b482a9bf0d292ec6542d2145a4408971e4c985f1))
+
+## [2.43.0](https://github.com/filebrowser/filebrowser/compare/v2.42.5...v2.43.0) (2025-09-13)
+
+
+### Features
+
+* "save changes" button to discard changes dialog ([84e8632](https://github.com/filebrowser/filebrowser/commit/84e8632b98e315bfef2da77dd7d1049daec99241))
+* Translate frontend/src/i18n/en.json in es ([571ce6c](https://github.com/filebrowser/filebrowser/commit/571ce6cb0d7c8725d1cc1a3238ea506ddc72b060))
+* Translate frontend/src/i18n/en.json in fr ([6b1fa87](https://github.com/filebrowser/filebrowser/commit/6b1fa87ad38ebbb1a9c5d0e5fc88ba796c148bcf))
+* Updates for project File Browser ([#5427](https://github.com/filebrowser/filebrowser/issues/5427)) ([8950585](https://github.com/filebrowser/filebrowser/commit/89505851414bfcee6b9ff02087eb4cec51c330f6))
+
+
+### Bug Fixes
+
+* optimize markdown preview height ([783503a](https://github.com/filebrowser/filebrowser/commit/783503aece7fca9e26f7e849b0e7478aba976acb))
+
+
+### Build
+
+* **deps-dev:** bump vite from 6.1.6 to 6.3.6 in /frontend ([36c6cc2](https://github.com/filebrowser/filebrowser/commit/36c6cc203e10947439519a0413d5817921a1690d))
+* **deps:** bump github.com/go-viper/mapstructure/v2 in /tools ([280fa56](https://github.com/filebrowser/filebrowser/commit/280fa562a67824887ae6e2530a3b73739d6e1bb4))
+* **deps:** bump github.com/ulikunitz/xz from 0.5.12 to 0.5.14 ([950028a](https://github.com/filebrowser/filebrowser/commit/950028abebe2898bac4ecfd8715c0967246310cb))
+
+
+### Refactorings
+
+* to use strings.Lines ([b482a9b](https://github.com/filebrowser/filebrowser/commit/b482a9bf0d292ec6542d2145a4408971e4c985f1))
+
### [2.42.5](https://github.com/filebrowser/filebrowser/compare/v2.42.4...v2.42.5) (2025-08-16)
diff --git a/auth/hook.go b/auth/hook.go
index 849a923d..3cb5b8b9 100644
--- a/auth/hook.go
+++ b/auth/hook.go
@@ -123,7 +123,7 @@ func (a *HookAuth) GetValues(s string) {
s = strings.ReplaceAll(s, "\r\n", "\n")
// iterate input lines
- for _, val := range strings.Split(s, "\n") {
+ for val := range strings.Lines(s) {
v := strings.SplitN(val, "=", 2)
// skips non key and value format
diff --git a/frontend/src/components/prompts/DiscardEditorChanges.vue b/frontend/src/components/prompts/DiscardEditorChanges.vue
index 4c1e5faa..bd6bc49a 100644
--- a/frontend/src/components/prompts/DiscardEditorChanges.vue
+++ b/frontend/src/components/prompts/DiscardEditorChanges.vue
@@ -11,17 +11,26 @@
@click="closeHovers"
:aria-label="$t('buttons.cancel')"
:title="$t('buttons.cancel')"
- tabindex="2"
+ tabindex="3"
>
{{ $t("buttons.cancel") }}
+
@@ -40,6 +49,12 @@ export default {
},
methods: {
...mapActions(useLayoutStore, ["closeHovers"]),
+ saveAndClose() {
+ if (this.currentPrompt?.saveAction) {
+ this.currentPrompt.saveAction();
+ }
+ this.closeHovers();
+ },
},
};
diff --git a/frontend/src/css/mdPreview.css b/frontend/src/css/mdPreview.css
index bf2863f6..7d6cab86 100644
--- a/frontend/src/css/mdPreview.css
+++ b/frontend/src/css/mdPreview.css
@@ -1,6 +1,4 @@
.md_preview {
- overflow-y: auto;
- max-height: 80vh;
padding: 1rem;
border: 1px solid #000;
font-size: 20px;
@@ -9,5 +7,5 @@
#preview-container {
overflow: auto;
- max-height: 80vh; /* Match the max-height of md_preview for scrolling */
+ flex: 1;
}
diff --git a/frontend/src/i18n/en.json b/frontend/src/i18n/en.json
index fd2d6d69..80ee6aa4 100644
--- a/frontend/src/i18n/en.json
+++ b/frontend/src/i18n/en.json
@@ -42,7 +42,8 @@
"update": "Update",
"upload": "Upload",
"openFile": "Open file",
- "discardChanges": "Discard"
+ "discardChanges": "Discard",
+ "saveChanges": "Save changes"
},
"download": {
"downloadFile": "Download File",
diff --git a/frontend/src/i18n/es.json b/frontend/src/i18n/es.json
index 8d84d4df..357de1dd 100644
--- a/frontend/src/i18n/es.json
+++ b/frontend/src/i18n/es.json
@@ -7,7 +7,7 @@
"copy": "Copiar",
"copyFile": "Copiar archivo",
"copyToClipboard": "Copiar al portapapeles",
- "copyDownloadLinkToClipboard": "Copy download link to clipboard",
+ "copyDownloadLinkToClipboard": "Copiar enlace de descarga al portapapeles",
"create": "Crear",
"delete": "Borrar",
"download": "Descargar",
diff --git a/frontend/src/stores/layout.ts b/frontend/src/stores/layout.ts
index faf8bca7..372fca06 100644
--- a/frontend/src/stores/layout.ts
+++ b/frontend/src/stores/layout.ts
@@ -41,6 +41,7 @@ export const useLayoutStore = defineStore("layout", {
prompt: value,
confirm: null,
action: undefined,
+ saveAction: undefined,
props: null,
close: null,
});
@@ -51,6 +52,7 @@ export const useLayoutStore = defineStore("layout", {
prompt: value.prompt,
confirm: value?.confirm,
action: value?.action,
+ saveAction: value?.saveAction,
props: value?.props,
close: value?.close,
});
diff --git a/frontend/src/types/layout.d.ts b/frontend/src/types/layout.d.ts
index b625cc07..a5c3f160 100644
--- a/frontend/src/types/layout.d.ts
+++ b/frontend/src/types/layout.d.ts
@@ -2,6 +2,7 @@ interface PopupProps {
prompt: string;
confirm?: any;
action?: PopupAction;
+ saveAction?: () => void;
props?: any;
close?: (() => Promise) | null;
}
diff --git a/frontend/src/views/files/Editor.vue b/frontend/src/views/files/Editor.vue
index 3408fb97..13013a9f 100644
--- a/frontend/src/views/files/Editor.vue
+++ b/frontend/src/views/files/Editor.vue
@@ -1,5 +1,5 @@
-
+
{{ fileStore.req?.name ?? "" }}
@@ -97,7 +97,6 @@ const isMarkdownFile =
onMounted(() => {
window.addEventListener("keydown", keyEvent);
- window.addEventListener("wheel", handleScroll);
window.addEventListener("beforeunload", handlePageChange);
const fileContent = fileStore.req?.content || "";
@@ -111,13 +110,6 @@ onMounted(() => {
console.error("Failed to convert content to HTML:", error);
previewContent.value = "";
}
-
- const previewContainer = document.getElementById("preview-container");
- if (previewContainer) {
- previewContainer.addEventListener("wheel", handleScroll, {
- capture: true,
- });
- }
}
});
@@ -148,7 +140,6 @@ onMounted(() => {
onBeforeUnmount(() => {
window.removeEventListener("keydown", keyEvent);
- window.removeEventListener("wheel", handleScroll);
window.removeEventListener("beforeunload", handlePageChange);
editor.value?.destroy();
});
@@ -166,6 +157,10 @@ onBeforeRouteUpdate((to, from, next) => {
event.preventDefault();
next();
},
+ saveAction: async () => {
+ await save();
+ next();
+ },
});
});
@@ -186,13 +181,6 @@ const keyEvent = (event: KeyboardEvent) => {
save();
};
-const handleScroll = (event: WheelEvent) => {
- const editorContainer = document.getElementById("preview-container");
- if (editorContainer) {
- editorContainer.scrollTop += event.deltaY;
- }
-};
-
const handlePageChange = (event: BeforeUnloadEvent) => {
if (!editor.value?.session.getUndoManager().isClean()) {
event.preventDefault();
diff --git a/go.mod b/go.mod
index 788dcf19..cf005b55 100644
--- a/go.mod
+++ b/go.mod
@@ -65,7 +65,7 @@ require (
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/cast v1.9.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
- github.com/ulikunitz/xz v0.5.14 // indirect
+ github.com/ulikunitz/xz v0.5.12 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/multierr v1.11.0 // indirect
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
diff --git a/go.sum b/go.sum
index a2988587..a9ccaa5b 100644
--- a/go.sum
+++ b/go.sum
@@ -232,8 +232,8 @@ github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSW
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce h1:fb190+cK2Xz/dvi9Hv8eCYJYvIGUTN2/KLq1pT6CjEc=
github.com/tomasen/realip v0.0.0-20180522021738-f0c99a92ddce/go.mod h1:o8v6yHRoik09Xen7gje4m9ERNah1d1PPsVq1VEx9vE4=
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
-github.com/ulikunitz/xz v0.5.14 h1:uv/0Bq533iFdnMHZdRBTOlaNMdb1+ZxXIlHDZHIHcvg=
-github.com/ulikunitz/xz v0.5.14/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
+github.com/ulikunitz/xz v0.5.12 h1:37Nm15o69RwBkXM0J6A5OlE67RZTfzUxTj8fB3dfcsc=
+github.com/ulikunitz/xz v0.5.12/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU=