From f78cdc449542c92c79105f2ce703e87c4b25865e Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Tue, 6 Dec 2022 17:05:16 +0000
Subject: [PATCH] fhemweb.js: tell the user if the copy text was truncated
 (Forum #129858)

git-svn-id: https://svn.fhem.de/fhem/trunk@26801 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
 fhem/www/pgm2/fhemweb.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fhem/www/pgm2/fhemweb.js b/fhem/www/pgm2/fhemweb.js
index f0917eaed..ce0a372f7 100644
--- a/fhem/www/pgm2/fhemweb.js
+++ b/fhem/www/pgm2/fhemweb.js
@@ -1001,16 +1001,17 @@ FW_detLink()
 
     } else if(cmd == "forumCopy") {
       FW_cmd(FW_root+"?cmd=list -r -i "+dev+"&XHR=1", function(data) {
-        var ta = document.createElement("textarea");
+        var ta = document.createElement("textarea"), at="";
         if(data.length > 50*1000) {
           data = data.substr(0,50*1000)+
                   "\n# ... truncated to 50k, original length "+data.length;
+          at = "<br><br>Text truncated to 50k due to forum restrictions.";
         }
         ta.value = '[code]'+data+'[/code]';
         document.body.appendChild(ta);
         ta.select();
         if(document.execCommand('copy'))
-          FW_okDialog('"forum ready" definition copied to the clipboard.');
+          FW_okDialog('"forum ready" definition copied to the clipboard.'+at);
          else
           FW_okDialog('Could not copy');
         document.body.removeChild(ta);