Greasy Fork镜像 Links

Add links to navigate to the update tab

目前为 2016-01-07 提交的版本。查看 最新版本

// ==UserScript==
// @name        Greasy Fork镜像 Links
// @namespace   chriskim06
// @description Add links to navigate to the update tab
// @include     https://gf.qytechs.cn/en/users/*
// @require     http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js
// @version     1.2.5
// @grant       none
// @locale      en
// ==/UserScript==

this.$ = this.jQuery = jQuery.noConflict(true);

$(function() {
  if ($('#user-script-list').length) {
    var count = $('#user-script-list > li').length;
    $('#user-script-list > li').each(function() {
      var item = $(this);
      var link = item.find('a:first');
      console.log(link.attr('href'));
      var href = link.attr('href') + '/' + link.html().replace(' ', '%20') + '.user.js';
      href = href.substr(3);
      var id = item.attr('data-script-id');
      var script = item.find('h2 > :first-child');
      script.attr('href', script.attr('href') + '/code');
      script.after('<a href="/en/scripts/' + id + '/versions/new">Edit</a>');
      script.after('<span class="name-description-separator"> - </span>');
      script.after('<a href="' + href + '">Install</a>');
      script.after('<span class="name-description-separator"> - </span>');
    });
    $('#user-script-list').prev().children(':first-child').append(' (' + count + ')');
  }
});

QingJ © 2025

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