.gitignore for AVR projects
[mirrors/Programs.git] / plugins / chrome-extensions / kybca2 / background.html
CommitLineData
21c4e167 1<html><head>
f1dbbd93 2<!-- meta http-equiv="refresh" content="10" / -->
21c4e167
H
3
4<script>
5
6function setIcon(badge,title){
7 chrome.browserAction.setBadgeText({'text':badge});
8 chrome.browserAction.setTitle({'title':title});
9}
10
11function getKybcaMails(){
12 if(!localStorage["secs"]) localStorage["secs"] = 30;
13 var check_mail_timer = setTimeout("getKybcaMails()", localStorage["secs"] * 1000);
14 var pkReqUrl='https://kyberia.sk/ajax/check_new_mail.php';
15 var pkReq=new XMLHttpRequest();
16 pkReq.onload=function(){
17 var mail = pkReq.responseText.split(";");
18 switch(mail[0].replace(/^\s+|\s+$/g,"")) { //trim() := replace(/^\s+|\s+$/g,"")
19 case "":
20 setIcon("?!", "Connection problem... Not loged in?");
21 localStorage["reconnect"] = 1;
22 break;
23 case "offline":
24 localStorage["reconnect"] = 1;
25 case "0":
26 setIcon("", "No new mail on Kyberia.");
27 break;
28 default:
29 setIcon(mail[0], mail[0]+" new mails! last from: "+mail[1]);
30 }
31 };
32 pkReq.open('GET',pkReqUrl);
33 pkReq.send();
34}
35
36chrome.browserAction.onClicked.addListener(function(tab) {
37 chrome.tabs.create({url:'https://kyberia.sk/id/24'});
38 setIcon("", "");
39});
40setIcon("?", "Waiting for first contact...");
41
42getKybcaMails();
43
44</script></head>
45<body>
46 <iframe id="lif" src="login.html"></iframe>
47</body>
48</html>
49
This page took 0.206253 seconds and 4 git commands to generate.