Feature Updates to Original Version#18
Open
shbatm wants to merge 233 commits intobarnabycolby:masterfrom
Open
Conversation
Typo in advanced slides carousel.
Fixes other typo in Readme.
The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/npm:braces:20180219 Latest report for shbatm/mmm-carousel: https://snyk.io/test/github/shbatm/mmm-carousel
[Snyk Update] New fixes for 2 vulnerable dependency paths
- Use carouselId in module filtering for ignoreModules config - Falls back to module.name - Works in all carousel modes (global, positional, slides) - Add documentation and example with multiple module instances Resolves #39
… navigation - Introduce isManualMode flag to control automatic rotation state - Add CAROUSEL_TOGGLE_AUTO notification and MMM-Remote-Control API action - Add guard clauses in restartTimer() and toggleTimer() to respect manual mode - Prevent automatic scheduling in moduleTransition when in manual mode - Update README with new notification documentation - Resolves #24
- Rename globalThis → carouselInstance (avoid shadowing) - Extract helper methods to reduce complexity - Add JSDoc to new methods (handleToggleAutoMode, handleCarouselGoto, setUpTransitionTimers, moduleTransition) - Refactor notification handling with switch statement - Add DOM null guards for indicator updates
- Extract 4 helper methods: setupKeyHandler, registerApiActions, initializeModule, showModulesForSlide - Add JSDoc to all new methods - Reduce ESLint max-lines-per-function to 70 - Remove complexity rule (satisfied by refactoring)
- Replace /Slide([0-9]+)/ regex with startsWith() and slice() - Use Number.isFinite() instead of typeof parseInt() === "number" - Remove unnecessary debug logging - Simpler, faster, and more maintainable code
- Convert 7 block comments (/* */) to JSDoc format (/** */) - Cache Object.keys(this.config.slides).length in getDom() - Extract createPageControls() helper from getDom
Replace confusing bind/call pattern where modules array was used as `this` context with a clean object-oriented approach: - Remove global carouselInstance variable (no longer needed) - buildModulesContext() now returns clean context object instead of mutating array with properties - moduleTransition() uses this.modulesContext instead of array-as-this - Extract selectWrapper() as standalone method - Simplify showModulesForSlide() to use for...of loops - manualTransition as arrow function closure Benefits: - Clearer code: this always refers to carousel instance - Better separation: modules array vs configuration object - More maintainable: standard OOP pattern - Easier to understand: no "clever" bind/call tricks
Replace mixed setInterval/setTimeout approach with recursive setTimeout pattern for cleaner and more maintainable timer management. Changes: - Remove all setInterval usage, use only setTimeout - Remove all clearInterval calls, only clearTimeout needed - Centralize timer logic in scheduleNextTransition() - Remove setupAutomaticTransitions() helper (no longer needed) - Schedule next transition after fade completes in moduleTransition() - Simplify restartTimer() to delegate to scheduleNextTransition() - Remove unused defaultTimer from context object - Remove timer parameter from buildModulesContext() Benefits: - Single timer type = simpler code - No timer type confusion (interval vs timeout) - All timer modes handled in one place - More flexible per-transition timing - No setInterval drift issues
- Replace parseInt() with Number() for cleaner type conversion - Add explicit validation using Number.isInteger() and bounds checking - Use guard clause pattern instead of try/catch blocks - Simplify object validation (payload && payload.slide) - Reduce from 18 to 16 lines while improving robustness
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
In positional mode, setUpTransitionTimers was called in a loop for each enabled position, but the context was stored in a single shared variable, causing each iteration to overwrite the previous position's context. Fixed by using closure-captured context in setInterval for each position, ensuring all enabled positions rotate independently.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New: Slide Indicators and Navigation Buttons can be enabled (see config settings)
New: Modules can be moved to different positions and CSS classes applied to them for each slide.
New: Multiple instances of a module can be used on different slides.
New: Integration with MMM-KeyBindings for keyboard and bluetooth remote navigation.