|
1 | 1 | // ==UserScript== |
2 | 2 | // @name 草榴小助手 |
3 | 3 | // @namespace hoothin |
4 | | -// @version 0.6.6 |
| 4 | +// @version 0.6.7 |
5 | 5 | // @description 草榴小助手修复,提供“加亮今日帖子”、“移除viidii跳转”、“图片自动缩放”、“种子链接转磁力链”、“预览整页图片”、“游客站内搜索”、“返回顶部”等功能! |
6 | 6 | // @author NewType & hoothin |
7 | 7 | // @match *://*.t66y.com/* |
|
126 | 126 | var viewportBottom = viewportTop + $(window).height(); |
127 | 127 | return elementBottom > viewportTop && elementTop < viewportBottom; |
128 | 128 | }; |
129 | | - var $tLike = $(".t_like"); |
130 | | - if ($tLike.length) { |
131 | | - var $tLikeClone = $tLike.clone(); |
132 | | - if (!$tLike.isInViewport()) { |
133 | | - $("#conttpc").prepend($tLikeClone); |
134 | | - } |
135 | | - |
136 | | - $(window).on("resize scroll", function() { |
137 | | - if ($tLike.isInViewport()) { |
138 | | - if ($tLikeClone.parent().length) $tLikeClone.detach(); |
139 | | - } else { |
140 | | - if ($tLikeClone.parent().length == 0) $("#conttpc").prepend($tLikeClone); |
141 | | - } |
142 | | - }); |
143 | | - } |
144 | 129 |
|
145 | 130 |
|
146 | 131 | // 种子链接转磁力链 |
|
165 | 150 | var replyStr = defaultReply; |
166 | 151 |
|
167 | 152 | helper.getScript('//cdn.jsdelivr.net/npm/jquery.cookie@1.4.1/jquery.cookie.min.js', e => { |
| 153 | + var $tLike = $(".t_like"); |
| 154 | + if ($tLike.length) { |
| 155 | + var $tLikeClone = $tLike.clone(); |
| 156 | + if (!$tLike.isInViewport()) { |
| 157 | + $("#conttpc").prepend($tLikeClone); |
| 158 | + } |
| 159 | + |
| 160 | + $(window).on("resize scroll", function() { |
| 161 | + if ($tLike.isInViewport()) { |
| 162 | + if ($tLikeClone.parent().length) $tLikeClone.detach(); |
| 163 | + } else { |
| 164 | + if ($tLikeClone.parent().length == 0) $("#conttpc").prepend($tLikeClone); |
| 165 | + } |
| 166 | + }); |
| 167 | + } |
168 | 168 | var lastReplyTime = $.cookie('lastReplyTime'); |
169 | 169 | var customReplyStr = $.cookie('customReplyStr'); |
170 | 170 | var isCheckIn = document.title.indexOf("打卡签到") !== -1; |
|
0 commit comments