Created
January 14, 2019 16:16
-
-
Save hsyl20/912b0a5fec9e7c621d8ac82e46b88d93 to your computer and use it in GitHub Desktop.
Add some buttons to Gitlab instance of GHC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Gitlab discussion helper | |
// @version 1 | |
// @grant none | |
// @description This script let you toggle all discussions in Gitlab | |
// @include https://gitlab.haskell.org/* | |
// @run-at document-idle | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js | |
// ==/UserScript== | |
(function() { | |
$('div#diff-notes-app > div:nth-child(1)').prepend('<div style="padding-top:5px"><div class="btn" onclick="$(\'.discussion-toggle-button\').click();">Toggle all</div><div class="btn" onclick="$(\'.discussion-toggle-button:has(i[class ~= fa-chevron-down])\').click()">Show all</div><div class="btn" onclick="$(\'.discussion-toggle-button:has(i[class ~= fa-chevron-up])\').click()">Hide all</div></div>'); | |
$('div#diff-notes-app > div:nth-child(4)').prepend('<div style="padding-top:5px"><div class="btn" onclick="$(\'.click-to-expand\')[0].click();$(\'.js-btn-vue-toggle-comments\').filter(\':not(.active)\').click();">Show all comments</div></div>'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script for GreaseMonkey (Firefox) / TamperMonkey (Chrome/Chromium) adds the following buttons to Gitlab merge request UI:
Discussions tab:
Changes tab: