Skip to content

Conversation

@developerfred
Copy link

Summary

Implements #7 - Set a max of 3 compare languages.

This feature limits the number of secondary languages users can select to a maximum of 3 (resulting in a 4-column grid: 1 primary + 3 secondary).

Changes

  • Added MAX_SECONDARY_LANGUAGES constant set to 3
  • Created limitSecondaryLanguages() function to manage checkbox enabled/disabled state
  • Added event listeners to all checkboxes to enforce the limit dynamically
  • Updated initHomePage() to apply limit after restoring selections from localStorage
  • Changed code classes from custom-${lang} to language-${lang} (following Prism.js pattern)

Technical Details

When 3 secondary languages are selected, remaining unchecked checkboxes are disabled. When a user unchecks a language, previously disabled checkboxes are re-enabled. The primary language checkbox remains disabled when selected as primary to prevent duplicate selections.

Closes #7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Set a max of 3 compare languages

1 participant