ECU Bitbucket Improvements

tbd

目前为 2023-01-30 提交的版本。查看 最新版本

// ==UserScript==
// @name        ECU Bitbucket Improvements
// @namespace   raveren
// @license     MIT
// @version     1.10
// @author      raveren
// @description tbd
// @require     https://code.jquery.com/jquery-3.6.3.min.js
// @include     https://bitbucket.org/ecu1/internal-www/pull-requests*
// @run-at      document-start
// ==/UserScript==

(function () {
    'use strict';

    window.addEventListener('load', function () {
        if (location.href === 'https://bitbucket.org/ecu1/internal-www/pull-requests/') {
            document.title = 'All Pull Requests';
        } else {
            document.title = document.title.replace('ecu1 / internal-www / Pull Request ', '');
        }


        $(document).on('mouseover', 'a.line-number-permalink', function (e) {
            if ($(this).data('ecu-loaded')) {
                return
            }
            $(this).data('ecu-loaded', 1)

            // https://bitbucket.org/ecu1/internal-www/pull-requests/1373#chg_app/Libs/Statistic/Modules/MidataOffeneAuftraege.php_newline81
            let link = $(this).prop('href').replace(/.*chg_app/, '')
            let line = link.replace(/.*_newline/, '')
            let path = link.replace(/_newline\d+$/, '')


            let a = document.createElement('span');
            a.innerHTML = '<a class="btn-octicon" href="http://localhost:8091/?message=' + path + ':' + line + '"><svg class="octicon octicon-device-desktop" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path d="M15 2H1c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h5.34c-.25.61-.86 1.39-2.34 2h8c-1.48-.61-2.09-1.39-2.34-2H15c.55 0 1-.45 1-1V3c0-.55-.45-1-1-1zm0 9H1V3h14v8z"></path></svg></a>';
            $(this).before(a);
        });
    });
})();

QingJ © 2025

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