Guest User

GMCLAN Emoticon Fix - Greasemonkey UserScript - v1.0

a guest
Nov 16th, 2021
61
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        GMCLAN Emoticon Fix
  3. // @namespace   mailto:korodzik@poczta.onet.pl
  4. // @description Inserts emoticons properly into old GMCLAN forum posts. [After an update of the Invision forum software, old posts have lost their smileys, leaving just their names behind; this script inserts the smiley images again where needed.]
  5. // @include     *forum.gmclan.org*
  6. // @version     1.0 (2021.11.16)
  7. // @grant       none
  8. // ==/UserScript==
  9. //thanks to http://greasemonkey.win-start.de/patterns/match-attribute.html for help
  10.  
  11. var thisElem;
  12. var paragraphs = document.evaluate(
  13.   "//div[@data-role='commentContent']",
  14.     document,
  15.     null,
  16.     XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
  17.     null);
  18.  
  19. for (var i=0; i<paragraphs.snapshotLength; i++)
  20. {
  21.   thisElem = paragraphs.snapshotItem(i);
  22. thisElem.innerHTML = thisElem.innerHTML.replaceAll('-_-','<img src="https://forum.gmclan.org/uploads/emoticons/sleep.gif">');
  23. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':(','<img src="https://forum.gmclan.org/uploads/emoticons/sad.gif">');
  24. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':)','<img src="https://forum.gmclan.org/uploads/emoticons/smile.gif">');
  25. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':D','<img src="https://forum.gmclan.org/uploads/emoticons/biggrin.gif">');
  26. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':P','<img src="https://forum.gmclan.org/uploads/emoticons/tongue2.gif">');
  27. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':]','<img src="https://forum.gmclan.org/uploads/emoticons/emot11.gif">');
  28. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':alien:','<img src="https://forum.gmclan.org/uploads/emoticons/alien.gif">');
  29. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':angel_not:','<img src="https://forum.gmclan.org/uploads/emoticons/angel_not.gif">');
  30. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':angry1:','<img src="https://forum.gmclan.org/uploads/emoticons/angry1.gif">');
  31. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':angry:','<img src="https://forum.gmclan.org/uploads/emoticons/angry.gif">');
  32. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':ban:','<img src="https://forum.gmclan.org/uploads/emoticons/ban.gif">');
  33. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':bann:','<img src="https://forum.gmclan.org/uploads/emoticons/bann.gif">');
  34. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':bash:','<img src="https://forum.gmclan.org/uploads/emoticons/bash.gif">');
  35. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':beer:','<img src="https://forum.gmclan.org/uploads/emoticons/beer.gif">');
  36. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':beta:','<img src="https://forum.gmclan.org/uploads/emoticons/beta.gif">');
  37. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':blink:','<img src="https://forum.gmclan.org/uploads/emoticons/blink.gif">');
  38. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':blush:','<img src="https://forum.gmclan.org/uploads/emoticons/blush.gif">');
  39. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':book:','<img src="https://forum.gmclan.org/uploads/emoticons/book.gif">');
  40. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':borek:','<img src="https://forum.gmclan.org/uploads/emoticons/emot_borek.png">');
  41. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':boxed:','<img src="https://forum.gmclan.org/uploads/emoticons/boxed.gif">');
  42. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':bye1:','<img src="https://forum.gmclan.org/uploads/emoticons/bye1.gif">');
  43. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':cat:','<img src="https://forum.gmclan.org/uploads/emoticons/cat.gif">');
  44. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':censored:','<img src="https://forum.gmclan.org/uploads/emoticons/censored.gif">');
  45. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':cheers:','<img src="https://forum.gmclan.org/uploads/emoticons/cheers.gif">');
  46. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':chris:','<img src="https://forum.gmclan.org/uploads/emoticons/chris.gif">');
  47. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':closedeyes:','<img src="https://forum.gmclan.org/uploads/emoticons/closedeyes.gif">');
  48. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':clover:','<img src="https://forum.gmclan.org/uploads/emoticons/clover.gif">');
  49. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':cold2:','<img src="https://forum.gmclan.org/uploads/emoticons/cold2.gif">');
  50. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':confused:','<img src="https://forum.gmclan.org/uploads/emoticons/confused.gif">');
  51. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':construction:','<img src="https://forum.gmclan.org/uploads/emoticons/construction.gif">');
  52. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':cool2:','<img src="https://forum.gmclan.org/uploads/emoticons/cool2.gif">');
  53. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':crosseyed:','<img src="https://forum.gmclan.org/uploads/emoticons/crosseyed.gif">');
  54. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':crying:','<img src="https://forum.gmclan.org/uploads/emoticons/crying.gif">');
  55. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':death:','<img src="https://forum.gmclan.org/uploads/emoticons/death.gif">');
  56. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':devil2:','<img src="https://forum.gmclan.org/uploads/emoticons/devil2.gif">');
  57. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':devil:','<img src="https://forum.gmclan.org/uploads/emoticons/devil.gif">');
  58. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':dots:','<img src="https://forum.gmclan.org/uploads/emoticons/dots.gif">');
  59. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':excl:','<img src="https://forum.gmclan.org/uploads/emoticons/excl.gif">');
  60. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':frusty:','<img src="https://forum.gmclan.org/uploads/emoticons/frusty.gif">');
  61. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':glare:','<img src="https://forum.gmclan.org/uploads/emoticons/glare.gif">');
  62. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':gnysek:','<img src="https://forum.gmclan.org/uploads/emoticons/emot_gnysek.png">');
  63. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':greedy:','<img src="https://forum.gmclan.org/uploads/emoticons/greedy.gif">');
  64. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':hammer:','<img src="https://forum.gmclan.org/uploads/emoticons/hammer.gif">');
  65. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':helpsmilie:','<img src="https://forum.gmclan.org/uploads/emoticons/helpsmilie.gif">');
  66. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':hitler:','<img src="https://forum.gmclan.org/uploads/emoticons/hitler.gif">');
  67. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':hmmm:','<img src="https://forum.gmclan.org/uploads/emoticons/hmmm.gif">');
  68. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':huh:','<img src="https://forum.gmclan.org/uploads/emoticons/huh.gif">');
  69. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':innocent:','<img src="https://forum.gmclan.org/uploads/emoticons/innocent.gif">');
  70. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':jason:','<img src="https://forum.gmclan.org/uploads/emoticons/jason.gif">');
  71. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':kicking:','<img src="https://forum.gmclan.org/uploads/emoticons/kicking.gif">');
  72. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':krider:','<img src="https://forum.gmclan.org/uploads/emoticons/krider.gif">');
  73. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':laugh:','<img src="https://forum.gmclan.org/uploads/emoticons/laugh.gif">');
  74. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':like:','<img src="https://forum.gmclan.org/uploads/emoticons/like.png">');
  75. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':lol:','<img src="https://forum.gmclan.org/uploads/emoticons/lol.gif">');
  76. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':lubieto:','<img src="https://forum.gmclan.org/uploads/emoticons/lubieto.png">');
  77. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':mad:','<img src="https://forum.gmclan.org/uploads/emoticons/mad.gif">');
  78. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':mellow:','<img src="https://forum.gmclan.org/uploads/emoticons/mellow.gif">');
  79. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':ninja:','<img src="https://forum.gmclan.org/uploads/emoticons/ninja.gif">');
  80. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':nuke:','<img src="https://forum.gmclan.org/uploads/emoticons/nuke.gif">');
  81. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':o','<img src="https://forum.gmclan.org/uploads/emoticons/ohmy.gif">');
  82. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':offtopic:','<img src="https://forum.gmclan.org/uploads/emoticons/offtopic.gif">');
  83. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':online2long:','<img src="https://forum.gmclan.org/uploads/emoticons/online2long.gif">');
  84. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':oops:','<img src="https://forum.gmclan.org/uploads/emoticons/oops.gif">');
  85. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':paperbag3:','<img src="https://forum.gmclan.org/uploads/emoticons/paperbag3.gif">');
  86. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':ph34r:','<img src="https://forum.gmclan.org/uploads/emoticons/ph34r.gif">');
  87. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':play_ball:','<img src="https://forum.gmclan.org/uploads/emoticons/play_ball.gif">');
  88. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':poster_oops:','<img src="https://forum.gmclan.org/uploads/emoticons/poster_oops.gif">');
  89. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':prop:','<img src="https://forum.gmclan.org/uploads/emoticons/prop.gif">');
  90. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':psichix:','<img src="https://forum.gmclan.org/uploads/emoticons/emot_psichix.png">');
  91. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':ranmus:','<img src="https://forum.gmclan.org/uploads/emoticons/emot_ranmus.png">');
  92. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':ranting2:','<img src="https://forum.gmclan.org/uploads/emoticons/ranting2.gif">');
  93. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':red_bandana:','<img src="https://forum.gmclan.org/uploads/emoticons/red_bandana.gif">');
  94. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':red_indian:','<img src="https://forum.gmclan.org/uploads/emoticons/red_indian.gif">');
  95. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':rip:','<img src="https://forum.gmclan.org/uploads/emoticons/rip.gif">');
  96. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':rockon:','<img src="https://forum.gmclan.org/uploads/emoticons/rockon.gif">');
  97. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':rolleyes:','<img src="https://forum.gmclan.org/uploads/emoticons/rolleyes.gif">');
  98. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':santa:','<img src="https://forum.gmclan.org/uploads/emoticons/santa.gif">');
  99. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':shuriken:','<img src="https://forum.gmclan.org/uploads/emoticons/shuriken.gif">');
  100. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':sick:','<img src="https://forum.gmclan.org/uploads/emoticons/sick.gif">');
  101. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':sleep1:','<img src="https://forum.gmclan.org/uploads/emoticons/sleep1.gif">');
  102. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':sleeping:','<img src="https://forum.gmclan.org/uploads/emoticons/sleeping.gif">');
  103. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':smartass:','<img src="https://forum.gmclan.org/uploads/emoticons/smartass.gif">');
  104. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':smile3:','<img src="https://forum.gmclan.org/uploads/emoticons/smile3.gif">');
  105. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':sp_ike:','<img src="https://forum.gmclan.org/uploads/emoticons/sp_ike.gif">');
  106. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':spam:','<img src="https://forum.gmclan.org/uploads/emoticons/spam.gif">');
  107. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':stupid:','<img src="https://forum.gmclan.org/uploads/emoticons/stupid.gif">');
  108. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':thumbsup:','<img src="https://forum.gmclan.org/uploads/emoticons/thumbsup.gif">');
  109. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':tongue:','<img src="https://forum.gmclan.org/uploads/emoticons/tongue.gif">');
  110. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':tv_happy:','<img src="https://forum.gmclan.org/uploads/emoticons/tv_happy.gif">');
  111. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':tv_horror:','<img src="https://forum.gmclan.org/uploads/emoticons/tv_horror.gif">');
  112. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':twisted:','<img src="https://forum.gmclan.org/uploads/emoticons/twisted.gif">');
  113. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':unsure:','<img src="https://forum.gmclan.org/uploads/emoticons/unsure.gif">');
  114. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':uzjel:','<img src="https://forum.gmclan.org/uploads/emoticons/uzjel.png">');
  115. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':w00t2:','<img src="https://forum.gmclan.org/uploads/emoticons/w00t2.gif">');
  116. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':w00t:','<img src="https://forum.gmclan.org/uploads/emoticons/w00t.gif">');
  117. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':wacko:','<img src="https://forum.gmclan.org/uploads/emoticons/wacko.gif">');
  118. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':weight_lift2:','<img src="https://forum.gmclan.org/uploads/emoticons/weight_lift2.gif">');
  119. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':weight_lift:','<img src="https://forum.gmclan.org/uploads/emoticons/weight_lift.gif">');
  120. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':wheelchair:','<img src="https://forum.gmclan.org/uploads/emoticons/wheelchair.gif">');
  121. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':whip:','<img src="https://forum.gmclan.org/uploads/emoticons/whip.gif">');
  122. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':whistling:','<img src="https://forum.gmclan.org/uploads/emoticons/whistling.gif">');
  123. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':wink:','<img src="https://forum.gmclan.org/uploads/emoticons/wink.gif">');
  124. thisElem.innerHTML = thisElem.innerHTML.replaceAll(':wub:','<img src="https://forum.gmclan.org/uploads/emoticons/wub.gif">');
  125. thisElem.innerHTML = thisElem.innerHTML.replaceAll(';)','<img src="https://forum.gmclan.org/uploads/emoticons/smile2.gif">');
  126. thisElem.innerHTML = thisElem.innerHTML.replaceAll("&lt;_&lt;",'<img src="https://forum.gmclan.org/uploads/emoticons/dry.gif">');
  127. thisElem.innerHTML = thisElem.innerHTML.replaceAll('B)','<img src="https://forum.gmclan.org/uploads/emoticons/cool.gif">');
  128. thisElem.innerHTML = thisElem.innerHTML.replaceAll('^_^','<img src="https://forum.gmclan.org/uploads/emoticons/happy.gif">');
  129. }
RAW Paste Data