GitLab Tweaks

change the list order in GitLab Issue Boards

Dovrai installare un'estensione come Tampermonkey, Greasemonkey o Violentmonkey per installare questo script.

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

Dovrai installare un'estensione come Tampermonkey o Violentmonkey per installare questo script.

Dovrai installare un'estensione come Tampermonkey o Userscripts per installare questo script.

Dovrai installare un'estensione come ad esempio Tampermonkey per installare questo script.

Dovrai installare un gestore di script utente per installare questo script.

(Ho già un gestore di script utente, lasciamelo installare!)

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione come ad esempio Stylus per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

Dovrai installare un'estensione per la gestione degli stili utente per installare questo stile.

(Ho già un gestore di stile utente, lasciamelo installare!)

// ==UserScript==
// @name         GitLab Tweaks
// @namespace    http://tampermonkey.net/
// @version      0.8
// @description  change the list order in GitLab Issue Boards
// @author       Longbiao CHEN
// @match        gitlab.longbiaochen.com/*
// @grant        GM_addStyle
// @license      GPLv3
// @require      https://code.jquery.com/jquery-3.2.1.min.js
// ==/UserScript==


(function() {

    // open Finder for files
    $('.detail-page-header-actions.js-issuable-actions').append('<a id="open-folder" class="d-none d-sm-none d-md-block btn btn-grouped btn-primary btn-inverted js-btn-issue-action" title="Open folder" data-qa-selector="open_folder_button" rel="nofollow" data-method="" href="open-folder:///Users/longbiao/Documents/">Open folder</a>');
    $('#open-folder').attr('href', 'open-folder:///Users/longbiao/Documents/' + window.location.pathname.split('/')[2]);
    document.addEventListener('keydown', function(e) {
        if (e.keyCode == 70 && e.shiftKey && e.metaKey) {
            console.log('hello');
            $('#open-folder').trigger( "click" );
        }
    }, false);

    // issue board
    var p = $('div.project-title > h2 > a');
    for(var i = 0; i < p.length; i++){
        var pi = p[i];
        pi.href += '/-/boards?key=1';
    }

    var p = $('div.namespace-title > a');
    for(var i = 0; i < p.length; i++){
        var pi = p[i];
        pi.href += '/-/boards?key=2';
    }


    var p = $('div.d-flex.align-items-center.flex-wrap.title.namespace-title.append-right-8 > a');
    for(var i = 0; i < p.length; i++){
        var pi = p[i];
        console.log(pi.href);
        pi.href += '/-/boards?key=3';

    }

    var p = $('.shortcuts-issues');
    for(var i = 0; i < p.length; i++){
        var pi = p[i];
        pi.href = pi.href.replace('/issues', '/boards');
    }
    $('#content-body > aside > div > div > a > i.fa-angle-double-right').click();

    // navigation buttons
    $('#nav-groups-dropdown > button').click(function(e){
        window.location.href = "/dashboard/groups?sort=name_asc";
    });

    $('a#logo').attr('href', '/dashboard/projects/starred?sort=name_asc');

    // wiki page
    $('body > div.layout-page.page-gutter.page-with-contextual-sidebar.right-sidebar-expanded.wiki-sidebar').attr('class','layout-page page-gutter page-with-contextual-sidebar right-sidebar-collapsed wiki-sidebar');
    $('aside.wiki-sidebar').attr('class', 'right-sidebar right-sidebar-collapsed wiki-sidebar js-wiki-sidebar js-right-sidebar');

    $('#filtered-search-issues').focus();

    $(document).on('dblclick', '.timeline-entry-inner', function(e){
        $('.qa-note-edit-button', this).click();
    });

})();