Skip to content

Instantly share code, notes, and snippets.

@murparreira
Last active January 2, 2016 21:09
Show Gist options
  • Save murparreira/8361411 to your computer and use it in GitHub Desktop.
Save murparreira/8361411 to your computer and use it in GitHub Desktop.
Plug DJ sugar
/* Desktop Notification script */
/* This one only works on Google Chrome */
API.on(API.CHAT, function(data) {
var notification = window.webkitNotifications.createNotification("", "Nova Mensagem", data.from + " : " + data.message);
notification.show();
setInterval(function() { notification.close() }, 2000);
});
/* Notification script */
/* This one works on both Firefox and Chrome */
API.on(API.CHAT, function(data) {
var notification = new Notification("Nova Mensagem: " + data.from + " : " + data.message);
notification.show();
setInterval(function() { notification.close() }, 2000);
});
/* Auto-woot script */
API.on(API.ADVANCE, function() {
setTimeout(function(){
$("#woot").click()
},3000)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment