Skip to content

📝 Add docstrings to vs-branch-6 #34

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 13, 2025
Merged
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
11 changes: 10 additions & 1 deletion .github/assets/js/shortcut-key.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
document.addEventListener('DOMContentLoaded', function() {
// Platform detection is now handled by platform-utils.js
// Update the displayed shortcut text is now handled by platform-utils.js
/**
* Dynamically loads a stylesheet into the document's head.
*
* Creates a <link> element with the specified URL, sets attributes necessary for secure loading,
* and appends it to the document's head. If the stylesheet fails to load, an error is logged
* to the console.
*
* @param {string} href - The URL of the stylesheet to be loaded.
* @returns {HTMLLinkElement} The created and appended link element.
*/

function loadStylesheet(href) {
const link = document.createElement('link');
Expand Down
8 changes: 7 additions & 1 deletion assets/js/platform-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ function isMacPlatform() {
}

/**
* Update UI elements based on platform (Mac vs non-Mac)
* Updates UI elements to reflect the user's platform.
*
* This function determines whether the current platform is a Mac by calling `isMacPlatform()`
* and adjusts the visibility of UI elements accordingly:
* - Elements with the class `.default-theme-text` are hidden on Mac platforms.
* - Elements with the class `.mac-theme-text` are shown on Mac platforms.
* On non-Mac platforms, the visibility settings are reversed.
*/
function updatePlatformSpecificElements() {
const isMac = isMacPlatform();
Expand Down