Greasy Fork 支持简体中文。

SH List All Chapters

Override the "Show All Chapters" button to list all chapters in the Table of Contents on ScribbleHub series pages instead of a pop-up.

安裝腳本?
作者推薦腳本

您可能也會喜歡 SH Auto Show Bookmark

安裝腳本
  1. // ==UserScript==
  2. // @name SH List All Chapters
  3. // @namespace ultrabenosaurus.ScribbleHub
  4. // @version 0.3
  5. // @description Override the "Show All Chapters" button to list all chapters in the Table of Contents on ScribbleHub series pages instead of a pop-up.
  6. // @author Ultrabenosaurus
  7. // @license GNU AGPLv3
  8. // @source https://greasyfork.org/en/users/437117-ultrabenosaurus?sort=name
  9. // @match https://www.scribblehub.com/series/*
  10. // @icon https://www.google.com/s2/favicons?domain=scribblehub.com
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. if( 0 != document.querySelectorAll('ul#pagination-mesh-toc li:nth-last-child(2)').length ){
  18. var top = parseInt( document.querySelectorAll('ul#pagination-mesh-toc li:nth-last-child(2)')[0].textContent );
  19. if( !isNaN( top ) && 1 < top ){
  20. //console.log(top);
  21. var btnElem = '<i class="fa fa-th-list chpnew" id="menu_icon_fic" aria-hidden="true" title="Show All Chapters"></i>';
  22. $('div.fic_toc_bar i#menu_icon_fic.fa-th-list').replaceWith(btnElem);
  23. var sacBtn = document.querySelectorAll('div.fic_toc_bar i#menu_icon_fic.fa-th-list')[0];
  24. if(sacBtn){
  25. sacBtn.addEventListener("click", function(){
  26. UBlistAllChaptersSH( top, 2 );
  27. }, false);
  28. }
  29. sacBtn = btnElem = null;
  30.  
  31. //UBlistAllChaptersSH( top, 2 );
  32. //top = null;
  33. }
  34. }
  35. })();
  36.  
  37. function UBlistAllChaptersSH(top, i){
  38. //console.log( top, i );
  39.  
  40. if( null != top && !isNaN( top ) && null != i && top >= i ){
  41. var e = $("#mypostid").attr("value");
  42. $.ajax({
  43. type: "POST",
  44. url: "https://www.scribblehub.com/wp-admin/admin-ajax.php",
  45. data: {
  46. action: "wi_getreleases_pagination",
  47. pagenum: i,
  48. mypostid: e
  49. },
  50. success: function(t) {
  51. //console.log(top, i);
  52. t = t.slice(0, -1);
  53. var ol = $(t).find('.toc_ol li');
  54. $('.toc_ol').append(ol);
  55. //console.log( ol );
  56. t = o = null;
  57. UBlistAllChaptersSH( top, i+1 );
  58. }
  59. });
  60. }
  61.  
  62. if( top <= i ){
  63. top = null;
  64. }
  65.  
  66. }