Guest User

Untitled

a guest
Apr 19th, 2016
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. // ==UserScript==
  2. // @name NoGIF
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @author You
  6. // @match http://tampermonkey.net/changelog.php?version=3.12.58&ext=dhdg&updated=true&old=3.8.52&intr=true
  7. // @grant none
  8. // @include http://www.neogaf.com/forum/*
  9. // ==/UserScript==
  10. /* jshint -W097 */
  11.  
  12. 'use strict';
  13.  
  14. var hide=document.createElement("input");
  15. hide.type="button";
  16. hide.value="Hide Gif";
  17. hide.onclick = hideGif;
  18. hide.setAttribute("style", "font-size:18px;position:absolute;top:205px;right:40px;");
  19.  
  20. var unhide=document.createElement("input");
  21. unhide.type="button";
  22. unhide.value="Unhide Gif";
  23. unhide.onclick = unhideGif;
  24. unhide.setAttribute("style", "font-size:18px;position:absolute;top:205px;right:150px;");
  25.  
  26.  
  27. var threadTitle = document.getElementsByName("keywords");
  28.  
  29. if(threadTitle[0].content.indexOf("COMICS!") >= 0)
  30. {
  31.  
  32. document.body.appendChild(hide);
  33. document.body.appendChild(unhide);
  34.  
  35. var as = document.getElementsByTagName("img");
  36.  
  37. hide.click();
  38.  
  39. }
  40. function unhideGif()
  41. {
  42.     for(var i=0;i<as.length;i++)
  43. {
  44. var cls = as[i];
  45. if((cls.src.indexOf(".gif") >=0) || (cls.src.indexOf(".GIF") >=0))
  46. {
  47. cls.removeAttribute("style",";display:none;");
  48. }
  49. }
  50. }
  51.  
  52.  
  53. function hideGif()
  54. {
  55.     for(var i=0;i<as.length;i++)
  56. {
  57. var cls = as[i];
  58. if((cls.src.indexOf(".gif") >=0) || (cls.src.indexOf(".GIF") >=0))
  59. {
  60. cls.setAttribute("style",";display:none;");
  61. }
  62. }
  63. }
Advertisement
Add Comment
Please, Sign In to add comment