How jonesyenmin/modal-popup works
Main Components
A. Core Library Components:
• Modal Video Core (lib/core/index.js)
• DOM Parser (lib/lib/dom-parser.js)
• Utility Functions (lib/lib/util.js)
• jQuery Adapter (lib/adaptor/jquery.js)
B. External Integration Points:
• YouTube Player API
• Vimeo Player API
• jQuery Integration Layer
┌─ Application Layer (Consumer Code) ─────────────────┐
• [HTML Button Trigger] → [Modal Video Instance] │
• Core Layer ────────────────────┐ │
• ┌─────────────┐ ┌──────────────┐ │ │
• Modal Manager│ ←→ │DOM Controller│ │ │
• ┘ └──────────────┘ │ │
• ↓ ↓ │ │
• ┌─────────────┐ ┌──────────────┐ │ │
• Event Handler│ ←→ │Utility Helper│ │ │
• ┘ └──────────────┘ │ │
• Integration Layer ─────────────────┐│ │
• ┌─────────────┐ ┌──────────────┐ ││ │
• YouTube API │ │ Vimeo API │ ││ │
• Integration │ │ Integration │ ││ │
• ┘ └──────────────┘ ││ │
• ↓ ↓ ││ │
• ┌────────────────────────────────────┐ ││ │
• jQuery Adapter Layer │ ││ │
• ┘ ││ │
• ┘│ │
• ┘
Component Relationships to Highlight
a. Modal Initialization Flow:
• HTML Trigger → Modal Video Instance
• Modal Manager → DOM Controller
• Event Handler → Video API Integration
b. Video Player Integration:
• Core → YouTube/Vimeo API
• jQuery Adapter → Core Components
Important Details
• Configuration options flow
• Event handling system
• DOM manipulation paths
• API integration points
• Accessibility features
Technical Specifications to Note
• Support for both YouTube and Vimeo
• jQuery compatibility
• CSS transition handling
• Accessibility support
• Configuration options