GitLab Plus

quickly do something for gitlab

Stan na 18-11-2020. Zobacz najnowsza wersja.

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

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

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ć!)

// ==UserScript==
// @name         GitLab Plus
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  quickly do something for gitlab
// @author       huiren
// @match        https://gitlab.*/*/commit/*
// @grant        none
// ==/UserScript==

(function() {
    // 'use strict';

    var plus = {
        link_to: function(url, text) { return $('<a/>').attr('href', url ).html(text) },
    };

    let bc = $('.breadcrumbs-list');
    let currentId = $('.breadcrumbs-list li:nth-child(4) a').text();

    bc.append( plus.link_to('../compare/master...' +  currentId, 'diff to master') );
    bc.append(' &nbsp; | &nbsp; ');
    bc.append( plus.link_to('../compare/' +  currentId + '...master', 'diff by master') );

})();