diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-02 16:54:20 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-02 16:54:20 -0400 |
| commit | c2a74cc20ebaa9898052ab758821ccfc7c3ee1f4 (patch) | |
| tree | 9a9d90471dd6241da885950c5b52416bba28619f /src/dashboard.js | |
| download | sober-c2a74cc20ebaa9898052ab758821ccfc7c3ee1f4.tar.gz sober-c2a74cc20ebaa9898052ab758821ccfc7c3ee1f4.tar.bz2 sober-c2a74cc20ebaa9898052ab758821ccfc7c3ee1f4.zip | |
Initial commit
Diffstat (limited to 'src/dashboard.js')
| -rw-r--r-- | src/dashboard.js | 53 |
1 files changed, 53 insertions, 0 deletions
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); + } +} |
