GitHub My Issues

Add a contextual link to issues you've contributed to on GitHub

Stan na 06-07-2022. Zobacz najnowsza wersja.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

"use strict";

// ==UserScript==
// @name          GitHub My Issues
// @description   Add a contextual link to issues you've contributed to on GitHub
// @author        chocolateboy
// @copyright     chocolateboy
// @version       1.3.1
// @namespace     https://github.com/chocolateboy/userscripts
// @license       GPL
// @include       https://github.com/
// @include       https://github.com/*
// @require       https://cdn.jsdelivr.net/npm/[email protected]/dist/cash.min.js
// @grant         GM_log
// ==/UserScript==

// NOTE This file is generated from src/github-my-issues.user.ts and should not be edited directly.

(() => {
  // src/github-my-issues.user.ts
  // @license       GPL
  var ID = "my-issues";
  var ISSUES = '[aria-label="Global"] a[href="/issues"]';
  var MY_ISSUES = "My Issues";
  var REPO = "octolytics-dimension-repository_nwo";
  var SELF = "user-login";
  var USER = "octolytics-dimension-user_login";
  function meta(name, key = "name") {
    const quotedName = JSON.stringify(name);
    return $(`meta[${key}=${quotedName}]`).attr("content");
  }
  function run() {
    $(`#${ID}`).remove();
    const self = meta(SELF);
    if (!self) {
      return;
    }
    const $issues = $(ISSUES);
    if ($issues.length !== 1) {
      return;
    }
    let subqueries = [`involves:${self}`, "sort:updated-desc"];
    let prop, path = "/issues";
    if (prop = meta(REPO)) {
      path = `/${prop}/issues`;
    } else if (prop = meta(USER)) {
      if (prop === self) {
        subqueries = [`user:${prop}`, "is:open", "archived:false", ...subqueries];
      } else {
        subqueries = [`user:${prop}`, ...subqueries];
      }
    }
    const query = subqueries.join("+");
    const href = `${path}?q=${escape(query)}`;
    const $link = $issues.clone().attr({ href, "data-hotkey": "g I", id: ID }).text(MY_ISSUES);
    $issues.after($link);
  }
  $(document).on("turbo:load", run);
})();