GreasyforkRequireEasyGetLatestVersion

Puts the link for the latest version of a library into an input with autoselect instead of a code tag.

目前为 2014-04-17 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name GreasyforkRequireEasyGetLatestVersion
  3. // @description Puts the link for the latest version of a library into an input with autoselect instead of a code tag.
  4. // @namespace Tobbe
  5. // @author Tobbe
  6. // @version 1.0
  7. //
  8. // @include https://greasyfork.org/scripts/*
  9. //
  10. // @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js
  11. //
  12. // @grant none
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. var scriptInfo = $('#script-links').next('p');
  17.  
  18. if(scriptInfo.html().contains('This script should not be not be installed directly. It is a library for other scripts to include the meta directive') === true) {
  19. var code = scriptInfo.children();
  20.  
  21. var input = $('<input type="text" style="width: 1000px">');
  22. input.val(code.html()).focus(function() { $(this).select(); });
  23.  
  24. code.replaceWith(input);
  25. }
  26. })();