Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions dom/library-settings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
@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%;
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;
}
}
}
67 changes: 67 additions & 0 deletions dom/library-settings.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0"?>
<html
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/1999/xhtml"
id="library-settings-window"
style="min-width: 35em; max-width: 35em; min-height: 40em"
>
<head>
<linkset>
<html:link
rel="stylesheet"
href="chrome://browser/content/zen-styles/zen-theme.css"
/>
<html:link
rel="stylesheet"
href="chrome://userscripts/content/zen-library/dom/library-settings.css"
/>
</linkset>
</head>

<html:body
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
<hbox flex="1" id="main-container" class="main-container">
<!-- Sidebar -->
<vbox id="sidebar">
<html:h3 data-l10n-id="library-settings-sidebar-title" />
<toolbarbutton
class="toolbarbutton-1 sidebar-tabbuton"
id="general-sidebar-tabbutton"
label="General"
tooltip="General Settings"
/>
<toolbarbutton
class="toolbarbutton-1 sidebar-tabbuton"
id="modules-sidebar-tabbutton"
label="Modules"
tooltip="Modules Settings"
/>
<toolbarbutton
class="toolbarbutton-1 sidebar-tabbuton"
id="advanced-sidebar-tabbutton"
label="Advanced"
tooltip="Advanced Settings"
/>
</vbox>

<!-- Main Content Area -->
<vbox id="settings-content" flex="1">
<vbox id="section-general" class="section">
<html:h2 data-l10n-id="pane-general-title" />
<vbox class="section-content"> General settings go here. </vbox>
</vbox>

<vbox id="section-modules" class="section">
<html:h2 data-l10n-id="pane-modules-title" />
<vbox class="section-content"> Module settings go here. </vbox>
</vbox>

<vbox id="section-advanced" class="section">
<html:h2 data-l10n-id="pane-modules-title" />
<vbox class="section-content"> Advanced settings go here. </vbox>
</vbox>
</vbox>
</hbox>
</html:body>
</html>
9 changes: 9 additions & 0 deletions sections/download.js
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1338,4 +1338,4 @@ body[library="true"] {

#zen-library {
list-style-image: url("chrome://userscripts/content/zen-library/icons/library.svg") !important;
}
}
12 changes: 11 additions & 1 deletion zenhaven.uc.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,20 @@ import { historySection } from "./sections/history.js";
.addEventListener("click", () => {
window.library.closelibrary();
});

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);
Expand Down