- 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.
5 lines
No EOL
130 B
JavaScript
5 lines
No EOL
130 B
JavaScript
// Mock for marked library
|
|
export const marked = {
|
|
parse: jest.fn((content) => `<p>${content}</p>`),
|
|
setOptions: jest.fn(),
|
|
}; |