File: home.html

package info (click to toggle)
django-session-security 2.6.7%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 660 kB
  • sloc: javascript: 6,675; python: 594; makefile: 134; sh: 10
file content (29 lines) | stat: -rw-r--r-- 718 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{% extends 'admin/base_site.html' %}

{% block content %}
<h2>Simulate long running request</h2>

Set an amount of seconds and focusout of this field:
<input name="seconds" />
{% endblock %}

{% block footer %}
{{ block.super }}
<script type="text/javascript">
    $(document).ready(function(){
        function longRunningRequest() {
            $.get(
                '{% url "sleep" %}', 
                {seconds: $('input[name=seconds]').val()}, 
                function(data, textStatus, jqXHR) {
                    longRunningRequest();
                }
            )
        }

        $('input[name=seconds]').blur(function() {
            longRunningRequest()
        });
    });
</script>
{% endblock %}