Last active
August 29, 2015 14:15
-
-
Save cha0s/616ba91f4c6f86909c30 to your computer and use it in GitHub Desktop.
This file contains hidden or 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() { angular.element(document.body).injector().invoke(['$rootScope', 'shrub-socket', 'shrub-ui/notifications', function($rootScope, socket, notifications) { if (window.playMessageSound) { window.playMessageSound = false; notifications.add({text: 'Message sound disabled'}); } else { window.playMessageSound = true; if (!window.messageSound) { window.messageSound = document.createElement('audio'); window.messageSound.src = 'http://reddichat.com/chat-message.mp3'; socket.on('reddichat.chat.message', function() { if (window.playMessageSound) window.messageSound.play(); }); } notifications.add({text: 'Message sound enabled'}); } $rootScope.$digest(); }]); })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment