Enfim, consegui resolver o problema do flash nele, porém quando recebo mensagem, ele não reproduz aquele famoso som de alerta do facacebook.
[som de alerta de mensagem do facebook]
http://www.zedge.net/ringtone/1548508/? ... book&cep=0
Procurei um script que integrasse o facebook com o desktop, encontrei apenas esse, fiz algumas alterações, acrescentando alguns links e retirando outros.
- Código: Selecionar todos
// Copyright 2012 Junaid Lone
// junaid7lone@gmail.com
(function() {
var desktop = new fogger.Fogger();
var notif = null;
message = null;
request = null;
var getUnreadCount = function() {
var notifCount = parseInt(notif.innerText);
messageCount = parseInt(message.innerText);
requestCount = parseInt(request.innerText);
if ((notifCount > 0) && (notifCount != parseInt(localStorage.notifCount))) {
localStorage.notifCount = notifCount;
if (notifCount > 1) {
var notif_text = 'notifications.';
} else {
var notif_text = 'notification.'
}
desktop.notify('Notification', 'You have ' + notifCount + ' new ' + notif_text);
}
if ((messageCount > 0) && (messageCount != parseInt(localStorage.messageCount))) {
localStorage.messageCount = messageCount;
if (messageCount > 1) {
var notif_text = 'messages.';
} else {
var notif_text = 'message.'
}
desktop.notify('Messages', 'You have ' + messageCount + ' unread ' + notif_text);
}
if ((requestCount > 0 ) && (requestCount != parseInt(localStorage.requestCount))) {
localStorage.requestCount = requestCount;
if (requestCount > 1) {
var notif_text = 'requests.';
} else {
var notif_text = 'request.'
}
desktop.notify('Friend Request', 'You have ' + requestCount + ' new ' + notif_text);
}
return notifCount + messageCount + requestCount;
};
var notify = function() {
var notifs = getUnreadCount();
//if (notifs != parseInt(localStorage.totalCount)) {
if (notifs > 0) {
desktop.setCount(notifs);
desktop.setCountVisible(true);
desktop.setUrgent(true);
} else {
desktop.setCountVisible(false);
desktop.setUrgent(false);
}
//}
//localStorage.totalCount = notifs;
};
var setupDesktop = function(desktop) {
// Create a new menu
var navigate = desktop.newMenu('Shortcuts');
var shortcuts = [
{name: 'Home', url: '/'},
{name: 'Perfil', url: '/me'},
{name: 'Fotos', url: '/me/photos'},
{name: 'Menssages', url: '/messages'},
{name: 'Registros de Atividade', url: '/me/allactivity'},
{name: 'Minha Conta', url: '/editaccount.php?ref=mb&drop'},
]
for (var i =0; i < shortcuts.length; i++) {
var S = shortcuts[i];
S.callback = (function(url) {
return function() {
window.location = url;
};
})(S.url);
navigate.addItem(S);
desktop.quicklist.addItem(S);
}
notif = document.getElementById("notificationsCountValue");
message = document.getElementById("mercurymessagesCountValue");
request = document.getElementById("requestsCountValue");
var jewels = document.getElementsByClassName('jewelButton');
for (var i=0; i < jewels.length; i++) {
jewels[i].onclick = function() {
setTimeout(notify, 500);
};
}
setInterval(notify, 3000); // check every 3 seconds
};
// Create a new object from the Fogger class
var waitForIt = function() {
if (document.getElementById("notificationsCountValue") === null) {
setTimeout(waitForIt, 1000)
} else {
setupDesktop(desktop);
}
};
waitForIt();
})();
Se alguém puder me ajudar, eu ficarei muito feliz