<commit_before>{% extends "vncbrowser/common.html" %}

{% block title %}Login to CATMAID{% endblock %}

{% block extrascript %}
    <script type="text/javascript" charset="utf-8">
      var catmaidLoginURL = "{{ catmaid_login|escapejs }}";
      var returnURL = "{{ return_url|escapejs }}";
      var loginToCATMAID = function() {
          $('#message').show().text('Logging in...');
          $('#error').hide();
          var username = document.getElementById('username').value;
          var password = document.getElementById('password').value;
          $.post(catmaidLoginURL,
            {'name': username, 'pwd': password},
            function(data) {
                $('#message').hide();
                if (data.error) {
                    $('#error').show().text("Login failed");
                } else if (data.notice) {
                    alert("Notice: "+data.notice);
                    $('#error').show().text("Login failed");
                } else if (data.id) {
                    if (!returnURL) {
                        returnURL = "{{ catmaid_url|escapejs }}";
                    }
                    alert("returnURL is '"+returnURL+"'");
                    document.location.href = returnURL;
                }
          }, "json");
      };
      var staticURLPrefix = "{{static|escapejs}}";
    </script>
{% endblock %}

{% block main %}

<h2>Login to CATMAID</h2>

<p style="color: red; display: none" id="error"></p>
<p style="display: none" id="message">Logging in...</p>

<form method="post" action="{{ catmaid_login }}" onsubmit="loginToCATMAID(); return false">
  <p>username: <input type="text" id="username" name="username" size="8"/></p>
  <p>password: <input type="password" id="password" name="password" size="8"/></p>
  <p><input type="submit" id="login" name="login" value="Login"></p>
</form>

{% endblock %}
<commit_msg>Remove an alert() which was in for debugging purposes<commit_after>{% extends "vncbrowser/common.html" %}

{% block title %}Login to CATMAID{% endblock %}

{% block extrascript %}
    <script type="text/javascript" charset="utf-8">
      var catmaidLoginURL = "{{ catmaid_login|escapejs }}";
      var returnURL = "{{ return_url|escapejs }}";
      var loginToCATMAID = function() {
          $('#message').show().text('Logging in...');
          $('#error').hide();
          var username = document.getElementById('username').value;
          var password = document.getElementById('password').value;
          $.post(catmaidLoginURL,
            {'name': username, 'pwd': password},
            function(data) {
                $('#message').hide();
                if (data.error) {
                    $('#error').show().text("Login failed");
                } else if (data.notice) {
                    alert("Notice: "+data.notice);
                    $('#error').show().text("Login failed");
                } else if (data.id) {
                    if (!returnURL) {
                        returnURL = "{{ catmaid_url|escapejs }}";
                    }
                    document.location.href = returnURL;
                }
          }, "json");
      };
      var staticURLPrefix = "{{static|escapejs}}";
    </script>
{% endblock %}

{% block main %}

<h2>Login to CATMAID</h2>

<p style="color: red; display: none" id="error"></p>
<p style="display: none" id="message">Logging in...</p>

<form method="post" action="{{ catmaid_login }}" onsubmit="loginToCATMAID(); return false">
  <p>username: <input type="text" id="username" name="username" size="8"/></p>
  <p>password: <input type="password" id="password" name="password" size="8"/></p>
  <p><input type="submit" id="login" name="login" value="Login"></p>
</form>

{% endblock %}

{'fraction_non_alphanumeric': 0.188623557821304, 'fraction_numerical': 0.002683123155352831, 'mean_word_length': 2.334525939177102, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6945001', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1053, 'n_words': 225}