~canonical-server/+junk/naroll

« back to all changes in this revision

Viewing changes to templates/index.html

  • Committer: Scott Moser
  • Date: 2010-10-29 15:26:00 UTC
  • Revision ID: smoser@ubuntu.com-20101029152600-dpu62ba358yburkl
changes for changin happy face and larger

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
    {
16
16
      $.get('/naroll/reset');
17
17
    }
 
18
{% if user.username in admins %}
18
19
    function click_off()
19
20
    {
 
21
      toggle_state("off");
20
22
      $.get('/naroll/off');
21
23
    }
22
24
    function click_on()
23
25
    {
 
26
      toggle_state("on");
24
27
      $.get('/naroll/on');
25
28
    }
 
29
    function toggle_state(newstate)
 
30
    {
 
31
       if (newstate == "on") {
 
32
          f = $("#facestate")
 
33
          f.attr("src","/media/happy.jpg");
 
34
          f.unbind("click");
 
35
          f.click(function() { click_off(); });
 
36
       } else {
 
37
          f = $("#facestate")
 
38
          f.attr("src","/media/sad.jpg");
 
39
          f.unbind("click");
 
40
          f.click(function() { click_on() });
 
41
       }
 
42
    }
 
43
    $(document).ready(function() { toggle_state("off"); } );
 
44
 
 
45
{% endif %}
26
46
                var last = 0;
27
47
                var refreshId = setInterval(function() {
28
48
                        $.get('/naroll/poll', function(data) {
32
52
</head>
33
53
<body>
34
54
{% if user.username in admins %}
35
 
<img onclick="click_on();" src="/media/happy.jpg"><img onclick="click_off();" src="/media/sad.jpg">
 
55
<img id="facestate" src="/media/sad.jpg">
36
56
{% endif %}
37
57
<div id="picspace" />
38
58
<div id="narwhal"></div>