Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. var flubb_sfx = new (function () {
  2. this.dir = "coui://ui/mods/com.flubbateios.sfx/";
  3. this.addHandler = function (msg, callback, disappear) {
  4. model.chatLog.subscribe(function () {
  5. var k = $('.div_chat_log_feed .chat_message_body');
  6. k.each(function () {
  7. var elem = $(this);
  8. if (elem.html() == msg) {
  9. if (elem.parent().attr('processed') != 'yes') {
  10. //run callback
  11. callback();
  12. elem.parent().attr('processed', 'yes');
  13. if (disappear) {
  14. //remove chat message
  15. elem.parent().css('display', 'none');
  16.  
  17. //get rid of thing in feed
  18. setTimeout(function () {
  19. $('.div_chat_feed .chat_message_body').each(function () {
  20. var feed = $(this);
  21. if (feed.html() == elem.html()) {
  22. feed.parent().css('display', 'none');
  23. }
  24. })
  25. }, 10);
  26. }
  27.  
  28. }
  29.  
  30. }
  31. });
  32.  
  33. })
  34.  
  35. }
  36. })()
  37.  
  38. $(document).ready(function () {
  39. flubb_sfx.addHandler('gg', function () {
  40. new Audio(flubb_sfx.dir + 'gg.ogg').play();
  41. }, false);
  42. flubb_sfx.addHandler('cena', function () {
  43. new Audio(flubb_sfx.dir + 'cena.ogg').play();
  44. }, true);
  45. flubb_sfx.addHandler('noot', function () {
  46. new Audio(flubb_sfx.dir + 'noot.ogg').play();
  47. }, true);
  48. flubb_sfx.addHandler('2000', function () {
  49. new Audio(flubb_sfx.dir + '2000.ogg').play();
  50. }, true);
  51. flubb_sfx.addHandler('violin', function () {
  52. new Audio(flubb_sfx.dir + 'violin.ogg').play();
  53. }, true);
  54.  
  55. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement