From 42044bcb7adbf29a57e466d7771b647c4790ab11 Mon Sep 17 00:00:00 2001 From: Mario Ostieri <107915956+mariostieriansys@users.noreply.github.com> Date: Tue, 15 Oct 2024 15:42:40 +0200 Subject: [PATCH] fix versioning of jquery in deep pixel html and copy bootstrap css across (#457) --- src/ansys/pyensight/core/deep_pixel_view.html | 2 +- src/ansys/pyensight/core/renderable.py | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ansys/pyensight/core/deep_pixel_view.html b/src/ansys/pyensight/core/deep_pixel_view.html index bbadd70c500..8464dd1a866 100644 --- a/src/ansys/pyensight/core/deep_pixel_view.html +++ b/src/ansys/pyensight/core/deep_pixel_view.html @@ -3,7 +3,7 @@
- + diff --git a/src/ansys/pyensight/core/renderable.py b/src/ansys/pyensight/core/renderable.py index 359bdaa247b..7c798161701 100644 --- a/src/ansys/pyensight/core/renderable.py +++ b/src/ansys/pyensight/core/renderable.py @@ -389,11 +389,14 @@ def update(self): for script in ["geotiff.js", "geotiff_nexus.js", "bootstrap.min.js"]: name = base_name + f"'{script}')" cmd += f'shutil.copy({name}, r"""{self._session.launcher.session_directory}""")\n' + name = "os.path.join(enve.home(), f'nexus{ceiversion.nexus_suffix}', 'django', " + name += "'website', 'static', 'website', 'content', 'bootstrap.min.css')" + cmd += f'shutil.copy({name}, r"""{self._session.launcher.session_directory}""")\n' self._session.cmd(cmd, do_eval=False) + jquery_version = "" if int(self._session._cei_suffix) < 251: - jquery = "jquery-3.4.1.min.js" - else: - jquery = "jquery.min.js" + jquery_version = "-3.4.1" + jquery = f"jquery{jquery_version}.min.js" cmd = "import shutil, enve, ceiversion, os.path\n" name = base_name + f"'{jquery}')" cmd += "try:" @@ -410,6 +413,7 @@ def update(self): html = html.replace("TIFF_URL", tiff_url) html = html.replace("ITEMID", self._guid) html = html.replace("OPTIONAL_QUERY", optional_query) + html = html.replace("JQUERY_VERSION", jquery_version) # refresh the remote HTML self._save_remote_html_page(html) super().update()