NGA Recommend Search Button

NGA 增加搜索精华主题按钮

  1. // ==UserScript==
  2. // @name NGA Recommend Search Button
  3. // @namespace https://gf.qytechs.cn/zh-CN/scripts/33356-nga-recommend-search-button
  4. // @version 0.0.1.20170920
  5. // @icon http://bbs.nga.cn/favicon.ico
  6. // @description NGA 增加搜索精华主题按钮
  7. // @author AgLandy
  8. // @include /^https?://(bbs\.ngacn\.cc|nga\.178\.com|bbs\.nga\.cn)/.+/
  9. // @grant none
  10. // @require http://cdn.bootcss.com/jquery/3.2.1/jquery.min.js
  11. // ==/UserScript==
  12.  
  13. //发布地址:http://bbs.ngacn.cc/read.php?tid=12485023
  14.  
  15. var $Q = jQuery.noConflict();
  16.  
  17. (function() {
  18. if(!$Q('a[title="搜索"]').length)
  19. return;
  20. $Q('a[title="搜索"]').click(function(){
  21. setTimeout(function(){
  22. $Q('button:contains("搜索用户")').after('<br><button type="button">搜索精华主题标题</button><br><button type="button">搜索精华主题标题和内容</button>');
  23. $Q('button:contains("搜索精华")').click(function(){
  24. var p = $Q(this).parent(), k = p.find(':text')[0], fcs = p.find(':radio:eq(0)')[0], fc = p.find(':radio:eq(1)')[0], fo = p.find('form')[0];
  25. k.value = k.value.replace(/^\s+|\s+$/g,'');
  26. if(!k.value)
  27. return alert('请输入关键词');
  28. fo.method = 'post';
  29. fo.action = '/thread.php?key='+encodeURIComponent(k.value);
  30. if(fcs.checked)
  31. fo.action += '&fid='+commonui.selectForum.get(4, 16).join(',');
  32. else if(fc.checked)
  33. fo.action += '&fid='+commonui.selectForum.get(64).join(',');
  34. fo.action += '&recommend=1';
  35. if(/内容/.test(this.innerHTML))
  36. fo.action += '&content=1';
  37. fo.submit();
  38. });
  39. },1);
  40. });
  41. })();

QingJ © 2025

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