Sleazy Fork is available in English.

98图片预览助手

浏览帖子列表时自动加载内部前三张(可配置)图片供预览。如需支持其他免翻地址,请使用@match自行添加连接,如果某个版块不希望预览,请使用@exclude自行添加要排除的版块链接

  1. // ==UserScript==
  2. // @name 98图片预览助手
  3. // @namespace 98imgloader
  4. // @version 1.7.1
  5. // @description 浏览帖子列表时自动加载内部前三张(可配置)图片供预览。如需支持其他免翻地址,请使用@match自行添加连接,如果某个版块不希望预览,请使用@exclude自行添加要排除的版块链接
  6. // @author sehuatang_chen
  7. // @license MIT
  8.  
  9. // @match https://www.sehuatang.org/*
  10. // @match https://www.sehuatang.net/*
  11. // @match https://rgkm7.cs33u.com/*
  12. // @match https://he2w0.0lr3i.com/*
  13. // @match https://https://vsgo.k3ut8.com/*
  14.  
  15. // @grant GM_xmlhttpRequest
  16. // @grant GM_getValue
  17. // @grant GM_setValue
  18. // @grant GM_addStyle
  19. // @grant GM_registerMenuCommand
  20. // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.min.js
  21. // @require https://cdn.bootcdn.net/ajax/libs/jquery_lazyload/1.9.7/jquery.lazyload.min.js
  22. // @require https://greasyfork.org/scripts/475748-zip%E8%A7%A3%E5%8E%8B%E5%B7%A5%E5%85%B7/code/zip%E8%A7%A3%E5%8E%8B%E5%B7%A5%E5%85%B7.js
  23. // @require https://greasyfork.org/scripts/475896-115%E6%8E%A8%E9%80%81%E5%B7%A5%E5%85%B7/code/115%E6%8E%A8%E9%80%81%E5%B7%A5%E5%85%B7.js
  24.  
  25. // ==/UserScript==
  26.  
  27. /* global $ */
  28. $(document).ready(() => {
  29. console.log("98imgloader ready")
  30. GM_script.init_styles();
  31. GM_script.init_variables();
  32. GM_script.add_config_menu();
  33.  
  34. var url = window.location.href;
  35. if (/^.*forum\.php\?.*mod=forumdisplay.*$/g.test(url)){
  36. normalthread.init()
  37. } else if (/^.*home\.php\?.*do=favorite.*$/g.test(url)) {
  38. favorite.init()
  39. } else if (/^((?!type=reply).)*(home\.php\?.*do=thread)((?!type=reply).)*$/g.test(url)) {
  40. userspace.init()
  41. } else {
  42. console.log("url not matched.")
  43. }
  44.  
  45. });
  46. const globalpage = {
  47. set_width: () => {
  48. if (GM_getValue("reset_width") == 1) {
  49. $(".wp").css("width",GM_getValue("reset_width_px") + "px")
  50. $("#nv").css("width",GM_getValue("reset_width_px") + "px")
  51. }
  52. }
  53. }
  54. const normalthread = {
  55. init: () => {
  56. normalthread.remove_ads();
  57. normalthread.add_one_key_btn();
  58. normalthread.add_column();
  59. globalpage.set_width();
  60. var $next_btn = $("#autopbn");
  61. $next_btn.on("click",function(){
  62. console.log("next_btn click!!!")
  63. //点击下一页后延迟page_thread_delayed秒再次触发图片加载。
  64. setTimeout(() => {
  65. normalthread.each_thread_list()
  66. }, parseInt(GM_getValue("page_thread_delayed")));
  67. });
  68. normalthread.each_thread_list();
  69. },
  70. add_one_key_btn: () => {
  71. var $load_img_btn = $("<a />");
  72. $load_img_btn.append($('<div>一键加载图片</div>'))
  73. $load_img_btn.on("click", function(){
  74. normalthread.each_thread_list(1)
  75. });
  76. $("#scrolltop").append($("<span />").append($load_img_btn));
  77. $load_img_btn.css("background","None");
  78. $load_img_btn.css("height","35px");
  79. },
  80. add_column: () => {
  81. $("#threadlist > div.th > table tr:eq(0)").append($('<td style="width:40px">操作</td>'))
  82. },
  83. remove_ads: () => {
  84. $("tbody[id*='stick']").remove();
  85. $("div.show-text2").parent().parent().parent().remove();
  86. $("tbody[id='separatorline']").remove();
  87. },
  88. each_thread_list: (isonekeyload) => {
  89. var count = 0
  90. var block_user = 0
  91. var hide = 0
  92. $("#threadlist table[id='threadlisttableid'] > tbody:not([id])").each(function(index) {
  93. var $_tbody=$(this);
  94. if ($_tbody.find('td[id^="noid_"]').length == 0) {
  95. $_tbody.find("tr").append($('<td id="noid_1_'+index+'" style="width:20px"></td>'));
  96. $_tbody.find("tr").append($('<td id="noid_2_'+index+'" style="width:20px"></td>'));
  97. }
  98. })
  99. $("#threadlist table[id='threadlisttableid'] > tbody[id*='normalthread']").each(function(index) {
  100. var $tbody=$(this);
  101. var thread_id = $tbody.attr("id").split("_")[1];
  102. var info_id = "info_" + thread_id;
  103. var load_btn_id = "load_" + thread_id;
  104. var rm_btn_id = "rm_" + thread_id;
  105. var black_btn_id = "black_" + thread_id;
  106. var $author_a = $tbody.find("td.by:eq(0) a")
  107. var userid = $author_a.attr("href").match(/(?<=uid=)\d*/g)[0];
  108. var username = $author_a.text()
  109.  
  110. if (GM_getValue("author_control") == 1) {
  111. var arr = JSON.parse(GM_getValue("author_list"))
  112. if (arr.findIndex((user) => user["id"] == userid) >= 0) {
  113. $tbody.remove();
  114. $("#"+info_id).remove();
  115. block_user++
  116. return;
  117. }
  118. }
  119.  
  120. var removed_ids = GM_getValue("removed_ids").split(",")
  121. var removed = removed_ids.includes(thread_id)
  122. if (removed) {
  123. if (GM_getValue("hideorgray") == "gray") {
  124. $tbody.css("background-color", "rgb(197 179 179)")
  125. } else {
  126. $tbody.remove();
  127. $("#"+info_id).remove();
  128. hide++
  129. return ;
  130. }
  131. }
  132.  
  133. if ($tbody.find("#"+black_btn_id).length == 0) {
  134. var $black_btn = $('<span title="7天内不看此作者" id="'+black_btn_id+'" uid="'+userid+'">'+imgs.hideuser_svg+'</span>')
  135.  
  136. $black_btn.click(function(){
  137. tools.add_user_id($(this).attr("uid"),username)
  138. tools.tip("操作成功")
  139. })
  140. $author_a.after($black_btn)
  141. }
  142.  
  143. if ($tbody.find("#"+load_btn_id).length == 0) {
  144. var $load_btn = $('<span title="查看帖内图片" >'+imgs.expand_svg+'</span>')
  145. $load_btn.on("click", function(){
  146. normalthread.load_thread_info($tbody)
  147. })
  148. $tbody.find("tr").append($('<td id="'+load_btn_id+'" style="width:20px"></td>').append($load_btn))
  149. }
  150.  
  151. if (GM_getValue("show_hide_btn") == 1 && $tbody.find("#"+rm_btn_id).length == 0) {
  152. var $rm_btn = $('<span title="隐藏此贴" >'+imgs.hide_svg+'</span>')
  153. $rm_btn.on("click", function(){
  154. tools.add_removed_id(thread_id)
  155. $tbody.remove();
  156. $("#"+info_id).remove();
  157. })
  158. $tbody.find("tr").append($('<td id="'+rm_btn_id+'" style="width:20px"></td>').append($rm_btn));
  159. }
  160.  
  161. if (GM_getValue("switch_autoload") == 1 || isonekeyload == 1) {
  162. if ($("#"+info_id).length == 0 && !removed) {
  163. if (GM_getValue("load_thread_delayed") == 0) {
  164. normalthread.load_thread_info($tbody)
  165. } else {
  166. count++;
  167. setTimeout(() => {
  168. normalthread.load_thread_info($tbody)
  169. }, GM_getValue("load_thread_delayed") * count)
  170. }
  171. }
  172. }
  173. })
  174.  
  175. if (!isonekeyload) {
  176. if (GM_getValue("author_control") == 1 && GM_getValue("hideorgray") == "hide") {
  177. tools.tip(`已隐藏屏蔽用户帖子${block_user}条,隐藏标记帖子${hide}条`)
  178. }else if (GM_getValue("author_control") == 1) {
  179. tools.tip(`已隐藏屏蔽用户帖子${block_user}条`)
  180. }else if (GM_getValue("hideorgray") == "hide") {
  181. tools.tip(`已隐藏标记帖子${hide}条`)
  182. }
  183. }
  184. },
  185. load_thread_info: ($thread_tbody) => {
  186. var tbody_clone_id = "info_" + $thread_tbody.attr("id").split("_")[1];
  187. if ($("#"+tbody_clone_id).length != 0) {
  188. return ;
  189. }
  190.  
  191. var $tbody_clone = $thread_tbody.clone();
  192. $tbody_clone.attr("id", tbody_clone_id);
  193. $tbody_clone.find("td,th").remove();
  194. var $tag_td = $('<td colspan="'+(GM_getValue("show_hide_btn") == 1 ? 7 : 6)+'"></td>');
  195. $tbody_clone.find("tr:eq(0)").append($tag_td);
  196.  
  197. var url = "/" + $thread_tbody.find(".icn > a").attr("href");
  198. tools.request_and_parse_thread(url, $tag_td)
  199. $thread_tbody.after($tbody_clone);
  200. }
  201. }
  202.  
  203. const favorite = {
  204. init: () => {
  205. favorite.add_one_key_btn();
  206. favorite.each_thread_list();
  207. },
  208. add_one_key_btn: () => {
  209. var $delete_select_btn = $("button[name='delsubmit']");
  210. var $load_img_btn = $("<a />");
  211. $load_img_btn.text("一键加载图片");
  212. $load_img_btn.on("click", function(){
  213. favorite.each_thread_list(1)
  214. });
  215. $load_img_btn.appendTo($delete_select_btn.parent())
  216. },
  217. each_thread_list: (isonekeyload) => {
  218. var count = 0
  219. $("div.bm > form:eq(0) > ul[id='favorite_ul'] > li[id*='fav_']").each(function(index) {
  220. var $li=$(this);
  221. var thread_id = $li.attr("id").split("_")[1];
  222. var info_id = "info_" + thread_id;
  223. var load_btn_id = "load_" + thread_id;
  224.  
  225. if ($li.find("#"+load_btn_id).length == 0) {
  226. var $load_btn = $("<a />");
  227. $load_btn.text("加载");
  228. $load_btn.attr("id", load_btn_id);
  229. $load_btn.addClass("y")
  230. $load_btn.css("margin","0 5px")
  231. $load_btn.on("click", function(){
  232. favorite.load_thread_info($li)
  233. })
  234. $li.find("#a_delete_"+thread_id).after($load_btn)
  235. }
  236.  
  237. if (GM_getValue("switch_autoload") == 1 || isonekeyload == 1) {
  238. if ($("#"+info_id).length == 0) {
  239. if (GM_getValue("load_thread_delayed") == 0) {
  240. favorite.load_thread_info($li)
  241. } else {
  242. count++;
  243. setTimeout(() => {
  244. favorite.load_thread_info($li)
  245. }, GM_getValue("load_thread_delayed") * count)
  246. }
  247. }
  248. }
  249. })
  250. },
  251. load_thread_info: ($thread_li) => {
  252. var info_id = "info_" + $thread_li.attr("id").split("_")[1];
  253. if ($("#"+info_id).length != 0) {
  254. return ;
  255. }
  256.  
  257. var $li_clone = $thread_li.clone();
  258. $li_clone.attr("id", info_id);
  259. $li_clone.children("*").remove();
  260.  
  261. var url = "/" + $thread_li.find("a:not([id]):eq(0)").attr("href");
  262. tools.request_and_parse_thread(url, $li_clone)
  263. $thread_li.after($li_clone);
  264. }
  265. }
  266.  
  267. const userspace = {
  268. init: () => {
  269. userspace.add_one_key_btn();
  270. userspace.add_column();
  271. userspace.each_thread_list();
  272. },
  273. add_one_key_btn: () => {
  274. var $load_img_btn = $("<a />");
  275. $load_img_btn.append($('<div>一键加载图片</div>'))
  276. $load_img_btn.on("click", function(){
  277. userspace.each_thread_list(1)
  278. });
  279. $("#scrolltop").append($("<span />").append($load_img_btn));
  280. $load_img_btn.css("background","None");
  281. $load_img_btn.css("height","35px");
  282. },
  283. add_column: () => {
  284. $("#ct div.tl table:eq(0) > tbody:eq(0) > tr:eq(0)").append($('<td style="width:30px">展开</td>'))
  285. },
  286. each_thread_list: (isonekeyload) => {
  287. var count = 0
  288. $("#ct div.tl table:eq(0) > tbody:eq(0) > tr:not([id]):gt(0)").each(function(index) {
  289. var $tr=$(this);
  290. var thread_id = $tr.find("th:eq(0) > a").attr("href").match(/(?<=tid=)\d*/g)[0];
  291. var info_id = "info_" + thread_id;
  292. var load_btn_id = "load_" + thread_id;
  293.  
  294. if ($tr.find("#"+load_btn_id).length == 0) {
  295. var $load_btn = $('<span title="查看帖内图片" >'+imgs.expand_svg+'</span>')
  296. $load_btn.on("click", function(){
  297. userspace.load_thread_info($tr, info_id)
  298. })
  299. $tr.append($('<td id="'+load_btn_id+'" style="width:20px"></td>').append($load_btn))
  300. }
  301.  
  302. if (GM_getValue("switch_autoload") == 1 || isonekeyload == 1) {
  303. if ($tr.find(":contains('求片问答悬赏区')").length == 0 && $("#"+info_id).length == 0) {
  304. if (GM_getValue("load_thread_delayed") == 0) {
  305. userspace.load_thread_info($tr, info_id)
  306. } else {
  307. count++;
  308. setTimeout(() => {
  309. userspace.load_thread_info($tr, info_id)
  310. }, GM_getValue("load_thread_delayed") * count)
  311. }
  312. }
  313. }
  314. })
  315. },
  316. load_thread_info: ($thread_tr, info_id) => {
  317. if ($("#"+info_id).length != 0) {
  318. return ;
  319. }
  320.  
  321. var $tr_clone = $thread_tr.clone();
  322. $tr_clone.attr("id", info_id);
  323. $tr_clone.children("*").remove();
  324.  
  325. var $tag_td = $('<td colspan="6"></td>');
  326. $tag_td.appendTo($tr_clone)
  327.  
  328. var url = "/" + $thread_tr.find("th:eq(0) > a").attr("href")
  329. tools.request_and_parse_thread(url, $tag_td)
  330. $thread_tr.after($tr_clone);
  331. }
  332. }
  333.  
  334. const imgs = {
  335. load_img_data: "data:image/gif;base64,R0lGODlhEAAQAPQAAP///2FhYfv7+729vdbW1q2trbe3t/Dw8OHh4bKystHR0czMzPX19dzc3Ovr68LCwsfHxwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/h1CdWlsdCB3aXRoIEdJRiBNb3ZpZSBHZWFyIDQuMAAh/hVNYWRlIGJ5IEFqYXhMb2FkLmluZm8AIfkECQoAAAAsAAAAABAAEAAABVAgII5kaZ6lMBRsISqEYKqtmBTGkRo1gPAG2YiAW40EPAJphVCREIUBiYWijqwpLIBJWviiJGLwukiSkDiEqDUmHXiJNWsgPBMU8nkdxe+PQgAh+QQJCgAAACwAAAAAEAAQAAAFaCAgikfSjGgqGsXgqKhAJEV9wMDB1sUCCIyUgGVoFBIMwcAgQBEKTMCA8GNRR4MCQrTltlA1mCA8qjVVZFG2K+givqNnlDCoFq6ioY9BaxDPI0EACzxQNzAHPAkEgDAOWQY4Kg0JhyMhACH5BAkKAAAALAAAAAAQABAAAAVgICCOI/OQKNoUSCoKxFAUCS2khzHvM4EKOkPLMUu0SISC4QZILpgk2bF5AAgQvtHMBdhqCy6BV0RA3A5ZAKIwSAkWhSwwjkLUCo5rEErm7QxVPzV3AwR8JGsNXCkPDIshACH5BAkKAAAALAAAAAAQABAAAAVSICCOZGmegCCUAjEUxUCog0MeBqwXxmuLgpwBIULkYD8AgbcCvpAjRYI4ekJRWIBju22idgsSIqEg6cKjYIFghg1VRqYZctwZDqVw6ynzZv+AIQAh+QQJCgAAACwAAAAAEAAQAAAFYCAgjmRpnqhADEUxEMLJGG1dGMe5GEiM0IbYKAcQigQ0AiDnKCwYpkYhYUgAWFOYCIFtNaS1AWJESLQGAKq5YWIsCo4lgHAzFmPEI7An+A3sIgc0NjdQJipYL4AojI0kIQAh+QQJCgAAACwAAAAAEAAQAAAFXyAgjmRpnqhIFMVACKZANADCssZBIkmRCLCaoWAIPm6FBUkwJIgYjR5LN7INSCwHwYktdIMqgoNFGhQQpMMt0WCoiGDAAvkQMYkIGLCXQI8OQzdoCC8xBGYFXCmLjCYhADsAAAAAAAAAAAA=",
  336. expand_svg : '<svg viewBox="0 0 1024 1024" width="16px" style="cursor:pointer" xmlns="http://www.w3.org/2000/svg" ><path fill="currentColor" d="M128 192h768v128H128V192zm0 256h512v128H128V448zm0 256h768v128H128V704zm576-352 192 160-192 128V352z"></path></svg>',
  337. hide_svg : '<svg viewBox="0 0 1024 1024" width="16px" style="cursor:pointer" xmlns="http://www.w3.org/2000/svg" ><path d="M876.8 156.8c0-9.6-3.2-16-9.6-22.4-6.4-6.4-12.8-9.6-22.4-9.6-9.6 0-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176C44.8 438.4 0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4 0 9.6 3.2 16 9.6 22.4 6.4 6.4 12.8 9.6 22.4 9.6 9.6 0 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4Zm-646.4 528c-76.8-70.4-128-128-153.6-172.8 28.8-48 80-105.6 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4Zm140.8-96c-12.8-22.4-19.2-48-19.2-76.8 0-44.8 16-83.2 48-112 32-28.8 67.2-48 112-48 28.8 0 54.4 6.4 73.6 19.2L371.2 588.8ZM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6-28.8 48-80 105.6-153.6 172.8-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176C979.199 585.6 1024 528 1024 512s-48.001-73.6-134.401-176Z" fill="currentColor"></path><path d="M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112-32 28.8-67.2 48-112 48Z" fill="currentColor"></path></svg>',
  338. close_svg : '<svg viewBox="0 0 1024 1024" width="16px" style="cursor:pointer" xmlns="http://www.w3.org/2000/svg" ><path fill="currentColor" d="M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"></path></svg>',
  339. upload_svg : '<svg viewBox="0 0 1024 1024" width="16px" style="cursor:pointer" xmlns="http://www.w3.org/2000/svg" ><path fill="currentColor" d="M544 864V672h128L512 480 352 672h128v192H320v-1.6c-5.376.32-10.496 1.6-16 1.6A240 240 0 0 1 64 624c0-123.136 93.12-223.488 212.608-237.248A239.808 239.808 0 0 1 512 192a239.872 239.872 0 0 1 235.456 194.752c119.488 13.76 212.48 114.112 212.48 237.248a240 240 0 0 1-240 240c-5.376 0-10.56-1.28-16-1.6v1.6H544z"></path></svg>',
  340. hideuser_svg: '<svg viewBox="0 0 1024 1024" width="16px" style="cursor:pointer" xmlns="http://www.w3.org/2000/svg" ><path d="M730.614 612.961c-27.79 14.626-52.036 35.076-71.115 59.728C615.725 648.664 565.459 635 512 635c-169.551 0-307 137.449-307 307 0 24.3-19.7 44-44 44s-44-19.7-44-44c0-163.047 98.787-303.02 239.774-363.332C279.812 528.088 229 440.978 229 342c0-156.297 126.703-283 283-283s283 126.703 283 283c0 98.978-50.812 186.088-127.774 236.668a394.09 394.09 0 0 1 63.388 34.293zM512 537c107.696 0 195-87.304 195-195s-87.304-195-195-195-195 87.304-195 195 87.304 195 195 195z m252.887 268.8l-64.974-64.973c-17.183-17.183-17.183-45.043 0-62.226s45.043-17.183 62.226 0l64.974 64.974 64.974-64.974c17.183-17.183 45.042-17.183 62.225 0s17.183 45.043 0 62.226L889.338 805.8l64.974 64.974c17.183 17.183 17.183 45.042 0 62.225s-45.042 17.183-62.225 0l-64.974-64.974L762.139 933c-17.183 17.183-45.043 17.183-62.226 0s-17.183-45.042 0-62.225l64.974-64.974z" fill="#000000" p-id="4945"></path></svg>'
  341. }
  342. const tools = {
  343. base_selector: "#postlist > div[id^=post_]:eq(0) ",
  344. headers: {
  345. 'User-agent': navigator.userAgent,
  346. 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
  347. },
  348. request_and_parse_thread: (url, $tag) => {
  349. GM_xmlhttpRequest({
  350. method: 'GET',
  351. url: url,
  352. headers: tools.headers,
  353. onload: (result) => {
  354. if (result.status != 200) {
  355. if (result.status == 404) {
  356. $tag.append("此贴不存在或已被删除或正在被审核")
  357. }
  358. return ;
  359. }
  360. var doc = result.responseText;
  361. var $pre_search_doc = $(doc).find(tools.base_selector)
  362. tools.load_img($pre_search_doc, $tag)
  363. // tools.load_download_link($pre_search_doc, $tag)
  364. }
  365. });
  366. },
  367. load_img: ($from_con, $to_con) => {
  368. var $tag_div = $('<div ></div>');
  369. $tag_div.css({
  370. "width" :"100%",
  371. "margin-bottom" :"5px",
  372. "overflow-x" :"auto",
  373. "max-height" :(GM_getValue("img_max_height")+10) + "px",
  374. });
  375. $to_con.append($tag_div);
  376. var $inner_tag_div = $('<div style="display: flex;align-items: center;"></div>');
  377. //有些帖子里含有一些分隔符形式的图片,在html特征上与正常的资源图片完全一致,无法过滤
  378. //仅能将资源地址为站内地址的图片忽略掉,这种图片基本都是无意义的静态资源。
  379. //剩下的从图床下载,与正经资源图片别无二致的分隔符形式图片只能将其视为普通图片显示出来
  380. //除非在脚本中进行资源预加载,判断其高度是否过低。但这样资源浪费过于严重。
  381. //点名批评forum.php?mod=viewthread&tid=1526548帖中那个welcome的动态图(逃
  382. var $imgs = $from_con.find('img.zoom[file^="http"]:not([file*="static/image"])')
  383. if ($imgs.length >= parseInt(GM_getValue("img_max_count"))) {
  384. $inner_tag_div.append('<span style="writing-mode: vertical-lr;">共'+$imgs.length+'张图</span>')
  385. }
  386. $imgs.slice(0, parseInt(GM_getValue("img_max_count")))
  387. .each(function(){
  388. var pic_url = $(this).attr( "zoomfile" ) || $(this).attr( "file" ) || $(this).attr( "src" );
  389. if (pic_url != undefined && pic_url != null && pic_url != '') {
  390. var $tag_img = $('<img />');
  391. $tag_img.attr({
  392. "data-original" : pic_url,
  393. "src" : GM_getValue("switch_lazy_load_img") == 1 ? imgs.load_img_data : pic_url,
  394. "onclick" :"zoom(this, this.src, 0, 0, 0)",
  395. })
  396. $tag_img.css({
  397. "max-width" :GM_getValue("img_max_width") + "px",
  398. "max-height" :GM_getValue("img_max_height") + "px",
  399. "cursor" :"pointer",
  400. "margin-right" :"3px",
  401. "float" :"left"
  402. });
  403. $inner_tag_div.append($tag_img);
  404. if (GM_getValue("switch_lazy_load_img") == 1) {
  405. $tag_img.lazyload({threshold:50});
  406. }
  407. }
  408. });
  409. if ($inner_tag_div.children().length == 0) {
  410. $tag_div.append("未识别到图片")
  411. } else {
  412. $tag_div.append($inner_tag_div)
  413. }
  414. },
  415. //为防止拿到资源地址后不点进帖子导致不评分评论收藏等,损害创作者权益,默认关闭此功能
  416. //开启方式自己找,别来问,别宣传
  417. load_download_link: ($from_con, $to_con) => {
  418. var $tag_div = $('<div></div>');
  419. $from_con.find("span[id*='attach_']")
  420. .each(function(){
  421. var $attach = $(this);
  422. if ($attach.find("a").length > 0){
  423. $tag_div.append($attach.parent().clone());
  424. tools.handleZipOrTxt($tag_div,$attach);
  425. }
  426. });
  427. $from_con.find("dl.tattl")
  428. .each(function(){
  429. var $attach = $(this);
  430. if ($attach.find("p.attnm").length > 0){
  431. $tag_div.append($attach.parent().clone());
  432. tools.handleZipOrTxt($tag_div,$attach);
  433. }
  434. });
  435. var links = [];
  436. $from_con.find("div.blockcode")
  437. .each(function(){
  438. var $codediv = $(this)
  439. $codediv.find("li").each(function(){
  440. var link = $(this).text()
  441. if (tools.check_link(link)) {
  442. links.push(link)
  443. }
  444. })
  445. });
  446. $from_con.find("a[href]")
  447. .each(function(){
  448. var $a_tag = $(this)
  449. var link = $a_tag.attr("href")
  450. if (tools.check_link(link)) {
  451. links.push(link)
  452. }
  453. });
  454. $from_con.find(tools._get_custom_selector())
  455. .each(function(){
  456. var text = $(this).text() + ' ';
  457. if (text.trim() != '') {
  458. var _links = tools.match_link(text)
  459. links.push(..._links);
  460. }
  461. });
  462.  
  463. Array.from(new Set(links.map(link => link.trim()))).map((link,index,arr) => tools.append_link(link,$tag_div))
  464.  
  465. if ($tag_div.children().length == 0) {
  466. $tag_div.append("未识别到资源连接")
  467. } else {
  468. var $115btn = $('<button type=button>一键推送</button>')
  469. $115btn.on('click',function(){
  470. var arrlink = []
  471. $(this).parent().parent().find('a[dlflag="1"]').each(function(){
  472. var _115link = $(this).attr('href')
  473. if (tools.check_link_can115(_115link)) {
  474. arrlink.push(_115link)
  475. }
  476. })
  477. if (arrlink.length == 0) {
  478. tools.tip("没有找到ed2k或磁力链接!");
  479. return
  480. }
  481. call115.push_urls(arrlink).then( result => {
  482. if (Array.isArray(result)) {
  483. let succ = 0;
  484. let error = 0;
  485. let errortext = "";
  486. result.map((item,index,arr) => {
  487. if (item.state) {
  488. succ++
  489. } else {
  490. error++;
  491. errortext += (item.error_msg + ":" + item.url + '<br/>')
  492. }
  493. })
  494. if (error == 0) {
  495. tools.tip(`成功推送${succ}条链接`)
  496. } else {
  497. tools.tip(`共推送${result.length}条链接,成功${succ}条,失败${error}条:<br/> ${errortext}`,1000*10)
  498. }
  499. }
  500. }).catch( msg => tools.tip(msg))
  501. })
  502. $tag_div.prepend($("<div></div>").append($115btn))
  503. $tag_div.prepend($('<div style="color:red">喜欢本贴的话别忘了点进去评分评论收藏哦!</div>'))
  504. }
  505. $to_con.append($tag_div);
  506. },
  507. append_link: (link,$tag_div) => {
  508. link = link.trim()
  509. var $linkdiv = $(`<div><a href="${link}" dlflag="1" target="_blank">${link}</a></div>`)
  510. if (tools.check_link_can115(link)) {
  511. var $uploadbtn = $(`<span link="${link}" title="推送到115(需要当前浏览器已登录)" style="margin-left: 10px">${imgs.upload_svg}</span>`)
  512. $uploadbtn.on("click",function(){
  513. call115.push_urls($(this).attr("link")).then( result => {
  514. if (result[0].state) tools.tip("推送成功")
  515. else tools.tip(result[0].error_msg)
  516. }).catch( msg => tools.tip(msg))
  517. })
  518. $uploadbtn.appendTo($linkdiv)
  519. }
  520. $tag_div.append($linkdiv)
  521. },
  522. handleZipOrTxt: ($tag_div, $attach) => {
  523. var $a_tag = $attach.find('a:eq(0)')
  524. if ($a_tag.text().toLowerCase().endsWith('.zip')){
  525. var $btn = $('<button type=button>解析压缩包</button>')
  526. var zipdownloadlink = $a_tag.attr("href")
  527. $btn.on('click',function(){
  528. readfirsttxtfileinzip(zipdownloadlink).then( text => {
  529. text.split('\n').map((text,index,arr) => tools.append_link(text,$tag_div))
  530. }).catch( error => {
  531. console.log(error)
  532. if (error.message == 'Encrypted zip are not supported') {
  533. tools.tip('暂不支持加密压缩包')
  534. }else if (error == 'download err.'){
  535. tools.tip("压缩包文件下载失败")
  536. }
  537. })
  538. })
  539. $tag_div.append($btn)
  540. } else if ($a_tag.text().toLowerCase().endsWith('.txt')) {
  541. var $btn1 = $('<button type=button>加载文档</button>')
  542. var txtdownloadlink = $a_tag.attr("href")
  543. $btn1.on('click',function(){
  544. let _header = {
  545. ...headers,
  546. 'Referer':txtdownloadlink
  547. }
  548. GM_xmlhttpRequest({
  549. method: 'GET',
  550. url: txtdownloadlink,
  551. headers: _header,
  552. responseType: 'blob',
  553. onload: (result) => {
  554. if (result.status === 200 || result.status === 304) {
  555. var reader = new FileReader();
  556. reader.readAsText(result.response, 'utf-8');
  557. reader.onload = function (e) {
  558. var text = reader.result
  559. text.split('\n').map((text,index,arr) => tools.append_link(text,$tag_div))
  560. }
  561. }else{
  562. tools.tip("文件下载失败")
  563. }
  564. }
  565. });
  566. })
  567. $tag_div.append($btn1)
  568. }
  569. },
  570. link_head: {
  571. can115: ["magnet:?xt=","ed2k://"],
  572. other: ["115://","https://pan.quark","https://pan.baidu"],
  573. },
  574. check_link: (linkstr) => tools._check_link(linkstr, [...tools.link_head.can115, ...tools.link_head.other ]),
  575. check_link_can115: (linkstr) => tools._check_link(linkstr,tools.link_head.can115),
  576. _check_link: (linkstr, heads) => heads.some( (head) => linkstr.startsWith(head) ),
  577. regExps:[],
  578. match_link: (text) => {
  579. if (tools.regExps.length == 0) {
  580. let all_link_head = [...tools.link_head.can115, ...tools.link_head.other ];
  581. all_link_head.map((currentValue,index,arr) => {
  582. var key = currentValue.replaceAll("?","\\?")
  583. if (currentValue == "ed2k://") {
  584. tools.regExps.push(new RegExp(`(${key})(.+?)(\\|/|复制代码)`, 'g'))
  585. }else{
  586. tools.regExps.push(new RegExp(`(${key})(.+?)(?=\\s|复制代码)`, 'g'))
  587. }
  588. })
  589. }
  590. var result = []
  591. tools.regExps.map((regExp,index,arr) => {
  592. var _link = text.match(regExp);
  593. if (_link != null) {
  594. result.push(..._link);
  595. }
  596. })
  597. return result;
  598. },
  599. _get_custom_selector: () => {
  600. var custom_selector = '';
  601. let all_link_head = [...tools.link_head.can115, ...tools.link_head.other ];
  602. for(let i = 0; i < all_link_head.length; i++){
  603. var _selector = ':contains('+all_link_head[i]+')';
  604. custom_selector = custom_selector + _selector;
  605. if ( i != all_link_head.length-1 ) {
  606. custom_selector = custom_selector + ",";
  607. }
  608. }
  609. return custom_selector;
  610. },
  611. add_removed_id: (thread_id) => {
  612. var max_length = parseInt(GM_getValue("max_hide_history"))
  613. var removed_ids = GM_getValue("removed_ids").split(",")
  614. if (max_length == 0) {
  615. GM_setValue("removed_ids", "")
  616. return ;
  617. }
  618. if (!removed_ids.includes(thread_id)) {
  619. removed_ids.push(thread_id);
  620. }
  621. if (removed_ids.length > max_length) {
  622. removed_ids = removed_ids.slice(0 - max_length)
  623. }
  624. GM_setValue("removed_ids", removed_ids.join(","))
  625. },
  626. add_user_id: (userid, userName) => {
  627. var arr = JSON.parse(GM_getValue("author_list"))
  628. if (arr.findIndex((user) => user["id"] == userid) < 0) {
  629. arr.push({
  630. "id":userid,
  631. "name":userName,
  632. "date":parseInt(+new Date()/1000)
  633. })
  634. GM_setValue("author_list", JSON.stringify(arr))
  635. }
  636. },
  637. _tipTimerId:null,
  638. tip: (content,time) => {
  639. $("#msg").remove();
  640. clearTimeout(tools._tipTimerId);
  641. let $tipcon = $(`
  642. <div id="msg" style="opacity:0;transition: all 0.5s;position:fixed;top: 10%;left: 50%;transform: translate(-50%,-50%);background: #000;color: #fff;border-radius: 4px;text-align: center;padding: 10px 20px;">
  643. ${content}
  644. </div>
  645. `)
  646. $("body").append($tipcon);
  647. setTimeout( () => {
  648. $tipcon.css("opacity", 0.8)
  649. })
  650. tools._tipTimerId = setTimeout( () => {
  651. $tipcon.css("opacity", 0)
  652. $tipcon.on("transitionend", function() {
  653. $("#msg").remove();
  654. })
  655. }, time?time:2000);
  656. }
  657. }
  658.  
  659. const GM_script = {
  660. init_styles: () => {
  661. GM_addStyle(`
  662. .setting-remark{
  663. color: gray;
  664. font-style: italic;
  665. }
  666. `);
  667. },
  668. init_variables: () => {
  669. GM_script.set_default_value("switch_autoload", 0);
  670. GM_script.set_default_value("page_thread_delayed", 1000);
  671. GM_script.set_default_value("switch_lazy_load_img", 1);
  672. GM_script.set_default_value("load_thread_delayed", 500);
  673. GM_script.set_default_value("img_max_height", 300);
  674. GM_script.set_default_value("img_max_width", 300);
  675. GM_script.set_default_value("img_max_count", 3);
  676. GM_script.set_default_value("show_hide_btn", 1);
  677. GM_script.set_default_value("reset_width", 0);
  678. GM_script.set_default_value("reset_width_px", 1500);
  679. GM_script.set_default_value("removed_ids", "");
  680. GM_script.set_default_value("max_hide_history", 500);
  681. GM_script.set_default_value("hideorgray", "gray");
  682. GM_script.set_default_value("author_control", 0);
  683. GM_script.set_default_value("author_list", "[]");
  684. var max_length = parseInt(GM_getValue("max_hide_history"));
  685. if (max_length == 0) {
  686. GM_setValue("removed_ids", "");
  687. } else {
  688. var removed_ids = GM_getValue("removed_ids").split(",");
  689. if (removed_ids.length > max_length) {
  690. removed_ids = removed_ids.slice(0 - max_length);
  691. GM_setValue("removed_ids", removed_ids.join(","));
  692. }
  693. }
  694. var now = parseInt(+new Date()/1000)
  695. var arr = JSON.parse(GM_getValue("author_list"))
  696. var newarr = arr.filter(user => (now - user["date"]) < 60*60*24*7 )
  697. GM_setValue("author_list", JSON.stringify(newarr))
  698. },
  699. set_default_value: (key, value) => {
  700. if ( GM_getValue(key) == undefined) {
  701. GM_setValue(key, value);
  702. }
  703. },
  704. add_config_menu: () => {
  705. GM_registerMenuCommand("设置", function() {
  706. var $config_madel = $('<div />');
  707. $config_madel.css({
  708. "width": "100%",
  709. "height": "100%",
  710. "background": "rgba(0, 0, 0, 0.4)",
  711. "position": "fixed",
  712. "top": "0",
  713. "left": "0",
  714. "visibility": "hidden",
  715. "opacity": "0",
  716. "z-index": "999",
  717. "transition": "all 0.3s",
  718. })
  719. $config_madel.on("click", function() {
  720. $config_madel.remove();
  721. })
  722. $config_madel.keyup(function(e){
  723. var key = e.which || e.keyCode;
  724. if(key == 27){
  725. $config_madel.remove();
  726. }
  727. });
  728.  
  729. var $config_window = $('<div />');
  730. $config_window.css({
  731. "position": "fixed",
  732. "top": "50%",
  733. "left": "50%",
  734. "padding" : "10px 20px",
  735. "background-color": "#fff",
  736. "border-radius": "10px",
  737. "transform": "translate(-50%,-50%)",
  738. });
  739. $config_window.on("click", function(event) {
  740. event.stopPropagation()
  741. })
  742. $config_window.appendTo($config_madel)
  743.  
  744. var $config_title = $(`
  745. <div>
  746. <span style="font-weight: bold">设置 -- 98图片浏览助手</span>
  747. <span id="close_cfg_window" title="关闭设置窗口" >${imgs.close_svg}</span>
  748. </div>
  749. `);
  750. $config_title.css({
  751. "border-bottom": "1px solid gray",
  752. "font-size": "20px",
  753. "display": "flex",
  754. "justify-content": "space-between"
  755. });
  756. $config_title.find("#close_cfg_window").on("click", function(){
  757. $config_madel.remove();
  758. })
  759. $config_title.appendTo($config_window)
  760.  
  761. var $form = $(`
  762. <form style="padding: 10px 20px; max-height=600px; overflow-y: auto;">
  763. <div>
  764. <input type="checkbox" id="reset_width" name="reset_width" />
  765. <label for="reset_width">适应宽屏,将内容宽度设置为</label>
  766. <input type="number" id="reset_width_px" name="reset_width_px" min="500" max="5000"/>
  767. <label for="reset_width_px">px</label>
  768. <div class="setting-remark">* 勾选后将会把内容区域的宽度设置为给定值。取值范围500-5000</div>
  769. </div>
  770. <div>
  771. <input type="checkbox" id="show_hide_btn" name="show_hide_btn" />
  772. <label for="show_hide_btn">显示隐藏按钮,最多纪录</label>
  773. <input type="number" id="max_hide_history" name="max_hide_history" min="0" max="5000"/>
  774. <label for="max_hide_history">条隐藏历史 -- 当前已记录 ${GM_getValue("removed_ids").split(",").length} </label>
  775. <button id="clear_hide" type=button>清空</button>
  776. <div class="setting-remark">* 按钮点击后可以暂时隐藏帖子,并记录此贴ID。取值范围0-5000</div>
  777. <div style="margin-left:24px">
  778. <span>刷新页面后,自动</span>
  779. <input type="radio" id="hide" name="hideorgray" value="hide" />
  780. <label for="hide">隐藏</label>
  781. <input type="radio" id="gray" name="hideorgray" value="gray" />
  782. <label for="gray">置灰</label>
  783. <span>标记过的帖子</span>
  784. </div>
  785. </div>
  786. <div>
  787. <input type="checkbox" id="switch_autoload" name="switch_autoload" />
  788. <label for="switch_autoload">开启自动加载</label>
  789. <div class="setting-remark">* 进入帖子列表或翻页后,自动加载所有未加载过的帖子</div>
  790. </div>
  791. <div>
  792. <label for="load_thread_delayed">帖子列表遍历延迟</label>
  793. <input type="number" id="load_thread_delayed" name="load_thread_delayed" min="0" max="5000"/>
  794. <label for="load_thread_delayed">毫秒</label>
  795. <div class="setting-remark">* 间隔多少毫秒加载下个帖子。0为不设延迟,取值范围0-5000</div>
  796. </div>
  797. <div>
  798. <label for="page_thread_delayed">点击下一页后延迟</label>
  799. <input type="number" id="page_thread_delayed" name="page_thread_delayed" min="500" max="5000"/>
  800. <label for="page_thread_delayed">毫秒再次触发加载</label>
  801. <div class="setting-remark">* 在开启自动加载的前提下,点击下一页后如果没有自动加载新出的帖子,可以适当调大该值。取值范围500-5000</div>
  802. </div>
  803. <div>
  804. <input type="checkbox" id="switch_lazy_load_img" name="switch_lazy_load_img" />
  805. <label for="switch_lazy_load_img">开启图片懒加载</label>
  806. <div class="setting-remark">* 只有图片将要进入显示区时才会下载</div>
  807. </div>
  808. <div>
  809. <label for="img_max_count">每个帖子最多加载</label>
  810. <input type="number" id="img_max_count" name="img_max_count" min="0" max="10"/>
  811. <label for="img_max_count">张图片</label>
  812. <div class="setting-remark">* 取值范围0-10</div>
  813. </div>
  814. <div>
  815. <label for="img_max_width">每行图片最宽占用</label>
  816. <input type="number" id="img_max_width" name="img_max_width" min="200" max="1000"/>
  817. <label for="img_max_width">像素</label>
  818. <div class="setting-remark">* 图片最宽占用多少空间。单位像素,取值范围200-1000</div>
  819. </div>
  820. <div>
  821. <label for="img_max_height">每行图片最高占用</label>
  822. <input type="number" id="img_max_height" name="img_max_height" min="200" max="1000"/>
  823. <label for="img_max_height">像素</label>
  824. <div class="setting-remark">* 图片最高占用多少空间。单位像素,取值范围200-1000</div>
  825. </div>
  826. <div>
  827. <input type="checkbox" id="author_control" name="author_control" />
  828. <label for="author_control">开启作者筛选 -- 当前小黑屋 ${JSON.parse(GM_getValue("author_list")).length} 人</label>
  829. <button id="clear_black" type=button>清空小黑屋</button>
  830. <div class="setting-remark">* 点击帖子作者后方的图标即可在7天内自动隐藏此人的帖子</div>
  831. </div>
  832. </form>
  833. `);
  834. $form.appendTo($config_window);
  835. var $clear_hide_btn = $form.find("#clear_hide");
  836. $clear_hide_btn.click(function() {
  837. GM_setValue("removed_ids", "");
  838. tools.tip("清理成功");
  839. });
  840. var $clear_blackbtn = $form.find("#clear_black");
  841. $clear_blackbtn.click(function() {
  842. GM_setValue("author_list", "[]");
  843. tools.tip("清理成功");
  844. });
  845.  
  846. var $btns = $(`
  847. <div>
  848. <button id="confirm_btn">确认</button>
  849. <button id="cancel_btn">取消</button>
  850. </div>
  851. `);
  852. $btns.css({
  853. "display": "flex",
  854. "justify-content": "flex-end",
  855. })
  856. var css_btn = {
  857. "margin-right": "10px",
  858. "border-radius": "4px",
  859. "border": "none",
  860. "min-height": "1em",
  861. "padding": "6px 12px",
  862. "cursor": "pointer"
  863. }
  864. var $confirm_btn = $btns.find("#confirm_btn")
  865. var $cancel_btn = $btns.find("#cancel_btn")
  866. $confirm_btn.css(css_btn);
  867. $confirm_btn.css({
  868. "color": "#FFF",
  869. "background-color": "#2ecc71",
  870. });
  871. $cancel_btn.css(css_btn);
  872. $cancel_btn.css({
  873. "color": "#000",
  874. "background-color": "#ecf0f1",
  875. });
  876.  
  877. $confirm_btn.click(function(){
  878. console.log("config value:");
  879. console.log("show_hide_btn", $form.find("#show_hide_btn").prop("checked"));
  880. GM_setValue("show_hide_btn", $form.find("#show_hide_btn").prop("checked") ? 1 : 0);
  881. console.log("max_hide_history", $form.find("#max_hide_history").val());
  882. GM_setValue("max_hide_history", $form.find("#max_hide_history").val());
  883. console.log("hideorgray", $form.find("input[name='hideorgray']:checked").val());
  884. GM_setValue("hideorgray", $form.find("input[name='hideorgray']:checked").val());
  885. console.log("reset_width", $form.find("#reset_width").prop("checked"));
  886. GM_setValue("reset_width", $form.find("#reset_width").prop("checked") ? 1 : 0);
  887. console.log("reset_width_px", $form.find("#reset_width_px").val());
  888. GM_setValue("reset_width_px", $form.find("#reset_width_px").val());
  889. console.log("switch_autoload", $form.find("#switch_autoload").prop("checked"));
  890. GM_setValue("switch_autoload", $form.find("#switch_autoload").prop("checked") ? 1 : 0);
  891. console.log("author_control", $form.find("#author_control").prop("checked"));
  892. GM_setValue("author_control", $form.find("#author_control").prop("checked") ? 1 : 0);
  893. console.log("switch_lazy_load_img", $form.find("#switch_lazy_load_img").prop("checked"));
  894. GM_setValue("switch_lazy_load_img", $form.find("#switch_lazy_load_img").prop("checked") ? 1 : 0);
  895. console.log("load_thread_delayed", $form.find("#load_thread_delayed").val());
  896. GM_setValue("load_thread_delayed", $form.find("#load_thread_delayed").val());
  897. console.log("page_thread_delayed", $form.find("#page_thread_delayed").val());
  898. GM_setValue("page_thread_delayed", $form.find("#page_thread_delayed").val());
  899. console.log("img_max_height", $form.find("#img_max_height").val());
  900. GM_setValue("img_max_height", $form.find("#img_max_height").val());
  901. console.log("img_max_width", $form.find("#img_max_width").val());
  902. GM_setValue("img_max_width", $form.find("#img_max_width").val());
  903. console.log("img_max_count", $form.find("#img_max_count").val());
  904. GM_setValue("img_max_count", $form.find("#img_max_count").val());
  905. tools.tip("保存成功")
  906. $config_madel.remove();
  907. });
  908.  
  909. $cancel_btn.click(function(){
  910. tools.tip("已取消")
  911. $config_madel.remove()
  912. });
  913. $btns.appendTo($config_window)
  914.  
  915. $form.find("#show_hide_btn").prop("checked",GM_getValue("show_hide_btn") == 1);
  916. $form.find("#max_hide_history").val(GM_getValue("max_hide_history"));
  917. $form.find("#reset_width").prop("checked",GM_getValue("reset_width") == 1);
  918. $form.find("#reset_width_px").val(GM_getValue("reset_width_px"));
  919. $form.find("#switch_autoload").prop("checked",GM_getValue("switch_autoload") == 1);
  920. $form.find("#author_control").prop("checked",GM_getValue("author_control") == 1);
  921. $form.find("#switch_lazy_load_img").prop("checked",GM_getValue("switch_lazy_load_img") == 1 );
  922. $form.find("#load_thread_delayed").val(GM_getValue("load_thread_delayed"));
  923. $form.find("#page_thread_delayed").val(GM_getValue("page_thread_delayed"));
  924. $form.find("#img_max_height").val(GM_getValue("img_max_height"));
  925. $form.find("#img_max_width").val(GM_getValue("img_max_width"));
  926. $form.find("#img_max_count").val(GM_getValue("img_max_count"));
  927. $form.find("input[id='"+GM_getValue("hideorgray")+"']").attr('checked', 'true');
  928.  
  929. $config_madel.appendTo($("body"));
  930. $config_madel.css('visibility', 'visible');
  931. $config_madel.css('opacity', '1');
  932. $config_madel.css('transform', 'scale(1)');
  933. })
  934. }
  935. }