зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-08-28 15:36:17 +03:00
- Rename vendor JS file to activeadmin/quill_editor.js to avoid conflicts - Update import alias to use 'activeadmin/quill_editor' for consistency - Remove jQuery-dependent legacy file (quill_editor_input.js) - Simplify engine asset configuration - only one JS file now - Update documentation with correct paths and import names - All functionality preserved with vanilla JavaScript BREAKING CHANGE: Drops support for jQuery-based initialization. Applications using the legacy jQuery initialization will need to update to the new module-based approach. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
26 строки
955 B
JavaScript
26 строки
955 B
JavaScript
// Import ActiveAdmin - this already includes all features and Rails UJS
|
|
// DO NOT import Rails separately as it's already included and started in ActiveAdmin
|
|
import '@activeadmin/activeadmin';
|
|
|
|
// Import Quill from NPM and make it globally available
|
|
import Quill from 'quill';
|
|
window.Quill = Quill;
|
|
|
|
// Import the image uploader plugin if available (optional)
|
|
try {
|
|
const ImageUploader = require('quill-image-uploader');
|
|
window.ImageUploader = ImageUploader.default || ImageUploader;
|
|
} catch(e) {
|
|
// Image uploader is optional (silent failure)
|
|
}
|
|
|
|
// Import the Quill Editor initialization module
|
|
import QuillEditorModule from 'activeadmin/quill_editor';
|
|
|
|
// Now that Quill is available, initialize the editors
|
|
// This ensures proper initialization order without setTimeout hacks
|
|
if (window.QuillEditor && window.QuillEditor.init) {
|
|
window.QuillEditor.init();
|
|
} else if (QuillEditorModule && QuillEditorModule.init) {
|
|
QuillEditorModule.init();
|
|
} |