Wide ExHentai

Wide ExHentai.org - support for wide 1920px monitors

  1. // ==UserScript==
  2. // @name Wide ExHentai
  3. // @namespace wideexhentai
  4. // @version 2014.08.07
  5. // @description Wide ExHentai.org - support for wide 1920px monitors
  6. // @match http://exhentai.org/*
  7. // @match http://g.e-hentai.org/*
  8. // @exclude http://g.e-hentai.org/s/*
  9. // @exclude http://exhentai.org/s/*
  10. // @run-at document-end
  11. // @grant none
  12. // @noframes
  13. // ==/UserScript==
  14.  
  15. function $(id) {return document.getElementById(id);}
  16. function c(id) {return document.getElementsByClassName(id);}
  17.  
  18. if(window.location.pathname.indexOf("/g/") != 0)
  19. {
  20. var im = c("id1");
  21. if(im.length != 0)
  22. {
  23. var style = document.createElement("style");
  24. style.textContent = "a:visited {color: Thistle;} div.id2 {padding: 3px 0px;}div.itg{max-width:1856px;}div.ido{max-width:1875px;}"
  25. document.head.appendChild(style);
  26. function setVCenter(img)
  27. {
  28. if(img.naturalHeight != 0)
  29. {
  30. img.style.marginTop = (290-img.naturalHeight)/2 + "px";
  31. }
  32. else
  33. {
  34. setTimeout(function() {setVCenter(img)}, 100);
  35. }
  36. }
  37. setTimeout(function() {
  38. for(var i=0; i< im.length; i++)
  39. {
  40. im[i].style.height = "345px";
  41. im[i].style.width = "225px";
  42. im[i].lastChild.previousSibling.style.height = "290px";
  43. setVCenter(im[i].lastChild.previousSibling.firstChild.firstChild);
  44. }
  45. }, 0);
  46. }
  47. }
  48. else // /g/
  49. {
  50. c("ptt")[0].style.margin = "45px auto 2px";
  51. if(c("gdtl").length != 0) // large thumbs hathperk
  52. {
  53. $("gdt").style.maxWidth = "1890px";
  54. var im = c("gdtl");
  55. for(var i=0; i< im.length; i++)
  56. {
  57. im[i].style.width = "234px"; // make place for one more thumb
  58. }
  59. }
  60. else
  61. {
  62. $("gdt").style.maxWidth = "1681px";
  63. }
  64. }