Add Notes about the repo
58
Notes-about-the-repo.md
Normal file
58
Notes-about-the-repo.md
Normal file
@@ -0,0 +1,58 @@
|
||||
Important to keep in mind if renaming the repo
|
||||
|
||||
### S.A.M.Y. UI – External CSS & JS Wiring
|
||||
|
||||
This document explains where S.A.M.Y. references the external CSS and JavaScript files hosted on the SVS Git server, and what you need to update if those files move.
|
||||
|
||||
---
|
||||
|
||||
## 1. External CSS path
|
||||
|
||||
In `Get-UIHtml`, the HTML template includes a `<link>` tag for the stylesheet:
|
||||
|
||||
```html
|
||||
<link rel="stylesheet" href="https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y./raw/branch/main/samy.css">
|
||||
|
||||
- This `href` is the **only place** the PowerShell script refers to the CSS file.
|
||||
- If you rename the repo, branch, or CSS filename, **update this URL**.
|
||||
- The browser pulls all layout/colors from this file.
|
||||
|
||||
---
|
||||
|
||||
## 2. External JS path
|
||||
|
||||
Near the bottom of the same HTML template, the script includes an external JS file:
|
||||
|
||||
<!-- External JS from Gitea -->
|
||||
<script src="https://git.svstools.ca/SVS_Public_Repo/S.A.M.Y./raw/branch/main/samy.js"></script>
|
||||
|
||||
- This `src` is the **only reference** to the UI logic (JS) outside the PS1.
|
||||
- If the JS file moves or is renamed, update this URL accordingly.
|
||||
|
||||
---
|
||||
|
||||
## 3. Dynamic bridge from PowerShell → JavaScript
|
||||
|
||||
Just above the external JS reference, the template injects dynamic data using a small inline script:
|
||||
|
||||
<script>
|
||||
window.SAMY_TASKS = [
|
||||
{{tasksJsAll}}
|
||||
];
|
||||
|
||||
window.SAMY_DEFAULT_PAGE = "{{defaultPage}}";
|
||||
</script>
|
||||
|
||||
At runtime, `Get-UIHtml` replaces:
|
||||
|
||||
- `{{tasksJsAll}}` with the generated task array from `$Global:SamyTasks`
|
||||
- `{{defaultPage}}` with the active page (typically `"onboard"`)
|
||||
|
||||
Your external `samy.js` should read these values, for example:
|
||||
|
||||
const tasks = window.SAMY_TASKS || [];
|
||||
const defaultPage = window.SAMY_DEFAULT_PAGE || "onboard";
|
||||
|
||||
This keeps all logic in `samy.js` while PowerShell simply injects data.
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user