Advertisement
Guest User

Untitled

a guest
May 5th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. (function() {
  2. "use strict";
  3. var chat = document.getElementById('chat');
  4. var counter = 0;
  5. var multiplier = 10;
  6. function rainbowBitches(node) {
  7. if (node.classList && node.classList.contains('message') && !node.classList.contains('pending')) {
  8. var content = node.querySelectorAll('.content');
  9. [].forEach.call(content, function(cnode) {
  10. cnode.style.color = 'hsl(' + counter + ', 100%,50%)';
  11. counter += multiplier;
  12. });
  13. }
  14. }
  15. [].forEach.call(chat.querySelectorAll('.user-container .message'), rainbowBitches);
  16. new MutationObserver(function(records) {
  17. records.forEach(function(record) {
  18. [].forEach.call(record.addedNodes, rainbowBitches);
  19. });
  20. }).observe(chat, {
  21. childList: true,
  22. subtree: true
  23. });
  24. }());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement