Add MediaPlace support to media-picker widgets - #441
Conversation
Custom-Link, the medialist widget (REX_MEDIALIST/REX_CUSTOM_MEDIALIST), and the older imglist widget now detect an active MediaPlace addon and open its overlay instead of the classic mediapool popup/upload pages. Falls back to unchanged classic behavior when MediaPlace isn't active. Detection/picking logic lives in a new shared assets/js/mediaplace-bridge.js (window.rex5MediaplaceBridge), mirroring the same pattern already used by the tinymce and cke5 addons, so all three widget scripts share one definition instead of duplicating it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughMoin. Version 9.4.0 ergänzt eine zentrale MediaPlace-Bridge. Custom-Link-, Bilderlisten- und Medialisten-Widgets nutzen bei aktivem MediaPlace das Overlay. Ohne MediaPlace bleiben die bisherigen REX-Popups aktiv. ChangesMediaPlace-Unterstützung für Medien-Widgets
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to When MediaPlace is active, the affected widgets use the overlay and otherwise retain existing behavior. No concrete user-impacting defect or merge-blocking risk remains, so the change is merge-ready after normal checks. Sequence Diagram(s)sequenceDiagram
participant RedaxoBackend
participant MedienWidget
participant rex5MediaplaceBridge
participant MP3
RedaxoBackend->>MedienWidget: lädt mediaplace-bridge.js
MedienWidget->>rex5MediaplaceBridge: isActive()
MedienWidget->>rex5MediaplaceBridge: pick(callback, filter)
rex5MediaplaceBridge->>MP3: open(options)
MP3-->>MedienWidget: ausgewählte Dateien
MedienWidget->>MedienWidget: aktualisiert Optionen und Vorschau
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 30.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 5 files. (3 skipped: 3 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
MediaPlace's options.filter is only a starting tab, not a hard restriction -- a configured types="jpg,png" widget config would silently stop being enforced once MediaPlace took over the picker. Wire the new MP3.open() allowedExtensions option (mediaplace >=1.3.6) through all three widgets so the restriction still holds. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Zusammenfassung
REX_MEDIALIST/REX_CUSTOM_MEDIALIST, Aktionen „Öffnen"/„Hinzufügen"/„Ansehen") und das ältere Bilderlisten-Widget öffnen jetzt automatisch das MediaPlace-Overlay statt des klassischen Medienpool-Popups bzw. der Upload-Seite, sofern MediaPlace installiert und aktiv ist.assets/js/mediaplace-bridge.js(window.rex5MediaplaceBridge) – gleiches Prinzip wie bei den tinymce-/cke5-AddOns, hier aber an einer Stelle definiert und von allen drei Widget-Skripten genutzt statt dupliziert.types="jpg,png"-Beschränkung bleibt weiterhin hart durchgesetzt: MediaPlace bekommt in 1.3.6 eine neueMP3.open()-OptionallowedExtensions, die nicht passende Dateien komplett aus dem Grid ausblendet und die Auswahl blockiert (statt nur den Start-Tab zu setzen, wie esfilterschon vorher tat). Ohne MediaPlace ≥1.3.6 filtert die alte, weicherefilter-Option weiterhin nur den Start-Tab.Test-Plan
node --checkauf allen JS-Dateienphp -laufboot.phpallowedExtensions-Filterlogik isoliert mit Node getestet (Groß-/Kleinschreibung, Whitelist/kein Filter)types=-Einschränkung) – bitte vor Merge gegenprüfen🤖 Generated with Claude Code