-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitlab-mark-viewed.user.js
More file actions
27 lines (25 loc) · 1.18 KB
/
gitlab-mark-viewed.user.js
File metadata and controls
27 lines (25 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// ==UserScript==
// @name GitLab — mark file as Viewed with "v"
// @namespace https://github.com/solcik/userscripts
// @version 0.2.2
// @description In a GitLab merge request diff, press "v" to toggle the focused file's "Viewed" checkbox.
// @author David Solc
// @match https://gitlab.com/*/-/merge_requests/*
// @match https://git.vs-point.cz/*/-/merge_requests/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=gitlab.com
// @homepageURL https://github.com/solcik/userscripts
// @supportURL https://github.com/solcik/userscripts/issues
// @updateURL https://raw.githubusercontent.com/solcik/userscripts/main/gitlab-mark-viewed.user.js
// @downloadURL https://raw.githubusercontent.com/solcik/userscripts/main/gitlab-mark-viewed.user.js
// @require https://cdn.jsdelivr.net/npm/mousetrap@1.6.5/mousetrap.min.js
// @grant none
// @license MIT
// ==/UserScript==
// Original idea: https://gist.github.com/CodeBrauer/2d5814262e53fafb4228ebcda08154d9
(function () {
'use strict';
Mousetrap.bind('v', function () {
const cb = document.querySelector("[data-testid='fileReviewCheckbox']");
if (cb) cb.click();
});
})();