SourceTree Clone for GitLab

Add a "Clone with SourceTree" button to GitLab, if you're into that sort of thing

スクリプトをインストールするには、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         SourceTree Clone for GitLab
// @namespace    https://sanin.dev
// @version      0.5
// @description  Add a "Clone with SourceTree" button to GitLab, if you're into that sort of thing
// @author       Cory Sanin
// @match        *://gitlab.com/*
// @grant        none
// @icon         https://www.sourcetreeapp.com/assets/img/favicons/sourcetree/android-chrome-192x192.png
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    var clonemenu = document.querySelector('ul.clone-options-dropdown');
    if(clonemenu){
        var openWithOptions = document.getElementsByClassName('open-with-link')[0].parentNode;
        var div = document.createElement('div');
        div.classList.add('gl-new-dropdown-item-text-wrapper');
        var a = document.createElement('a');
        a.classList.add('dropdown-item', 'open-with-link');
        a.href = `sourcetree://cloneRepo/${document.getElementById('ssh_project_clone').value}`
        div.appendChild(document.createTextNode('Clone In SourceTree'));
        a.appendChild(div);
        openWithOptions.appendChild(a);
    }
})();