From 28c8384a0d42d2eb15259e54009f7c3c8849fdce Mon Sep 17 00:00:00 2001 From: edbrz9 Date: Thu, 29 Dec 2022 15:19:38 +0100 Subject: [PATCH] component update --- proj/y2t/assets/js/main.js | 21 ++++++++------------- proj/y2t/handler.php | 8 ++++---- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/proj/y2t/assets/js/main.js b/proj/y2t/assets/js/main.js index 92af526..1e8154b 100644 --- a/proj/y2t/assets/js/main.js +++ b/proj/y2t/assets/js/main.js @@ -2,24 +2,19 @@ Vue.component('Copybox',{ template : `
- +

{{ txt }}

`, props : { - obj : Object - }, - data () { - return { - siteoff : { - fr : "Site officiel", - en : "Official website", - it : "Sito ufficiale", - }, - } + txt : String }, methods : { - copyToClipboard(){ - + copyToClipboard() { + navigator.clipboard.writeText(this.txt).then(() => { + console.log('Text copied to clipboard'); + }, (err) => { + console.error('Failed to copy text: ', err); + }); }, } }) diff --git a/proj/y2t/handler.php b/proj/y2t/handler.php index 34d92d1..c9d59b3 100644 --- a/proj/y2t/handler.php +++ b/proj/y2t/handler.php @@ -40,9 +40,10 @@ foreach ($output as $item) { - echo '
'; - echo $item; - echo '
'; + echo ''; + //echo '
'; + //echo $item; + //echo '
'; } //echo nl2br("\n END OF THE OUTPUT\n"); /* @@ -57,7 +58,6 @@ var_export($ret); */ ?> -