tieba page

显示手机版贴吧里被隐藏的楼层与翻页按钮,回贴,顺便拦点儿广告

  1. // ==UserScript==
  2. // @name tieba page
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.018
  5. // @author fthvgb1
  6. // @match https://tieba.baidu.com/*
  7. // @match https://tiebac.baidu.com/*
  8. // @match http://tieba.baidu.com/*
  9. // @grant GM.openInTab
  10. // @grant GM_xmlhttpRequest
  11. // @description 显示手机版贴吧里被隐藏的楼层与翻页按钮,回贴,顺便拦点儿广告
  12. // ==/UserScript==
  13.  
  14.  
  15. (function () {
  16. 'use strict';
  17.  
  18. function jpg(v) {
  19. let fimgs = v.querySelectorAll('span[class="wrap pbimgwapper"]>img.BDE_Image');
  20. if (fimgs.length > 0) {
  21. fimgs.forEach(img => {
  22. img.src = img.src.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc');
  23. })
  24. }
  25. let imgs = v.querySelectorAll('.pb_img_item:not([data-type="gif"]),[data-class="BDE_Image"]:not([data-type="gif"])');
  26. if (imgs.length > 0) {
  27. imgs.forEach(value => {
  28. let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc');
  29. let tmp = decodeURIComponent(h.split('&src=')[1]).split('/');
  30. tmp = tmp[tmp.length - 1];
  31. value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-url="${tmp}" class="BDE_Image" src="${h}" alt=""></div>`;
  32. })
  33. }
  34. }
  35.  
  36. function gif(v) {
  37. let imgs = v.querySelectorAll('[data-type="gif"]');
  38. if (imgs.length > 0) {
  39. imgs.forEach(value => {
  40. let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc');
  41. let url = h.split('&src=')[1];
  42. let ssr = decodeURIComponent(url);
  43. let x = ssr.split('/');
  44. let id = x[x.length - 1];
  45. value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-src="${h}" data-url="${id}" data-type="gif" onclick="this.src=this.dataset.src;" class="BDE_Image" src="${ssr}" alt="gif"></div>`;
  46. })
  47. }
  48. }
  49.  
  50. function delElement(selectors) {
  51. selectors.forEach(value => {
  52. let x = document.querySelector(value);
  53. if (x) {
  54. x.parentNode.removeChild(x)
  55. }
  56. });
  57. }
  58.  
  59. function replayPage(res, el, call) {
  60. let ht = (new DOMParser()).parseFromString(res.data.floor_html, 'text/html');
  61. let lii = ht.querySelectorAll('li');
  62. let x = [];
  63. lii.forEach(function (li, index) {
  64. let uuu = li.querySelector('.left>div .user_name');
  65. let ct = li.querySelector('.user_name + p').innerText;
  66. let info = JSON.parse(li.dataset.info);
  67. let username = uuu.outerHTML;
  68. username = username.replace('</a>', `</a> <span style="color: #8fa391">${ct}</span>`).replace('javascript:;', `/home/main?un=${info.un}`);
  69. let s = li.querySelector('.content span');
  70. s.className = 'floor_content';
  71. let c = li.querySelector('.content').innerHTML;
  72. let div = `
  73. <div class="fmain j_floor_main">
  74. <div class="floor_footer_item">
  75. ${username}
  76. ${c}
  77. </div>
  78. </div>`;
  79. li.innerHTML = div;
  80. let ll = document.createElement('li');
  81. ll.classList.add('list_item_floor');
  82. ll.classList.add('j_list_item_floor');
  83. ll.innerHTML = div;
  84. ll.setAttribute('data-info', li.dataset.info);
  85. llxx(ll)
  86. x.push(ll);
  87. });
  88. if (call) {
  89. call(x);
  90. }
  91. x.forEach(v => {
  92. url(v);
  93. el.appendChild(v);
  94. });
  95.  
  96. }
  97.  
  98. function tpage(tot, el, call) {
  99. tot = parseInt(tot);
  100. let d = document.createElement('div');
  101. d.classList.add('pagexx');
  102. d.style.cssText = 'text-align: center;margin:5px 0 2px';
  103. let a = document.createElement('a');
  104. a.href = 'javascript:void(0)';
  105. a.innerText = '<';
  106. let i = document.createElement('input');
  107. d.append(a);
  108. a.style.cssText = `
  109. height: 20px;
  110. line-height: 20px;
  111. display: inline-block;
  112. text-align: center;
  113. color: #fff;
  114. width: 20px;
  115. background-color: rgba(0,0,0,.3);
  116. `;
  117. let r = a.cloneNode(true);
  118. a.classList.add('l');
  119. [a, r].forEach(v => {
  120. v.addEventListener('click', ev => {
  121. let r = parseInt(i.dataset.r);
  122. if (v.classList.contains('r') && r < tot) {
  123. ppage(r + 1);
  124. }
  125. if (v.classList.contains('l') && r > 1) {
  126. ppage(r - 1);
  127. }
  128.  
  129. });
  130. });
  131. d.appendChild(a);
  132. d.appendChild(i);
  133. d.appendChild(r);
  134. el.parentNode.appendChild(d);
  135. r.innerText = '>';
  136. r.classList.add('r');
  137. i.style.width = '60px';
  138. i.style.margin = '0 6px';
  139. i.style.textAlign = 'center';
  140. i.type = 'text';
  141. i.value = '1/' + tot;
  142. i.dataset.o = tot;
  143. i.dataset.r = '1';
  144.  
  145. function ppage(page) {
  146. i.dataset.r = page;
  147. i.type = 'text';
  148. i.value = page + '/' + tot;
  149. el.innerHTML = '';
  150. if (call) {
  151. call(page);
  152. }
  153. }
  154.  
  155. i.addEventListener('click', ev => {
  156. i.value = '';
  157. i.type = 'number';
  158. i.step = '1';
  159. i.min = '1';
  160. });
  161. i.addEventListener('keyup', ev => {
  162. if (ev.key === 'Enter') {
  163. i.blur();
  164. }
  165. });
  166. i.addEventListener('blur', ev => {
  167. let page = parseInt(i.value);
  168. if (page > 0 && page <= tot) {
  169. ppage(page);
  170. } else {
  171. i.type = 'text';
  172. i.value = i.dataset.r + '/' + tot;
  173. }
  174. })
  175. }
  176.  
  177. function lo(reference, target) {
  178. //因为我们会将目标元素的边框纳入递归公式中,这里先减去对应的值
  179. let result = {
  180. left: -target.clientLeft,
  181. top: -target.clientTop
  182. };
  183. let node = target;
  184. while (node !== reference && node !== document) {
  185. result.left = result.left + node.offsetLeft + node.clientLeft;
  186. result.top = result.top + node.offsetTop + node.clientTop;
  187. node = node.parentNode;
  188. }
  189. if (isNaN(reference.scrollLeft)) {
  190. result.right = document.documentElement.scrollWidth - result.left;
  191. result.bottom = document.documentElement.scrollHeight - result.top;
  192. } else {
  193. result.right = reference.scrollWidth - result.left;
  194. result.bottom = reference.scrollHeight - result.top;
  195. }
  196. return result;
  197. }
  198.  
  199. function ab(e) {
  200. let f = e.querySelector('#pb_imgs_div');
  201. if (f) {
  202. let dd = [];
  203. let num = e.querySelector('img.pic_icon').parentElement.innerText.replace('图', '');
  204. num = parseInt(num);
  205. f.querySelectorAll('#pb_imgs_div>div').forEach((d, i) => {
  206. let div = document.createElement('div');
  207. div.dataset.url = d.dataset.url;
  208. div.dataset.class = 'BDE_Image';
  209. dd.push(div);
  210. });
  211. if (num > 3) {
  212. let pic = decodeURIComponent(dd[0].dataset.url).split('/');
  213. pic = pic[pic.length - 1].split('.')[0];
  214. let word = document.querySelector('a.post_title_text').innerText.replace('吧', '');
  215. let kz = document.querySelector('html').innerHTML.match(/kz: "(\d+)"/)[1];
  216. let width = Math.min(window.innerHeight, window.innerWidth) * 3;
  217. let url = `/mo/q/album?word=${word}&tid=${kz}&pic_id=${pic}&see_lz=1&img_quality=100&direction=2&img_width=${width}&img_height=2000`;
  218. $.ajax({
  219. url: url,
  220. async: false,
  221. dataType: 'json',
  222. success: res => {
  223. let imgs = res.data.images;
  224. dd = []
  225. imgs.forEach((img, i) => {
  226. if (i > num - 1) {
  227. return;
  228. }
  229. let div = document.createElement('div');
  230. div.dataset.url = img.url.replace('&amp;src=', '&src=');
  231. if (div.dataset.url.indexOf('&src') < 0) {
  232. div.dataset.url += '?&src=' + div.dataset.url;
  233. }
  234. div.dataset.class = 'BDE_Image';
  235. dd.push(div);
  236. })
  237. }
  238. });
  239.  
  240. }
  241. let pb = document.createElement('div');
  242. dd.forEach(v => {
  243. pb.appendChild(v);
  244. });
  245. let pp = document.querySelector('#pb_imgs');
  246. if (pp) {
  247. let parentNode = pp.parentElement;
  248. pb.className = 'pb_less_imgs';
  249. pb.id = 'pb_less_imgs';
  250. parentNode.insertBefore(pb, pp);
  251. parentNode.removeChild(pp);
  252. }
  253. }
  254. }
  255.  
  256. function url(li) {
  257. let as = li.querySelectorAll('a');
  258. as.forEach(a => {
  259. let src = a.href;
  260. if (src.search(/(fr=share)|(client_type=2)/) > -1) {
  261.  
  262. let href = src.match(/(https?:\/\/tieba\.baidu\.com\/p\/\d+)/);
  263. if (href && href.length > 0) {
  264. a.href = href[1];
  265. a.innerText = a.href;
  266. }
  267. }
  268. })
  269. }
  270.  
  271. function gmPage(url, el, page, call) {
  272. GM_xmlhttpRequest({
  273. method: 'GET',
  274. url: url,
  275. headers: {
  276. "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36'
  277. },
  278. onload: function (res) {
  279. let lis = (new DOMParser()).parseFromString(res.responseText, 'text/html');
  280.  
  281. let tmp = lis.querySelectorAll('li');
  282. let arr = [...tmp];
  283. arr.splice(tmp.length - 1, 1);
  284. if (page === 1 && el.childElementCount > 0) {
  285. arr.splice(0, 2);
  286. }
  287. arr.forEach(li => {
  288.  
  289. let o = JSON.parse(li.getAttribute('data-field'));
  290. let n = {
  291. pid: o.spid,
  292. un: o.user_name
  293. }
  294. let ell = document.createElement('li');
  295. ell.className = 'list_item_floor j_list_item_floor';
  296. ell.setAttribute('data-info', JSON.stringify(n))
  297. ell.setAttribute('pid', o.spid);
  298. let time = li.querySelector('.lzl_time').innerHTML;
  299. let h = li.querySelector('a[class="at j_user_card "]');
  300.  
  301. let he = `<a href="${h.href}" target="_blank" class="user_name">${h.getAttribute('username') + (h.innerText !== h.getAttribute('username') ? '(' + h.innerText + ')' : '')}</a>`;
  302. let re = li.querySelector('.lzl_content_main');
  303.  
  304. let rrr = re.querySelector('.at');
  305. let rrrxx = '';
  306. if (rrr) {
  307. rrrxx += `回复 <a href="${rrr.href}">${rrr.innerText}</a> : `
  308. re.removeChild(rrr)
  309. }
  310. let ly = re.innerHTML.trim();
  311.  
  312. if (ly.indexOf('回复') === 0) {
  313. rrrxx += re.innerHTML.replace('回复', '').replace(':', '');
  314. } else {
  315. rrrxx += re.innerHTML;
  316. }
  317.  
  318. ell.innerHTML = `
  319. <div class="fmain j_floor_main">
  320. <div class="floor_footer_item">
  321. ${he} <span style="color: #8fa391">${time}</span>
  322. <span class="floor_content">
  323. ${rrrxx}
  324. </span>
  325. </div>
  326. </div>
  327. `;
  328.  
  329. llxx(ell)
  330. el.append(ell)
  331.  
  332. })
  333. if (call) {
  334. call()
  335. }
  336. }
  337. });
  338. }
  339.  
  340. function llxx(li) {
  341.  
  342. let info = JSON.parse(li.dataset.info);
  343. if (!window.lz) {
  344. lzl();
  345. }
  346. let rep = li.querySelector('a.user_name');
  347. let xx = rep.innerHTML;
  348. if (':' === xx[xx.length - 1]) {
  349. xx = xx.substring(0, xx.length - 1)
  350. }
  351.  
  352. let x = ''
  353. let i = `&nbsp;<span style="text-align: center;
  354. background: #3381e3;
  355. color: #fff;
  356. padding: 0 4px;
  357. margin: 0 4px 0 0;
  358. border-radius: 2px;
  359. vertical-align: middle;
  360. font-size: 14px;
  361. ">楼主</span>`
  362. let y = ':'
  363. if (window.lz.un === info.un || window.lz.name_show === info.un) {
  364. x = i
  365. }
  366. rep.outerHTML = `<a href="/home/main?un=${info.un}" class="user_name">${xx}</a>` + x + y;
  367. let c = li.querySelector('.floor_content a[href*="/home/main?un="]')
  368. if (!c) {
  369. c = li.querySelector('.floor_content a[href*="jump?un="]');
  370. if (c) {
  371. c.href = '/home/main?un=' + c.innerText
  372. }
  373. }
  374.  
  375.  
  376. if (c) {
  377. let un = c.href.split('un=')[1];
  378. un = decodeURI(un);
  379. if (window.lz.un === un || window.lz.name_show === un) {
  380. c.outerHTML += i
  381. }
  382. }
  383. }
  384.  
  385. function t() {
  386. lz();
  387.  
  388.  
  389. $("ul#pblist>li").forEach(function (e, iii) {
  390. let ff = f(e);
  391. if (ff === 1) {
  392. if (!window.lz) {
  393. window.lz = JSON.parse(e.dataset.info)
  394. }
  395. ab(e);
  396. }
  397. let videos = e.querySelectorAll('.video');
  398. if (videos.length > 0) {
  399. videos.forEach(video => {
  400. let src = video.getAttribute('data-vhsrc');
  401. let img = video.querySelector('img');
  402. let hr = video.getAttribute('data-vsrc');
  403.  
  404. if (src) {
  405. video.outerHTML = `<video poster="${img.src}" src="${src}" controls="controls" style="max-width:100%;min-width:100%"></video>`;
  406. } else if (hr && hr.indexOf('bilibili.com') > -1) {
  407. let av = hr.match(/av(\d+)/)[1]
  408. video.outerHTML = `<iframe src="//player.bilibili.com/player.html?aid=${av}&page=1" allowfullscreen="true"> </iframe>`
  409.  
  410. } else if (hr && hr.indexOf('youku.com') > -1) {
  411. let r = hr.split('id_')[1].replace('.html', '')
  412. video.outerHTML = `<iframe src='https://player.youku.com/embed/${r}' frameborder=0 allowfullscreen="true"></iframe>`
  413.  
  414. } else if (hr && hr.indexOf('tudou.com') > -1) {
  415. // 土豆已死,有事请烧纸 悲伤的故事 .........
  416. }
  417.  
  418. });
  419. }
  420. url(e);
  421. delElement(['#diversBanner', '.j_videoFootDownBtn']);
  422. gif(e);
  423. jpg(e);
  424. let ee = $(e);
  425. let tid = ee.attr("tid");
  426. let x = ee.find('.list_item_top a.j_report_btn');
  427. let kz = 0;
  428. if (x && x.length > 0) {
  429. kz = x[0].href.match(/tid=(\d+)&/);
  430. kz = kz[1];
  431. }
  432. let lzll = e.querySelector('.flist');
  433. if (lzll) {
  434. [...lzll.children].forEach(li => {
  435.  
  436. llxx(li)
  437. })
  438. }
  439.  
  440. let floor = e.getElementsByClassName('pb_floow_load');
  441. if (floor.length > 0) {
  442. let a = floor[0];
  443. let text = floor[0].textContent;
  444. let url = `/t/p/${tid}`;
  445. let num = parseInt(text.match(/\d+/)[0]);
  446. a.innerText = `还有${num}条回复`;
  447. a.dataset.url = url;
  448. a.classList.remove('j_enter_lzl_daoliu');
  449. $(a).unbind('click');
  450. let orgnum = num;
  451. let page = 2;
  452. let tot = Math.ceil(orgnum / 10);
  453. let el = a.previousElementSibling;
  454. a.addEventListener('click', function () {
  455.  
  456. let that = this;
  457. if (num === orgnum) {
  458. let url = this.getAttribute('data-url');
  459. if (num <= 8) {
  460. $.get(url, function (rst) {
  461. replayPage({data: {floor_html: rst}}, el, ls => {
  462. ls.splice(0, 2)
  463. that.parentNode.removeChild(that);
  464. });
  465. });
  466. return
  467. }
  468. if (GM_xmlhttpRequest) {
  469. const tt = Math.ceil((new Date()).getTime());
  470. url = `/p/comment?tid=${kz}&pid=${tid}&pn=1&t=${tt}`;
  471. gmPage(url, el, 1, () => {
  472.  
  473. num -= 8;
  474. that.innerText = `还有${num}条回复`;
  475. if (orgnum > 10) {
  476. a.style.display = 'none';
  477. tpage(tot, el, (page) => {
  478. if (a.style.display !== 'none') {
  479. a.style.display = 'none';
  480. }
  481. let tt = Math.ceil((new Date()).getTime());
  482. let url = `/p/comment?tid=${kz}&pid=${tid}&pn=${page}&t=${tt}`;
  483. gmPage(url, el, page, function () {
  484. let l = lo(document, el);
  485. window.scrollTo({top: l.top - 20, left: 0, behavior: "smooth"});
  486. });
  487. });
  488. }
  489. })
  490. } else {
  491. $.get(url, function (rst) {
  492. replayPage({data: {floor_html: rst}}, el, ls => {
  493. ls.splice(0, 2)
  494. });
  495. if (num <= 8) {
  496. that.parentNode.removeChild(that);
  497. } else {
  498. num -= 8;
  499. that.innerText = `还有${num}条回复`;
  500. if (orgnum > 18) {
  501. a.style.display = 'none';
  502. tpage(tot, el, (page) => {
  503. if (a.style.display !== 'none') {
  504. a.style.display = 'none';
  505. }
  506. let url = `/mo/q//flr?fpn=${page}&kz=${kz}&pid=${tid}&is_ajax=1&has_url_param=0&template=lzl`;
  507. $.get(url, res => {
  508. replayPage(res, el);
  509. let l = lo(document, el);
  510. window.scrollTo({top: l.top - 20, left: 0, behavior: "smooth"});
  511. })
  512. });
  513. }
  514. }
  515. });
  516. }
  517.  
  518.  
  519. } else {
  520. if (GM_xmlhttpRequest) {
  521. const tt = Math.ceil((new Date()).getTime());
  522. url = `/p/comment?tid=${kz}&pid=${tid}&pn=${page}&t=${tt}`;
  523. gmPage(url, el, page, () => {
  524. let i = el.parentNode.querySelector('.pagexx input');
  525. if (i) {
  526. i.dataset.r = `${page}`;
  527. i.type = 'text';
  528. i.value = page + '/' + tot;
  529. }
  530. ++page;
  531. if (num > 10) {
  532. num -= 10;
  533. that.innerText = `还有${num}条回复`;
  534. } else {
  535. that.parentNode.removeChild(that);
  536. }
  537. })
  538. } else {
  539. let url = `/mo/q//flr?fpn=${page}&kz=${kz}&pid=${tid}&is_ajax=1&has_url_param=0&template=lzl`;
  540. $.get(url, function (res) {
  541. replayPage(res, el);
  542. let i = el.parentNode.querySelector('.pagexx input');
  543. if (i) {
  544. i.dataset.r = `${page}`;
  545. i.type = 'text';
  546. i.value = page + '/' + tot;
  547. }
  548. ++page;
  549. if (num > 10) {
  550. num -= 10;
  551. that.innerText = `还有${num}条回复`;
  552. } else {
  553. that.parentNode.removeChild(that);
  554. }
  555. })
  556. }
  557. }
  558. });
  559. }
  560.  
  561. });
  562. killCheckUrl();
  563. }
  564.  
  565. function lz() {
  566. let lz = document.querySelector('span.poster_only');
  567. if (lz) {
  568. let r = document.createElement('span');
  569. r.classList.add('poster_only');
  570. r.style.marginLeft = '5px';
  571. r.innerText = '倒序看帖';
  572. lz.parentNode.insertBefore(r, lz);
  573.  
  574. lz.onclick = null;
  575. let h = location.href;
  576. let ff = 0;
  577. let rr = 0;
  578. if (h.indexOf('see_lz=1') > -1) {
  579. lz.textContent = '取消只看楼主';
  580. h = h.replace('see_lz=1', 'see_lz=0');
  581. ff = 1;
  582. }
  583. if (h.indexOf('r=1') > -1) {
  584. r.textContent = '取消倒序看帖';
  585. h = h.replace('r=1', 'r=0');
  586. rr = 1;
  587. }
  588.  
  589. r.addEventListener('click', (e) => {
  590. if (rr === 0) {
  591. h = h.indexOf('?') < 0 ? h + '?r=1' : (h[h.length - 1] === '&' ? (h + 'r=1&') : (h + '&r=1'));
  592. h = h.replace(/pn=\d+/, 'pn=' + (totalPage - 1) * 30);
  593. }
  594. location.href = h;
  595. e.stopPropagation();
  596. }, true);
  597. lz.addEventListener('click', (e) => {
  598. if (ff === 0) {
  599. h = h.indexOf('?') < 0 ? h + '?see_lz=1' : h + '&see_lz=1';
  600. }
  601. location.href = h;
  602. e.stopPropagation();
  603. }, true);
  604. }
  605. }
  606.  
  607. function f(value) {
  608. let dt = JSON.parse(value.getAttribute('data-info'));
  609. let fl = 0;
  610. if (dt) {
  611. fl = dt.floor_num;
  612. let l = document.createElement('span');
  613. l.style.color = 'green';
  614. l.textContent = fl + '楼';
  615. if (fl === 1) {
  616. l.textContent = '楼主';
  617. } else if (fl === 2) {
  618. l.textContent = '沙发';
  619. } else if (fl === 3) {
  620. l.textContent = '板凳';
  621. }
  622. value.querySelector('.list_item_time').parentNode.appendChild(l);
  623. }
  624. return fl;
  625. }
  626.  
  627. function check() {
  628. let ua = navigator.userAgent.toLowerCase();
  629. return ua.indexOf('mobile') > -1 || ua.indexOf('phone') > -1;
  630. }
  631.  
  632. function p() {
  633. let c = document.querySelector('.slide_frame');
  634. let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  635. let observer = new MutationObserver((mutations) => {
  636. mutations.forEach(item => {
  637. if (item.addedNodes.length > 0) {
  638. item.addedNodes.forEach(node => {
  639. let img = node.querySelector('img');
  640. if (img) {
  641. let tmp = img.src.split('&src=');
  642. let src = img.src;
  643. if (tmp.length > 1) {
  644. let newSrc = decodeURIComponent(tmp[1]);
  645. img.src = newSrc;
  646. let tt = newSrc.split('/');
  647. let i = document.querySelector(`img[data-url="${tt[tt.length - 1]}"]`);
  648. if (i && i.src !== newSrc) {
  649. i.src = newSrc;
  650. i.addEventListener('click', evt => {
  651. i.src = src;
  652. });
  653. }
  654.  
  655. } else {
  656. let x = img.src.split('/');
  657. let u = x[x.length - 1];
  658. let i = document.querySelector(`img[data-url="${u}"]`);
  659.  
  660. if (i && i.src !== img.src && i.dataset.type === 'gif') {
  661. i.src = img.src;
  662. } else if (i && i.src !== img.src && !i.dataset.type) {
  663. i.src = img.src;
  664. i.addEventListener('click', evt => {
  665. i.src = i.parentNode.dataset.url;
  666. });
  667. }
  668. }
  669. }
  670. })
  671. }
  672. })
  673. });
  674.  
  675. observer.observe(c, {
  676. childList: true,
  677. });
  678. }
  679.  
  680. function createTime() {
  681. let url = location.href.replace('&mo_device=1', '');
  682.  
  683. if (url[url.length - 1] === '&') {
  684. url = url + 'tab=main&'
  685. }
  686. url = decodeURIComponent(url);
  687. if (url.indexOf('/mo/') > -1) {
  688. let word = /word=(.*?)&/.exec(url)[1];
  689. url = url.replace('mo/q/m', 'f').replace(/word=(.*?)&/, 'kw=' + word + '&');
  690.  
  691. }
  692. if (url.indexOf('lp=sfrs_good_area_link') > -1) {
  693. url += 'tab=good&'
  694. }
  695. //debugger
  696. GM_xmlhttpRequest({
  697. method: 'GET',
  698. url: url,
  699. headers: {
  700. "User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36'
  701. },
  702. onload: function (res) {
  703.  
  704. let r = (new DOMParser()).parseFromString(res.responseText, 'text/html');
  705. let w = r.getElementById('pagelet_html_frs-list/pagelet/thread_list').innerHTML;
  706. let ul = w.replace('<!--', '').replace('-->', '');
  707. let u = document.createElement('div');
  708. u.innerHTML = ul;
  709. let lis = u.querySelectorAll('li.j_thread_list');
  710.  
  711. if (lis.length > 0) {
  712. lis.forEach(li => {
  713. let time = li.querySelector('.is_show_create_time');
  714. if (!time) {
  715. return
  716. }
  717. time = time.textContent;
  718. let tid = li.dataset.tid;
  719. if (tid !== null || tid !== 'null') {
  720. let tar = document.querySelector('li[data-tid="' + tid + '"] .ti_author_icons');
  721. let ttt = document.querySelector('li[data-tid="' + tid + '"] .ti_time');
  722. if (!tar) {
  723. return;
  724. }
  725. let ki = li.querySelector('span[class="tb_icon_author_rely j_replyer"]');
  726. if (!ki) {
  727. return;
  728. }
  729.  
  730. ttt.innerHTML = ki.title.split(':')[1] + '&nbsp;&nbsp;' + ttt.innerHTML;
  731.  
  732. let d = document.createElement('span');
  733. d.style.marginLeft = '1rem';
  734. d.style.color = '#9999b3';
  735. d.innerText = time;
  736. tar.appendChild(d);
  737. }
  738. })
  739. }
  740. },
  741.  
  742. });
  743. }
  744.  
  745. function slio(els) {
  746. //let lis = document.querySelectorAll('#frslistcontent>li');
  747. let startX = 0;
  748. let endX = 0;
  749. let startY = 0;
  750. let endY = 0;
  751. els.forEach(li => {
  752. li.addEventListener('touchstart', evt => {
  753. startX = evt.changedTouches[0].screenX;
  754. startY = evt.changedTouches[0].screenY;
  755. });
  756. li.addEventListener('touchmove', evt => {
  757. endX = evt.changedTouches[0].screenX;
  758. endY = evt.changedTouches[0].screenY;
  759. });
  760.  
  761. li.addEventListener('touchend', evt => {
  762. if ((endX - startX) > 100 && Math.abs(endY - startY) <= 100) {
  763. let url = li.querySelector('li.tl_shadow>a.ti_item').href;
  764. window.open(url, '_blank');
  765. }
  766. if ((startX - endX) > 100 && Math.abs(endY - startY) <= 100) {
  767. GM.openInTab(li.querySelector('li.tl_shadow>a.ti_item').href, true);
  768. }
  769. })
  770. })
  771. }
  772.  
  773. function list() {
  774. slio(document.querySelectorAll('#frslistcontent>li'));
  775. delElement([
  776. '.frs_daoliu_for_app', '.tl_shadow_for_app_modle', '.footer_logo', '.footer_link_highlight',
  777. '.appBottomPromote', '.appPromote',
  778. ]);
  779. let ads = document.querySelectorAll('li.tl_shadow_for_app');
  780. if (ads.length > 0) {
  781. let url = document.querySelector('.tl_shadow_for_app').parentNode.querySelector('a.j_common').href;
  782. ads.forEach(v => {
  783. let a = v.querySelector('a.j_enter_for_app');
  784. let tid = v.getAttribute('data-tid');
  785. a.href = url.replace(/\/(\d+)\?/.exec(url)[1], tid);
  786. a.classList.remove('tl_shadow_for_app');
  787. })
  788. }
  789. createTime();
  790. let list = document.querySelector('#tlist');
  791. let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  792. let observer = new MutationObserver((mutations) => {
  793. if (mutations.length > 0) {
  794. createTime();
  795. slio(document.querySelectorAll('#frslistcontent>li'));
  796. }
  797. });
  798. observer.observe(list, {
  799. childList: true,
  800. });
  801. }
  802.  
  803. function ft(event) {
  804. event.preventDefault();
  805. }
  806.  
  807. function god() {
  808. let targetNode = document.querySelector("#glob");
  809. let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  810. window.onpopstate = e => {
  811. if (targetNode.style.visibility === 'hidden' && window.hhxx === 1) {
  812. targetNode.style.visibility = 'visible';
  813. window.hhxx = 0;
  814. document.querySelector('.ui_slider_hybrid').removeEventListener('touchmove', ft)
  815.  
  816. }
  817. };
  818.  
  819. let observer = new MutationObserver((mutations) => {
  820. let m = mutations[0];
  821. if (m.target.style.display === 'none') {
  822. document.querySelector('.ui_slider_hybrid').addEventListener('touchmove', ft);
  823. setTimeout(() => {
  824. m.target.style.display = 'block';
  825. m.target.style.visibility = 'hidden';
  826. window.hhxx = 1;
  827. let ui = document.querySelector('.ui_slider_hybrid');
  828. if (ui.style.display === 'block') {
  829. ui.style.top = '-44px';
  830. }
  831. }, 300);
  832. }
  833. });
  834. let observerOptions = {
  835. attributes: true,
  836. attributeFilter: ['style']
  837. };
  838. observer.observe(targetNode, observerOptions);
  839.  
  840. (new MutationObserver(m => {
  841. if (m[0].addedNodes.length > 0) {
  842. let n = m[0].addedNodes[0];
  843. n.parentNode.removeChild(n);
  844. }
  845.  
  846. })).observe(document.querySelector('#po_list'), {
  847. childList: true,
  848. });
  849.  
  850. }
  851.  
  852. function lzl() {
  853. let kz = document.querySelector('html').innerHTML.match(/kz: "(\d+)"/)[1];
  854. let url = `/p/${kz}`;
  855. $.ajax({
  856. url: url,
  857. async: false,
  858. type: 'get',
  859. success: (res) => {
  860. let html = (new DOMParser()).parseFromString(res, 'text/html');
  861. let lz = html.querySelector('#pblist li')
  862. window.lz = JSON.parse(lz.dataset.info)
  863. }
  864. })
  865.  
  866. }
  867.  
  868. function killCheckUrl() {
  869. let urls = document.querySelectorAll('a[href*="/mo/q/checkurl"]');
  870. [...urls].forEach(a => {
  871. const url = decodeURIComponent(a.href).split('url=')[1]
  872. a.href = url;
  873. a.target = '_blank';
  874. })
  875. }
  876.  
  877. function detail() {
  878. god();
  879. p();
  880. reply();
  881. document.querySelectorAll('ul#pblist>li').forEach(value => {
  882. if (value.classList.contains('class_hide_flag')) {
  883. value.classList.remove('class_hide_flag');
  884. }
  885. });
  886. t();
  887.  
  888. delElement([
  889. '.img_desc', '.father-cut-recommend-normal-box', '.father-cut-daoliu-normal-box',
  890. '#diversBanner', '.footer_logo', '.j_footer_link', '.frs_daoliu_for_app',
  891. '.j_videoFootDownBtn', '.appBottomPromote', '.appPromote',
  892. ]);
  893.  
  894.  
  895. document.querySelector('.father-cut-pager-class-no-page').classList.remove('father-cut-pager-class-no-page');
  896.  
  897. let list = document.querySelector('ul#pblist');
  898. let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
  899. let observer = new MutationObserver((mutations) => {
  900. t();
  901. });
  902.  
  903. observer.observe(list, {
  904. childList: true
  905. });
  906.  
  907.  
  908. }
  909.  
  910. let book, svgss;
  911.  
  912. function clickControl() {
  913.  
  914. let el = ['list_item_top_name', 'j_new_header_reply', 'list_item_user_wrap', 'user_img', 'user_name', 'icon_tieba_edit', 'reply_num', 'for_app_label_text_tag'];
  915. document.querySelector('body').addEventListener('click', ev => {
  916. for (let i in el) {
  917. if (ev.target.classList.contains(el[i])) {
  918. ev.stopPropagation();
  919. ev.preventDefault();
  920. }
  921. }
  922.  
  923. if (ev.target.tagName === 'svg') {
  924. if ([...svgss].indexOf(ev.target.parentNode)) {
  925. return;
  926. }
  927. ev.stopPropagation();
  928. ev.preventDefault();
  929. if (ev.target.innerHTML.indexOf('remind_on') > -1) {
  930. location.href = '/mo/q/msg'
  931. }
  932. if (ev.target.innerHTML.indexOf('topbar_search') > -1) {
  933. location.href = '/mo/q/searchpage'
  934. }
  935. }
  936.  
  937. if (ev.target.tagName === 'A' && ev.target.classList.contains('notice')) {
  938. ev.stopPropagation();
  939. ev.preventDefault();
  940. location.href = '/mo/q/msg';
  941. }
  942.  
  943. if (ev.target.tagName === 'A' && ev.target.className === 'item comment itemonly') {
  944. ev.stopPropagation();
  945. ev.preventDefault();
  946. }
  947.  
  948. if (ev.target.classList.contains('j_new_header_reply')) {
  949. F.use('spb/widget/normal_post_list', function (threadList) {
  950. if (!window.xxLL) {
  951. window.xxLL = new threadList(window.conxx)
  952. }
  953. window.xxLL.floorReply(ev);
  954. });
  955. }
  956.  
  957. if (ev.target.classList.contains('user_img')) {
  958. ev.stopPropagation();
  959. ev.preventDefault();
  960. let name = $(ev.target).parents('li').find('span.user_name').text();
  961. location.href = `/home/main?un=${name}`;
  962. }
  963. let ii;
  964. if (ev.target.tagName === 'IMG' && (ii = ev.target.parentNode, ii.classList.contains('ti_avatar'))) {
  965. ev.stopPropagation();
  966. ev.preventDefault();
  967. location.href = ii.dataset.url;
  968. }
  969.  
  970. if (ev.target.classList.contains('user_name')) {
  971. ev.stopPropagation();
  972. ev.preventDefault();
  973. location.href = `/home/main?un=${ev.target.innerText}`;
  974. }
  975. if (ev.target.tagName === 'SPAN' && ev.target.classList.contains('forumname')) {
  976. ev.preventDefault(), ev.stopPropagation();
  977. if (ev.target.innerText.lastIndexOf('吧') === ev.target.innerText.length - 1) {
  978. ev.target.innerText = ev.target.innerText.substring(0, ev.target.innerText.length - 1)
  979. }
  980. location.href = `/f?kw=${ev.target.innerText}&pn=0&`;
  981.  
  982. }
  983. if (ev.target.tagName === 'SPAN' && (ev.target.classList.contains('createtime') || ev.target.classList.contains('ti_time') || ev.target.classList.contains('ti_author'))) {
  984. ev.stopPropagation();
  985. ev.preventDefault();
  986. }
  987. if (ev.target.tagName === 'SPAN' && ev.target.classList.contains('btn_icon')) {
  988. ev.stopPropagation();
  989. ev.preventDefault();
  990. }
  991.  
  992. if (ev.target.tagName === 'SPAN' && ev.target.classList.contains('message')) {
  993. ev.stopPropagation();
  994. ev.preventDefault();
  995. location.href = '/mo/q/msg';
  996. }
  997.  
  998. if (ev.target.classList.contains('j_like')) {
  999. ev.stopPropagation();
  1000. ev.preventDefault();
  1001. let a = /function\(SignArrow\)\{(.*?)\}\)\;\}\)/.exec($('html').html())[1].replace('new SignArrow', '');
  1002. let _sl = (new Function(a + ';return _sl'))();
  1003. F.use(['sfrs/widget/sign_arrow'], SignArrow => {
  1004. let sl = new SignArrow(_sl);
  1005. sl.likeHandle();
  1006. });
  1007. }
  1008.  
  1009. if (ev.target.classList.contains('bookmark_icon')) {
  1010. ev.stopPropagation();
  1011. ev.preventDefault();
  1012. let a = /function\(MoreNewSpinner\)\{((.*?)moreNewSpinner\.init\(\);)/.exec($('html').html())[2].replace('new MoreNewSpinner', '');
  1013. let c = (new Function(a + ';return moreNewSpinner'))();
  1014. F.use(['spb/widget/more_newspinner'], MoreNewSpinner => {
  1015. if (!book) {
  1016. book = new MoreNewSpinner(c);
  1017. book.init();
  1018. }
  1019. book.handleCollect(ev);
  1020. });
  1021.  
  1022. }
  1023.  
  1024. if (ev.target.classList.contains('j_sign')) {
  1025. ev.stopPropagation();
  1026. ev.preventDefault();
  1027. let a = /function\(SignArrow\)\{(.*?)\}\)\;\}\)/.exec($('html').html())[1].replace('new SignArrow', '');
  1028. let _sl = (new Function(a + ';return _sl'))();
  1029. F.use(['sfrs/widget/sign_arrow'], SignArrow => {
  1030. let sl = new SignArrow(_sl);
  1031. sl.signHandle();
  1032. });
  1033. }
  1034.  
  1035. if (ev.target.tagName === 'H4' && ev.target.classList.contains('title')) {
  1036. ev.stopPropagation();
  1037. ev.preventDefault();
  1038. location.href = `/home/main?un=${ev.target.innerText}`;
  1039. }
  1040. if (ev.target.classList.contains('icon_tieba_edit')) {
  1041. //todo 发帖 似乎没相关的调用模块???
  1042. }
  1043. //console.log(ev.target, ev.target.tagName);
  1044.  
  1045. }, true);
  1046. }
  1047.  
  1048. function reply() {
  1049. let h = document.querySelector('html').innerHTML;
  1050. let co = /spb\/widget\/normal_post_list', function \(threadList\) \{ new threadList\((.*?)\}\);/.exec(h);
  1051. let con = co[1] + '}';
  1052. let conf = (new Function("return " + con))();
  1053.  
  1054. window.conxx = conf;
  1055. window.xxLL = null;
  1056.  
  1057. let pa = document.querySelector('#list_pager');
  1058. pa.parentNode.removeChild(pa);
  1059. F.use('spb/widget/normal_post_list', function (threadList) {
  1060. if (!window.xxLL) {
  1061. window.xxLL = new threadList(conf)
  1062. }
  1063. window.totalPage = xxLL.pager._conf.totalPage;
  1064. if (location.href.indexOf('r=1') > -1) {
  1065. xxLL.pager._conf.url += '&r=1';
  1066. }
  1067. });
  1068.  
  1069. document.querySelectorAll('.j_nreply_btn').forEach(value => {
  1070. value.addEventListener('click', evt => {
  1071. evt.preventDefault();
  1072. evt.stopPropagation();
  1073. window.xxLL.floorReply(evt);
  1074. })
  1075. })
  1076. }
  1077.  
  1078. function fnav() {
  1079. let d = document.createElement('div');
  1080. let startX;
  1081. let startY;
  1082. let sx = document.documentElement.clientWidth;
  1083. let sy = document.documentElement.clientHeight;
  1084. let tempX = localStorage.getItem('tiebaPageX');
  1085. let endX = tempX ? tempX : 10;
  1086. let tempY = localStorage.getItem('tiebaPageY');
  1087. let endY = tempX ? tempY : 50;
  1088. d.style.cssText = `position: fixed;width: 45px;right: ${endX}px;bottom: ${endY}px;z-index:1;`;
  1089. d.innerHTML = `
  1090. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  1091. <path d="M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"></path>
  1092. </svg>
  1093. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  1094. <path d="M256 504c137 0 248-111 248-248S393 8 256 8 8 119 8 256s111 248 248 248zm0-448c110.5 0 200 89.5 200 200s-89.5 200-200 200S56 366.5 56 256 145.5 56 256 56zm20 328h-40c-6.6 0-12-5.4-12-12V256h-67c-10.7 0-16-12.9-8.5-20.5l99-99c4.7-4.7 12.3-4.7 17 0l99 99c7.6 7.6 2.2 20.5-8.5 20.5h-67v116c0 6.6-5.4 12-12 12z"></path>
  1095. </svg>
  1096. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  1097. <path d="M256 8C119 8 8 119 8 256s111 248 248 248 248-111 248-248S393 8 256 8zm0 448c-110.5 0-200-89.5-200-200S145.5 56 256 56s200 89.5 200 200-89.5 200-200 200zm-32-316v116h-67c-10.7 0-16 12.9-8.5 20.5l99 99c4.7 4.7 12.3 4.7 17 0l99-99c7.6-7.6 2.2-20.5-8.5-20.5h-67V140c0-6.6-5.4-12-12-12h-40c-6.6 0-12 5.4-12 12z"></path>
  1098. </svg>
  1099.  
  1100. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
  1101. <path d="M290.59 192c-20.18 0-106.82 1.98-162.59 85.95V192c0-52.94-43.06-96-96-96-17.67 0-32 14.33-32 32s14.33 32 32 32c17.64 0 32 14.36 32 32v256c0 35.3 28.7 64 64 64h176c8.84 0 16-7.16 16-16v-16c0-17.67-14.33-32-32-32h-32l128-96v144c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V289.86c-10.29 2.67-20.89 4.54-32 4.54-61.81 0-113.52-44.05-125.41-102.4zM448 96h-64l-64-64v134.4c0 53.02 42.98 96 96 96s96-42.98 96-96V32l-64 64zm-72 80c-8.84 0-16-7.16-16-16s7.16-16 16-16 16 7.16 16 16-7.16 16-16 16zm80 0c-8.84 0-16-7.16-16-16s7.16-16 16-16 16 7.16 16 16-7.16 16-16 16z"></path>
  1102. </svg>
  1103. `;
  1104. let svgs = svgss = d.querySelectorAll('svg');
  1105. let f = 1;
  1106. let timer = null;
  1107.  
  1108. function dd() {
  1109. [svgs[0], svgs[1], svgs[2]].forEach(el => {
  1110. el.style.display = f === 1 ? 'block' : 'none'
  1111. });
  1112. f = f === 1 ? 2 : 1;
  1113. }
  1114.  
  1115. let flag = 0;
  1116.  
  1117. function drop(e) {
  1118. e.preventDefault();
  1119. e.stopPropagation();
  1120. if (!flag) {
  1121. return;
  1122. }
  1123. let touches = e.touches[0];
  1124. let svg = d;
  1125. endX = sx - touches.clientX - Math.ceil(svg.offsetWidth / 2);
  1126. endY = sy - touches.clientY - Math.ceil(svg.offsetHeight / 2);
  1127. if (endX > sx - svg.offsetWidth) {
  1128. endX = sx - svg.offsetWidth
  1129. } else if (endX < 0) {
  1130. endX = 0;
  1131. }
  1132. if (endY > sy - svg.offsetHeight) {
  1133. endY = sy - svg.offsetHeight;
  1134. } else if (endY < 0) {
  1135. endY = 0;
  1136. }
  1137. svg.style.right = endX + "px";
  1138. svg.style.bottom = endY + "px";
  1139. }
  1140.  
  1141. svgs.forEach((value, key) => {
  1142.  
  1143. if (key !== 3) {
  1144. value.style.display = 'none';
  1145. } else {
  1146. value.addEventListener('touchstart', ev => {
  1147. startX = ev.touches[0].clientX - d.offsetLeft;
  1148. startY = ev.touches[0].clientY - d.offsetLeft;
  1149. timer = setTimeout(() => {
  1150. value.style.fill = 'rgba(210,74,195,0.3)';
  1151. flag = 1;
  1152. }, 600);
  1153. });
  1154. value.addEventListener('touchmove', drop, {
  1155. passive: false
  1156. });
  1157. value.addEventListener('touchend', ev => {
  1158. clearTimeout(timer);
  1159. localStorage.setItem('tiebaPageX', endX);
  1160. localStorage.setItem('tiebaPageY', endY);
  1161. value.style.fill = 'rgba(77, 74, 210,.3)';
  1162. flag = 0;
  1163. })
  1164. }
  1165. value.style.fill = 'rgba(77, 74, 210,.3)';
  1166. value.addEventListener('click', ev => {
  1167. switch (key) {
  1168. case 0:
  1169. location.href = '/mo/q/searchpage';
  1170. break;
  1171. case 1:
  1172. window.scrollTo({top: 0, left: 0, behavior: "smooth"});
  1173. dd();
  1174. break;
  1175. case 2:
  1176. window.scrollTo({top: document.documentElement.scrollHeight, left: 0, behavior: "smooth"});
  1177. dd();
  1178. break;
  1179. case 3:
  1180. dd();
  1181. break;
  1182.  
  1183. }
  1184. });
  1185. });
  1186. document.querySelector('body').appendChild(d);
  1187. }
  1188.  
  1189. try {
  1190.  
  1191. if (!check()) {
  1192. return;
  1193. }
  1194. fnav();
  1195. clickControl();
  1196. let css = document.createElement('style');
  1197. css.textContent = `
  1198. .class_hide_flag{display:block!important;}.father-cut-pager-class-no-page>#list_pager{visibility: visible!important;height: 44px!important;}#glob,body{margin-top: 0px!important;}.father_cut_list_class{padding-bottom: 0px!important;}.father-cut-recommend-normal-box,.father-cut-daoliu-normal-box,.fixed_bar,.pb,.frs,.no_mean,.addbodybottom,.img_desc,.top-guide-wrap,.open-style,.index-feed-cards .hot-topic,.appPromote_wrapper,.ui_image_header_bottom,.videoFooter,#diversBanner,.tb-footer-wrap,.interest-bar,.footer-wrap,.client-btn,.daoliu{display:none!important;}.tl_shadow:not([data-tid]),#pblist>li:not([data-tid]){display:none!important;}.navbar-view{top:24px!important;}.navbar-box{top:44px!important;}
  1199. .footer_logo,.footer-version { display:none!important}
  1200. .fr_list .list_item_floor { padding-top: 8px;
  1201. letter-spacing: 1px;
  1202. border-radius: 8px;
  1203. margin-bottom: 2px
  1204. border: 1px solid rgba(0,0,0,.1);
  1205. box-shadow: 5px 5px 5px rgba(0,0,0,0.2);}
  1206. .floor_footer_item .user_name,.floor_footer_item .user_name:visited { color:#125bc7; }
  1207. .floor_content a,.floor_content a:visited { color:#498bef; }
  1208. .fr_list .list_item_floor:nth-child(odd){ background-color:rgba(180, 228, 207, 0.2); }
  1209. .fr_list .list_item_floor:nth-child(even){ background-color:rgba(168, 191, 157, 0.16); }
  1210. `;
  1211. document.querySelector('head').append(css);
  1212.  
  1213. delElement(['.ui_image_header_bottom']);
  1214.  
  1215. if (document.querySelector('#pblist')) {
  1216. detail();
  1217. }
  1218. if (document.querySelector('#tlist')) {
  1219. list();
  1220. }
  1221.  
  1222. } catch (e) {
  1223. console.log(e)
  1224. }
  1225. })();