Advertisement
Guest User

Untitled

a guest
Jan 31st, 2015
474
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.80 KB | None | 0 0
  1. // ==UserScript==
  2. // @name Sex141 HD
  3. // @version 31/Jan/2015
  4. // @namespace Sex141HD
  5. // @description 自動放大首頁/地區分類/廣告內的囡囡圖片,移除不必要網頁元素,提升搵囡囡效率。
  6. // @icon http://i.imgur.com/h9IhB.jpg
  7. // @grant none
  8. // @require http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js
  9. // @include http://*141.com/*/
  10. // @include http://*141.com/*/*
  11. // @include http://*141.com/*/*region-*.html
  12. // @include http://*141.com/*/main.php
  13. // @include http://*141.com/*/*gal-*.html?building=*&region=*
  14. // @include http://*141.com/*/*gal-*.html
  15. // @include http://*141.com/*/*girl-*.html
  16. // @include http://*141.com/*/*-girls.html?page=*
  17. // @include http://*141.com/*/*gals.html?page=*
  18. // @include http://*141.com/*/*building-*.html?region=*
  19. // @downloadURL http://userscripts.org/scripts/source/161439.user.js
  20. // @updateURL http://userscripts.org/scripts/source/161439.user.js
  21. // @run-at document-end
  22. // ==/UserScript==
  23.  
  24. // Google Chrome does not support the @require rule.
  25. // a function that loads jQuery and calls a callback function when jQuery has finished loading
  26. function addJQuery(callback) {
  27. var script = document.createElement("script");
  28. script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js");
  29. script.addEventListener('load', function() {
  30. var script = document.createElement("script");
  31. script.textContent = "(" + callback.toString() + ")();";
  32. document.body.appendChild(script);
  33. }, false);
  34. document.body.appendChild(script);
  35. }
  36.  
  37. function RevampPage()
  38. {
  39. //增加頁面寬度
  40. $('#header_menu, #core, #coretable, #header, #core > table').css('width','100%');
  41. $('table.cat , #outer, div.category.cl').css('width', '90%');
  42.  
  43. //移除141真人語音Banner
  44. $('div.category.cl').first().remove();
  45. $('div.category.cl div.cl').first().remove();
  46.  
  47. //移除頂部足浴廣告
  48. $('#core iframe').remove();
  49.  
  50. //移除其他垃圾網頁元素
  51. $('#adanc, #topten, #avtable, span.icon, span.overlap, #gamerules_menu, h2.mbm').remove();
  52.  
  53. //改變列表圖片大小
  54. $("img[src*='go141'] , img.pframe").not("[src*='gif']").not("[src*='png']").each(function(index, item) {
  55. var s = $(item).attr('src');
  56. s = s.replace(/picprofile/g ,"middle");
  57. s = s.replace(/small/g ,"main");
  58. $(item).attr('src', s);
  59. $(item).css({"width": "222px", "height": "296px"});
  60. //$(item).attr('style', 'width:222px;height:296px;');
  61. //$(item).attr('width', '222px');
  62. //$(item).attr('height', '296px');
  63. });
  64.  
  65. $('div.gtable div.item , div.items div.item').css({"width": "232px", "height": "310px"});
  66.  
  67. //改變內文圖片大小
  68. $("img[id*='aimg_']").not("[src*='gif']").not("[src*='png']").each(function(index, item) {
  69. var s = $(item).attr('src');
  70. $(item).attr('src', s);
  71. $(item).css({"width": "auto", "height": "auto"});
  72. //$(item).attr('style', 'width:222px;height:296px;');
  73. //$(item).attr('width', '222px');
  74. //$(item).attr('height', '296px');
  75. });
  76.  
  77. $('#flip-container, div.scrolldiv, #girlpage, #flip-tabs, #content-0').css('width','100%');
  78.  
  79. if ($("#morebtn").length > 0){
  80. $('#searchpg').bind("DOMSubtreeModified", function() {
  81. ResizeImage();
  82. });
  83. }
  84.  
  85. }
  86.  
  87. function ResizeImage()
  88. {
  89. $("img[src*='go141'], img.pframe").not("[src*='gif']").not("[src*='png']").each(function(index, item) {
  90. var s = $(item).attr('src');
  91. s = s.replace(/picprofile/g ,"middle");
  92. s = s.replace(/small/g ,"main");
  93. $(item).attr('src', s);
  94. $(item).attr('width', '222');
  95. $(item).attr('height', '296');
  96. });
  97. }
  98.  
  99. $(document).ready(function() {
  100. if(!window.jQuery)
  101. addJQuery(RevampPage);
  102. else
  103. RevampPage();
  104. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement