Greasy Fork is available in English.

今年一定島 列印模式

汲汲營營大報社

질문, 리뷰하거나, 이 스크립트를 신고하세요.
  1. // ==UserScript==
  2. // @name 今年一定島 列印模式
  3. // @description 汲汲營營大報社
  4. // @author 稻米
  5. // @version 2024.11.04.0010.build16299
  6. // @namespace https://greasyfork.org/zh-TW/scripts/425205
  7.  
  8. // @match *://gaia.komica.org/00b/*
  9. // @match *://gaia.komica1.org/00b/*
  10. // @match *://gaia.komica2.cc/00b/*
  11. // @match *://gita.komica1.org/00b/*
  12.  
  13. // @exclude *://*/00b/src/*
  14. // @exclude *://*/00b/thumb/*
  15.  
  16. // @grant none
  17. // @license WTFPL
  18.  
  19.  
  20. // ==/UserScript==
  21.  
  22. $(document).ready(function() {
  23. //poi();
  24. poi();
  25. });
  26. function poi(){
  27.  
  28. //console.log( document.styleSheets );
  29. //console.log(window.location.href);
  30. var tmp=window.location.href;
  31. tmp=tmp.match("\\?res=");
  32. //window.location.href.match("\\?res=")
  33. //console.log(tmp);
  34. if(tmp){
  35. if( $('div.thread').length == 1 ){
  36. poi2();
  37. }
  38. }else{
  39. //console.log('非回應');
  40. }
  41. }
  42. function poi2(){
  43. //console.log(arguments.callee.name); //poi2
  44. //$("#threads").before('before');
  45. $(".thread").before('<poi><button type="reset">列印模式</button></poi>');
  46. $("poi >button:contains('列印模式')").click(function(){
  47. //console.log('按鈕');
  48. poi3();
  49. $(window).off();
  50. });
  51. //
  52.  
  53. }//poi2(){
  54.  
  55. function poi3(){
  56. var selfres = $('.post.threadpost').attr('data-no'); //首篇編號
  57. console.log( selfres );
  58. var apiurl='./pixmicat.php?mode=module&load=mod_ajax&action=thread&html=true&op='+selfres; //綜合版原生api
  59. console.log( apiurl );
  60.  
  61. var jqxhr=$.ajax({
  62. dataType: "json",
  63. url: apiurl,
  64. });
  65. jqxhr.done(function(a,b,c){
  66. //console.log( a,b,c ); //json,success,readyState
  67. var json1=a; // $.parseJSON(); //已解析
  68. console.log( json1.posts ); //json
  69. var FFF='';
  70. $.each(json1.posts, function(index,item){
  71. //console.log( index,item ); //json
  72. //console.log( item.com ); //json
  73. /*
  74. com 留言
  75. ext 檔案類型
  76. html
  77. id
  78. image 圖片
  79. mail
  80. name
  81. no
  82. now
  83. resto
  84. sub 標題
  85. thumb 縮圖
  86. time
  87. */
  88.  
  89. //var aa='<h3>'+'</h3>';
  90. var aa1=`
  91. <div><b>
  92. ${item.name}
  93. ${item.now}
  94. ID:${item.id}
  95. No.${item.no}
  96. </b></div>
  97. `;
  98. var aa2=`
  99. <blockquote>
  100. ${item.com}
  101. </blockquote>
  102. `;
  103. var aa3='';;
  104. var imgurl;
  105. if(item.ext=='.jpg' || item.ext=='.png'){ //顯示原圖
  106. imgurl='http:'+item.image+'';
  107. //imgurl='https://images.weserv.nl/?url=' + imgurl + '&output=jpg&q=85&filename=' + imgurl.match(/[0-9]{10,}/) +'&w=2048&h=2048&fit=inside&we';// http://
  108. //imgurl='https:'+item.thumb+'';//縮圖連結
  109. imgurl='https:'+item.image+'';//原圖連結
  110. aa3='<img src='+imgurl+' style="width:auto;height:auto;max-width:250px;max-height:250px;">';
  111. }
  112. if(item.ext=='.gif' || item.ext=='.webm'){ //顯示縮圖
  113. imgurl='https:'+item.thumb+'';//縮圖連結
  114. aa3='<img src='+imgurl+' style="width:auto;height:auto;max-width:250px;max-height:250px;">';
  115. }
  116.  
  117. FFF=FFF+'<div>'+aa1+aa2+aa3+',</div>';
  118. });
  119. //FFF=FFF+'<small><sub>end</sub></small>'
  120. FFF=FFF+'<div><small><sub>end</sub></small></div>'
  121. FFF='<div>'+FFF+'</div>';
  122. //console.log( FFF ); //文字
  123. $('html').attr('style', 'all: initial;'); //reset style
  124. $('head').html('');
  125. $('body').html('');
  126. $('body').append(FFF);
  127. //$('body').append('<img src="https://imgpoi.com/i/KRKEDM.jpg">');
  128.  
  129.  
  130. });
  131.  
  132.  
  133.  
  134. };
  135.  
  136. /*
  137.  
  138.  
  139. 如果是要把討論串存成圖片 可以在chrome按F12 會出現開發人員工具
  140. 再按ctrl+shift+p 會出現命令菜單 先輸入cap 會跳到適當的位置
  141. 選擇 Capture full size screenshot 就能擷取目前的網頁
  142.  
  143. 如果覺得擷取的檔案太大 可以按ctrl+shift+m 切換成畫面較小的手機模式再擷取
  144. */