Skip to content

Commit

Permalink
fix versioning of jquery in deep pixel html and copy bootstrap css ac…
Browse files Browse the repository at this point in the history
…ross (#457)
  • Loading branch information
mariostieriansys authored Oct 15, 2024
1 parent b6ebee1 commit 42044bc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/ansys/pyensight/core/deep_pixel_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<link rel="stylesheet" type="text/css" href="/bootstrap.min.cssOPTIONAL_QUERY"/>

<script src='/jquery-3.4.1.min.jsOPTIONAL_QUERY'></script>
<script src='/jqueryJQUERY_VERSION.min.jsOPTIONAL_QUERY'></script>
<script src='/geotiff.jsOPTIONAL_QUERY'></script>
<script src='/geotiff_nexus.jsOPTIONAL_QUERY'></script>
<script src="/bootstrap.min.jsOPTIONAL_QUERY"></script>
Expand Down
10 changes: 7 additions & 3 deletions src/ansys/pyensight/core/renderable.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:"
Expand All @@ -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()
Expand Down

0 comments on commit 42044bc

Please sign in to comment.