ulvis.paste.net

Paste Search Dynamic
Recent pastes
mentionlinks on bottom js
  1. function mentionlinks() {
  2.     var replies = document.querySelectorAll("section.reply")
  3.     replies.forEach(reply => {
  4.         var links = reply.querySelectorAll('.info a.mentionlink');
  5.         if (links.length != 0) {
  6.             if (reply.querySelector('.mentionlinks') == null) {
  7.                 var div = document.createElement('div');
  8.                 div.setAttribute('class', 'mentionlinks');
  9.                 reply.appendChild(div);
  10.             };
  11.             links.forEach(mentionlink => {
  12.                 reply.querySelector('.mentionlinks').appendChild(mentionlink)
  13.             });
  14.         }
  15.     });
  16. }
  17.  
  18. MutationObserver = window.MutationObserver || window.WebKitMutationObserver;
  19.  
  20. var observer = new MutationObserver(function(mutations, observer) {
  21.     mentionlinks()
  22. });
  23.  
  24. observer.observe(document, {
  25.   subtree: true,
  26.   attributes: true
  27. });
Parsed in 0.006 seconds