zFrontier帖子显示大图

zFrontier帖子图片替换为大图

  1. // ==UserScript==
  2. // @name zFrontier帖子显示大图
  3. // @namespace https://gf.qytechs.cn/scripts/419183-zfrontier%E5%B8%96%E5%AD%90%E6%98%BE%E7%A4%BA%E5%A4%A7%E5%9B%BE
  4. // @version 0.3
  5. // @description zFrontier帖子图片替换为大图
  6. // @author mlch911
  7. // @match https://www.zfrontier.com/app/flow/*
  8. // @grant GM_registerMenuCommand
  9. // @grant GM_getValue
  10. // @grant GM_setValue
  11. // ==/UserScript==
  12.  
  13. (function () {
  14. 'use strict';
  15. var max_width_key = 'max-width'
  16.  
  17. function switchImg() {
  18. var pic = $('.gallery-pic img')
  19. if (pic.length > 0) {
  20. pic.each(function () {
  21. var large_img = $(this).attr("large")
  22. if (large_img.length > 0 && large_img != $(this)) {
  23. if ($(this).attr("lazy") != 'loaded') {
  24. setTimeout(function () {
  25. switchImg()
  26. }, 100)
  27. return
  28. } else {
  29. if ($(this).attr('src') != large_img) {
  30. $(this).attr('src', large_img)
  31. }
  32. if (!hasConfigCSS) {
  33. configCSS()
  34. hasConfigCSS = true
  35. }
  36. }
  37. }
  38. })
  39. }
  40. }
  41.  
  42. var hasConfigCSS = false
  43.  
  44. function configCSS() {
  45. var max_width = GM_getValue(max_width_key)
  46. if (max_width == null) {
  47. max_width = '50%'
  48. GM_setValue(max_width_key, max_width)
  49. }
  50.  
  51. var left_side = $('.body-wrap .left-side')
  52. left_side.css('width', 'auto')
  53. left_side.css('max-width', max_width)
  54.  
  55. var article = $('.body-wrap .left-side article')
  56. article.each(function () {
  57. $(this).css('width', 'auto')
  58. })
  59.  
  60. var p = $('.body-wrap .left-side .article-wrap p')
  61. p.each(function () {
  62. if ($(this).find('.gallery-pic').length == 0) {
  63. $(this).css('max-width', '700px')
  64. }
  65. })
  66. }
  67.  
  68. $('.body-wrap .left-side').ready(function () {
  69. setTimeout(function () {
  70. switchImg()
  71. }, 500)
  72. })
  73.  
  74. function AddCustomStyle() {
  75.  
  76. }
  77.  
  78. AddCustomStyle();
  79. try {
  80. GM_registerMenuCommand('脚本设置', function () {
  81. document.querySelector("#sp-ac-content").style.display = 'block';
  82. });
  83. } catch (e) {}
  84. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址