// 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. // Copy the item id to the clipboard and flash feedback on the button. The // revert is core/clipboard.ts's, through the legacy bridge, and its duration is // `Intent::Revert`. window.onCopyItemId = function (id) { window.copyWithFeedback(this, id, 'Copied!'); }; // 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(); };