changeset 5245:b2de3a2ad3b9

Orthanc Explorer: buttons to copy the URL of ZIP/DICOM to the clipboard
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 07 Apr 2023 12:20:27 +0200
parents c9e2c6d1cd62
children b36f82260f41 742448a9b600
files NEWS OrthancServer/OrthancExplorer/explorer.html OrthancServer/OrthancExplorer/explorer.js
diffstat 3 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/NEWS	Wed Apr 05 17:54:21 2023 +0200
+++ b/NEWS	Fri Apr 07 12:20:27 2023 +0200
@@ -13,6 +13,11 @@
 * Added "OrthancPluginRegisterDatabaseBackendV4()" to communicate using Google
   Protocol Buffers between the Orthanc core and database plugins
 
+Orthanc Explorer
+----------------
+
+* Added buttons to copy the URL of ZIP archives and DICOM files to the clipboard
+
 Maintenance
 -----------
 
--- a/OrthancServer/OrthancExplorer/explorer.html	Wed Apr 05 17:54:21 2023 +0200
+++ b/OrthancServer/OrthancExplorer/explorer.html	Fri Apr 07 12:20:27 2023 +0200
@@ -262,6 +262,7 @@
               </li>
               <li data-icon="gear"><a href="#" id="patient-archive">Download ZIP</a></li>
               <li data-icon="gear"><a href="#" id="patient-media">Download DICOMDIR</a></li>
+              <li data-icon="gear"><a href="#" id="patient-archive-link">Copy link to ZIP</a></li>
             </ul>
           </div>
         </div>
@@ -316,6 +317,7 @@
               </li>
               <li data-icon="gear"><a href="#" id="study-archive">Download ZIP</a></li>
               <li data-icon="gear"><a href="#" id="study-media">Download DICOMDIR</a></li>
+              <li data-icon="gear"><a href="#" id="study-archive-link">Copy link to ZIP</a></li>
             </ul>
           </div>
         </div>
@@ -372,6 +374,7 @@
               <li data-icon="search"><a href="#" id="series-preview">Preview this series</a></li>
               <li data-icon="gear"><a href="#" id="series-archive">Download ZIP</a></li>
               <li data-icon="gear"><a href="#" id="series-media">Download DICOMDIR</a></li>
+              <li data-icon="gear"><a href="#" id="series-archive-link">Copy link to ZIP</a></li>
             </ul>
           </div>
         </div>
@@ -426,6 +429,7 @@
                 <a href="#" id="instance-modified-from">Before modification</a>
               </li>
               <li data-icon="arrow-d"><a href="#" id="instance-download-dicom">Download the DICOM file</a></li>
+              <li data-icon="arrow-d"><a href="#" id="instance-download-link">Copy link to the DICOM file</a></li>
               <li data-icon="arrow-d"><a href="#" id="instance-download-json">Download the JSON file</a></li>
               <li data-icon="search"><a href="#" id="instance-preview">Preview the instance</a></li>
             </ul>
--- a/OrthancServer/OrthancExplorer/explorer.js	Wed Apr 05 17:54:21 2023 +0200
+++ b/OrthancServer/OrthancExplorer/explorer.js	Fri Apr 07 12:20:27 2023 +0200
@@ -1365,6 +1365,36 @@
   window.location.href = '../series/' + $.mobile.pageData.uuid + '/media';
 });
 
+
+$('#patient-archive-link').live('click', function(e) {
+  e.preventDefault();
+  var url = new URL('../patients/' + $.mobile.pageData.uuid + '/archive', window.location.href);
+  navigator.clipboard.writeText(url.href);
+  $(e.target).closest('li').buttonMarkup({ icon: 'check' });
+});
+
+$('#study-archive-link').live('click', function(e) {
+  e.preventDefault();
+  var url = new URL('../studies/' + $.mobile.pageData.uuid + '/archive', window.location.href);
+  navigator.clipboard.writeText(url.href);
+  $(e.target).closest('li').buttonMarkup({ icon: 'check' });
+});
+
+$('#series-archive-link').live('click', function(e) {
+  e.preventDefault();
+  var url = new URL('../series/' + $.mobile.pageData.uuid + '/archive', window.location.href);
+  navigator.clipboard.writeText(url.href);
+  $(e.target).closest('li').buttonMarkup({ icon: 'check' });
+});
+
+$('#instance-download-link').live('click', function(e) {
+  e.preventDefault();
+  var url = new URL('../instances/' + $.mobile.pageData.uuid + '/file', window.location.href);
+  navigator.clipboard.writeText(url.href);
+  $(e.target).closest('li').buttonMarkup({ icon: 'check' });
+});
+
+
 $('.patient-attachment').live('click', function(e) {
   e.preventDefault();  //stop the browser from following
   window.location.href = '../patients/' + $.mobile.pageData.uuid + '/attachments/' + e.target.id + '/data';