GitLab Tweaks

change the list order in GitLab Issue Boards

  1. // ==UserScript==
  2. // @name GitLab Tweaks
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.8
  5. // @description change the list order in GitLab Issue Boards
  6. // @author Longbiao CHEN
  7. // @match gitlab.longbiaochen.com/*
  8. // @grant GM_addStyle
  9. // @license GPLv3
  10. // @require https://code.jquery.com/jquery-3.2.1.min.js
  11. // ==/UserScript==
  12.  
  13.  
  14. (function() {
  15.  
  16. // open Finder for files
  17. $('.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>');
  18. $('#open-folder').attr('href', 'open-folder:///Users/longbiao/Documents/' + window.location.pathname.split('/')[2]);
  19. document.addEventListener('keydown', function(e) {
  20. if (e.keyCode == 70 && e.shiftKey && e.metaKey) {
  21. console.log('hello');
  22. $('#open-folder').trigger( "click" );
  23. }
  24. }, false);
  25.  
  26. // issue board
  27. var p = $('div.project-title > h2 > a');
  28. for(var i = 0; i < p.length; i++){
  29. var pi = p[i];
  30. pi.href += '/-/boards?key=1';
  31. }
  32.  
  33. var p = $('div.namespace-title > a');
  34. for(var i = 0; i < p.length; i++){
  35. var pi = p[i];
  36. pi.href += '/-/boards?key=2';
  37. }
  38.  
  39.  
  40. var p = $('div.d-flex.align-items-center.flex-wrap.title.namespace-title.append-right-8 > a');
  41. for(var i = 0; i < p.length; i++){
  42. var pi = p[i];
  43. console.log(pi.href);
  44. pi.href += '/-/boards?key=3';
  45.  
  46. }
  47.  
  48. var p = $('.shortcuts-issues');
  49. for(var i = 0; i < p.length; i++){
  50. var pi = p[i];
  51. pi.href = pi.href.replace('/issues', '/boards');
  52. }
  53. $('#content-body > aside > div > div > a > i.fa-angle-double-right').click();
  54.  
  55. // navigation buttons
  56. $('#nav-groups-dropdown > button').click(function(e){
  57. window.location.href = "/dashboard/groups?sort=name_asc";
  58. });
  59.  
  60. $('a#logo').attr('href', '/dashboard/projects/starred?sort=name_asc');
  61.  
  62. // wiki page
  63. $('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');
  64. $('aside.wiki-sidebar').attr('class', 'right-sidebar right-sidebar-collapsed wiki-sidebar js-wiki-sidebar js-right-sidebar');
  65.  
  66. $('#filtered-search-issues').focus();
  67.  
  68. $(document).on('dblclick', '.timeline-entry-inner', function(e){
  69. $('.qa-note-edit-button', this).click();
  70. });
  71.  
  72. })();