This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
orbit-4-1/public/desktop_widgets/4fa7812ec88514014d7c59bd/4fa7812ec88514014d7c59bd.js

41 lines
1.4 KiB
JavaScript
Raw Permalink Normal View History

2012-04-26 06:47:49 +00:00
var gmail = function(){
$.ajax({
url: "/desktop/forgmail",
dataType : "xml",
success:function(data){
2012-05-03 06:40:54 +00:00
if($(data).find("HEAD").find("ERROR").text()=="true"){
$("#gmail #content #msgbody").text($(data).find("HEAD").find("ERRORMSG").text());
2012-04-26 06:47:49 +00:00
}else{
2012-05-03 06:40:54 +00:00
if($(data).find("HEAD").find("TITLE").text()=="Unauthorized"){
$("#gmail #forerror").text($(data).find("HEAD").find("TITLE").text()).show();
2012-04-26 06:47:49 +00:00
}else{
2012-05-03 06:40:54 +00:00
if($(data).find("fullcount").text()=="0"){
$("#gmail #forerror").hide();
$("#gmail #content #msgbody").text("No new mails");
}else{
var msg;
if($(data).find("fullcount").text()=="1")
msg = $(data).find("fullcount").text()+" unread message in your inbox.";
else
msg = $(data).find("fullcount").text()+" unread messages in your inbox.";
o.notify(msg,"alert",2);
$(data).find("entry").each(function(i,val){
if(i==0){
$("#gmail #forerror").hide();
var atag = $("<a href='"+$(this).find("link").attr("href")+"'>"+$(this).find("title").text()+"</a>");
$("#gmail #content #subject").html($(this).find("title").text());
$("#gmail #content #date").text($(this).find("issued").text());
$("#gmail #content #msgbody").text($(this).find("summary").text());
}
})
}
2012-04-26 06:47:49 +00:00
}
}
$("#gmail #loading").hide();
$("#gmail #content").show();
2012-05-03 06:40:54 +00:00
2012-04-26 06:47:49 +00:00
}
});
}