From fc3558da0416f9340dfd947daf76c2123e7f4444 Mon Sep 17 00:00:00 2001 From: Anoms12 <117039159+Anoms12@users.noreply.github.com> Date: Thu, 24 Jul 2025 19:23:47 -0400 Subject: [PATCH 1/4] feat: add settings window to Haven --- dom/library-settings.css | 34 +++++++++++++++++++++++++++ dom/library-settings.xhtml | 48 ++++++++++++++++++++++++++++++++++++++ style.css | 2 +- zenhaven.uc.js | 12 +++++++++- 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 dom/library-settings.css create mode 100644 dom/library-settings.xhtml diff --git a/dom/library-settings.css b/dom/library-settings.css new file mode 100644 index 0000000..118514d --- /dev/null +++ b/dom/library-settings.css @@ -0,0 +1,34 @@ +@namespace html 'http://www.w3.org/1999/xhtml'; +@namespace xul 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; + +#main-content { + background: var(--zen-themed-toolbar-bg-transparent); + appearance: -moz-window-titlebar; + + user-select: none; + touch-action: none; + pointer-events: auto; + + width: 100%; + height: 100%; + + overflow-x: hidden; + overflow-y: auto; + + gap: 2rem; + padding: 1rem; +} + +.section { + width: 100%; + position: relative; + gap: 0.6rem; + + .section-content { + width: 100%; + background: var(--zen-toolbar-element-bg); + border-radius: 6px; + padding: 1em; + font-size: 1.1em; + } +} \ No newline at end of file diff --git a/dom/library-settings.xhtml b/dom/library-settings.xhtml new file mode 100644 index 0000000..b2a07bd --- /dev/null +++ b/dom/library-settings.xhtml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + General settings go here. + + + + + + + Module settings go here. + + + + + + diff --git a/style.css b/style.css index 9c8ba65..00a98dd 100644 --- a/style.css +++ b/style.css @@ -1338,4 +1338,4 @@ body[library="true"] { #zen-library { list-style-image: url("chrome://userscripts/content/zen-library/icons/library.svg") !important; -} +} \ No newline at end of file diff --git a/zenhaven.uc.js b/zenhaven.uc.js index 6b42bb3..3db8515 100644 --- a/zenhaven.uc.js +++ b/zenhaven.uc.js @@ -312,10 +312,20 @@ import { historySection } from "./sections/history.js"; .addEventListener("click", () => { window.haven.closeHaven(); }); + + function openBlankWindow() { + window.openDialog( + "chrome://userscripts/content/zen-library/dom/library-settings.xhtml", + "Library Settings", + "centerscreen,chrome,dialog=no,resizable=no,titlebar" + ); + } + toolbarFooterXML .querySelector("#library-settings-button") .addEventListener("click", () => { - alert("Library settings clicked!"); + openBlankWindow(); + console.log("Blank window opened via button click"); }); this.elements.customToolbar.appendChild(toolbarFooterXML); From 11e81d8611e6eff2fef15352e856e594bcf78878 Mon Sep 17 00:00:00 2001 From: Anoms12 <117039159+Anoms12@users.noreply.github.com> Date: Thu, 24 Jul 2025 19:54:25 -0400 Subject: [PATCH 2/4] fix: move back to richlistbox --- dom/library-settings.xhtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom/library-settings.xhtml b/dom/library-settings.xhtml index b2a07bd..8b2ae58 100644 --- a/dom/library-settings.xhtml +++ b/dom/library-settings.xhtml @@ -21,7 +21,7 @@ - + From 4158cc69f0d192741edf01ba23c41d1e7cdf61b0 Mon Sep 17 00:00:00 2001 From: Anoms12 <117039159+Anoms12@users.noreply.github.com> Date: Thu, 24 Jul 2025 21:49:37 -0400 Subject: [PATCH 3/4] feat: make the styles look a but better --- dom/library-settings.css | 67 ++++++++++++++++++++------------------ dom/library-settings.xhtml | 10 +++--- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/dom/library-settings.css b/dom/library-settings.css index 118514d..fc8a7b1 100644 --- a/dom/library-settings.css +++ b/dom/library-settings.css @@ -1,34 +1,37 @@ -@namespace html 'http://www.w3.org/1999/xhtml'; -@namespace xul 'http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'; - -#main-content { - background: var(--zen-themed-toolbar-bg-transparent); - appearance: -moz-window-titlebar; - - user-select: none; - touch-action: none; - pointer-events: auto; - - width: 100%; - height: 100%; - - overflow-x: hidden; - overflow-y: auto; - - gap: 2rem; - padding: 1rem; -} - -.section { - width: 100%; - position: relative; - gap: 0.6rem; - - .section-content { +@namespace html "http://www.w3.org/1999/xhtml"; +@namespace xul "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; +body { + margin: 0 !important; + width: 100vw; + height: 100vh; + #main-container { + color: white; + font-size: 12px; width: 100%; - background: var(--zen-toolbar-element-bg); - border-radius: 6px; - padding: 1em; - font-size: 1.1em; + height: 100%; + display: flex; + flex-direction: row; + background-color: var(--zen-main-browser-background); + + #sidebar { + height: 100%; + width: 25%; + overflow-y: auto; + background-color: black; + border-right: 1px solid white; + padding: 40px 10px 40px 10px; + display: flex; + flex-direction: column; + justify-content: center; + align-items: flex-start; + .sidebar-tabbuton { + margin: auto 10px auto 0; + } + } + #settings-content { + display: flex; + flex-direction: column; + padding: 15px; + } } -} \ No newline at end of file +} diff --git a/dom/library-settings.xhtml b/dom/library-settings.xhtml index 8b2ae58..69f61a4 100644 --- a/dom/library-settings.xhtml +++ b/dom/library-settings.xhtml @@ -17,18 +17,16 @@ - + - - - - + + - + From 3d7b0d08d38ee0e9d76534cf1d882ef016d1b080 Mon Sep 17 00:00:00 2001 From: Anoms12 <117039159+Anoms12@users.noreply.github.com> Date: Sun, 27 Jul 2025 19:47:43 -0400 Subject: [PATCH 4/4] feat: add example prefs idk how to do --- dom/library-settings.xhtml | 53 ++++++++++++++++++++++++++------------ sections/download.js | 9 +++++++ 2 files changed, 46 insertions(+), 16 deletions(-) diff --git a/dom/library-settings.xhtml b/dom/library-settings.xhtml index 69f61a4..93d5e77 100644 --- a/dom/library-settings.xhtml +++ b/dom/library-settings.xhtml @@ -1,8 +1,10 @@ - + - + - + - - + + + - - - General settings go here. - + + General settings go here. - - - Module settings go here. - + + Module settings go here. + + + + + Advanced settings go here. diff --git a/sections/download.js b/sections/download.js index ff95b21..917063c 100644 --- a/sections/download.js +++ b/sections/download.js @@ -1,5 +1,14 @@ import { parseElement } from "../utils/parse.js"; +// Prefs for the settings menu/window thingy. +const getFileCategories = UC_API.Prefs.get("zen.library.downloads.file-catagories").value; +const showFileStatus = UC_API.Prefs.get("zen.library.downloads.show-file-status").value; +const showFileSize = UC_API.Prefs.get("zen.library.downloads.show-file-size").value; +const showFileTime = UC_API.Prefs.get("zen.library.downloads.show-file-time").value; +const showFileUrl = UC_API.Prefs.get("zen.library.downloads.show-file-url").value; +const showDownloadInfo = UC_API.Prefs.get("zen.library.downloads.show-download-info").value; +const DoubleClickToOpen = UC_API.Prefs.get("zen.library.downloads.double-click-to-open").value; + export const downloadsSection = { id: "downloads", label: "Downloads",