GameFAQs Profile Avvy to Posts

Does a thing that the script name says it does

  1. // ==UserScript==
  2. // @name GameFAQs Profile Avvy to Posts
  3. // @author Metallia
  4. // @namespace Cats
  5. // @description Does a thing that the script name says it does
  6. // @include http://www.gamefaqs.com/boards/*
  7. // @version 1.3-kraust
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. // Feel free to edit, redistribute, all that good stuff.
  12. // Kraust just one line added by me.
  13.  
  14. var messageList = document.evaluate('//table[contains(@class,"board message")]', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
  15. if (messageList !== null) {
  16. postsWithAvatars = document.evaluate('//td[contains(@class,"msg")]//ul[@data-img]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
  17. var avvyImgs = new Array();
  18. var clearDivs = new Array();
  19. for (var i = 0; i < postsWithAvatars.snapshotLength; i++) {
  20. avvyImgs[i] = document.createElement('img');
  21. avvyImgs[i].setAttribute("src",postsWithAvatars.snapshotItem(i).getAttribute('data-img'));
  22. avvyImgs[i].setAttribute("style","float: right !important; margin: 5px !important;");
  23. clearDivs[i] = document.createElement('div');
  24. clearDivs[i].setAttribute("style","clear: right !important;");
  25. var appendHere = postsWithAvatars.snapshotItem(i).parentNode.parentNode.parentNode.parentNode.parentNode.childNodes[1].childNodes[0];
  26. appendHere.appendChild(clearDivs[i]);
  27. appendHere.insertBefore(avvyImgs[i],appendHere.childNodes[0]);
  28. }
  29. $(".board blockquote").css("margin-right", "115px");
  30. $(".board .board_poll").css("margin-right", "115px");
  31. }