Sleazy Fork is available in English.

Soul+Linker

用于魂+和DLsite之间的快速跳转,同时让魂+使用起来更加方便

Fra og med 02.01.2023. Se den nyeste version.

  1. // ==UserScript==
  2. // @name Soul+Linker
  3. // @name:en Soul+Linker
  4. // @name:zh Soul+Linker
  5. // @namespace Xiccnd@qq.com
  6. // @version 1.3.9
  7. // @description 用于魂+和DLsite之间的快速跳转,同时让魂+使用起来更加方便
  8. // @description:en Used for quick jumps between Soul+ and DLsite, while making Soul+ more convenient to use
  9. // @description:zh 用于魂+和DLsite之间的快速跳转,同时让魂+使用起来更加方便
  10. // @author Xiccnd
  11.  
  12. // @license GPL-3.0 License
  13.  
  14. // @include *://white-plus.net/*
  15. // @include *://snow-plus.net/*
  16. // @include *://level-plus.net/*
  17. // @include *://east-plus.net/*
  18. // @include *://south-plus.net/*
  19. // @include *://north-plus.net/*
  20. // @include *://spring-plus.net/*
  21. // @include *://summer-plus.net/*
  22. // @include *://imoutolove.me/*
  23.  
  24. // @include *//www.dlsite.com*product_id/*
  25.  
  26. // @include *://www.white-plus.net/*
  27. // @include *://www.snow-plus.net/*
  28. // @include *://www.level-plus.net/*
  29. // @include *://www.east-plus.net/*
  30. // @include *://www.south-plus.net/*
  31. // @include *://www.north-plus.net/*
  32. // @include *://www.spring-plus.net/*
  33. // @include *://www.summer-plus.net/*
  34. // @include *://bbs.imoutolove.me/*
  35.  
  36. // @exclude *://www.white-plus.net/index.php
  37. // @exclude *://www.snow-plus.net/index.php
  38. // @exclude *://www.level-plus.net/index.php
  39. // @exclude *://www.east-plus.net/index.php
  40. // @exclude *://www.south-plus.net/index.php
  41. // @exclude *://www.north-plus.net/index.php
  42. // @exclude *://www.spring-plus.net/index.php
  43. // @exclude *://www.summer-plus.net/index.php
  44. // @exclude *://bbs.imoutolove.me/index.php
  45.  
  46. // @exclude *://www.white-plus.net/
  47. // @exclude *://www.snow-plus.net/
  48. // @exclude *://www.level-plus.ne/
  49. // @exclude *://www.east-plus.net/
  50. // @exclude *://www.south-plus.net/
  51. // @exclude *://www.north-plus.net/
  52. // @exclude *://www.spring-plus.net/
  53. // @exclude *://www.summer-plus.net/
  54. // @exclude *://bbs.imoutolove.me/
  55.  
  56. // @exclude *://white-plus.net/index.php
  57. // @exclude *://snow-plus.net/index.php
  58. // @exclude *://level-plus.net/index.php
  59. // @exclude *://east-plus.net/index.php
  60. // @exclude *://south-plus.net/index.php
  61. // @exclude *://north-plus.net/index.php
  62. // @exclude *://spring-plus.net/index.php
  63. // @exclude *://summer-plus.net/index.php
  64. // @exclude *://imoutolove.me/index.php
  65.  
  66. // @exclude *://white-plus.net/
  67. // @exclude *://snow-plus.net/
  68. // @exclude *://level-plus.ne/
  69. // @exclude *://east-plus.net/
  70. // @exclude *://south-plus.net/
  71. // @exclude *://north-plus.net/
  72. // @exclude *://spring-plus.net/
  73. // @exclude *://summer-plus.net/
  74. // @exclude *://imoutolove.me/
  75.  
  76. // @require https://code.jquery.com/jquery-3.6.0.min.js
  77. // @icon https://cdn.jsdelivr.net/gh/Xiccnd/Xiccnd-Pic@master/20220421113011992.1vh7zbll47r4.ico
  78. // @grant none
  79. // ==/UserScript==
  80.  
  81. $(function () {
  82.  
  83. 'use strict'
  84.  
  85. /*
  86. * 设置全局变量,开头加前缀避免重名
  87. * */
  88.  
  89. //设置检查规则
  90. const XICCND_CHECK_RJ = new RegExp('RJ[0-9]{6}')
  91. const XICCND_CHECK_DL = new RegExp('dlsite')
  92. const XICCND_CHECK_SEARCH = new RegExp('search.php[?]keyword-RJ[0-9]{6}')
  93.  
  94. //设置跳转魂+域名
  95. const XICCND_WEBSITE = 'east-plus.net'
  96.  
  97. /*
  98. * 开关插件功能
  99. * */
  100.  
  101. //开启跳转和图片预览功能
  102. xiccndRJ()
  103.  
  104. //开启网站清爽模式,建议配合Soul+Cleaner和Soul++图墙自动打开一起使用
  105. //xiccndCleanMode()
  106.  
  107. //开启去除文章广告,会导致无法列表模式观看,建议图墙用户开启
  108. //xiccndCleanList()
  109.  
  110. //开启DLsite跳转魂+搜索
  111. xiccndRJSearch()
  112.  
  113. //开启魂+内部跳转
  114. xiccndInnerJump()
  115.  
  116. /*
  117. * 跳转
  118. * */
  119. function xiccndRJ() {
  120. //获取标题
  121. const XICCND_TITLE = $('h1#subject_tpc.fl').html()
  122.  
  123. //创建复制按钮
  124. const COPY_BUTTON = "<button id='copy_button' style='display: none; margin-left: 10px; cursor: pointer' onclick='return false'>复制标题</button>"
  125.  
  126. //标题后中添加复制按钮
  127. if ($('button#copy_button') > 0) {
  128. console.log('复制按钮已存在')
  129. } else {
  130. $('h1#subject_tpc.fl').append(COPY_BUTTON)
  131. }
  132.  
  133. $('h1#subject_tpc.fl').on('click', function () {
  134. $('button#copy_button').stop().toggle(300)
  135. })
  136.  
  137. $('button#copy_button').on('click', function () {
  138. // 创建元素用于复制
  139. const aux = document.createElement('input')
  140. // 获取复制内容
  141. let content = XICCND_TITLE.substr(0,XICCND_TITLE.indexOf('<div class'))
  142. //判断凛+div元素添加上没有
  143. if (XICCND_TITLE.indexOf('<div class') === -1) {
  144. content = XICCND_TITLE
  145. }
  146. // 设置元素内容
  147. aux.setAttribute('value', content)
  148. // 将元素插入页面进行调用
  149. document.body.appendChild(aux)
  150. // 复制内容
  151. aux.select()
  152. // 将内容复制到剪贴板
  153. document.execCommand('copy')
  154. // 删除创建元素
  155. document.body.removeChild(aux)
  156.  
  157. alert('标题已复制\n' + content)
  158. })
  159. //检查标题是否含有RJ号
  160. if (XICCND_CHECK_RJ.test(XICCND_TITLE)) {//如果含有
  161. //获取RJ号
  162. let RJ = XICCND_TITLE.substr(XICCND_TITLE.indexOf("RJ"), 8)
  163.  
  164. let RJPre
  165. let RJBody
  166.  
  167. //如果RJ号10位
  168. if (RJ.substr(2, 1) === "0") {
  169. RJ = XICCND_TITLE.substr(XICCND_TITLE.indexOf("RJ"), 10)
  170. //合成路径
  171. RJPre = RJ.substr(0, 6)
  172. RJBody = parseInt(RJ.substr(6, 1)) + 1
  173.  
  174. if (RJBody === 10) {//当RJBody为9时,RJBody要变为0,前一个数字加1
  175. RJPre = RJPre.substr(0, 5) + (parseInt(RJPre.substr(5, 1)) + 1)
  176. RJBody = 0
  177. }
  178. } else {//RJ号8位
  179. //合成路径
  180. RJPre = RJ.substr(0, 4)
  181. RJBody = parseInt(RJ.substr(4, 1)) + 1
  182.  
  183. if (RJBody === 10) {//当RJBody为9时,RJBody要变为0,前一个数字加1
  184. RJPre = RJPre.substr(0, 3) + (parseInt(RJPre.substr(3, 1)) + 1)
  185. RJBody = 0
  186. }
  187. }
  188.  
  189.  
  190. const RJSRC = RJPre + RJBody + '000'
  191. //合成图片地址
  192. const SRC = '//img.dlsite.jp/modpub/images2/work/doujin/' + RJSRC + '/' + RJ + '_img_main.jpg'
  193. //创建图片
  194. const IMG = '<img id="xiccndImg" style="display: none; width: 15%; position: absolute; left: 1%;top: 10px;border: 5px dashed pink" alt= "NoImg" src= ' + '"' + SRC + '"' + '>'
  195.  
  196. //网页中添加图片
  197. if ($('img#xiccndImg') > 0) {
  198. console.log('预览图已存在')
  199. } else {
  200. $('body').append(IMG)
  201. }
  202.  
  203. $("h1#subject_tpc.fl").on('mouseover', function () {
  204. $(this).css('cursor', 'pointer').css('color', 'pink')
  205. }).on('mouseout', function () {
  206. $(this).css('color', '#bbbbbb')
  207. }).on('click', function (event) {
  208. //获取当前鼠标的坐标
  209. const mouse_x = event.pageX + "px"
  210. const mouse_y = event.pageY + "px"
  211.  
  212. //如果图片隐藏时可改变图片位置
  213. if ($('img#xiccndImg').css('display') === 'none') {
  214. $('img#xiccndImg').css({
  215. left: mouse_x,
  216. top: mouse_y
  217. })
  218. }
  219.  
  220. $('img#xiccndImg').stop().toggle(300)
  221. })
  222. //跳转网页
  223. $('img#xiccndImg').on('click', function () {
  224. window.open("https://www.dlsite.com/maniax/work/=/product_id/" + RJ + ".html");
  225. }).on('mouseover', function () {
  226. $(this).css('cursor', 'pointer').css('border', '5px dashed plum')
  227. }).on('mouseout', function () {
  228. $(this).css('border', '5px dashed pink')
  229. })
  230. } else {//如果不含有
  231. //检查是否已存在表单
  232. if (!($('form#xiccndSearchForm').size > 0)) {
  233. //生成跳转表单
  234. const SEARCHBAR = '<input id="xiccndSearchbar" type="text" value="RJ" placeholder="请输入RJ号" style="width: 100px; height: 20px; margin-left: 5px"/>'
  235. const BUTTON = '<input id="xiccndSearchbarButton" type="submit" value="跳转" style="height: 25px; margin-left: 5px"/>'
  236. const FORM = '<form id="xiccndSearchForm" action="" style="display: none">' + SEARCHBAR + BUTTON + '</form>'
  237. //添加生成表单
  238. $('div.h1.fl').append(FORM)
  239. }
  240. //标题点击效果
  241. $("h1#subject_tpc.fl").on('click', function () {
  242. $('form#xiccndSearchForm').stop().toggle(500)
  243. }).on('mouseover', function () {
  244. $(this).css('cursor', 'pointer').css('color', 'plum')
  245. }).on('mouseout', function () {
  246. $(this).css('color', '#bbbbbb')
  247. })
  248. //跳转按钮效果
  249. $('input#xiccndSearchbarButton').on('mouseover', function () {
  250. $(this).css('cursor', 'pointer')
  251. }).on('click', function () {
  252. //获取搜索框内值
  253. let searchRJ = $('input#xiccndSearchbar').val()
  254.  
  255. //判断RJ号
  256. while (!(XICCND_CHECK_RJ.test(searchRJ))) {
  257. if (searchRJ === '') {
  258. searchRJ = prompt('RJ号为空,请重新输入!')
  259. } else if (searchRJ == null) {//点击取消
  260. break
  261. } else {
  262. searchRJ = prompt('RJ号不规范,请重新输入!')
  263. }
  264. }
  265.  
  266. //判断是否点击取消,否的话跳转
  267. if (searchRJ != null) {
  268. $('form#xiccndSearchForm').attr('action', 'https://www.dlsite.com/maniax/work/=/product_id/' + searchRJ + '.html')
  269. } else {
  270. return false
  271. }
  272. })
  273. }
  274. }
  275.  
  276. /*
  277. * 去除文章广告
  278. * */
  279. function xiccndCleanMode() {
  280. //去除页头广告
  281. $('div#header div').eq(-2).remove()
  282. //去除网页头部
  283. $('td.banner').remove()
  284. //去除网页底部
  285. $('div#main>div.t_one').remove()
  286. $('div#footer').remove()
  287. //去除公告
  288. $('div.gonggao').remove()
  289. }
  290.  
  291. /*
  292. * 去除文章广告
  293. * */
  294. function xiccndCleanList() {
  295. $('table#ajaxtable>tbody').eq(1).remove()
  296. }
  297.  
  298. /*
  299. * DLsite跳转魂+搜索
  300. * */
  301. function xiccndRJSearch() {
  302. //获取当前网址
  303. const URL = window.location.href
  304.  
  305. //检查是否为DLsite网站
  306. if (XICCND_CHECK_DL.test(URL)) {
  307. //改作品名称可选
  308. $('#work_name').css('user-select', 'auto')
  309.  
  310. //添加搜索按钮
  311. const SEARCH_BUTTON = "<button id='xiccnd_search_button' style='margin-left: 10px; background-color: white; border: pink dashed 3px; border-radius: 10px' >跳转搜索</button>"
  312. $('#work_name').append(SEARCH_BUTTON)
  313.  
  314. //截取RJ号
  315. let RJ = URL.substr(URL.indexOf("RJ"), 8)
  316.  
  317. //判断是否10位RJ号
  318. if (RJ.substr(2,1) === "0") {
  319. RJ = URL.substr(URL.indexOf("RJ"), 10)
  320. }
  321.  
  322. //设置1s1check
  323. setInterval(skip_adult_check,1000)
  324.  
  325. //如果出现成人检查直接切换网址
  326. function skip_adult_check() {
  327. if($('.adult_check_box').length != 0) {
  328. window.location.replace('https://www.dlsite.com/maniax/work/=/product_id/' + RJ + '.html')
  329. }
  330. }
  331.  
  332. $('button#xiccnd_search_button').on('mouseover', function () {
  333. $(this).css('cursor', 'pointer').css('border', 'plum dashed 3px')
  334. }).on('mouseout', function () {
  335. $(this).css('border', 'pink dashed 3px')
  336. }).on('click', function () {//带RJ号跳转搜索页面
  337. window.open('https://' + XICCND_WEBSITE + '/search.php?keyword-' + RJ)
  338. })
  339. } else if (XICCND_CHECK_SEARCH.test(URL)) {//检查是否为搜索界面
  340. //截取RJ号
  341. let SEARCH_RJ = URL.substr(URL.indexOf("RJ"), 8)
  342.  
  343. //判断是否10位RJ号
  344. if (SEARCH_RJ.substr(2,1) === "0") {
  345. SEARCH_RJ = URL.substr(URL.indexOf("RJ"), 10)
  346. }
  347.  
  348. //在搜索框填入RJ号
  349. $('input.input[name="keyword"]').val(SEARCH_RJ)
  350. //改搜索条件为所有主题帖
  351. $('select[name="sch_time"]>option[value="all"]').attr('selected', 'selected')
  352. //点击搜索按钮
  353. $('input.btn[value="提 交"]').trigger('click')
  354. }
  355. }
  356.  
  357. /*
  358. * 魂+内部跳转
  359. * */
  360. function xiccndInnerJump() {
  361. //获取当前网址
  362. const URL = window.location.href
  363.  
  364. //如果是同人音声
  365. if (URL.indexOf('fid-128.html') > 0) {
  366. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  367. '<ul style="list-style-type: none; width: 200px">' +
  368. '<li style="border: pink dashed 3px">同人音声<span style="float: right; margin-top: 3px; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  369. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  370. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  371. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  372. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">游戏资源</li>' +
  373. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">COSPLAY</li>' +
  374. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  375. '</ul>' +
  376. '</div>'
  377. //判断跳转div元素是否存在
  378. if ($('div#jump_div').size > 0) {
  379. console.log('跳转列表已存在')
  380. } else {
  381. //添加div
  382. $('body').append(JUMP_DIV)
  383. }
  384.  
  385. $('div#jump_div li').on('mouseover', function () {
  386. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  387. }).on('mouseout', function () {
  388. $(this).css('background-color', 'transparent')
  389. }).eq(0).on('click', function () {
  390. if ($(this).next('li').css('display') === 'none') {
  391. $('div#jump_div li').stop().slideDown(300)
  392. $(this).find('span').html('&#916;')
  393. } else {
  394. $('div#jump_div li').not(':first').stop().slideUp(300)
  395. $(this).find('span').html('&#8711;')
  396. }
  397. }).end().eq(1).on('click', function () {
  398. window.location.href = 'thread_new.php?fid-9.html'
  399. }).end().eq(2).on('click', function () {
  400. window.location.href = 'thread_new.php?fid-48.html'
  401. }).end().eq(3).on('click', function () {
  402. window.location.href = 'thread_new.php?fid-135.html'
  403. }).end().eq(4).on('click', function () {
  404. window.location.href = 'thread_new.php?fid-6.html'
  405. }).end().eq(5).on('click', function () {
  406. window.location.href = 'thread_new.php?fid-201.html'
  407. }).end().eq(6).on('click', function () {
  408. window.location.href = 'thread_new.php?fid-4.html'
  409. })
  410. }
  411.  
  412. //如果是茶馆
  413. if (URL.indexOf('fid-9.html') > 0) {
  414. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  415. '<ul style="list-style-type: none; width: 200px">' +
  416. '<li style="border: pink dashed 3px">茶馆<span style="float: right; margin-top: 3px; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  417. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  418. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  419. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  420. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">游戏资源</li>' +
  421. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">COSPLAY</li>' +
  422. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  423. '</ul>' +
  424. '</div>'
  425. //判断跳转div元素是否存在
  426. if ($('div#jump_div').size > 0) {
  427. console.log('跳转列表已存在')
  428. } else {
  429. //添加div
  430. $('body').append(JUMP_DIV)
  431. }
  432.  
  433. $('div#jump_div li').on('mouseover', function () {
  434. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  435. }).on('mouseout', function () {
  436. $(this).css('background-color', 'transparent')
  437. }).eq(0).on('click', function () {
  438. if ($(this).next('li').css('display') === 'none') {
  439. $('div#jump_div li').stop().slideDown(300)
  440. $(this).find('span').html('&#916;')
  441. } else {
  442. $('div#jump_div li').not(':first').stop().slideUp(300)
  443. $(this).find('span').html('&#8711;')
  444. }
  445. }).end().eq(1).on('click', function () {
  446. window.location.href = 'thread_new.php?fid-128.html'
  447. }).end().eq(2).on('click', function () {
  448. window.location.href = 'thread_new.php?fid-48.html'
  449. }).end().eq(3).on('click', function () {
  450. window.location.href = 'thread_new.php?fid-135.html'
  451. }).end().eq(4).on('click', function () {
  452. window.location.href = 'thread_new.php?fid-6.html'
  453. }).end().eq(5).on('click', function () {
  454. window.location.href = 'thread_new.php?fid-201.html'
  455. }).end().eq(6).on('click', function () {
  456. window.location.href = 'thread_new.php?fid-4.html'
  457. })
  458. }
  459.  
  460. //如果是询问&求物
  461. if (URL.indexOf('fid-48.html') > 0) {
  462. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  463. '<ul style="list-style-type: none; width: 200px">' +
  464. '<li style="border: pink dashed 3px">询问&求物<span style="float: right; margin-top: 3px; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  465. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  466. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  467. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  468. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">游戏资源</li>' +
  469. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">COSPLAY</li>' +
  470. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  471. '</ul>' +
  472. '</div>'
  473. //判断跳转div元素是否存在
  474. if ($('div#jump_div').size > 0) {
  475. console.log('跳转列表已存在')
  476. } else {
  477. //添加div
  478. $('body').append(JUMP_DIV)
  479. }
  480.  
  481. $('div#jump_div li').on('mouseover', function () {
  482. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  483. }).on('mouseout', function () {
  484. $(this).css('background-color', 'transparent')
  485. }).eq(0).on('click', function () {
  486. if ($(this).next('li').css('display') === 'none') {
  487. $('div#jump_div li').stop().slideDown(300)
  488. $(this).find('span').html('&#916;')
  489. } else {
  490. $('div#jump_div li').not(':first').stop().slideUp(300)
  491. $(this).find('span').html('&#8711;')
  492. }
  493. }).end().eq(1).on('click', function () {
  494. window.location.href = 'thread_new.php?fid-9.html'
  495. }).end().eq(2).on('click', function () {
  496. window.location.href = 'thread_new.php?fid-128.html'
  497. }).end().eq(3).on('click', function () {
  498. window.location.href = 'thread_new.php?fid-135.html'
  499. }).end().eq(4).on('click', function () {
  500. window.location.href = 'thread_new.php?fid-6.html'
  501. }).end().eq(5).on('click', function () {
  502. window.location.href = 'thread_new.php?fid-201.html'
  503. }).end().eq(6).on('click', function () {
  504. window.location.href = 'thread_new.php?fid-4.html'
  505. })
  506. }
  507.  
  508. //如果是GALGAME
  509. if (URL.indexOf('fid-135.html') > 0) {
  510. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  511. '<ul style="list-style-type: none; width: 200px">' +
  512. '<li style="border: pink dashed 3px">GALGAME<span style="float: right; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  513. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  514. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  515. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  516. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">游戏资源</li>' +
  517. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">COSPLAY</li>' +
  518. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  519. '</ul>' +
  520. '</div>'
  521. //判断跳转div元素是否存在
  522. if ($('div#jump_div').size > 0) {
  523. console.log('跳转列表已存在')
  524. } else {
  525. //添加div
  526. $('body').append(JUMP_DIV)
  527. }
  528.  
  529. $('div#jump_div li').on('mouseover', function () {
  530. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  531. }).on('mouseout', function () {
  532. $(this).css('background-color', 'transparent')
  533. }).eq(0).on('click', function () {
  534. if ($(this).next('li').css('display') === 'none') {
  535. $('div#jump_div li').stop().slideDown(300)
  536. $(this).find('span').html('&#916;')
  537. } else {
  538. $('div#jump_div li').not(':first').stop().slideUp(300)
  539. $(this).find('span').html('&#8711;')
  540. }
  541. }).end().eq(1).on('click', function () {
  542. window.location.href = 'thread_new.php?fid-9.html'
  543. }).end().eq(2).on('click', function () {
  544. window.location.href = 'thread_new.php?fid-128.html'
  545. }).end().eq(3).on('click', function () {
  546. window.location.href = 'thread_new.php?fid-48.html'
  547. }).end().eq(4).on('click', function () {
  548. window.location.href = 'thread_new.php?fid-6.html'
  549. }).end().eq(5).on('click', function () {
  550. window.location.href = 'thread_new.php?fid-201.html'
  551. }).end().eq(6).on('click', function () {
  552. window.location.href = 'thread_new.php?fid-4.html'
  553. })
  554. }
  555.  
  556. //如果是游戏资源
  557. if (URL.indexOf('fid-6.html') > 0) {
  558. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  559. '<ul style="list-style-type: none; width: 200px">' +
  560. '<li style="border: pink dashed 3px">游戏资源<span style="float: right; margin-top: 3px; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  561. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  562. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  563. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  564. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  565. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">COSPLAY</li>' +
  566. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  567. '</ul>' +
  568. '</div>'
  569. //判断跳转div元素是否存在
  570. if ($('div#jump_div').size > 0) {
  571. console.log('跳转列表已存在')
  572. } else {
  573. //添加div
  574. $('body').append(JUMP_DIV)
  575. }
  576.  
  577. $('div#jump_div li').on('mouseover', function () {
  578. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  579. }).on('mouseout', function () {
  580. $(this).css('background-color', 'transparent')
  581. }).eq(0).on('click', function () {
  582. if ($(this).next('li').css('display') === 'none') {
  583. $('div#jump_div li').stop().slideDown(300)
  584. $(this).find('span').html('&#916;')
  585. } else {
  586. $('div#jump_div li').not(':first').stop().slideUp(300)
  587. $(this).find('span').html('&#8711;')
  588. }
  589. }).end().eq(1).on('click', function () {
  590. window.location.href = 'thread_new.php?fid-9.html'
  591. }).end().eq(2).on('click', function () {
  592. window.location.href = 'thread_new.php?fid-128.html'
  593. }).end().eq(3).on('click', function () {
  594. window.location.href = 'thread_new.php?fid-48.html'
  595. }).end().eq(4).on('click', function () {
  596. window.location.href = 'thread_new.php?fid-135.html'
  597. }).end().eq(5).on('click', function () {
  598. window.location.href = 'thread_new.php?fid-201.html'
  599. }).end().eq(6).on('click', function () {
  600. window.location.href = 'thread_new.php?fid-4.html'
  601. })
  602. }
  603.  
  604. //如果是COSPLAY
  605. if (URL.indexOf('fid-201.html') > 0) {
  606. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  607. '<ul style="list-style-type: none; width: 200px">' +
  608. '<li style="border: pink dashed 3px">COSPLAY<span style="float: right; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  609. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  610. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  611. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  612. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  613. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">游戏资源</li>' +
  614. '<li style="border: pink dashed 3px; display: none">实用动画</li>' +
  615. '</ul>' +
  616. '</div>'
  617. //判断跳转div元素是否存在
  618. if ($('div#jump_div').size > 0) {
  619. console.log('跳转列表已存在')
  620. } else {
  621. //添加div
  622. $('body').append(JUMP_DIV)
  623. }
  624.  
  625. $('div#jump_div li').on('mouseover', function () {
  626. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  627. }).on('mouseout', function () {
  628. $(this).css('background-color', 'transparent')
  629. }).eq(0).on('click', function () {
  630. if ($(this).next('li').css('display') === 'none') {
  631. $('div#jump_div li').stop().slideDown(300)
  632. $(this).find('span').html('&#916;')
  633. } else {
  634. $('div#jump_div li').not(':first').stop().slideUp(300)
  635. $(this).find('span').html('&#8711;')
  636. }
  637. }).end().eq(1).on('click', function () {
  638. window.location.href = 'thread_new.php?fid-9.html'
  639. }).end().eq(2).on('click', function () {
  640. window.location.href = 'thread_new.php?fid-128.html'
  641. }).end().eq(3).on('click', function () {
  642. window.location.href = 'thread_new.php?fid-48.html'
  643. }).end().eq(4).on('click', function () {
  644. window.location.href = 'thread_new.php?fid-135.html'
  645. }).end().eq(5).on('click', function () {
  646. window.location.href = 'thread_new.php?fid-6.html'
  647. }).end().eq(6).on('click', function () {
  648. window.location.href = 'thread_new.php?fid-4.html'
  649. })
  650. }
  651.  
  652. //如果是实用动画
  653. if (URL.indexOf('fid-4.html') > 0) {
  654. const JUMP_DIV = '<div id="jump_div" style="position: fixed; left: 0; top: 10px; color: black; font-size: 2em; text-align: center; user-select: none">' +
  655. '<ul style="list-style-type: none; width: 200px">' +
  656. '<li style="border: pink dashed 3px">实用动画<span style="float: right; margin-top: 3px; margin-right: 7px; width: 17px">&#8711;</span></li>' +
  657. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">茶馆</li>' +
  658. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">同人音声</li>' +
  659. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">询问&求物</li>' +
  660. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; border-bottom: pink dashed 3px; display: none">GALGAME</li>' +
  661. '<li style="border-left: pink dashed 3px; border-right: pink dashed 3px; display: none">游戏资源</li>' +
  662. '<li style="border: pink dashed 3px; display: none">COSPLAY</li>' +
  663. '</ul>' +
  664. '</div>'
  665. //判断跳转div元素是否存在
  666. if ($('div#jump_div').size > 0) {
  667. console.log('跳转列表已存在')
  668. } else {
  669. //添加div
  670. $('body').append(JUMP_DIV)
  671. }
  672.  
  673. $('div#jump_div li').on('mouseover', function () {
  674. $(this).css('cursor', 'pointer').css('background-color', 'rgba(255,255,255,0.2)')
  675. }).on('mouseout', function () {
  676. $(this).css('background-color', 'transparent')
  677. }).eq(0).on('click', function () {
  678. if ($(this).next('li').css('display') === 'none') {
  679. $('div#jump_div li').stop().slideDown(300)
  680. $(this).find('span').html('&#916;')
  681. } else {
  682. $('div#jump_div li').not(':first').stop().slideUp(300)
  683. $(this).find('span').html('&#8711;')
  684. }
  685. }).end().eq(1).on('click', function () {
  686. window.location.href = 'thread_new.php?fid-9.html'
  687. }).end().eq(2).on('click', function () {
  688. window.location.href = 'thread_new.php?fid-128.html'
  689. }).end().eq(3).on('click', function () {
  690. window.location.href = 'thread_new.php?fid-48.html'
  691. }).end().eq(4).on('click', function () {
  692. window.location.href = 'thread_new.php?fid-135.html'
  693. }).end().eq(5).on('click', function () {
  694. window.location.href = 'thread_new.php?fid-6.html'
  695. }).end().eq(6).on('click', function () {
  696. window.location.href = 'thread_new.php?fid-201.html'
  697. })
  698. }
  699.  
  700. /*
  701. * 实现拖动效果
  702. * */
  703. const DIV_DRAGABLE = $('div#jump_div')
  704. //绑定鼠标左键按住事件
  705. DIV_DRAGABLE.on('mousedown', function (event) {
  706. //获取需要拖动节点的坐标
  707. const offset_x = $(this)[0].offsetLeft//x坐标
  708. const offset_y = $(this)[0].offsetTop//y坐标
  709. //获取当前鼠标的坐标
  710. const mouse_x = event.pageX
  711. const mouse_y = event.pageY
  712.  
  713. //绑定拖动事件
  714. $(document).on('mousemove', function (ev) {
  715. //拖动时禁用点击事件
  716. $('div#jump_div').css('pointer-events', 'none')
  717. //计算鼠标移动了的位置
  718. const _x = ev.pageX - mouse_x
  719. const _y = ev.pageY - mouse_y
  720. //设置移动后的元素坐标
  721. const now_x = (offset_x + _x) + "px";
  722. const now_y = (offset_y + _y) + "px";
  723. //改变目标元素的位置
  724. DIV_DRAGABLE.css({
  725. top: now_y,
  726. left: now_x
  727. })
  728. })
  729. })
  730.  
  731. $(document).on('mouseup', function () {
  732. //恢复点击事件
  733. $('div#jump_div').css('pointer-events', 'auto')
  734. //当鼠标左键松开,解除事件绑定
  735. $(this).off('mousemove')
  736. })
  737. }
  738. })
  739.