Posts

Showing posts from June, 2025

Click to Copy with Toast and No Alert Pop Up (thanks chatGPT and Sam Altman)

Click to Copy with a Toast Message (No Alert) Here’s how you can display code like the one below: hiSetBindKey("Schematics" " F5" "hiDeiconifyWindow(window(1)) && hiRaiseWindow(window(1))") ...and allow users to: Click the code to copy it to clipboard See a small toast saying Copied! next to the label All without triggering an alert box 🔧 Full HTML + CSS + JS (Paste in a blog post) This version is safe even with quotes and parentheses — it programmatically sets the text to avoid HTML escaping issues. <style> .copy-container { position: relative; margin: 1.5em 0; } .copy-label { font-weight: bold; margin-bottom: 0.4em; } .copy-text { display: inline-block; padding: 0.5em 0.8em; border: 1px solid #ccc; background: #f4f4f4; font-family: monospace; white-space: pre-wrap; cursor: pointer; user-select: none; transition: background 0.2s ease; } .copy-text:h...