From c2a74cc20ebaa9898052ab758821ccfc7c3ee1f4 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Thu, 2 Jun 2016 16:54:20 -0400 Subject: Initial commit --- src/dashboard.js | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 src/dashboard.js (limited to 'src/dashboard.js') diff --git a/src/dashboard.js b/src/dashboard.js new file mode 100644 index 0000000..b3ec97c --- /dev/null +++ b/src/dashboard.js @@ -0,0 +1,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); + } +} -- cgit v1.2.3-70-g09d2