Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Feb 11, 2025
1 parent 0773fcd commit bc57556
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 460 deletions.
29 changes: 0 additions & 29 deletions TODO.md

This file was deleted.

1 change: 0 additions & 1 deletion app/routers/xlwings.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,5 @@ def scan_directory(
files.update(
scan_directory(settings.base_dir, directory, prepend_dir_name=True)
)

response = {"packages": packages, "files": files}
return response
29 changes: 0 additions & 29 deletions app/static/css/style.css
Original file line number Diff line number Diff line change
@@ -1,29 +0,0 @@
/* Styles for the resizable divider */
.resizer {
height: 5px;
background: #ccc;
cursor: row-resize;
position: relative; /* Add relative position for pseudo element */
}

.resizer::before {
content: "";
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 30px; /* Adjust width for a short line */
height: 1px;
background: #000;
}

#output {
overflow: auto;
font-family: monospace;
white-space: nowrap;
font-size: 0.75rem;
}

.nav-link.active {
border-top: 4px solid green !important;
}
51 changes: 51 additions & 0 deletions app/static/js/core/examples.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const visibility = {
isOpen: false,
label: "Show",
toggle() {
this.isOpen = !this.isOpen;
this.label = this.isOpen ? "Hide" : "Show";
},
};
registerAlpineComponent("visibility", visibility);

const slider = {
percentage: 50,
update() {
this.percentage = this.$el.value;
},
};
registerAlpineComponent("slider", slider);

const nameForm = {
firstName: "",
lastName: "",
fullName: "(empty)",
focus() {
this.$el.focus();
},
handleInput() {
this[this.$el.name] = this.$el.value;
const fullName = `${this.firstName} ${this.lastName}`;
this.fullName = !this.firstName && !this.lastName ? "(empty)" : fullName;
},
};
registerAlpineComponent("nameForm", nameForm);

const appLoader = {
url: "",
async init() {
let bookName = await xlwings.getActiveBookName();
// Works with both an unsaved book ("Book1") as well as a saved one "Book1.xlsx"
if (bookName.includes("Book1")) {
// TODO: fix if app_path is provided
this.url = "/taskpane?app=1";
} else {
this.url = "/taskpane?app=2";
}
this.$nextTick(() => {
htmx.process(this.$el);
this.$dispatch("app:loadTaskpane");
});
},
};
registerAlpineComponent("appLoader", appLoader);
Loading

0 comments on commit bc57556

Please sign in to comment.