🏠 Home 

Greasy Fork is available in English.

人教电子教材显示书名

显示书名

  1. // ==UserScript==
  2. // @name 人教电子教材显示书名
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-11-7
  5. // @description 显示书名
  6. // @author AN drew
  7. // @match https://jc.pep.com.cn/*
  8. // @require https://lib.baomitu.com/jquery/3.5.0/jquery.min.js
  9. // @grant GM_addStyle
  10. // ==/UserScript==
  11. (function() {
  12. 'use strict';
  13. GM_addStyle(`
  14. .page_pc_btm_book_body{height:auto!important}
  15. .page_pc_btm_book_body .name{padding-left: 8px; margin:2px 14px; font-weight:bold; font-family:楷体,cursive; font-size:22px;}
  16. .page_pc_btm_book_body .read{margin:5px 0px 20px 20px!important}
  17. .textbook .item{height:auto!important}
  18. .textbook .item .name{padding-left: 8px; margin:2px 14px; font-weight:bold; font-family:楷体,cursive; font-size:22px;}
  19. .textbook .item .read{margin-top:5px!important}
  20. `);
  21. let t=setInterval(function(){
  22. if($('.page_pc_btm_book_body').length>0)
  23. {
  24. $('.page_pc_btm_book_body').each(function(){
  25. if($(this).find('.name').length>0)
  26. {
  27. let old_title=$(this).find('.name').text();
  28. let new_title=$(this).find('.imga').attr('title');
  29. if(old_title != new_title)
  30. {
  31. $(this).find('.name').text(new_title);
  32. }
  33. }
  34. else
  35. {
  36. if($(this).find('.imga').length>0)
  37. {
  38. let title=$(this).find('.imga').attr('title');
  39. $(this).find('.imga').after('<div class="name">'+title+'</div>');
  40. }
  41. }
  42. });
  43. }
  44. if($('.textbook .item').length>0)
  45. {
  46. $('.textbook .item').each(function(){
  47. if($(this).find('.name').length>0)
  48. {
  49. let old_title=$(this).find('.name').text();
  50. let new_title=$(this).find('.cover').attr('alt');
  51. if(old_title != new_title)
  52. {
  53. $(this).find('.name').text(new_title);
  54. }
  55. }
  56. else
  57. {
  58. if($(this).find('.cover').length>0)
  59. {
  60. let title=$(this).find('.cover').attr('title');
  61. $(this).find('.cover').after('<div class="name">'+title+'</div>');
  62. }
  63. }
  64. });
  65. }
  66. },1000);
  67. })();