greasyfork. APPLIES TO LINKS SEARCH BY SITES

greasyfork.org. makes applies to “All site” link to the “*” by site search (JasonBarnabe/greasyfork#146)

当前为 2018-03-14 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name greasyfork. APPLIES TO LINKS SEARCH BY SITES
  3. // @version 2016.6.15
  4. // @changelog https://github.com/jesus2099/konami-command/commits/master/greasyfork_APPLIES-TO-LINKS-SEARCH-BY-SITES.user.js
  5. // @description greasyfork.org. makes applies to “All site” link to the “*” by site search (JasonBarnabe/greasyfork#146)
  6. // @supportURL https://github.com/jesus2099/konami-command/labels/greasyfork_APPLIES-TO-LINKS-SEARCH-BY-SITES
  7. // @compatible opera(12.18.1872)+violentmonkey my setup
  8. // @namespace https://github.com/jesus2099/konami-command
  9. // @author PATATE12
  10. // @licence CC-BY-NC-SA-4.0; https://creativecommons.org/licenses/by-nc-sa/4.0/
  11. // @licence GPL-3.0+; http://www.gnu.org/licenses/gpl-3.0.txt
  12. // @since 2014-06-06
  13. // @icon data:image/gif;base64,R0lGODlhEAAQAKEDAP+/3/9/vwAAAP///yH/C05FVFNDQVBFMi4wAwEAAAAh/glqZXN1czIwOTkAIfkEAQACAwAsAAAAABAAEAAAAkCcL5nHlgFiWE3AiMFkNnvBed42CCJgmlsnplhyonIEZ8ElQY8U66X+oZF2ogkIYcFpKI6b4uls3pyKqfGJzRYAACH5BAEIAAMALAgABQAFAAMAAAIFhI8ioAUAIfkEAQgAAwAsCAAGAAUAAgAAAgSEDHgFADs=
  14. // @grant none
  15. // @match *://greasyfork.org/*/scripts/*
  16. // @match *://greasyfork.org/scripts/*
  17. // @exclude *://greasyfork.org/*/scripts/*/*
  18. // @exclude *://greasyfork.org/*/scripts/?
  19. // @exclude *://greasyfork.org/*/scripts/by*
  20. // @exclude *://greasyfork.org/scripts/*/*
  21. // @exclude *://greasyfork.org/scripts/?
  22. // @exclude *://greasyfork.org/scripts/by*
  23. // @run-at document-end
  24. // ==/UserScript==
  25. "use strict";
  26. var appliesto = document.querySelector("div#script-meta dd.script-show-applies-to");
  27. if (appliesto) {
  28. var text = appliesto.textContent.trim();
  29. if (text.match(/^(all sites|alle seiten|todos los sitios|tous les sites|semua situs|すべてのサイト|alle websites|wszystkie strony|todos sites|все сайты|所有站点|所有網站)$/i)) {
  30. appliesto.replaceChild(appliestoLink(text, "*"), appliesto.firstChild);
  31. }
  32. }
  33. function appliestoLink(text, site) {
  34. var a = document.createElement("a");
  35. a.setAttribute("href", "/scripts/by-site/" + (site ? site : text));
  36. a.appendChild(document.createTextNode(text));
  37. return a;
  38. }