Skip to content
Snippets Groups Projects
Commit 919351de authored by Fabien  MAREUIL's avatar Fabien MAREUIL
Browse files

add waiting gif on tmap

parent 7db147f1
No related branches found
No related tags found
No related merge requests found
Pipeline #132481 passed
......@@ -35,7 +35,16 @@
</div>
</div>
<div class="row d-flex">
<div id="webgl-message" class="messages inner-wrap" style="display: none;">
<div class="alert alert-warning" role="alert">
<strong>WebGL is not available in your browser.</strong>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>
<iframe id="encoder_iframe" style="min-height:800px !important; width:100%;" src="{% url 'pocketome_html' %}">
</iframe>
</div>
<div class="row d-flex mb-3 justify-content-md-end">
......@@ -43,5 +52,53 @@
<div class="error"></div>
</div>
</div>
<div class="modal fade" id="waitingmodal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="text-center">
<h3>Please Wait</h3>
<p class="loader"></p>
</div>
</div>
</div>
</div>
</div>
<script src="{% static 'js/targetcentrict_networks.js' %}"></script>
<script>
$(document).ready(function () {
var modalShown = false;
$('#waitingmodal').on('shown.bs.modal', function () {
modalShown = true;
}).modal('show');
$('#encoder_iframe').on('load', function () {
if (modalShown) {
$('#waitingmodal').modal('hide');
} else {
$('#waitingmodal').on('shown.bs.modal', function () {
$('#waitingmodal').modal('hide');
});
}
});
});
document.addEventListener("DOMContentLoaded", function () {
// Check WebGL availability
if (!checkWebGL()) {
// Show the message if WebGL is not available
var webglMessage = document.getElementById("webgl-message");
webglMessage.style.display = "block";
}
});
// Function to check WebGL availability
function checkWebGL() {
try {
var canvas = document.createElement('canvas');
return !!window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'));
} catch (e) {
return false;
}
}
</script>
{% endblock %}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment