Merge pull request #609 from minrk/only-relevant-warning

hide http warning until it's relevant
This commit is contained in:
Matthias Bussonnier
2016-06-14 09:42:24 -07:00
committed by GitHub

View File

@@ -22,9 +22,9 @@
</div> </div>
<div class='auth-form-body'> <div class='auth-form-body'>
<p id='insecure-login-warning'> <p id='insecure-login-warning' class='hidden'>
Warning: JupyterHub seems to be served over an unsecured HTTP connection. Warning: JupyterHub seems to be served over an unsecured HTTP connection.
We strongly recommend enabling TLS for JupyterHub. We strongly recommend enabling HTTPS for JupyterHub.
</p> </p>
{% if login_error %} {% if login_error %}
@@ -72,8 +72,10 @@
{{super()}} {{super()}}
<script> <script>
if (window.location.protocol === "https:") { if (window.location.protocol === "http:") {
var warnings = document.getElementById('insecure-login-warning').remove() // unhide http warning
var warning = document.getElementById('insecure-login-warning');
warning.className = warning.className.replace(/\bhidden\b/, '');
} }
</script> </script>