2025-11-17 16:28:52 +00:00
|
|
|
-- ==============================================================================
|
|
|
|
|
-- CV Site - Toggle Functions
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
-- Toggle functions for CV customization (length, icons, theme)
|
|
|
|
|
-- Migrated from JavaScript (cv-functions.js) after confirming no def limit
|
|
|
|
|
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
-- CV LENGTH TOGGLE
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
|
|
|
|
|
def toggleCVLength(isLong)
|
|
|
|
|
set paper to the first .cv-paper
|
|
|
|
|
set actionBarToggle to #lengthToggle
|
|
|
|
|
set menuToggle to #lengthToggleMenu
|
|
|
|
|
|
|
|
|
|
if isLong is true
|
|
|
|
|
remove .cv-short from paper
|
|
|
|
|
add .cv-long to paper
|
|
|
|
|
call localStorage.setItem('cv-length', 'long')
|
|
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
|
|
|
else
|
|
|
|
|
remove .cv-long from paper
|
|
|
|
|
add .cv-short to paper
|
|
|
|
|
call localStorage.setItem('cv-length', 'short')
|
|
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
-- ICONS TOGGLE
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
|
|
|
|
|
def toggleIcons(showIcons)
|
|
|
|
|
set paper to the first .cv-paper
|
|
|
|
|
set actionBarToggle to #iconToggle
|
|
|
|
|
set menuToggle to #iconToggleMenu
|
|
|
|
|
|
|
|
|
|
if showIcons is true
|
|
|
|
|
add .show-icons to paper
|
2025-11-20 11:21:43 +00:00
|
|
|
call localStorage.setItem('cv-icons', 'show')
|
2025-11-17 16:28:52 +00:00
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
|
|
|
else
|
|
|
|
|
remove .show-icons from paper
|
2025-11-20 11:21:43 +00:00
|
|
|
call localStorage.setItem('cv-icons', 'hide')
|
2025-11-17 16:28:52 +00:00
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
-- THEME TOGGLE
|
|
|
|
|
-- ==============================================================================
|
|
|
|
|
|
|
|
|
|
def toggleTheme(isClean)
|
2025-11-19 14:31:17 +00:00
|
|
|
set container to the first .cv-container
|
2025-11-17 16:28:52 +00:00
|
|
|
set actionBarToggle to #themeToggle
|
|
|
|
|
set menuToggle to #themeToggleMenu
|
|
|
|
|
|
|
|
|
|
if isClean is true
|
2025-11-19 14:31:17 +00:00
|
|
|
add .theme-clean to container
|
2025-11-17 16:28:52 +00:00
|
|
|
call localStorage.setItem('cv-theme', 'clean')
|
|
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to true end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to true end
|
|
|
|
|
else
|
2025-11-19 14:31:17 +00:00
|
|
|
remove .theme-clean from container
|
2025-11-17 16:28:52 +00:00
|
|
|
call localStorage.setItem('cv-theme', 'default')
|
|
|
|
|
if actionBarToggle exists then set actionBarToggle's checked to false end
|
|
|
|
|
if menuToggle exists then set menuToggle's checked to false end
|
|
|
|
|
end
|
|
|
|
|
end
|