aboutsummaryrefslogtreecommitdiff
path: root/src/dashboard.js
blob: b3ec97ce566bc5a8506aa698eed144dcf4c0884c (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
function loadDashboard() {
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
      var parts = xhttp.response
      document.getElementById("text").innerHTML = parts
    }
  };
  //var query = getQueryStrings();
  //var bugnum = query["id"];
  xhttp.open("GET", "./cgi-bin/dashboard.cgi?cookie="+document.cookie, true);
  xhttp.send();
}
var lastcheckin;
function setup(){
  loadDashboard();
  lastchecking = getMinutes();
}
window.onload = setup

if (!("Notification" in window)) {
  alert("This browser does not support desktop notification");
}
else if (Notification.permission !== 'denied') {
  Notification.requestPermission(function (permission) {
  });
}

function checkfornewbugs(){
  var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
      var parts = xhttp.response
      document.getElementById("notification").innerHTML = parts
    }
  };
  //var query = getQueryStrings();
  //var bugnum = query["id"];
  xhttp.open("GET", "./cgi-bin/popups.cgi?for=" + document.cookie, true);
  xhttp.send();
}

function notifyMe() {
  var title = "This is a title!";
  var options = {
    body: "Some body text",
    data: "This is data",
  };
  var notification = new Notification("Hi there!", options);
  notification.onclick = function(){
    alert("You clicked: " + notification.data);
  }
}