From 413d3715c759a4e13f76f2a9f410aa811eefe339 Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Sun, 24 Nov 2024 18:32:48 -0600 Subject: [PATCH] added a "copy all" button --- src/scripts/main.js | 5 ++++- src/templates/suggestion-list-content.hbs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/scripts/main.js b/src/scripts/main.js index 34b9124..6a882d8 100644 --- a/src/scripts/main.js +++ b/src/scripts/main.js @@ -15,7 +15,10 @@ const TEMPLATES = { function registerClipboardCopyButton() { copyToClipboardListener = (event) => { - const text=event.target.dataset.clipboardText; + let text=event.target.dataset.clipboardText; + if (text.includes(';;;')){ + text = text.split(';;;').join('\n') + } console.log(`Session Title Suggestions | Copying "${text}" to clipboard`); navigator.clipboard.writeText(text) } diff --git a/src/templates/suggestion-list-content.hbs b/src/templates/suggestion-list-content.hbs index 44c6f70..419a057 100644 --- a/src/templates/suggestion-list-content.hbs +++ b/src/templates/suggestion-list-content.hbs @@ -1,3 +1,3 @@ \ No newline at end of file +{{~/each~}} Copy All \ No newline at end of file