File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
document . addEventListener ( 'DOMContentLoaded' , function ( ) {
2
2
// Platform detection is now handled by platform-utils.js
3
- // Update the displayed shortcut text is now handled by platform-utils.js
3
+ /**
4
+ * Dynamically loads a stylesheet into the document's head.
5
+ *
6
+ * Creates a <link> element with the specified URL, sets attributes necessary for secure loading,
7
+ * and appends it to the document's head. If the stylesheet fails to load, an error is logged
8
+ * to the console.
9
+ *
10
+ * @param {string } href - The URL of the stylesheet to be loaded.
11
+ * @returns {HTMLLinkElement } The created and appended link element.
12
+ */
4
13
5
14
function loadStylesheet ( href ) {
6
15
const link = document . createElement ( 'link' ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,13 @@ function isMacPlatform() {
9
9
}
10
10
11
11
/**
12
- * Update UI elements based on platform (Mac vs non-Mac)
12
+ * Updates UI elements to reflect the user's platform.
13
+ *
14
+ * This function determines whether the current platform is a Mac by calling `isMacPlatform()`
15
+ * and adjusts the visibility of UI elements accordingly:
16
+ * - Elements with the class `.default-theme-text` are hidden on Mac platforms.
17
+ * - Elements with the class `.mac-theme-text` are shown on Mac platforms.
18
+ * On non-Mac platforms, the visibility settings are reversed.
13
19
*/
14
20
function updatePlatformSpecificElements ( ) {
15
21
const isMac = isMacPlatform ( ) ;
You can’t perform that action at this time.
0 commit comments