// Delegated event handlers extracted from inline on* attributes in the // dashboard, dashboard editor, embed, and wizard templates, moved here for CSP // compliance (so script-src can drop 'unsafe-inline'). The dispatcher in // the core module invokes each of these by name with `this` bound to the dispatching // element and any data-arg/data-arg2 attributes passed as arguments. Bodies // are preserved verbatim from the original inline handlers. // Reactivate-account form: schedule a page reload after the HTMX request. window.reactivateReload = function () { setTimeout(function(){ window.location.reload(); }, 500); }; // Copy the item id to the clipboard and flash feedback on the button. The // revert is core/clipboard.ts's, through the legacy bridge; 1500 is the // duration this button already used. window.onCopyItemId = function (id) { window.copyWithFeedback(this, id, 'Copied!', 1500); }; // Custom page reset form: confirm before submitting. data-submit auto-prevents // the native submit, so re-submit programmatically when confirmed. window.confirmResetPage = function () { if (confirm('Reset this page to the platform default? This clears your custom HTML and CSS.')) this.submit(); };