summaryrefslogtreecommitdiff
blob: 9bdf740edae5c4e9efc2f716e060a092c7497d03 (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/** Keyboard events **/
document.onkeyup = function(e){ 
  var keycode;
  
  if (e == null) { // ie 
    keycode = event.keyCode; 
  } else { // mozilla 
    keycode = e.which; 
  } 

  if (keycode == 27) {
    if (uki('#nfu-popup').visible())
      uki('#nfu-popup').hide();
    if (uki('#assign-popup').visible())
      uki('#assign-popup').hide();
    if (uki('#file-1-popup').visible())
      uki('#file-1-popup').hide();
    if (uki('#file-2-popup').visible())
      uki('#file-2-popup').hide();
    
    enableMainView();
    uki('Table').focus();
  } else if (keycode == 13 && e.ctrlKey) {
    if (uki('#nfu-popup').visible())
      uki('#cve-nfu-go').click();
    if (uki('#assign-popup').visible())
      uki('#cve-assign-go').click();
    if (uki('#file-1-popup').visible())
      uki('#cve-file-1-go').click();
    if (uki('#file-2-popup').visible())
      uki('#cve-file-2-go').click();
  }
};

uki('Table').keyup(
  function(e) {
    var c = e.keyCode;
    //alert(c);
    
    if (c == 110 || c == 78) { // n;N
      uki('#cve-mark-nfu').click();
      return;
    }
    
    if (c == 108 || c == 76) { // l;L
      uki('#cve-mark-later').click();
      return;      
    }
    
    if (c == 105 || c == 73) { // i;I
      uki('#cve-mark-invalid').click();
      return;      
    }

    if (c == 97 || c == 65 || c == 51) { // a;A;#
      uki('#assign-bug-nr').focus();
      return;      
    }
    
    if (c == 102 || c == 70 || c == 98 || c == 66) { // f;F;b;B
      uki('#cve-file').click();
      return;      
    }

    if (c == 13) { // enter key
      uki('#cve-details').click();
      return;
    }
  }
);
/** Keyboard events end **/