Created
March 21, 2012 22:56
-
-
Save michaelmior/2153949 to your computer and use it in GitHub Desktop.
TalkerApp notifications for webkit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){window.notifications={notifications_support:function(){return%20true;},notify:function(obj){if(obj.title%20!=window.notifications.prevmsg.title%20%26%26%20obj.description%20!=window.notifications.prevmsg.description){var%20not=window.webkitNotifications.createNotification('http://talkerapp.com/images/favicon.png',obj.title,obj.description);not.show();window.setTimeout(function(){not.cancel();},5000);}window.notifications.prevmsg=obj;},prevmsg:{}};})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.notifications = { | |
notifications_support: function () { | |
return true; | |
}, | |
notify: function (obj) { | |
if (obj.title != window.notifications.prevmsg.title && obj.description != window.notifications.prevmsg.description) { | |
var not = window.webkitNotifications.createNotification('http://talkerapp.com/images/favicon.png', obj.title, obj.description); | |
not.show(); | |
window.setTimeout(function () { | |
not.cancel(); | |
}, 5000); | |
} | |
window.notifications.prevmsg = obj; | |
}, | |
prevmsg: {} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment