~larry-e-works/uci-engine/write-exitcode-to-file

« back to all changes in this revision

Viewing changes to webui/webui_ticket_list.js

  • Committer: Joe Talbott
  • Date: 2014-01-23 19:29:38 UTC
  • mto: (126.2.10 webui)
  • mto: This revision was merged to the branch mainline in revision 161.
  • Revision ID: joe.talbott@canonical.com-20140123192938-pdcv9cysfu8s5eeg
Add webui app

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
YUI().use('node', 'datatable-mutable', 'webui', function(Y) {
 
2
 
 
3
  var url_prefix = "/api/";
 
4
  var uri = 'api_example.json';
 
5
 
 
6
  Y.webui.make_main_table('#table');
 
7
 
 
8
  Y.delegate('click', function(e) {
 
9
    var target = e.currentTarget;
 
10
    var id = target.ancestor('tr').get('id');
 
11
    var ticket_id = this.getRecord(id).get('ticket_id');
 
12
    var url = "/ticket.html?ticket_id=" + ticket_id;
 
13
 
 
14
    location = url;
 
15
  }, '#table', 'td', Y.webui.main_table); 
 
16
 
 
17
  Y.webui.get_config();
 
18
  Y.webui.get_tickets();
 
19
 
 
20
  var refresh_rate = Y.one("#refresh_rate");
 
21
  refresh_timeout = null;
 
22
  refresh_rate.on('change', function(e) {
 
23
    var value = refresh_rate.get('value');
 
24
    if (refresh_timeout) {
 
25
      clearTimeout(refresh_timeout);
 
26
    }
 
27
    interval = parseInt(value) * 1000;
 
28
    Y.webui.update_tickets();
 
29
  });
 
30
 
 
31
});
 
32
 
 
33
/* Unit tests */
 
34
YUI().use('webui', function(Y) {
 
35
 
 
36
});