diff --git a/repository/src/main/resources/META-INF/resources/ootbee-support-tools/js/threads.js b/repository/src/main/resources/META-INF/resources/ootbee-support-tools/js/threads.js index 0a31826e..1fab37df 100644 --- a/repository/src/main/resources/META-INF/resources/ootbee-support-tools/js/threads.js +++ b/repository/src/main/resources/META-INF/resources/ootbee-support-tools/js/threads.js @@ -54,6 +54,31 @@ Admin.addEventListener(window, 'load', function() { toolName = newToolName; }; + + AdminTD.copyToClipboard = function copyToClipBoard(toSave) + { + var textToWrite, dump, tDump, area; + + dump = el(toSave); + if (dump) + { + tDump = dump.innerHTML; + textToWrite += tDump + "\n"; + } + + textToWrite = textToWrite.replace(//g, ""); + textToWrite = textToWrite.replace(//g, ""); + textToWrite = textToWrite.replace(/<\/span>/g, ""); + textToWrite = textToWrite.replace(/</g, "<"); + textToWrite = textToWrite.replace(/>/g, ">"); + + area = document.createElement('textarea'); + area.value = textToWrite; + document.body.appendChild(area); + area.select(); + document.execCommand('copy'); + document.body.removeChild(area); + }; AdminTD.saveTextAsFile = function saveTextAsFile(toSave) { @@ -158,6 +183,7 @@ Admin.addEventListener(window, 'load', function() if (selectors[i].id === "s" + tabName) { Admin.addClass(selectors[i], "selected"); + el("copycurrent").setAttribute("onclick", "AdminTD.copyToClipboard('" + tabName + "');"); el("savecurrent").setAttribute("onclick", "AdminTD.saveTextAsFile('" + tabName + "');"); } else diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.html.ftl b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.html.ftl index a731d1cc..fe426396 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.html.ftl +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.html.ftl @@ -34,6 +34,7 @@ Copyright (C) 2005 - 2020 Alfresco Software Limited.

${msg("threaddump.intro-text")?html}

<@button label=msg("threaddump.get-another") onclick="AdminTD.getDump();"/> + <@button id="copycurrent" class="copy" label=msg("threaddump.copycurrent") onclick="AdminTD.copyToClipboard('current');"/> <@button id="savecurrent" class="save" label=msg("threaddump.savecurrent") onclick="AdminTD.saveTextAsFile('current');"/> <@button class="save" label=msg("threaddump.saveall") onclick="AdminTD.saveTextAsFile('all');"/> diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.properties index 9c75cc76..a5c2311d 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get.properties @@ -2,4 +2,5 @@ threaddump.title=Thread Dump threaddump.intro-text=View and save thread dumps. threaddump.get-another=Get Another Thread Dump threaddump.saveall=Save All +threaddump.copycurrent=Copy Current Thread to Clipboard threaddump.savecurrent=Save Current Thread \ No newline at end of file diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_de.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_de.properties index d7b12a75..0a2e513c 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_de.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_de.properties @@ -1,5 +1,6 @@ threaddump.title=Prozessabbild threaddump.intro-text=Hier k\u00f6nnen Sie Prozessabbilder erstellen und speichern. threaddump.get-another=Weiteres Abbild erstellen -threaddump.saveall=Alles Speichern -threaddump.savecurrent=Aktuelles Abbild Speichern \ No newline at end of file +threaddump.saveall=Alle speichern +threaddump.copycurrent=Aktuelles Abbild in Zwischenablage kopieren +threaddump.savecurrent=Aktuelles Abbild speichern \ No newline at end of file diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_en.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_en.properties index 9c75cc76..a5c2311d 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_en.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_en.properties @@ -2,4 +2,5 @@ threaddump.title=Thread Dump threaddump.intro-text=View and save thread dumps. threaddump.get-another=Get Another Thread Dump threaddump.saveall=Save All +threaddump.copycurrent=Copy Current Thread to Clipboard threaddump.savecurrent=Save Current Thread \ No newline at end of file diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_es.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_es.properties index 4135d9c3..9c9fcfec 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_es.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_es.properties @@ -2,4 +2,5 @@ threaddump.title=Thread Dump threaddump.intro-text=Ver y salvar Thread Dumps (Volcados de hilos). threaddump.get-another=Obtener un Thread Dump threaddump.saveall=Salvar Todo +threaddump.copycurrent=Copy Current Thread to Clipboard threaddump.savecurrent=Salvar este Thread Dump \ No newline at end of file diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_it.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_it.properties index ed547b02..771ee298 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_it.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_it.properties @@ -2,4 +2,5 @@ threaddump.title=Dump del Thread threaddump.intro-text=Visualizza e salva i dump del thread threaddump.get-another=Ottieni un altro dump del Thread threaddump.saveall=Salva Tutto +threaddump.copycurrent=Copy Current Thread to Clipboard threaddump.savecurrent=Salva il thread corrente diff --git a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_pt.properties b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_pt.properties index e2865d19..71ec8003 100644 --- a/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_pt.properties +++ b/repository/src/main/resources/alfresco/templates/webscripts/org/orderofthebee/support-tools/admin/ootbee-support-tools/thread-dump.get_pt.properties @@ -2,4 +2,5 @@ threaddump.title=Dump de Thread threaddump.intro-text=Visualizar e salvar dumps de threads. threaddump.get-another=Obter outro Dump de Thread threaddump.saveall=Salvar Tudo +threaddump.copycurrent=Copy Current Thread to Clipboard threaddump.savecurrent=Salvar Thread Atual