妖火论坛快捷回复插件

在妖火论坛帖子页面右侧添加快捷回复按钮

目前为 2025-01-19 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name 妖火论坛快捷回复插件
  3. // @namespace https://yaohuo.me
  4. // @version 1.3
  5. // @description 在妖火论坛帖子页面右侧添加快捷回复按钮
  6. // @author GodPoplar
  7. // @match https://yaohuo.me/bbs-*
  8. // @match https://www.yaohuo.me/bbs-*
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // 检查当前页面是否有 class="retextarea" 的元素
  17. const retextareaElement = document.querySelector('.retextarea');
  18. if (!retextareaElement) return;
  19.  
  20. // 创建按钮容器
  21. const buttonContainer = document.createElement('div');
  22. buttonContainer.style.width='300px';
  23. buttonContainer.style.position = 'fixed';
  24. buttonContainer.style.top = '40%';
  25. buttonContainer.style.left = '70%';
  26. buttonContainer.style.zIndex = '9999';
  27. buttonContainer.style.backgroundColor = '#f9f9f9';
  28. buttonContainer.style.border = '1px solid #ccc';
  29. buttonContainer.style.padding = '10px';
  30. buttonContainer.style.borderRadius = '5px';
  31.  
  32. // 定义快捷回复的内容
  33. const replies = ['感谢分享', '感谢','多谢分享','多谢!', '666','恭喜','已阅','同问','一样','等等','带带','帮顶','不至于','不清楚','不知道','O(∩_∩)O哈哈~','交给楼上','对-_-','吃~~','没了','没有','ε=(´ο`*)))唉','[url=https://werun.id/#/register?code=gWOx5EBA]10元500g,可免流可翻,点击注册(不可用)免费2天15g[/url]'];
  34.  
  35. // 创建按钮并添加功能
  36. replies.forEach(reply => {
  37. const button = document.createElement('button');
  38. button.textContent = reply;
  39. button.style.marginRight = '5px';
  40. button.style.padding = '5px 10px';
  41. button.style.cursor = 'pointer';
  42. button.style.backgroundColor = '#007bff';
  43. button.style.color = 'white';
  44. button.style.border = 'none';
  45. button.style.borderRadius = '3px';
  46.  
  47. // 按钮点击事件
  48. button.addEventListener('click', () => {
  49. // 设置第一个 .retextarea 的 value 值
  50. retextareaElement.value = reply;
  51.  
  52. // 模拟点击 type="submit" 的 input 元素
  53. const submitButton = document.querySelector('input[type="submit"]');
  54. if (submitButton) {
  55. submitButton.click();
  56. } else {
  57. alert('未找到提交按钮');
  58. }
  59. });
  60.  
  61. // 将按钮添加到容器中
  62. buttonContainer.appendChild(button);
  63. });
  64.  
  65. // 将容器添加到页面顶部
  66. document.body.appendChild(buttonContainer);
  67. })();

QingJ © 2025

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