diff Sources/OrthancExplorer.js @ 46:9b2a2fcc9878 nexus

added option to disable Nexus support
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 10 Apr 2024 07:49:45 +0200
parents 967f947014ac
children 83b1abee3ece
line wrap: on
line diff
--- a/Sources/OrthancExplorer.js	Tue Apr 09 22:13:01 2024 +0200
+++ b/Sources/OrthancExplorer.js	Wed Apr 10 07:49:45 2024 +0200
@@ -395,27 +395,29 @@
 
 
 function AddOpenStlNexusButton(instanceId, id, parent) {
-  $.ajax({
-    url: '/instances/' + instanceId + '/content/0008,9123',
-    success: function(creatorVersionUid) {
-      if (creatorVersionUid == STL_PLUGIN_NEXUS_CREATOR_VERSION_UID) {
-        var b = $('<a>')
-            .attr('id', id)
-            .attr('data-role', 'button')
-            .attr('href', '#')
-            .attr('data-icon', 'search')
-            .attr('data-theme', 'e')
-            .text('Nexus 3D viewer')
-            .button();
+  if (${IS_NEXUS_ENABLED}) {
+    $.ajax({
+      url: '/instances/' + instanceId + '/content/0008,9123',
+      success: function(creatorVersionUid) {
+        if (creatorVersionUid == STL_PLUGIN_NEXUS_CREATOR_VERSION_UID) {
+          var b = $('<a>')
+              .attr('id', id)
+              .attr('data-role', 'button')
+              .attr('href', '#')
+              .attr('data-icon', 'search')
+              .attr('data-theme', 'e')
+              .text('Nexus 3D viewer')
+              .button();
 
-        b.insertAfter($('#' + parent));
+          b.insertAfter($('#' + parent));
 
-        b.click(function() {
-          window.open('../stl/nexus/threejs.html?model=../../instances/' + instanceId + '/nexus');
-        });
+          b.click(function() {
+            window.open('../stl/nexus/threejs.html?model=../../instances/' + instanceId + '/nexus');
+          });
+        }
       }
-    }
-  });
+    });
+  }
 }