CL1024

草榴社区 - 去广告插件屏蔽 「取消viidii跳转」「种子链接转化磁链接」「去帖子广告」「阅读帖子按楼数快速跳转楼层」「帖子内隐藏1024的回复」「今日帖子加亮」「超大图片根据屏幕缩放」「快捷键:详细页J/K 上/下一个回复,F6跳转技术讨论区,【.】返回顶部」

  1. // ==UserScript==
  2. // @name CL1024
  3. // @namespace CL1024
  4. // @version 1.4.0
  5. // @description 草榴社区 - 去广告插件屏蔽 「取消viidii跳转」「种子链接转化磁链接」「去帖子广告」「阅读帖子按楼数快速跳转楼层」「帖子内隐藏1024的回复」「今日帖子加亮」「超大图片根据屏幕缩放」「快捷键:详细页J/K 上/下一个回复,F6跳转技术讨论区,【.】返回顶部」
  6. // @homepageURL https://greasyfork.org/zh-CN/scripts/1983-cl1024
  7. // @copyright 2012-2022 rose1988c
  8. // @require http://cdn.staticfile.org/jquery/1.8.3/jquery.min.js
  9. // @match https://t66y.com/*
  10. // @grant GM_addStyle
  11. // ==/UserScript==
  12.  
  13. // @author rose1988c
  14. // @date 2012.11.15
  15. // @modified 2012.11.15 磁链接转化
  16. // @modified 2012.11.28 去广告
  17. // @modified 2012.12.23 帖子按楼跳转页面,方便用户在<求片求助贴>找片
  18. // @modified 2013.01.05 按楼跳转页面,并'定位指定楼层'
  19. // @modified 2013.01.17 隐藏1024的回复
  20. // @modified 2013.03.11 今日帖子高亮 - 列表标题左边“.::”将改为“Today”
  21. // @modified 2013.03.12 [暂失效]新增快捷键 - 打开帖子, __J__为下一个回复,__K__为上一个回复,点__.__返回顶部
  22. // @modified 2013.03.18 修复bug - 回复后滚动条跳到顶部
  23. // @1.1.4 2014.01.03 更新 - vivi跳转更新
  24. // @1.1.5 2014-01-03 更新 - 修复点击[显示]无效
  25. // @1.1.6 2014-01-03 BUG - 排除迅雷离线页面加载脚本。感谢@文科
  26. // @1.1.7 2014-01-03 更新 - 超高清、大图根据屏幕尺寸缩放到适合屏幕大小
  27. // @1.1.7 2014-01-03 BUG - 修复点击[显示]无效
  28. // @1.1.8 2014-01-04 更新 - 新增点击下载种子
  29. // @1.1.9 2014-1-14 增加统计
  30. // @1.2.2 2014-1-14 更新匹配问题
  31. // @1.2.3 2014-2-21 更新Chrome 插件失效问题。CL闹哪样?非得加载http://69.175.44.45:88/style.css?v=1.1 卡死了。
  32. // @1.2.4 2014-2-21 防止69.175.44.45:88 css加载失败
  33. // @1.2.5 2014-6-2 防止jquery加载失败
  34. // @1.2.6 2014-6-2 userscripts加载失败
  35. // @1.2.8 2014-6-17 修复偷懒造成的无法访问,js过大
  36. // @1.2.9 2014-7-7 修复偷懒匹配网站问题
  37. // @1.3.0 2015-9-6 修复反馈的bug,匹配网站、和第二页黑屏,增加chrome插件提示
  38. // @1.3.1 2015-9-6 修改chrome发布网址
  39. // @1.3.2 2015-9-10 去掉google统计
  40. // @1.3.3 2017-1-19 fix
  41. // @1.4.0 2022-09-28 “去广告插件屏蔽, 请等待10秒, 或将其关闭即刻恢复浏览” ? 吐了,麻烦做个好产品好吗?现在完全已经被其他社区(2048,sht,chlt, lwlt)给超过了
  42.  
  43. (function() {
  44. if (document.title.indexOf('草榴') != -1) {
  45.  
  46. var CONSTANTS = {
  47. 'version': '1.3.1',
  48. 'localurl': window.location.href,
  49. 'localhost': window.location.host,
  50. 'regularVii': /www.viidii.com|www.viidii.info/,
  51. 'regularBlog': /htm_data|read.php/gi,
  52. 'regularList': /thread/gi,
  53. 'regularCat': /hash/gi,
  54. 'readurl': 'http://' + window.location.host + '/read.php',
  55. 'tips': '<div class="tips_container"><div class="close">X</div>去<input type="text" class="input-w80" placeholder="" id="wantlc" name="wantlc" />樓<input type="button" id="gotolc" value="Go" /> or <input type="button" id="goback" value="Back" onclick="history.go(-1);"><br /></div>',
  56. 'css': '.tips_container{position:fixed;bottom:2em;right:2em;color:green;opacity:0.4;background:#fff;padding:10px;z-index:99999}.tips_container:hover{opacity:0.9}.tips_container .close{position:absolute;top:0;right:0;color:red;cursor:pointer}.tips_container select, .tips_container select option{max-width:18em} input.input-w80 {background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #B2CCCC; height: 18px;line-height: 18px;margin: 2px;padding: 0 3px;width:40px;}.hidden1024{height:36px;overflow:hidden;}',
  57. 'indexcss': '.posttoday{color:#f60;}'
  58. };
  59.  
  60. var PLANETWORK = {
  61. isPlanetHasWater: function() {
  62. return CONSTANTS.regularBlog.test(CONSTANTS.localurl);
  63. },
  64. isPlanetHasPeople: function() {
  65. return CONSTANTS.regularList.test(CONSTANTS.localurl);
  66. },
  67. KillVill: function(orginUrl) {
  68. var decodeStr = /.*\?http:/g;
  69. var decodeSig = /______/g;
  70. var jsSuffix = '&amp;z';
  71. var htmlSuffix = '&z';
  72. var returnSuffix = 'return false';
  73. if (orginUrl.indexOf('viidii') != -1) {
  74. var pureUrl = orginUrl.replace(decodeStr, 'http:').replace(decodeSig, '.').replace(jsSuffix, '').replace(htmlSuffix, '').replace(returnSuffix, '');
  75. return pureUrl
  76. } else {
  77. return orginUrl;
  78. }
  79. },
  80. Mercury: function() {
  81.  
  82. var self = this;
  83. // 处理链接
  84. var linkNode = $('a[href*=\'viidii\']');
  85. if (linkNode.length != 0) {
  86. linkNode.each(function() {
  87. var orginLink = $(this).attr('href');
  88. var pureLink = self.KillVill(orginLink);
  89. $(this).attr('href', pureLink);
  90. });
  91. }
  92.  
  93. var linkNode = $('a[href*=\'hash\=\']');
  94. if (linkNode.length != 0) {
  95. linkNode.each(function() {
  96. var orginLink = $(this).attr('href');
  97.  
  98. var tempLink = orginLink.split('hash=');
  99. var hrefMagnet = 'magnet:?xt=urn:btih:' + tempLink[1].substring(3);
  100.  
  101. $(this).after('<a href="' + orginLink + '" target="_blank">下载种子</a>');
  102. $(this).attr('href', hrefMagnet).text(hrefMagnet);
  103. $(this).parent().addClass('link-braces');
  104. });
  105. }
  106. },
  107. Venus: function() {
  108. $('img,input[type=image]').each(function() {
  109. var thiz = $(this);
  110. var thizonclick = thiz.attr('onclick');
  111. if (CONSTANTS.regularVii.test(thizonclick)) {
  112. var newonclick = thizonclick.replace('http://www.viidii.com/?', '').replace('http://www.viidii.info/?', '').replace(/______/g, '.').replace(/&z/g, '');
  113. thiz.attr('onclick', newonclick).css('cursor', 'pointer');
  114. }
  115.  
  116. if (thiz.parent().attr('class') != 'tac') {
  117. var setwidth = parseInt(screen.width) - 395;
  118. imgReady(thiz.attr('src'), function() {
  119. var imgWidth = this.width;
  120. var imgHeight = this.height;
  121. if (imgWidth > setwidth) {
  122. newWidth = setwidth;
  123. newHeight = (setwidth / imgWidth) * imgHeight;
  124. thiz.width(newWidth);
  125. thiz.height(newHeight);
  126. thiz.closest('td').width(setwidth + 16);
  127. thiz.closest('div').width(setwidth + 16);
  128. }
  129.  
  130. });
  131. }
  132. });
  133. },
  134. Earth: function() {
  135. $('.sptable').remove();
  136. },
  137. Mars: function() {
  138. var target = UTILS.getQueryStringByName('target');
  139.  
  140. $('a[class=s3]').each(function(i, val) {
  141. var a_html = $(this).html();
  142. if (a_html.indexOf('樓') > 0) {
  143. var parentdiv = $(this).closest('div.t2');
  144. a_html = a_html.replace(/[^0-9]/ig, '');
  145. parentdiv.attr('id', 'post_' + parseInt(a_html));
  146. }
  147. });
  148.  
  149. UTILS.addCss(CONSTANTS.css);
  150. UTILS.addDom(CONSTANTS.tips, function() {
  151. return false;
  152. });
  153. UTILS.onlynum('wantlc');
  154.  
  155. // Bind Quick redirct by input Enter Key - cat
  156. $('#wantlc').bind('keyup', function(event) {
  157. if (event.keyCode == 13) {
  158. $('#gotolc').click();
  159. }
  160. });
  161.  
  162. // $("#wantlc").focus(); 悲剧,先注释了。
  163.  
  164. $('.close').click(function() {
  165. $(this).parent().remove();
  166. });
  167.  
  168. $('#gotolc').click(function() {
  169. var wantlc = parseInt($(this).prev().val()); // 想去的楼层 - cyw
  170. var locationurlarray = UTILS.getQueryString(CONSTANTS.localurl);
  171.  
  172. if (wantlc != '') {
  173. var urlgetpage = UTILS.getQueryStringByName('page');
  174. var page = Math.ceil((wantlc + 1) / 25);
  175.  
  176. if (urlgetpage == page) {
  177. UTILS.html_scrollTop_target('post_' + wantlc);
  178. return false;
  179. }
  180.  
  181. if (locationurlarray.length > 1) {
  182. var rePage = /page/gi;
  183. var reTarget = /target/gi;
  184. for (var i = locationurlarray.length - 1; i >= 0; i--) {
  185. // page and target
  186. if (rePage.test(locationurlarray[i])) {
  187. locationurlarray[i] = 'page=' + page;
  188. }
  189. if (reTarget.test(locationurlarray[i])) {
  190. locationurlarray = UTILS.array_prototype_del(locationurlarray, i);
  191. }
  192. }
  193. locationurlarray = locationurlarray.join('&');
  194. window.location.href = CONSTANTS.readurl + '?' + locationurlarray + '&target=post_' + wantlc;
  195. // window.open();
  196. return false;
  197. } else {
  198. locationurlarray = CONSTANTS.localurl.split('/'); // Get tid
  199. var tid = locationurlarray.pop().split('.');
  200. if (typeof(tid[0]) != 'undefined') {
  201. tid = tid[0];
  202. window.location.href = CONSTANTS.readurl + '?tid=' + tid + '&page=' + page + '&target=post_' + wantlc;
  203. return false;
  204. }
  205. }
  206. }
  207. });
  208.  
  209. UTILS.html_scrollTop_target(target);
  210.  
  211. //hide1024
  212. $('div.t2').each(function() {
  213. var thiz = $(this);
  214. var html = thiz.children().find('.tpc_content').html();
  215. var thiz_id = thiz.attr('id');
  216.  
  217. if (html == '1024') {
  218. thiz.addClass('hidden1024');
  219.  
  220. var tiptop = thiz.find('.tiptop');
  221. var thiz_lc = thiz.find('.tipad > span:last').children().clone();
  222. tiptop.append('<a class="show1024" class="act-show-1024" rel="' + thiz_id + '" style="color:green" href="javascript:void(0);">显示</a> | ').append(thiz_lc);
  223. }
  224.  
  225. });
  226.  
  227. $('.show1024').click(function() {
  228. var thiz_id = $(this).attr('rel');
  229. $('#' + thiz_id).toggleClass('hidden1024');
  230. });
  231.  
  232. //快捷键
  233. $(document).keydown(function(e) {
  234. if (e.keyCode == KEY_ASCLL.j) {
  235. UTILS.shortcut_key_current();
  236. UTILS.shortcut_key_jump(true, 'current-comment');
  237. return false;
  238. }
  239. if (e.keyCode == KEY_ASCLL.k) {
  240. UTILS.shortcut_key_current();
  241. UTILS.shortcut_key_jump(false, 'current-comment');
  242. return false;
  243. }
  244. if (e.keyCode == KEY_ASCLL.period) {
  245. UTILS.html_scrollTop_target('top');
  246. return false;
  247. }
  248. if (e.keyCode == KEY_ASCLL.f6) {
  249. window.location.href = '/' + 'thread0806.php?fid=7';
  250. return false;
  251. }
  252. });
  253. },
  254. Jupiter: function() {
  255. // today 样式
  256. UTILS.addCss(CONSTANTS.indexcss);
  257.  
  258. var today = new Date();
  259. today = UTILS.data_format(today, 'yyyy-MM-dd');
  260.  
  261. $('.tr3').each(function() {
  262. var tr3 = $(this);
  263. var postdata = $(this).find('a[class=bl]').next();
  264. if (postdata.text() == today) {
  265. postdata.addClass('posttoday');
  266. tr3.find('td:first').children().html('Today').addClass('posttoday').css('border-bottom', '1px dotted tomato');
  267. }
  268. });
  269. },
  270. Uranus: function() {},
  271. Neptune: function() {},
  272. Pluto: function() {
  273. // GM_addStyle function is not existed in chrome 27
  274. var GM_addStyle = GM_addStyle ||
  275. function(css) {
  276. var style = document.createElement('style');
  277. style.type = 'text/css';
  278. style.appendChild(document.createTextNode(css));
  279. document.getElementsByTagName('head')[0].appendChild(style);
  280. };
  281.  
  282. // 增加自定义样式
  283. GM_addStyle('\
  284. body {\
  285. font-family: Tahoma;\
  286. font-size: 12px;\
  287. background: #F9F9EC;\
  288. }\
  289. h1,h2,h3,h4,h5,h6,form,body {\
  290. padding: 0;\
  291. margin: 0;\
  292. }\
  293. td,th,div {\
  294. word-break: break-all;\
  295. word-wrap: break-word;\
  296. }\
  297. table {\
  298. empty-cells: show;\
  299. }\
  300. img {\
  301. border: 0;\
  302. }\
  303. h3,h2 {\
  304. display: inline;\
  305. font-size: 14px;\
  306. }\
  307. h3 {\
  308. font-weight: normal;\
  309. }\
  310. h2 a,h3 a {\
  311. color: #000;\
  312. }\
  313. h4 {\
  314. margin: 20px 0 10px;\
  315. font-size: 1.1em;\
  316. }\
  317. textarea,input,select {\
  318. font: 12px Arial;\
  319. padding: 1px 3px 0 3px;\
  320. vertical-align: middle;\
  321. margin-bottom: 1px;\
  322. }\
  323. .c {\
  324. clear: both;\
  325. height: 0;\
  326. font: 0/0 Arial;\
  327. }\
  328. .b {\
  329. font-weight: bold;\
  330. }\
  331. .tal {\
  332. text-align: left;\
  333. }\
  334. .tac {\
  335. text-align: center;\
  336. }\
  337. .tar {\
  338. text-align: right;\
  339. }\
  340. .fr {\
  341. float: right;\
  342. }\
  343. .fl {\
  344. float: left;\
  345. }\
  346. a {\
  347. text-decoration: none;\
  348. color: #2f5fa1;\
  349. }\
  350. a:hover {\
  351. text-decoration: underline;\
  352. }\
  353. .f9 {\
  354. font-size: 11px;\
  355. }\
  356. .f10 {\
  357. font-size: 11px;\
  358. }\
  359. .f12 {\
  360. font-size: 12px;\
  361. }\
  362. .f14 {\
  363. font-size: 14px;\
  364. }\
  365. .fn,.fn a {\
  366. font-weight: normal;\
  367. }\
  368. .s1 {\
  369. color: #008000;\
  370. }\
  371. .s2 {\
  372. color: #984B98;\
  373. }\
  374. .s3 {\
  375. color: #FA891B;\
  376. }\
  377. .s4 {\
  378. color: #0033FF;\
  379. }\
  380. .s5 {\
  381. color: #659B28;\
  382. }\
  383. .gray {\
  384. color: #818a89;\
  385. }\
  386. .f_one,.t_one,.r_one {\
  387. background: #F9F9EC;\
  388. }\
  389. .f_two,.t_two,.r_two {\
  390. background: #F4FBFF;\
  391. }\
  392. textarea,input,select {\
  393. font: 12px Arial;\
  394. padding: 1px 3px 0 3px;\
  395. vertical-align: middle;\
  396. margin-bottom: 1px;\
  397. }\
  398. select {\
  399. border: solid 1px #D4EFF7;\
  400. }\
  401. .btn {\
  402. background: #A6CBE7;\
  403. color: #004c7d;\
  404. border-width: 1px;\
  405. padding-left: 15px;\
  406. padding-right: 15px;\
  407. vertical-align: middle;\
  408. }\
  409. .input {\
  410. border: solid 1px #A6CBE7;\
  411. padding: 2px 0px 2px 1px;\
  412. font-size: 1.0em;\
  413. vertical-align: middle;\
  414. }\
  415. form {\
  416. display: inline;\
  417. }\
  418. textarea {\
  419. border: solid 1px #A6CBE7;\
  420. }\
  421. #header {\
  422. width: 98%;\
  423. margin: auto;\
  424. }\
  425. .toptool {\
  426. border-bottom: 1px solid #daebcd;\
  427. }\
  428. .toptool span {\
  429. padding: 1px 5px;\
  430. line-height: 150%;\
  431. }\
  432. .banner {\
  433. padding-right: 3%;\
  434. background: #0F7884;\
  435. }\
  436. .banner img {\
  437. vertical-align: middle;\
  438. }\
  439. .t {\
  440. border: 1px solid #A6CBE7;\
  441. margin: 0px auto 8px;\
  442. }\
  443. .t table {\
  444. border: 1px solid #fff;\
  445. margin: 0 auto;\
  446. width: 99.98%;\
  447. }\
  448. .t2 {\
  449. border-top: #A6CBE7 1px solid;\
  450. margin: 0px auto 5px;\
  451. }\
  452. .t3 {\
  453. margin: auto;\
  454. }\
  455. .t4 {\
  456. padding: 1px 0 1px 1px;\
  457. }\
  458. .h {\
  459. border-bottom: 4px solid #dbecF4;\
  460. background: #B1D3E0;\
  461. text-align: left;\
  462. color: #004c7d;\
  463. padding: 5px 7px 3px 7px;\
  464. }\
  465. .h span {\
  466. font-weight: normal;\
  467. }\
  468. .h h2 {\
  469. font-weight: bold;\
  470. }\
  471. .h a {\
  472. font-family: Arial;\
  473. color: #004c7d;\
  474. }\
  475. .h span a,.h span {\
  476. color: #5599bb;\
  477. }\
  478. .h a.a2 {\
  479. margin-left: 12px;\
  480. }\
  481. .tr1 th {\
  482. padding: 5px 10px;\
  483. text-align: left;\
  484. vertical-align: top;\
  485. font-weight: normal;\
  486. }\
  487. .tr1 td.td1 {\
  488. border: 1px solid #D4EFF7;\
  489. }\
  490. .tr2 {\
  491. background: #f3f8ef;\
  492. color: #659b28;\
  493. }\
  494. .tr2 td,.tr2 th {\
  495. line-height: 21px;\
  496. border-bottom: 1px solid #daebcd;\
  497. padding: 0px 6px 0px;\
  498. border-top: 1px solid #A6CBE7;\
  499. }\
  500. .tr2 a {\
  501. color: #659b28;\
  502. margin: 2px;\
  503. }\
  504. .tr3 td,.tr3 th {\
  505. border-bottom: 1px solid #D4EFF7;\
  506. padding: 5px 8px;\
  507. }\
  508. .tr3 th {\
  509. text-align: left;\
  510. font-weight: normal;\
  511. }\
  512. .tr4 {\
  513. background: #B1D3E0;\
  514. color: #004c7d;\
  515. }\
  516. .tr4 td {\
  517. padding: 4px 10px;\
  518. }\
  519. .tr td,.tr th {\
  520. padding: 2px;\
  521. }\
  522. .tpc_content {\
  523. font-size: 14px;\
  524. font-family: Arial;\
  525. padding: 0 2% 0 0.5%;\
  526. margin: 0 0 2%;\
  527. }\
  528. .tips {\
  529. background: #F4FBFF;\
  530. border: #D4EFF7 1px solid;\
  531. padding: 5px;\
  532. margin: 0 1% 1% 0;\
  533. float: left;\
  534. text-align: center;\
  535. }\
  536. .tips li {\
  537. list-style: none;\
  538. padding: 0 5px;\
  539. float: left;\
  540. overflow: hidden;\
  541. white-space: nowrap;\
  542. }\
  543. .tiptop {\
  544. border-bottom: 1px solid #D4EFF7;\
  545. padding: 0 0 5px 0;\
  546. vertical-align: middle;\
  547. }\
  548. .tipad {\
  549. border-top: 1px solid #D4EFF7;\
  550. margin: 10px 0 0;\
  551. padding: 5px 0 0;\
  552. }\
  553. .quote {\
  554. font-size: 70%;\
  555. color: #004c7d;\
  556. margin: 2px;\
  557. padding: 0;\
  558. }\
  559. blockquote {\
  560. width: 92%;\
  561. font-size: 85%;\
  562. color: #81888c;\
  563. border: 1px solid #D4EFF7;\
  564. border-left-width: 3px;\
  565. padding: 5px;\
  566. margin: 0 0 1%;\
  567. }\
  568. .menu {\
  569. position: absolute;\
  570. background: #fff;\
  571. border: 1px solid #A6CBE7;\
  572. }\
  573. .menu td, .menu li,.menu ul {\
  574. background: #B1D3E0;\
  575. padding: 0;\
  576. margin: 0;\
  577. }\
  578. .menu li {\
  579. list-style: none;\
  580. }\
  581. .menu a {\
  582. display: block;\
  583. padding: 3px 15px 3px 15px;\
  584. }\
  585. .menu a:hover {\
  586. background: #2f5fa1;\
  587. text-decoration: none;\
  588. color: #fff;\
  589. }\
  590. .menu ul.ul1 li a {\
  591. display: inline;\
  592. padding: 0;\
  593. }\
  594. .pages {\
  595. margin: 3px 0;\
  596. font: 11px/12px Tahoma;\
  597. }\
  598. .pages * {\
  599. vertical-align: middle;\
  600. }\
  601. .pages a {\
  602. padding: 1px 4px 1px;\
  603. border: 1px solid #A6CBE7;\
  604. margin: 0 1px 0 0;\
  605. text-align: center;\
  606. text-decoration: none;\
  607. font: normal 12px/14px verdana;\
  608. }\
  609. .pages a:hover {\
  610. border: #659b28 1px solid;\
  611. background: #f3f8ef;\
  612. text-decoration: none;\
  613. color: #004c7d;\
  614. }\
  615. .pages input {\
  616. margin-bottom: 0px;\
  617. border: 1px solid #659b28;\
  618. height: 15px;\
  619. font: bold 12px/15px Verdana;\
  620. padding-bottom: 1px;\
  621. padding-left: 1px;\
  622. margin-right: 1px;\
  623. color: #659b28;\
  624. }\
  625. #footer {\
  626. width: 98%;\
  627. text-align: right;\
  628. border-top: 2px solid #dbecF4;\
  629. margin: auto;\
  630. padding: 5px 0;\
  631. border-bottom: #f3f8ef 12px solid;\
  632. }\
  633. #main {\
  634. width: 98%;\
  635. margin: auto;\
  636. }\
  637. .tr3 td,.tr3 th {\
  638. border-right: 1px solid #D4EFF7;\
  639. }\
  640. .y-style {\
  641. text-align: center;\
  642. }\
  643. .t table {\
  644. border: 0;\
  645. width: 100%;\
  646. }\
  647. .tr1 th {\
  648. border-right: 1px solid #D4EFF7;\
  649. }\
  650. .tr1 td.td1 {\
  651. border-left: 0;\
  652. }\
  653. .t {\
  654. padding: 1px;\
  655. }\
  656. .signature {\
  657. height: expression(this.scrollHeight>parseInt(this.currentStyle.maxHeight)?this.currentStyle.maxHeight:auto);\
  658. }\
  659. .sptable h4 {\
  660. display:none;\
  661. margin: 0em 0 -.1em;\
  662. color: #6666FF;\
  663. font-size: 14px;\
  664. padding-bottom: 8px;\
  665. }\
  666. .sptable a {\
  667. display:none;\
  668. color: #339900;\
  669. }\
  670. .sptable h4:hover {\
  671. display:none;\
  672. text-decoration: underline;\
  673. }\
  674. .sptable td {\
  675. display:none;\
  676. cursor: pointer;\
  677. text-align: left;\
  678. }\
  679. ');
  680.  
  681. },
  682. OpenBlock:function(){
  683. var html = $('.tpc_content:eq(0)').html();
  684. var openblcokv = setInterval(()=>{
  685. var temp = $('.tpc_content:eq(0)').html();
  686. if (temp.length <= 100) {
  687. $('.tpc_content:eq(0)').html(html);
  688. clearInterval(openblcokv)
  689. }
  690. }, 1000);
  691. },
  692. Solar: function() {
  693. var isPlanetHasWater = this.isPlanetHasWater();
  694. var isPlanetHasPeople = this.isPlanetHasPeople();
  695. if (isPlanetHasWater) {
  696. this.Mercury();
  697. this.Venus();
  698. this.Mars();
  699. this.Earth();
  700. this.Pluto();//样式
  701. this.OpenBlock();
  702. } else if (isPlanetHasPeople) {
  703. this.Jupiter();
  704. this.Earth();
  705. this.Pluto();//样式
  706.  
  707. UTILS.addDomObj('<tr align="center" class="tr3 t_one"><td><a title="下载chrome插件" href="http://cl.aacc.in/" target="_blank" class="posttoday hightLight hightLightFirst" style="border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: rgb(255, 99, 71);">Today</a></td>\
  708. <td style="text-align:left;padding-left:8px" id=""> \
  709. <h3><a style="color:green;" href="http://cl.aacc.in/" target="_blank" id="">rose1988c推出更强大的CL1024谷歌插件,欢迎下载</a></h3> \
  710. <font color="green">[積分+999]</font><i style="color:red">new</i></td>\
  711. <td class="tal y-style"><a href="http://cl.aacc.in/" class="bl">rose1988c</a>\
  712. <div class="f10">2015-09-06</div></td>\
  713. <td class="tal f10 y-style">MarkTop</td>\
  714. <td class="tal y-style"><a href="http://cl.aacc.in/" class="f10"> 2015-09-06 11:38 </a><br>by: rose1988c</td>\
  715. </tr>', $('.tr3:first'));
  716.  
  717. } else {
  718. return false;
  719. }
  720.  
  721. }
  722. };
  723.  
  724. // ======================================================================
  725. // Helper
  726. // ======================================================================
  727. // hot key
  728. var KEY_ASCLL = {
  729. // Shift key, ⇧
  730. '⇧': 16,
  731. 'shift': 16,
  732. // CTRL key, on Mac: ⌃
  733. '⌃': 17,
  734. 'ctrl': 17,
  735. // ALT key, on Mac: ⌥ (Alt)
  736. '⌥': 18,
  737. 'alt': 18,
  738. 'option': 18,
  739. // META, on Mac: ⌘ (CMD), on Windows (Win), on Linux (Super)
  740. '⌘': 91,
  741. 'meta': 91,
  742. 'cmd': 91,
  743. 'super': 91,
  744. 'win': 91,
  745. // Backspace key, on Mac: ⌫ (Backspace)
  746. '⌫': 8,
  747. 'backspace': 8,
  748. // Tab Key, on Mac: ⇥ (Tab), on Windows ⇥⇥
  749. '⇥': 9,
  750. '⇆': 9,
  751. 'tab': 9,
  752. // Return key, ↩
  753. '↩': 13,
  754. 'return': 13,
  755. 'enter': 13,
  756. '⌅': 13,
  757. // Pause/Break key
  758. 'pause': 19,
  759. 'pause-break': 19,
  760. // Caps Lock key, ⇪
  761. '⇪': 20,
  762. 'caps': 20,
  763. 'caps-lock': 20,
  764. // Escape key, on Mac: ⎋, on Windows: Esc
  765. '⎋': 27,
  766. 'escape': 27,
  767. 'esc': 27,
  768. // Space key
  769. 'space': 32,
  770. // Page-Up key, or pgup, on Mac: ↖
  771. '↖': 33,
  772. 'pgup': 33,
  773. 'page-up': 33,
  774. // Page-Down key, or pgdown, on Mac: ↘
  775. '↘': 34,
  776. 'pgdown': 34,
  777. 'page-down': 34,
  778. // END key, on Mac: ⇟
  779. '⇟': 35,
  780. 'end': 35,
  781. // HOME key, on Mac: ⇞
  782. '⇞': 36,
  783. 'home': 36,
  784. // Insert key, or ins
  785. 'ins': 45,
  786. 'insert': 45,
  787. // Delete key, on Mac: ⌫ (Delete)
  788. 'del': 45,
  789. 'delete': 45,
  790.  
  791. // Left Arrow Key, or ←
  792. '←': 37,
  793. 'left': 37,
  794. 'arrow-left': 37,
  795. // Up Arrow Key, or ↑
  796. '↑': 38,
  797. 'up': 38,
  798. 'arrow-up': 38,
  799. // Right Arrow Key, or →
  800. '→': 39,
  801. 'right': 39,
  802. 'arrow-right': 39,
  803. // Up Arrow Key, or ↓
  804. '↓': 40,
  805. 'down': 40,
  806. 'arrow-down': 40,
  807.  
  808. // odities, printing characters that come out wrong:
  809. // Num-Multiply, or *
  810. '*': 106,
  811. 'star': 106,
  812. 'asterisk': 106,
  813. 'multiply': 106,
  814. // Num-Plus or +
  815. '+': 107,
  816. 'plus': 107,
  817. // Num-Subtract, or -
  818. '-': 109,
  819. 'subtract': 109,
  820. // ';': 186, //???
  821. // = or equals
  822. '=': 187,
  823. 'equals': 187,
  824. // Comma, or ,
  825. ',': 188,
  826. 'comma': 188,
  827. // '-': 189, //???
  828. // Period, or ., or full-stop
  829. '.': 190,
  830. 'period': 190,
  831. 'full-stop': 190,
  832. // Slash, or /, or forward-slash
  833. '/': 191,
  834. 'slash': 191,
  835. 'forward-slash': 191,
  836. // Tick, or `, or back-quote
  837. '`': 192,
  838. 'tick': 192,
  839. 'back-quote': 192,
  840. // Open bracket, or [
  841. '[': 219,
  842. 'open-bracket': 219,
  843. // Back slash, or \
  844. '\\': 220,
  845. 'back-slash': 220,
  846. // Close backet, or ]
  847. ']': 221,
  848. 'close-bracket': 221,
  849. // Apostraphe, or Quote, or '
  850. '\'': 222,
  851. 'quote': 222,
  852. 'apostraphe': 222
  853. };
  854.  
  855. // To minimise code bloat, add all of the NUMPAD 0-9 keys in a loop
  856. var i = 95,
  857. n = 0;
  858. while (++i < 106) {
  859. KEY_ASCLL['num-' + n] = i;
  860. ++n;
  861. }
  862.  
  863. // To minimise code bloat, add all of the top row 0-9 keys in a loop
  864. var i = 47,
  865. n = 0;
  866. while (++i < 58) {
  867. KEY_ASCLL[n] = i;
  868. ++n;
  869. }
  870.  
  871. var i = 111,
  872. n = 1;
  873. while (++i < 136) {
  874. KEY_ASCLL['f' + n] = i;
  875. ++n;
  876. }
  877.  
  878. var i = 64;
  879. while (++i < 91) {
  880. KEY_ASCLL[String.fromCharCode(i).toLowerCase()] = i;
  881. }
  882. //hotkey
  883.  
  884. var imgReady = (function() {
  885. var list = [],
  886. intervalId = null,
  887.  
  888. // 用来执行队列
  889. tick = function() {
  890. var i = 0;
  891. for (; i < list.length; i++) {
  892. list[i].end ? list.splice(i--, 1) : list[i]();
  893. }!list.length && stop();
  894. },
  895.  
  896. // 停止所有定时器队列
  897. stop = function() {
  898. window.clearInterval(intervalId);
  899. intervalId = null;
  900. };
  901.  
  902. return function(url, ready, load, error) {
  903. var onready, width, height, newWidth, newHeight, img = new Image();
  904.  
  905. img.src = url;
  906.  
  907. // 如果图片被缓存,则直接返回缓存数据
  908. if (img.complete) {
  909. ready.call(img);
  910. load && load.call(img);
  911. return;
  912. }
  913.  
  914. width = img.width;
  915. height = img.height;
  916.  
  917. // 加载错误后的事件
  918. img.onerror = function() {
  919. error && error.call(img);
  920. onready.end = true;
  921. img = img.onload = img.onerror = null;
  922. };
  923.  
  924. // 图片尺寸就绪
  925. onready = function() {
  926. newWidth = img.width;
  927. newHeight = img.height;
  928. if (newWidth !== width || newHeight !== height ||
  929. // 如果图片已经在其他地方加载可使用面积检测
  930. newWidth * newHeight > 1024) {
  931. ready.call(img);
  932. onready.end = true;
  933. }
  934. };
  935. onready();
  936.  
  937. // 完全加载完毕的事件
  938. img.onload = function() {
  939. // onload在定时器时间差范围内可能比onready快
  940. // 这里进行检查并保证onready优先执行
  941. !onready.end && onready();
  942.  
  943. load && load.call(img);
  944.  
  945. // IE gif动画会循环执行onload,置空onload即可
  946. img = img.onload = img.onerror = null;
  947. };
  948.  
  949. // 加入队列中定期执行
  950. if (!onready.end) {
  951. list.push(onready);
  952. // 无论何时只允许出现一个定时器,减少浏览器性能损耗
  953. if (intervalId === null) intervalId = setInterval(tick, 40);
  954. }
  955. };
  956. })();
  957.  
  958. // UTILS Func
  959. var UTILS = {
  960. addCss: function(str) {
  961. var style = document.createElement('style');
  962. style.textContent = str;
  963. document.head.appendChild(style);
  964. },
  965. getScript: function(src) {
  966. var script = document.createElement('script');
  967. script.src = src;
  968. document.body.appendChild(script);
  969. },
  970. addScript: function(js) {
  971. var oHead = document.getElementsByTagName('HEAD')[0],
  972. oScript = document.createElement('script');
  973. oScript.type = 'text/javascript';
  974. oScript.text = js;
  975. oHead.appendChild(oScript);
  976. },
  977. addDom: function(html, callback) {
  978. var div = document.createElement('div');
  979. div.innerHTML = html;
  980. callback.call(div, div);
  981. document.body.appendChild(div);
  982. },
  983. addDomObj: function(html, obj) {
  984. obj.before(html);
  985. },
  986. validate: function(url) {
  987. var magnetPattern = /magnet:\?xt=urn:btih:([a-zA-Z0-9]+)/;
  988. if (magnetPattern.test(url)) {
  989. return url.match(magnetPattern)[0];
  990. }
  991. return url;
  992. },
  993. getCookie: function(ae) {
  994. return (document.cookie.match(new RegExp('(^' + ae + '| ' + ae + ')=([^;]*)')) == null) ? '' : RegExp.$2
  995. },
  996. proxy: function(fn) {
  997. var script = document.createElement('script');
  998. script.textContent = '(' + fn.toString() + ')(window);';
  999. document.body.appendChild(script);
  1000. },
  1001. isArray: function(o) {
  1002. return Object.prototype.toString.call(o).indexOf('Array') !== -1;
  1003. },
  1004. array_prototype_del: function(array, n) {  // n表示第几项,从0开始算起。
  1005. if (n < 0) {  // 如果n<0,则不进行任何操作。
  1006.  
  1007. return array;
  1008. } else {
  1009. return array.slice(0, n).concat(array.slice(n + 1, array.length));
  1010. }
  1011. /*
  1012. * concat方法:返回一个新数组,这个新数组是由两个或更多数组组合而成的。
  1013. * 这里就是返回this.slice(0,n)/this.slice(n+1,this.length)
  1014. * 组成的新数组,这中间,刚好少了第n项。 slice方法: 返回一个数组的一段,两个参数,分别指定开始和结束的位置。
  1015. */
  1016. },
  1017. onlynum: function(input) {
  1018. $('#' + input).keyup(function(e) {
  1019. $(this).val($(this).val().replace(/[^0-9)]+/, ''));
  1020. }).focus(function() {
  1021. $(this).val($(this).val().replace(/[^0-9]+/, ''));
  1022. });
  1023. },
  1024. getQueryString: function(url) {
  1025. var url = url || location.search;
  1026. var result = url.match(new RegExp('[\?\&][^\?\&]+=[^\?\&]+', 'g'));
  1027. if (result == null) return new Array();
  1028. for (var i = 0; i < result.length; i++) {
  1029. result[i] = result[i].substring(1);
  1030. }
  1031. return result;
  1032. },
  1033. getQueryStringByName: function(name) {
  1034. var result = location.search.match(new RegExp('[\?\&]' + name + '=([^\&]+)', 'i'));
  1035. if (result == null || result.length < 1) {
  1036. return '';
  1037. }
  1038. return result[1];
  1039. },
  1040. getQueryStringByIndex: function(index) {
  1041. if (index == null) {
  1042. return '';
  1043. }
  1044. var queryStringList = getQueryString();
  1045. if (index >= queryStringList.length) {
  1046. return '';
  1047. }
  1048. var result = queryStringList[index];
  1049. var startIndex = result.indexOf('=') + 1;
  1050. result = result.substring(startIndex);
  1051. return result;
  1052. },
  1053. html_scrollTop_target: function() {
  1054.  
  1055. var target = arguments[0] || 0;
  1056. var timeset = arguments[1] || 500;
  1057.  
  1058. if (target == '0') {
  1059. return false;
  1060. }
  1061.  
  1062. if (target == 'top') {
  1063. $('html,body').animate({
  1064. scrollTop: 0
  1065. }, timeset);
  1066. return false;
  1067. }
  1068.  
  1069. if (target.length > 2) {
  1070. var $target = $('#' + target);
  1071. if ($target.length > 0) {
  1072. var targetOffset = $target.offset().top;
  1073. $('html,body').animate({
  1074. scrollTop: targetOffset
  1075. }, timeset);
  1076. }
  1077. return false;
  1078. }
  1079. },
  1080. /**
  1081. * js时间对象的格式化; this new Data() eg:format="yyyy-MM-dd hh:mm:ss";
  1082. */
  1083. data_format: function(data, format) {
  1084. var o = {
  1085. 'M+': data.getMonth() + 1,
  1086. // month
  1087. 'd+': data.getDate(),
  1088. // day
  1089. 'h+': data.getHours(),
  1090. // hour
  1091. 'm+': data.getMinutes(),
  1092. // minute
  1093. 's+': data.getSeconds(),
  1094. // second
  1095. 'q+': Math.floor((data.getMonth() + 3) / 3),
  1096. // quarter
  1097. 'S': data.getMilliseconds() // millisecond
  1098. }
  1099. if (/(y+)/.test(format)) {
  1100. format = format.replace(RegExp.$1, (data.getFullYear() + '').substr(4 - RegExp.$1.length));
  1101. }
  1102. for (var k in o) {
  1103. if (new RegExp('(' + k + ')').test(format)) {
  1104. format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
  1105. }
  1106. }
  1107. return format;
  1108. },
  1109. shortcut_key_jump: function(isDown, currentclass) {
  1110. var className = currentclass;
  1111. var current = $('.' + className).first(),
  1112. next = undefined;
  1113. next = isDown ? current.next().next('.t2') : current.prev().prev('.t2');
  1114. if (next && next.length) {
  1115. current.removeClass(className);
  1116. next.addClass(className);
  1117.  
  1118. // var next_div = next[0];
  1119. UTILS.html_scrollTop_target(next.attr('id'), 300);
  1120. return false;
  1121.  
  1122. }
  1123. },
  1124. shortcut_key_current: function() {
  1125. var _class = arguments[0] || '.t2';
  1126. var _scrollTop = $(document).scrollTop();
  1127. if ($('.current-comment').length > 0) {
  1128. return;
  1129. }
  1130. if (_scrollTop == 0) {
  1131. $(_class).first().addClass('current-comment');
  1132. } else {
  1133. $(_class).each(function() {
  1134. if ($(this).offset().top > _scrollTop && $('.current-comment').length == 0) {
  1135. $(this).addClass('current-comment');
  1136. return;
  1137. } else {
  1138. $(this).removeClass('current-comment');
  1139. }
  1140. });
  1141. }
  1142. }
  1143. };
  1144.  
  1145. //太阳系行星工作
  1146. PLANETWORK.Solar();
  1147. }
  1148.  
  1149. })();