- Add safety checks for window.openTTSModal and window.openTranslateModal availability - Implement fallback dynamic imports if window functions not available - Prevents "window.openTTSModal is not a function" and "window.openTranslateModal is not a function" errors - Provides graceful error handling with user feedback if modal imports fail - Resolves loading order dependency issues between ui.js and embed modal This ensures modal buttons work regardless of script loading order.
6 lines
No EOL
167 B
JavaScript
6 lines
No EOL
167 B
JavaScript
// Mock for highlight.js library
|
|
export default {
|
|
highlightElement: jest.fn(),
|
|
highlightAll: jest.fn(),
|
|
highlight: jest.fn((lang, code) => ({ value: code })),
|
|
}; |