diff --git a/Notes-about-the-repo.md b/Notes-about-the-repo.md index 83f6972..00c2d8e 100644 --- a/Notes-about-the-repo.md +++ b/Notes-about-the-repo.md @@ -6,16 +6,16 @@ This document explains where S.A.M.Y. references the external CSS and JavaScript --- + ## 1. External CSS path In `Get-UIHtml`, the HTML template includes a `` tag for the stylesheet: -```html - + -- 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. +- 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 and colors from this file. --- @@ -26,12 +26,12 @@ Near the bottom of the same HTML template, the script includes an external JS fi -- This `src` is the **only reference** to the UI logic (JS) outside the PS1. +- 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 +## 3. Dynamic bridge from PowerShell to JavaScript Just above the external JS reference, the template injects dynamic data using a small inline script: @@ -56,3 +56,51 @@ Your external `samy.js` should read these values, for example: This keeps all logic in `samy.js` while PowerShell simply injects data. --- + +## 4. Removal of inline CSS and JS in the PS1 + +The old here-strings: + + $style = @' + ...CSS... + '@ + + $script = @' + ...JavaScript... + '@ + +have been removed. + +Now: + +- All styling lives in `samy.css` on Gitea. +- All client-side behavior (tabs, checkboxes, DattoRMM calls, etc.) lives in `samy.js` on Gitea. +- The PS1 only: + - Builds checkbox HTML + - Builds the `tasksJsAll` JS snippet + - Injects placeholders into `$htmlTemplate` + +This keeps the PowerShell script lighter and makes UI adjustments possible without touching the PS1. + +--- + +## 5. Note about logging helpers (optional cleanup) + +The script currently contains two sets of logging helpers: + +1. A newer pair that: + - Uses `EventLog = "SVSMSP Events"` + - Uses `EventSource = "SVSMSP_Module"` + - Matches the SVSMSP toolkit behavior + +2. An older pair that: + - Uses `EventLog = "Application"` + - Uses `EventSource = "Script Automation Monkey"` + +PowerShell will use the last definition in the file. +When convenient, consider: + +- Keeping only the newer `Write-LogHelper` / `Write-LogHybrid` that log to `SVSMSP Events` +- Removing the older `Script Automation Monkey` / `Application` versions to avoid confusion + +This is unrelated to CSS and JS, but good housekeeping for the logging story.