зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-08-29 07:46:17 +03:00
- Switch to ActiveAdmin 4 beta with Tailwind CSS - Replace Sprockets with Propshaft for Rails 8 - Migrate from jQuery to vanilla JavaScript - Implement proper module initialization without setTimeout hacks - Add esbuild for JavaScript bundling with clean import aliases - Configure Tailwind CSS build process with ActiveAdmin plugin - Update engine configuration for both Propshaft and Sprockets - Add comprehensive documentation for AA4 gem updates - Maintain backward compatibility with legacy AA versions 🤖 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();
|
|
} |