nijie_no_carousel

ニジエの「この絵で抜いた人はこんな絵でも抜いています」をカルーセルを使わずにすべて表示

  1. // ==UserScript==
  2. // @name nijie_no_carousel
  3. // @version 0.1
  4. // @namespace
  5. // @author qa2
  6. // @description ニジエの「この絵で抜いた人はこんな絵でも抜いています」をカルーセルを使わずにすべて表示
  7. // @include http://nijie.info/view.php?id=*
  8. // @include https://nijie.info/view.php?id=*
  9. // @run-at document-end
  10. // ==/UserScript==
  11.  
  12. (function(){
  13. var css ='\
  14. #carouselPrev-view,#carouselNext-view{display:none;}\
  15. #carouselWrap-view,#carouselWrap-view ul.column{height:254px;}\
  16. #carouselInner-view{width:auto!important;margin-left:0!important;}\
  17. #carouselInner-view ul.column li a img{max-width:118px;margin:0,padding:0}\
  18. #carouselInner-view ul.column li{width:120px;height:122px;margin-top:5px;margin-right:5px}';
  19.  
  20. (function(csstext){
  21. var sheet = document.body.appendChild(document.createElement("style"))
  22. sheet.type="text/css";
  23. sheet.textContent = csstext;
  24. sheet.id = 'outercss';
  25. return sheet;
  26. })(css);
  27.  
  28. function reform(node){
  29. view = document.evaluate('.//div[@id="carouselInner-view"]', node, null, 7, null).snapshotItem(0);
  30. if(view){
  31. ul = view.getElementsByClassName("column");
  32. while(ul[1]){
  33. list = ul[1].getElementsByTagName("li");
  34. while(list[0]){
  35. ul[0].appendChild(list[0]);
  36. }
  37. view.removeChild(ul[1]);
  38. }
  39. }
  40. }
  41.  
  42. document.body.addEventListener('AutoPagerize_DOMNodeInserted', function (evt) {
  43. var node = evt.target;
  44. reform(node);
  45. }, false);
  46.  
  47. reform(document);
  48. })();