Gitlab submodule compare

Clicking on submodule link opens comparison in new tab

スクリプトをインストールするには、Tampermonkey, GreasemonkeyViolentmonkey のような拡張機能のインストールが必要です。

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

スクリプトをインストールするには、TampermonkeyViolentmonkey のような拡張機能のインストールが必要です。

スクリプトをインストールするには、TampermonkeyUserscripts のような拡張機能のインストールが必要です。

このスクリプトをインストールするには、Tampermonkeyなどの拡張機能をインストールする必要があります。

このスクリプトをインストールするには、ユーザースクリプト管理ツールの拡張機能をインストールする必要があります。

(ユーザースクリプト管理ツールは設定済みなのでインストール!)

このスタイルをインストールするには、Stylusなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus などの拡張機能をインストールする必要があります。

このスタイルをインストールするには、Stylus tなどの拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

このスタイルをインストールするには、ユーザースタイル管理用の拡張機能をインストールする必要があります。

(ユーザースタイル管理ツールは設定済みなのでインストール!)

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
// ==UserScript==
// @name         Gitlab submodule compare
// @namespace    http://tampermonkey.net/
// @version      0.2.0
// @description  Clicking on submodule link opens comparison in new tab
// @author       Cáno
// @match        https://git.getprintbox.com/*
// @grant        none
// @require      https://code.jquery.com/jquery-3.2.1.min.js
// ==/UserScript==

(function() {
    'use strict';
    //return;
    setInterval(function() {
        $('.file-title-name > .commit-sha').each(function() {
            var parent = $(this);
            var n = parent.closest('.diff-file').find('.line_content.parallel:not(.old) > span').html();
            var o = parent.closest('.diff-file').find('.line_content.parallel.old > span').html();
            var a = parent.prev().find('a');
            if (a.attr('done') !== 'true') {
                a.attr('href', a.attr('href') + '/compare/' + o + '...' + n);
            }
            a.attr('done', true);
        });
    }, 1600);
})();